The March 2003 Blog
send me a comment

Your Next Digital Camera; Converting a Tape to CD (Monday, Mar 31)
[ permalink ] [ e-mail your comments ]

Here are a couple of random computer multimedia topics for you, while I'm thinking about it.

First, I read in Ed's personal blog this weekend that someone gave him a link to a article about the next generation of digital cameras. I actually read a much more in-depth article about that in Discover magazine a few months back, and that stuff looks really cool. I can't wait to get my hands on one of those, although I'll probably have to wait a few years until the prices come down.

Second, I was converting a cassette tape to CD this past weekend, and I thought I'd share my experience. I wasn't doing it out of any desire to violate copyright laws or because I thought that cassette tapes will become an outdated media format any time soon, but simply because I have a tape that my 2-year-old son loves to listen to, and I know it's going to get worn out pretty soon. Unfortunately, it's an old Woody Guthrie tape that's probably way out of print and really hard to get another good copy of. And besides, I wanted to be able to listen to it in the CD player in the car (my wife's car, anyway -- someday maybe I'll have a CD player too).

Fortunately, I'm no stranger to transferring tapes to CD, because a couple of years ago I did this with an old demo tape of my band from college that I found in the attic (I was the bass player, by the way, albeit not a cool Chapman Stick player as I'm sure Ben would have me be). So I wasn't intimidated by the process, although the last time I did it I used an old copy of CoolEdit, and this time I wanted to try to use the ahead Nero Wave Editor software that I've already got on one of my computers (CoolEdit is a fantastic piece of software, by the way, so if you're looking for a WAV editor you should look there first).

It turns out that Nero Wave Editor was not only easy to use but quite fast, so it was an enjoyable experience. If you want the step-by-step of what I did, I went ahead and typed it all up and posted it here to the site. Of course, if you're going to undertake such an activity, I'd also recommend reading the instructions at, because they know a lot more about this sort of thing than I do.

So after a few hours of recording and fiddling, I ended up with a nice copy of the tape on a CD-R that I can easily copy and play all over the house. Yay for me. Do other people do this sort of thing on the weekend too, or am I just weird?

Blog Format Updates (Sunday, Mar 30)
[ permalink ] [ e-mail your comments ]

Just made some updates to the ol' blog format. First, I added the word "permalink" to represent the permalinks to my individual entries (I think the "::" permalinks on the entries before was a little too subtle) as well as a link you can use to easily send me an e-mail about an individual entry (someday this may be replaced by an "add a comment" link, but don't hold your breath).

Even more exciting is that the main blog link now points to a page that always has the latest blog entries on it. For now, I'm showing the last 15. The reason I did this is because I was finding myself intentionally not posting things that I thought were important on the last few days of the month because I knew they would fall off forever as soon as the next month began. The thing that held me back from that until now was having to programmatically deal with anchor links, to make sure that anything that was using an anchor link would still point to a valid entry once the anchored article fell off the current page. And I had to keep my old permalink structure intact for other sites that were pointing to old entries on my site.

Okay, too much information. Let's just say I got everything working the way I like it. For archival purposes, I get to keep my individual entries on monthly pages (which I like because the entries that refer to each other are likely to be together, and they can maintain a little more relevance that way), and on a daily basis you can read the latest stuff all together. I went ahead and modified the RSS feed to do the same thing, for convenience.

So maybe this is the last time I have to remind everyone to make sure that their nsftools blog bookmark is set to, to make sure you're always getting the current blog. Thanks for reading, keep on comin' back.

Johan Broke My Blog :-) (Saturday, Mar 29)
[ permalink ] [ e-mail your comments ]

Niel Revelle just wrote to tell me that having the word "Känngård" in a recent blog entry (as in Johan Känngård), broke my RSS feed. Suddenly it stopped validating. Turns out the fix was that I needed to specify an encoding in the opening <xml> tag for the feed, because apparently the default encoding doesn't accept accented characters like "ä" and "å". Crazy. So I changed the opening tag to:

<?xml version="1.0" encoding="ISO-8859-1"?>

and I'm validating again. Johan told me that I also could have used &auml; for ä and &aring; for å, but what's the fun in that?

More Than I Ever Wanted To Know About Comment Blocks... (Friday, Mar 28)
[ permalink ] [ e-mail your comments ]

