Month End REFERRER Stats

Very simple LotusScript function to parse value on url line

Below Is a very simple LotusScript code function that assumes that there is only one paramenter such that the url is something like "pathtoMyAgent/MyAgent?OpenAgent&123", where 123 is the parameter value you are look for

Function ExtractPassedParameter As String '======================================================== ' This routine parses parameters sent to the agent in the ' command line. to the right of the & '========================================================

In the process of doing some work I came across this problem, and after searching / googling the usual suspects did not find a resolution, until I remembered how I done this in the past. I'm going to document my solution as a aid to other and for the next time I have a brain freeze.

This works for Lotus Notes Domino R5.x.

When does this error occur : When doing Domino Web work, the easy, standard, way of executing a agent from a Web Form is to create a formula hotspot or button with the formula : @Command([ToolsRunMacro]; "myAgent") Which will execute the "myAgent" Agent, and the other half of this is have LotusScript code along the lines of :

Sub Initialize

Dim session As New NotesSession
Dim sessiondb As NotesDatabase
Set sessiondb = session.CurrentDatabase

Dim sessionDoc As notesDocument
Set sessionDoc = session.DocumentContext
........' the rest of the code

Now after doing what ever other stuff you what / need to do, you what to delete the Document from which you called the agent so you :
Call sessionDoc.remove(True)

Which would do ordinarily do exactly that, but this time blows up and doesn't remove the document. ACK!

After trying a few things and then RTFM'ing, I discover that at the end of the help page for DocumentContext property it says :

You cannot use the encrypt and remove methods on the Document object returned by DocumentContext...

So, I'm SOL, right? Not so fast....

I've got 2 ways around this:

1) rather that do a remove in the first agent, mark it with a status indicating it needs to be deleted...
Set sessionDoc.Status = "DeleteMe"
Call sessionDoc.Save ( True, False )

The Documents can either be manually deleted (from a Lotus client and special view, by the appropriate user) or you can create a scheduled agent to do a search for document marked for deletion and zap them. Like this....

Two additional things 2 keep in mind. Make sure any user views or lookups wouldn't find the document marked with the sessionDoc.Status = "DeleteMe". Run the actual delete agent as often as needed or a server resources allow.

I don't like the above solution because I need to worry about the showing up where it shouldn't or going though any views might show the document. For a existing application, there is a risk that a deleted document will be visible. The other reason I don't like it is because It requires an higher level user to remember to open a view to manually delete (and I'm busy enough as it is) or the server resources to run yet another scheduled agent (and the servers are the only thing busier than me).

2) The workaround is to invoke the agent another way, to modify the agent to make it to work by NOt using the @Command([ToolsRunMacro]; "myAgent") Command and the DocumentContext property.

