Tuesday, April 25, 2006

Gasoline prises in US vs Sweden

Today I found a video on MSN which shows prises of gasoline (bensin) in the USA. The current price is 3$ for a gallon.

1 gallon is 3.8 liters.
1$ is 7.6 SEK (Swedish crowns).
So the price of 1 liter gasoline counted in SEK is: (3 / 3.8) * 7.6 = 6

The current price of gasoline in Sweden is 12 SEK/liter, which makes the gasoline price in the US twice as cheap as in Sweden.

Historical price rise is about the same for both coutries: about 50% up during last 3 years, maybe slightly higher rise in the US.


http://video.msn.com/v/us/v.htm?g=942c87fb-acd7-4150-acf2-d3573072c9ff&t=s2&f=06/64&p=hotvideo_energy

Monday, April 24, 2006

Very fast import from MS Excel to Lotus Notes using LotusScript

Original location: Fast import from Excel to Notes

This LotusScript agent has very high performance. It can read 10000 cells in just 1 second, compared to reading cell-by-cell which would take several minutes.



Sub Initialize
'This agent imports records from excel to Notes. It uses Range method which makes it very fast.
'Copyright Botstation (www.botstation.com)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim xlApp As Variant, xlsheet As Variant, xlwb As Variant, xlrange As Variant
Dim x As Integer
Dim y As Integer

Dim filename As String, currentvalue As String
Dim rowsatonce As Integer, cnt As Integer
Dim DataArray

Set db=session.CurrentDatabase
Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True 'Excel program is visible to see what is happening

Set xlwb=xlApp.Workbooks.Open("C:\test.xls")
Set xlsheet =xlwb.Worksheets(1)

actRows=1000 'process 1000 rows
actColumns=5 'process 5 columns

Redim DataArray(actRows, actColumns) As String
DataArray=xlsheet.Range("A1").Resize(actRows, actColumns).Value 'get sheet area of 5*1000 size

For x=1 To actRows
For y=1 To actColumns
currentvalue=Cstr(DataArray(x,y))
tmp=tmp+" "+currentvalue
Next
tmp=tmp+" "+Chr(10)
Next

Msgbox tmp

End Sub



Implementation of putting array values into notes documents is left as an exercise to the reader :)

Sametime for iSeries How to Install Sametime and Add It to a Domino Server

Just found a technote on how to install Sametime on iSeries(AS400). Actually it's more like an article than a regular technote. I had the link as icon on my Windows Desktop for about a year, so today was it's lucky day.
The technote has some black-green screenshots for AS400 lovers :)

Here is the link:
http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21085821

Take also a look at common problems for Sametime on iSeries, the same problems apply to other OS:
http://www-1.ibm.com/support/docview.wss?rs=477&context=SSKTXQ&q=1108423&uid=swg21108423&loc=en_US&cs=utf-8&lang=en

And one more useful technote:
Changing IP Address or Hostname After Adding Sametime
http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21099966

Saturday, April 22, 2006

Sametime Bot instructional video and configuration program

I've created a VB program which helps to configure Botstation Sametime Bot. The problem with current configuration is that person installing the Bot must change in BAT-file and in INI-file some customer-specific values, such as server name and login info. It is not very difficult, but several people evaluating the Bot expressed their desire to make the configuration easier. With this new configuration program they do not need to care about what file to open and which variales to change. They don't even need to read the instructions. This will hopefully make many users happy.

I am also planning to create an instructional screen capture video in Flash. To be more precise, several videos: one for each topic. The topics will be:
-Installing Bot
-Configuring Bot
-Creating new Pattern Answer "from scratch"
-Creating new Agent Answer "from scratch"
Each video will be about 2 minutes long, hopefully even with speaker voice, if I find some native English speaker.

Friday, April 14, 2006

Sametime Bot

Lean, mean Sametime machine is ready to serve you!
New version of Botstation Sametime Bot is released today and the most important improvement is better support for running agents on local Notes client.
You can now also spcify another ID file and password to login with, instead of using the last user's ID.

Sametime Bot http://www.botstation.com/products/stbot/about.php

Free 30-day trial version is available for download

Technorati:

Notes Error "Can't run a private agent belonging to someone else"

If you get "Can't run a private agent belonging to someone else" error when you trigger a Lotus Notes agent from your Java application, make sure that the agent is initiated in the same thread as it's parent Database. Looks like you can't simply get agent object from another thread without getting it through it's parent database object. Well, you actually get the valid object but the agent can not start. This applies only to local calls, not to DIIOP. And it looks that sometimes it can work anyway.
You might ask why would you have separate sessions/threads in the first place? There are many reasons for that, especially in large applications where Domino objects might have been initiated in different classes.