Okay, I almost tried to sneak this in and not say anything about it, because I'm about sick of talking about updating the ls2html code (and I'm at risk of losing half my readership due to sheer boredom), but I'll tell you anyway. Here's the scoop:

Back when I was a young, naive programmer (two days ago), I thought that %REM blocks in LotusScript were pretty simple things. You start with %REM, type a bunch of comments, and close with %END REM. Piece of cake. But now that I'm programmatically parsing script with ls2html, I'm discovering that there's more to it than that. For example:

So anyway, I updated the ls2html family of scripts (again) to account for my newfound knowledge of LotusScript comment blocks. What a strange little language. If you notice anything else I need to change, please tell me about it.

Oh yeah, and if you're using the ls2html script library in a database, don't forget to modify and re-save the forms and agents that are calling the script library, to make sure they're also using the newer version of the scripts. If you want a shortcut for your agents, you can download and use my ScriptSearch utility, which has an option to automatically recompile agents that contain a certain search term (like, say, 'Use "ls2html"').

Another Little ls2html Update (Thursday, Mar 27)
[ permalink ] [ e-mail your comments ]

Ferdy (not "Freddy" ;-) told me about a little problem with the ls2html scripts. Apparently you can end a %REM block with either %END REM (with a space between the words) or %ENDREM (no space). I had no idea. I updated ls2html, ls2rtf, and FormatLS accordingly, so feel free to redownload for the latest little fixes.

Sadly, I'm sure there will be a few more of those kinds of tweaks as more people use the scripts. That's good, though. All part of the process.

(By the way, this is pretty funny.)

My Tools Are Being Used, Java's Not? (Wednesday, Mar 26)
[ permalink ] [ e-mail your comments ]

First, I'd like to say I'm pretty excited that some of the scripts from my site are getting improved and used by others in the Domino community. Joe Litton has recently made a version of the FormatLS database available online, so you can format your LotusScript as HTML with a simple copy-paste-and-click on a web page. If that's not fun, I don't know what is. Also, Johan Känngård has turned my Base64 scripts into a LotusScript class, making some nice improvements along the way. Great job Johan!

In other news, a new DominoPower article indicates that most Lotus Business Partners that were surveyed by GSS still aren't using Java. To quote:

"The survey results showed that about two-thirds of Domino-focused IBM Lotus Business Partners actually aren't using any Java technologies at all. Of those respondents, about half have no plans to start using Java in the next six months. The balance of those not using Java say they expect to use at least one Java-based technology in the future."

Fascinating, and somewhat disheartening. You'd think that the BP community would be all over Java, especially with the push towards Websphere and all the Java that it entails. Oh well, that doesn't mean that we can't beat them to the punch. If you still haven't started playing with Java, you can download my Java Sample Code Database to help you get started.

Blogs And Forums -- Value Is Where You Find It (Monday, Mar 24)
[ permalink ] [ e-mail your comments ]

There are some interesting comments on Mike's site about the value of blogs, with good references to some other discussions that are going on along the same lines. I think an interesting sideline to this discussion is that some people turn it into a "blogs vs. forums" debate.

My feeling is that both things have their place, and there's a lot of overlap among the two mediums. The primary difference in my mind is that blogs have a direction set primarily (or entirely) by a single person, which tends to make them rather proactive in the information they present. Technical forums, on the other hand, aren't led by anyone and they tend to be fairly reactive in nature (valuable information comes from answers to questions, so if a question isn't asked then the information isn't usually offered). This is a generalization of course, and there are plenty of exceptions to this rule, but in my experience this is essentially how it works.

Naturally, blogs and forums each have their place in the world, and as I said, there's a lot of overlap. You can easily find great information in both places, and you'll often find yourself drawn more to one or the other based on your personality. If you find a few blogs that really appeal to the way your mind works, read them and read them often -- you'll probably get a lot of information that way over a period of time, from the blog itself and from the links it contains. If you find yourself coming back to the forums time and time again, keep on going back -- there's good stuff there too.