Rather, Launch the agent via it url (either building a HREF or using @URLOpen("pathtoMyAgent/MyAgent?OpenAgent&ID=123"), pass on the url line a ID to the document, then within Agent, parse the url to get the Id and do a look to get the NotesDocument which is then removable.

I'll post some code to parse the url line paramters shortly. A quick google failed to find anything useful. Hopeful this will save the life of some newbie.

Found Words : Gerry; Red Guard generation, Spim

Red Guard generation: China's equivalent to the West's baby-boomers. Those born after 1966 (the Cultural Revolution) but before China's one child policy (and leading to the rise of the so-called "little emperors") in 1979. spotted in The Economist, Marcth 27th edition, A Survey of Retirement.

Sunday, March 28, 2004

Cecilia Zhang, Missing Girl, found dead. Heaven gains an Angel.

As just reported by The Globe and Mail, In a tragic end to the mysterious disappearance of nine-year-old Cecilia Zhang, the little girl's remains were identified Sunday. Very few details have been reported so far.

Cecilia was discovered missing the morning of Oct. 20. She would have turned 10 on March 30.

Such a sad story. I hope they find the horrible person or people who did this.

Saturday, March 27, 2004

Boolean Logic : George Boole's The Laws of Thought published 150 years ago.

It was 150 years ago that George Boole published his classic The Laws of Thought, in which he outlined concepts that form the underpinnings of the modern high-speed computer. SIOBHAN ROBERTS chronicles the man and his method

What is a wiki? Where as a blog is primarily a linear (most recent first) and single author web space, a wiki is more category / cross-link driven and multi-author collaborative web space. Some blogs can be viewed by categories, and Wiki's can be viewed by most recent or by author, but generally blogs are a functional subset of wiki's. Both are variations of very simple content management, with the focus on content, informality, trust, and ease of use. The word comes from "wikiwiki," which means "fast" in the Hawaiian language.

Return of the homebrew code

Most modern software is written by huge teams of programmers. But there is still room for homebrew coders, at least in some unusual niches...

Such difficulties are typically faced by just a few thousand people with specific and unusual requirements—too few to merit the attention of the big computer firms, but enough to provide opportunities for a growing band of homebrew coders who set out to develop niche products...

In many cases these programmers are making a decent living in the process, thanks to the availability of high-speed internet connections, cheap web-hosting services and online-payment systems such as PayPal and Kagi—all of which make it quick and easy to distribute software and collect money from customers. The trend is also a response to the sorry state of the technology industry, following the bursting of the dotcom bubble. Where they could once command salaries of $100,000, programmers now worry about their jobs disappearing to India. So instead of waiting for things to improve, some have decided to strike out on their own....

Brent Simmons is one such programmer.. he runs Ranchero Software from his garage in Seattle. They make a clever piece of software called NetNewsWire, which runs on the Mac OS X operating system and makes it easy to read news and then post comments on to a weblog. “I like being able to design and implement software and have the final say,” says Mr Simmons. “It's a higher level of creativity than working on someone else's software. I get to refine and market my own ideas.” At $40 each, Mr Simmons needs to sell 2,000 copies of his program each year to earn what he would be paid as an employee elsewhere....

and Jonas Salling of Salling Software, Gaurav Banga and Saurabh Aggarwbi (PDAapps sells VeriChat, IM for PDA's), and Nick Bradbury of Bradbury Software, know for HomeSite (sold to Allaire/Macromedia), TopStyle and a news-reading program called FeedDemon (all wonderful products). Brent and Nick both have blogs.

While new opportunities abound, however, this world of independents is an unforgiving meritocracy. For homebrew coders, the fact that their fortunes depend directly on the quality of their products is both the risk and the reward.

Tuesday, March 23, 2004

Back from Sking, and buried

Yes, I'm safely back from 6 glorious days of skiing at Quebec City. The weather was good ( -8 to -2 C) Snow was very good (although the mash on Monday was tough on the legs) at Mont Ste Anne, Le Massif and Stoneham. The Hotel (Manoir Victoria in old Quebec City) was most excellent with great accommodations, staff and hard to beat location. We had a great crew of High Park Ski Club crazies, some of whom I knew / had been warned about, and we (Elicia and I ) made some new friends. And the food was to die for. If you don't believe me just look at the expanding tummy, despite my efforts to burn it off on the slopes.

So I'm back, buried under a pile of work, reading (although I did get Eastern Standard Tribe read / consumed, yum yum), email and blog feeds. (Oh the spammers seem to be back from their vacation too.) I can tell that spring is just around the corner, because a pile of ants found the remains of my yogurt.

Sunday, March 14, 2004

How to earn a week of Skiing....the hard way

After finally getting the Server restored, and working the next 16 hours, I'm off on a previously booked ski trip to Quebec city. And trying not to think, too much, about the looming deadline. I love deadlines, and the get big whooshing sound they make when they rush by....

Friday, March 12, 2004

Where have all the spammers gone?

I'm going to jinx myself but, I've gotten no spam today, where I would "normally" get 20 to 40 pieces (most caught by my filters). Is this a national Span holiday? Is there a conference of spammers going on? Are they all talking to their lawyers about the lawsuits launch this week? Whats going on!

Thursday, March 11, 2004

The Starup Insanity

'Being part of a start-up is about more than get-rich-quick dreams. It's an emotional commitment to a hurried, harried, adrenaline-driven way of working. For those who can cope, it seems oddly addictive.'

Gambler’s Fallacy.

I won’t work for big companies anymore.

I can’t work for big companies anymore.

It’s not the company, but the work.

Big companies are no longer hiring.

The valley is really one big company already

Start-ups are addictive.

I would add: It's not the work it's the people. There are a bunch of people whom I would easly work with again. There arealso a few people with whom I would not work with again for any reason (or maybe only for cash up front). Okay maybe I need a 12 step program?

Very Ultra DSL, really soon.

Using 2 new upgraded technologies BCI (Bell Canada) hope to provide 16 megabits a second in early 2004, and 22 mbps as early as next year. Currently Sympatico's Ultra service does ~ 3 Mb down (and 600 Kbp up). The the local Cable company (Rogers) is also testing service at like speeds.

The How is two new technologies now ready for rollout. The first is OPI-DSLAM, which is a device that sits at the other end of the DSL system used by Bell through its Sympatico Internet service; it replaces the older DSLAM, which is limited to about six megabits a second. The second is the Nortel 6500, a technology that can deliver and manage fibre optic lines close enough to the home to realize superhigh speeds.

I'm already 200 feet away from a central switch. If they ever run the fiber above ground, I suspect that I'd be out that night tapping it.

22 mpbs is very good. However, how many TV signals could I stream at a time over that? I wonder how much brandwidth a single channel needs? (leaving aside issues on the Server, Caching, etc.) Hopeful I'll get a change to use their Video on Demand soon.

Now they need to come up with a good marketing name, if they don't just keep "Ultra" as the high end.

170 people Dead, and 600 wounded by bombing in Madrid

Bloody hell. Made all the more awful by the fact that Elicia and I where at the Atocha train station station last November, arriving from Sevilla on one of those trains. The ETA Basque separatist group is suspected in this massacre, based on the type of materials used, and a van that was stopped at the end of February. The timing of the attack would appear to be related to the Spainish General Election this Sunday.

I remeber that when we boarded the (EVA) train (in Sevilla), we did go though a security check and pass thought what I thought was a metal detector.

A coordinated wave of bomb attacks on Madrid's commuter train system today killed at least 186 people and wounded over 1,000 at the height of the city's rush hour. There has been no claim of responsibility in the bombings, but Spanish officials are blaming terrorists from the Basque separatist group ETA..

Here is a pdf of the Madrid subway map planometro.pdf (~ 90 Kb) I got from here The Atocha train station (Atocha Renfe is the metro/subway station) is in the lower Right half part on the Blue No 1 line (Plaza de Castilla / Congosto). http://www.softdoc.es/madrid_guide/info/trains.html has more info on the station, including this : Atocha is the largest and most used train station.

Russell Beattie blogs about this. Russell has just returned to the US, with his (Spanish) wife and child, after living for several years in Madrid.
His wifes family is OK.
Boing Boing has an entry with links to Spainish Bloggers and this image is going around wrt the bombing :

Update > 5pm EST, Via the BBC : A statement attributed to al-Qaeda claims responsibility. Although "other indicators pointed to .. Eta". Perhaps they are working together? Current count of Sadness : at least 190 people.

Massive demonstrations are planned for tomorrow at 7PM in cities all over Spain. Expect live blog coverage.

Wednesday, March 10, 2004

Robot builder could 'print' houses

A robot for "printing" houses is to be trialled by the construction industry. It takes instructions directly from an architect's computerised drawings and then squirts successive layers of concrete on top of one other to build up vertical walls and domed roofs.
...
Engineer Behrokh Khoshnevis, at the University of Southern California, has been perfecting his "contour crafter" for more than a year. "The goal is to be able to completely construct a one-story, 2000-square foot home on site, in one day and without using human hands," he says.
....
The first house will be built in 2005. If the technology is successful the robot could enable new designs that cannot be built using conventional methods, for example involving complex curving walls.

If this works out the applications could range from low cost housing in the both the First to Third worlds ("Press 'A' for instant Afgah village"), to custom built high end houses.

Local content on the map

This only works for US address so here's an example for people playing along at home : 235 2nd St San Francisco, CA 94105-3124. Kind of Cool! and if you select an restaurants "point" you can get further information.

Wonder how long before I can do this on a GPS enabled Hand held device?

This is pretty great. Now if Yahoo was smart (and I'm *not* trying to give it ideas since their online solution is similar to what our WaveSpotter J2ME client does on the mobile side) they would hook up their new Yahoo Maps with the new Point of Interest locations (POIs) to their mobile services section. They already have everything in place to enable this instantly - they know my user name, and that's associated with my Yahoo Mobile profile with my phone's number and capabilities. I should be able to look up a map on Yahoo, and if I'm logged in, click on a button that says "send to my mobile" and off it goes - a WAP Push message with the map at the top and the POIs listed at the bottom.

Of course Yahoo - like most American portals - probably doesn't take mobile phones seriously yet so this won't happen for at least 9 months to a year if ever, so that's nice to know. It's amazing it took them this long to add POI data to their maps.

iPod media reader offloads digital camera memory into your MP3 player

Belkin has shipped a six-in-one media reader that plugs into your iPod -- plug the reader into your iPod, stick the Compact Flash, SmartMedia, Memory Stick or whatnot from your camera into the reader, and your photos are offloaded onto the iPod's hard-drive, freeing you up to take new shots. When you get home, plug your iPod into your computer and offload your archived photos. Smart, smart, smart. Link

I was speculating last fall when some sort of Digital Camera to micro HD would happen. I see 2 big advantages to this : Freeing up the smaller memory card to the bigger / cheaper HD is one (saving me from having multiple cards at minimum). Backing up the data is another (for longer trips, as insurance against losing the card or camera, or card failure. i.e. peace of mind). Now what I really what is to be able to back up the data from my Handy Computing / Communicator / Media device into a cyberspace CVS repository and do so transparently, incremental, and wirelessly. But that's for next year......

This is one of those good news, bad news things : I just got noticed. Isn't this wonderful....Oh c**p everyone is looking at me, is my fly up or down....I expect a flood of hits over the next while added to the steady stream of people looking for R5 RSS Lotus notes solutions.

To those people : I hope you find the solution useful out of the box. If not tell me what you like what you don't, how you would like to / hope to use it. I've already had some wonderful feedback and suggestions. Thank you. And thanks for the Link Love Chad.

I was chatting with Weidong Huang from Reader's Digest a few days ago about some weird behaviour in the Domino Java class loader. It's actually pretty interesting, but it requires some historical context first.

NOTE: It's possible that most of this applies to Domino R6, but I've only personally tried this in R5.0.12.

A couple of years ago, we were developing a system to manage magazine article editing workflow. We made a design decision to implement some software in Domino, using XML and Java. We came up with a set of classes to represent the problem domain, rendered the data into XML format and then used XSLT to display the data in HTML format. In essence, this would allow us to implement an MVC architecture and keep things fairly clean, while simultaneously providing data export functionality via XML.

The architecture actually worked fairly well, but we ran into some serious performance problems. The built-in XML handling provided by XML4J was insufficient for the task, so we decided to use Xerces for XML parsing and Xalan for the transforms using XSLT. To keep things simple, we were using standard Domino Java agents to render the results to the browser. This is where we hit our first major hurdle.

The Java class libraries for Xerces and Xalan are large. You can attach them to an agent, but that incurs a rather severe run-time hit to load the libraries. It seems that Domino stores these as attachments in the agents and detaches them to create the run-time environment each time. In any case, response time was unacceptable.

The good news is that you can get around this performance bottleneck by installing the Java libraries on the server and telling Domino about them via the JavaUserClasses variable in the NOTES.INI file on the server. In order to compile agent code that uses the system-loaded libraries, you'll have to do the same thing on the client side so that Designer can see the same class environment. Pre-loading the classes on the server greatly improves the performance of agent execution, but it comes with a price. If you want to change those libraries, you'll have to have direct access to the server. Also, modifying those libraries generally requires a server restart. Finally, you'll have to make sure that the paths to those libraries are relatively short since Java has a 256 character limit on the classpath variable and Domino tacks on a whole bunch of it's own libraries when the server loads.

That solved the biggest performance issue, but we still had another problem because of all the XML generation going on. It takes some time to generate our XML files, and it was unacceptably long to do this every time the client made a request. We needed to cache the data in many cases so that navigation was faster. This is where it would have been nice to have been working with servlets, because there didn't seem to be a way to keep an in-memory cache for the XML data across requests using agents. Once the agent was done, all the data and context disappeared. I eventually implemented a cache that wrote XML data to Notes documents. That worked, but it still took a second or two to read the data and create the DOM tree.

It always bothered me that there was no way around that, because we didn't have time to do a servlet implementation of all the user interface code. Well, Wei discovered that classes loaded via the JavaUserClasses statement having static members are cached across agent calls. In our original implementation, we included our home grown classes as a small JAR file in each agent. It was small enough so that load peformance wasn't a big deal, and it allowed us to update the template in development without having to restart the server each time. This implementation broke when we moved the class to the server because some of our other caching code assumed that everything could be recycled when the agent was finished. Unfortunately, that assumption was no longer valid when the data was being shared across agents.

So, it looks like it is possible to share in-memory data across subsequent runs of a Domino Java agent. I have reproduced this behaviour in a test example in R5.0.12, and Wei has shown this to be true in R6. I can't guarantee that the class will remain loaded, but it's something to look at if you're having performance issues with Java agents in Domino. This also means that using static variables in classes loaded via JavaUserClasses may result in threading problems if you're not careful.