Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Tue 3 Jan 2006, 11:56 PM
Well, as my brother Dan one famously said, "The path to fame is to wear a big name tag".  Since you are unlikely to be willing to wear a sandwich board with your name on it the way he did for months, your next best bet is to have your photo in the world famous Lotusphere Sessions DB.  But wait, I hear you say, he can't possibly add all our photos.  The darn database would be huge.

Right you are, so instead, I am going to do something easier (and lighter).  I am going to add all the people in the Frappr Lotusphere 2006 group to the Sessions database.  I won't actually include their photos, but I'll point to them.  Here are a few examples:


Portland (OR)

Posted by: John Head

Aurora (IL)

Posted by: Elvis Presley

Leicester, England (United Kingdom)

OK, so maybe a bit of clean up will be needed before the database is finalized, as I doubt Elvis is really coming.  But you would be there too.  There are 255 people in the group so far, but you could be 256 (if you hurry), and your photo will show up along with these famous folks.

Copyright © 2006 Genii Software Ltd.

Tue 3 Jan 2006, 11:09 AM
Among the many posts on the Notes Gold forums, the ones I really enjoy are those where a question is asked about coding, and a series of answers hones in on an especially good way to solve the problem.  Today, for example, Patrick Mens asked this question:
I have a database with about 150,000 documents and a textfile with about 1000 lines. The text on each line is something like 123415=90712.

I have created an lotusscript agent which creates a collection of all 160,000 documents. Gets each document one by one and compares a value of 1 field of that document with all lines in the textfile. When there is a match the field is changed. This is repeated for each document

I have run this agent with a test version of the database and it takes about 2 hours and 30 minutes to run through all documents. 

Is there a way to make this agent go faster? I can imagine that doing some changes in the code will make the processing go much faster.
To start with, Patrick asked the question in a reasonable manner, which is always pleasant.  While he did not post the code until a later post, he explained the scenario well.

Then the fun began.  A series of suggestions were made, by myself and others, all of which were reasonable, and a few of which were eye opening.  In roughly chronological order, it was suggested that:
  1. The text file be read into a list or array to save re-processing the file (both Alan Bell and I suggested this)
  2. That GetNthDocument be avoided and GetNextDocument used instead (Vilhjalmur Helgason suggested this)
  3. That a view be walked instead of a collection, and that the ColumnValues(i) be used instead of opening the document (Vilhjalmur Helgason suggested this too)
  4. That the document not be saved unless a change was made (my idea after seeing Patrick's code, which did Save every time)
  5. That a subcollection be made using a view and GetDocumentsByKey, then have the StampAll method be used to process once for each 1000 entries. (John Buragas came up with this)


Each suggestion seemed sensible, and each successive idea will probably lead to a significant increase in speed. Patrick asked the original question at 9:10am, and Alan Bell had posted a bit of code showing how to accomplish John's suggestion by 10:41am.  I would venture that the StampAll method will be a huge performance winner, but even if it is not, the previous suggestions are all excellent.  This is an excellent of how a "self help" forum can work at its best.  Cheers to all involved, and I look forward to hearing back from Patrick on what the results were.  I certainly learned something.

Copyright © 2006 Genii Software Ltd.