I think the argument that blogs are a waste of energy because the information isn't centralized is a little off the mark. First of all, I think that the type of people who want to run their own blogs or websites in the first place are creative sorts who don't want to be constricted by the format of someone else's forum or site. The type of creativity that goes into building your own site is exactly the kind of thing that makes the site valuable in the first place. Second, the feeling that having all of the information in one place makes it easier to search isn't entirely accurate. Over time, an active forum will have so much "noise" that it becomes hard to search for useful information about anything but very specific and slightly obscure things. If you want to search across blogs and personal websites, I've got one word for you: Google. Third, I think the question is one of economics. The flow of information on the Internet has always come from a free market of individual contributions from many different places. It's the Adam Smith theory that individuals working on behalf of their own self-interest will ultimately contribute to the common good.

So when it comes to blogs versus forums, there's really no battle. Value is where you find it.

The Domino Blogging Community (Sunday, Mar 23)
[ permalink ] [ e-mail your comments ]

Okay, I know it's supposed to be bad form to blog about blogging, and other people may have covered this subject already, but this is my site and I can write whatever I want to write.

I just wanted to take a moment to comment on how impressed I've been with the Lotus Notes/Domino blogging community so far. And it's not the attitudes that people have or quality of the site designs or anything like that; I've been most impressed with the information sharing that's really started to take off. People posting code and giving tips and tricks and being open about their knowledge. I think that aspect of the community has gotten a lot bigger, just in the past 6 months.

That's not to downplay the Sandbox, which is okay for somewhat finished applications (not that I can seem to get mine posted on there, but after over 6 months I've given up hope that any of my submissions will ever get posted), or the forums, which are good for question-and-answer type knowledge, but I think what the blogging sites have brought to the table is a different type of knowledge sharing. It's not giving you a specific tool for a specific job or answering a specific question that someone happens to have, it's providing pieces to a puzzle that you can put together in any way you'd like. There's more creativity in the process of absorbing the information, because you don't have the black and white "That'll fix the problem I've been having" or "That doesn't apply to me", but rather "I wonder how I could take all these bits of information and apply them in an interesting/useful way?"

Added to that is the personalities of all the bloggers, which makes it more of a community and less of a help desk. That part really appeals to me because I've been the only Notes developer on all of my projects for all but about 3 months of the past 5 years. You really get to a point where you want other Notes people around who can relate to your situation. Even if you're just getting the "virtual personalities" of other people in a rather one-sided conversation, that's a lot better than working in a total vacuum.

Now, that being said, I probably remove myself from the rest of the community a little more than I should at times, since I don't have comments on my site, and I tend to post information more about what I'm doing than what's going on in the rest of the community, and I kind of just put my head down and work on the site instead of interacting very much with other people. But that's my personality, and that's part of what makes this site mine. That's also part of what makes this community useful -- if a lot of us are doing our own things, then that gives everyone else more things to think about and a greater variety of code and information to use.

For example, there was a tremendous amount of discussion over at Mike's site about open-source and building a "standard" Notes blogging template, and that spilled over to some of the other blog sites as well. As neat as that would be, I actually like having several different blogging templates to look at, all of them completely different. That gives me the opportunity to look at the same thing done in different ways, which in turn makes me think of different ways I can do the things I'm doing. It's all part of the creative process, absorbing all that knowledge and putting pieces of it back together for yourself to build something that fits your own needs.

So to everyone else out there, keep up the good work, and I look forward to seeing more code and information from you in the future.

SCO Update (Tuesday, Mar 18)
[ permalink ] [ e-mail your comments ]

Here's an update to the SCO lawsuit against IBM: I received this e-mail from the SCO mailing list today. It explains the background and "rationale" behind the lawsuit...

Option Compare Nocase, (Monday, Mar 17)
[ permalink ] [ e-mail your comments ]

If you're having case-sensitivity problems with the ls2html or ls2rtf scripts, try adding "Option Compare Nocase" to the Options section of the script library (note that you have to add it to the library, not the agent you're calling it from). That will allow the functions to interpret "dim", "Dim", and "DIM" all as the same keyword.

That seemed like a nice default option to set, so I added it to the ls2html and ls2rtf files that are available for download here (as well as the sample FormatLS.nsf database). With the minor updates, we're now up to version 1.0b. I may add some functionality soon to change the case of the keywords that are found to the case that Notes is expecting (i.e. -- "dim" will become "Dim"). That's pretty easy to do, and I know how I'm going to do it, but I probably won't have time until next week or so.