Incorrect:
class ClassA{
Session s = null;
Database db = null;
Agent agent = null;
NotesThread.sinitThread();
s = NotesFactory.createSession();
db=s.getDatabase(null, "mydb.nsf");
agent = db.getAgent("agent123");
// NotesThread.stermThread(); //Notes thread is still running!
}

class ClassB{
NotesThread.sinitThread();
Agent agent=classA.agent; //this is valid call and we do get valid agent object!
agent.run(); //here we get error "Can't run a private agent belonging to someone else"
NotesThread.stermThread();
}


Correct:
class ClassA{
Session s = null;
Database mydb = null;
NotesThread.sinitThread();
s = NotesFactory.createSession();
db=s.getDatabase(null, "mydb.nsf");
// NotesThread.stermThread(); //Notes thread is still running!
}

class ClassB{
NotesThread.sinitThread();
Agent agent=classA.mydb.getAgent("agent123");
agent.run(); //agent gets triggered without error
NotesThread.stermThread();
}

Wednesday, April 12, 2006

A minimum WinXP Install

Found an article about what files can be deleted from Windows XP without considerably affecting the functionality. Not sure if it applies in all cases, and haven't tested it by myself yet, but it sounds interesting.

Here is a list of directories which according to the article can be deleted:

C:\windows\apppatch C:\windows\inf C:\windows\system\ (surprise!!!)
C:\windows\msagent C:\windows\help C:\windows\ime\ (depending on the language)
C:\windows\srchasst C:\windows\mui C:\windows\temp C:\windows\debug C:\windows\tasks C:\windows\registration C:\windows\pchealth C:\windows\installer C:\Windows\system32\catroot C:\Windows\system32\catroot2 C:\Windows\system32\wbem C:\Windows\system32\dllclache C:\Windows\system32\setup C:\Windows\system32\npp C:\Windows\system32\spool C:\Windows\system32\inetsrv C:\Windows\system32\ime C:\Windows\system32\com C:\Windows\system32\1033 C:\Windows\system32\usmt C:\Windows\system32\mui C:\Windows\system32\oobe C:\Windows\system32\xircom C:\Windows\system32\restore C:\Windows\system32\macromed
Source: http://www.xxcopy.com/xxcopy80.htm

Here is another related WinXP article: http://www.sapiensbryan.com/index.php/winxp-minimum-system-requirements/

Monday, April 10, 2006

Running servlets in Lotus Domino 6

To run servlets in R6 you must do following:
1)In Domino Directory (NAB) open the server's document and in the "Internet Protocols\Domino Web Engine" tab there is "Java Servlets" section. There you choose "Domino Servlet Manager" as Java servlet support.
2)Put servlet's class file into servlets directory (domino\servlet) on your Domino server.
3)Put Java libraries used by servlet (if any needed) to jvm\lib\ext directory in Domino, e.g. C:\Lotus6Server\Domino\jvm\lib\ext

Now your servlet should be able to start. You can test it by calling it by it's file name, e.g.: http://myserver.com/servlet/helloworld
Note that you do not specify ".class" file extension when you call the servlet.

If it does not work, restart the Domino server and even better restart the whole computer just to be sure :)

Saturday, April 08, 2006

Lotus Domino is Exchange, SQL Server, Access, Visual Basic, and IIS all wrapped together

Read the whole article

What Is Lotus Notes?
by Julian Robichaux
revision 1.1

For as long as I've been working with Lotus Notes, people have asked me, "Just what the heck is Lotus Notes anyway?" That has always been a difficult question to answer, because there are no equivalent products to compare it to. A typical conversation will go something like this:


"Does it do e-mail?"
"Yes."
"So it's like Exchange, right?"
"Only in the sense that it's an e-mail system. It's actually primarily a database system that happens to have built-in e-mail functionality."
"Okay, so it's like SQL or Oracle or something."
"No, it's not a relational database system like those are. It's more of a flattened data structure."
"What's that?"
"Probably nothing you should worry about. It's a database."
"Okay, so how do I manipulate the data? Write an Access front-end or something?"
"No, that's all built-in to the client. It's also got support for several programming languages, and a web server component that allows you to access the data from a web browser."
"Then it's like Exchange, SQL Server, Access, Visual Basic, and IIS all wrapped together?"
"Sort of. But it's packaged so that you don't see all those separate components individually. That's what makes it such a powerful workflow application."
"I don't think I understand..."
"I know. I think I'll have to show you some sample applications."

Read the whole article