By the way, I know I've been writing some pretty boring blog entries for a while, so if you want something a little less technical and a little more fun, check out my friend Tom's site at He's a Domino developer buddy of mine in Atlanta, and I'm always amused at the stuff he ends up blogging about. Some of his stories are just pure entertainment.

ls2html Database Example (Sunday, Mar 16)
[ permalink ] [ e-mail your comments ]

I was curious to see how the ls2html code would work with a web page where you could type or paste in some LotusScript code in and get the formatted code back. So this weekend I wrote a database that does just that.

I really need to get some other hobbies...

(NOTE: I made a small update to this database early on Monday morning, so if you downloaded before 6:30 AM EST on Monday, please re-download)

Minor Update to ls2html and ls2rtf (Friday, Mar 14)
[ permalink ] [ e-mail your comments ]

I just made a minor update to the ls2html and ls2rtf code; you can either re-download it or just add these two lines to the Initialize section of both script libraries:

operators("#") = "" functions("Line") = ""

I also added the line "Dim style as StyleDef" to the short example code in the ls2html library, because I mistakenly left that out before.

The nice thing is, none of those changes are "critical" to the operation of the scripts, so even if someone downloaded the scripts yesterday and never re-downloads them again, everything will still work (except a line like "Line Input #fileNum, text$" won't get formatted quite right). It also shows how easy it is to update this script as new keywords and classes are added to LotusScript in the future. Naturally, I'll try to maintain the scripts as best I can, but you can also make your own additions simply by adding elements to the lists in the Initialize section. Piece of cake.

By the way, the script I used to format the two lines of LotusScript above was simply this:

Use "ls2html" newStuff$ = |operators("#") = ""| & Chr(10) & |functions("Line") = ""| Dim style As StyleDef Call GetDefaultLsStyleDef(style) style.script = style.script & "background: #FFDDFF; padding: 15px 15px 15px 15px;" Print ConvertStringEx(newStuff$, style, False)

Then I ran the script in debug mode, set a breakpoint at the end of the script, and copied the output to the clipboard. It would have been even shorter if I didn't want the funky purple background color. Then it would have just been:

Use "ls2html" newStuff$ = |operators("#") = ""| & Chr(10) & |functions("Line") = ""| Print ConvertString(newStuff$)

Pretty easy, huh?

Format LotusScript As NotesRichText (Thursday, Mar 13)
[ permalink ] [ e-mail your comments ]

It occurred to me after posting the LotusScript-to-HTML code yesterday that some people might rather send their formatted LotusScript to a NotesRichText field -- like if you're sending code in the body of a Notes e-mail message, or you have a Notes database that holds script fragments or something. Well, here you go: a modified version of the ls2html script library that converts LotusScript to NotesRichText.

Also, I've got to say that I'm impressed with Joe Litton, who sent me an e-mail less than 3 hours after I posted the code yesterday with a wrapper to the ls2html library. Amazing speed.

Format LotusScript As HTML (Wednesday, Mar 12)
[ permalink ] [ e-mail your comments ]

I know I've been neglecting the blog/site for a few days, so as a present I cleaned up some code I had that formats LotusScript code as HTML. I even added the latest keywords and classes for ND6, so it'll work for all you early adopters out there. As an added treat, here's the code itself in HTML format (created using a single-line call to the ConvertFile function).

What would be really cool is if someone (like LDD?) took this script library and made a simple web form where a user could paste in some raw LotusScript code, click a button, and have it transformed into HTML -- that would be awful handy for including LotusScript in a discussion forum. Of course, if anyone decides to use this code like that, I hope that they make mention of where they got it from... :-)

SCO Sues IBM (Saturday, Mar 8)
[ permalink ] [ e-mail your comments ]

Remember how I said a little while back that SCO has a nifty new legal department that was planning to sue other Linux companies over intellectual property violations? Well, their first victim is IBM, although the lawsuit looks like it's more along the unfair competition lines. According to their press release:

The complaint alleges that IBM made concentrated efforts to improperly destroy the economic value of UNIX, particularly UNIX on Intel, to benefit IBM's new Linux services business.

Of course, they're only asking for $1 billion, so IBM may want to just write a check and avoid the hassle of a lawsuit.

Java Optimization (Friday, Mar 7)
[ permalink ] [ e-mail your comments ]

Here are a few links to some articles (two of them old, but still useful) about optimizing your Java code. Some of the concepts are applicable to other programming languages as well, especially the thought that "premature optimization is the root of all evil". :-)

PreciseJava site (several articles)
older JavaWorld article
Jonathan Hardwick's notes about the subject

As with anything of this nature, make sure you verify the results in your programs before you blindly implement the recommendations. There are always cases where something is technically more efficient to do in a general case, but not necessarily better for your specific situation. Also (my personal opinion), keep in mind that minor optimizations that make your code harder to follow usually aren't worth making.

Java Hash Functions (Wednesday, Mar 5)
[ permalink ] [ e-mail your comments ]

I know...I've been talking about Java quite a bit recently, and I promise I'll get back to some Notes development pretty soon. But Java is just such a rich language, and I'm always finding fun new things tucked away in the standard distributions (even the old 1.1.8 distribution that ships with 4.6 and R5). After all, with the jar files that are included with the R5 client alone, there are 2,545 Java classes you have access to (here's the code I used to get that number).

As an example, I was reading through the great O'Reilly book Java Cryptography today and playing around with the built-in Java crypto functions, and I found out that it takes exactly 3 lines of code to hash a String using MD5 or SHA-1. All you have to do is:

import sun.misc.*;

//initialize your code...
String hString = "This is a string I'm gonna hash";
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(hString.getBytes(), 0, hString.length());
byte[] md5Hash = md5.digest();

If you replace getInstance("MD5") with getInstance("SHA"), you get a SHA-1 hash. And then you can get the message digest of an entire file like this:

FileInputStream in = new FileInputStream(fileName);
byte[] buffer = new byte[4096];
int length;
while ((length = >= 0)
    md5.update(buffer, 0, length);
byte[] md5Hash = md5.digest();

It doesn't get much easier than that. If you're doing any kind of hashing in Notes, all the classes are already included (much less overhead than using LotusScript implementations of these things).

SimpleMimeReader (Tuesday, Mar 4)
[ permalink ] [ e-mail your comments ]

A while back, I had a need to read multi-part MIME messages in a Notes agent, and I wanted all of the multi-part parsing to get done for me so I could just get the message parts. Seemed simple enough, but when I went looking on the web for a Java class I could download that would do the job for me, I discovered that all the multi-part MIME parsing classes I could find were either for Servlets (and required a ServletInputStream) or for post-1.1.8 versions of Java (so I couldn't use them in R5). Sure, there's JavaMail, but then I'd also have to install or include the JavaBeans Activation Framework -- and that's a pretty big package to deal with (not to mention unsupported by Notes) just so I can parse a stupid message.

So anyway, I started working on a multi-part MIME-parser class, and then I shelved it, and I recently pulled it back up and finished it for sentimental reasons. In case anyone else in the world has a need for it, the SimpleMimeReader class is now available for your downloading pleasure. Handy for use with raw e-mail messages, file-uploads to servlets, and multi-part SOAP responses, among other things.

Why Do We Do It? (Saturday, Mar 1)
[ permalink ] [ e-mail your comments ]

The other day, Mike wrote an interesting blog entry about being asked why he runs his website. It was especially interesting to me, because I've often wondered that same thing (about myself, not about Mike). What's the motivation behind running a free website? Why spend so much time on it? Isn't there something better I should be doing?

I actually sat down to write an explanation about why I do it a few months ago, but after I wrote this page-long essay I let it sit for a few days, and when I came back to it I realized that none of the reasons really hit the mark. Sure, they were all good and logical reasons (good for the resume, learning experience, the satisfaction of helping other people, blah-dee-blah), but they just weren't quite right. They didn't really explain it.

Then, after reading Mike's entry, I've been really thinking about it again, and I think I have the answer (at least for me):

It's a creative outlet.

That's it. That's the big reason. It's not ego or money or some caveman tendency to hide behind the computer when I get home. It's a creative outlet. Some people paint, some people work on old cars, some people read a lot of books or watch a lot of movies -- I write little bits of code and maintain this website. It's one of the things I do to keep my brain from decaying into a lump of mush.

Some people don't understand, and that's okay. My website/blog fills a void for me, and if other people happen to like it too, more power to it. The more personal, the more universal (I think that's a William Blake quote, but you'll have to check it).