Friday, July 27, 2007

An overview of Lotus Notes deployment on Windows Terminal Services and Citrix

A few people have been asking about this so I thought I'd compile it once. I have written on the subject of deploying Notes on Windows Terminal Services before, so the intent here is to give a somewhat high level overview of thin client infrastructures and how Notes fits into them. If you have any additional questions please feel free to ask and I'll do my best to respond.

A brief history of Windows Terminal Services (WTS) and Citrix

Thin client computing isn't anything new. The old mainframe terminal scenario was the same thing. A network device connected to the mainframe, which had everything the end user needed. The terminal simply took the stream of data from the mainframe and displayed it on the screen.

In the mid 80's GUI's were starting to take over the business world and OS/2 was one of the first to be embraced by businesses. Ed Iacobucci was a developer on the IBM OS/2 team who was working on a multi-user version of OS/2. IBM wasn't interested, so in the late 80's Ed left to form his own company, which he called Citrix.

Fast forward to the early 90's when Microsoft released Windows NT, their first 32-bit server OS. Microsoft wasn't interested in doing a multi-user OS either, but they were intrigued enough that in 1994 they gave Citrix a copy of the Windows NT 3.51 source so Citrix could deliver a third-party solution. Shortly afterwards Citrix released WinFrame, which let multiple end users log into a server and run installed applications simultaneously. This was so successful that in 1997 Microsoft licensed Citrix technology so they could incorporate it into Windows NT. This yielded the release of Windows NT 4.0 Terminal Services Edition in 1998.

Ultimately this paved the way for the more robust implementation of WTS in Windows 2000 Server and Windows Server 2003. It's also used as a basis for remote desktop sharing in Windows XP.

The difference between WTS and Citrix


So now you know that WTS originally came from Citrix so you may be wondering what the differnce is. The biggest difference is the protocol. Microsoft uses RDP while Citrix uses ICA. The ICA protocol has better compression and performance than RDP. Citrix also offers special packages for delivering web apps and for working with WAN or slow data links. I will admit I have no experience with Citrix. In the environment I support we did not determine a need for the extra features Citrix brings to the table. (Maybe my friend Eric will chime in and offer some of his reasoning.)


Deploying Lotus Notes on WTS and Citrix (the old way)


Since multi-user Windows OS's didn't exist until 1998, this is a pretty new segment of the market. As such many application vendors were caught off guard by its meteoric rise in popularity. Lotus was no exception.

As you know, all configuration files are in the Notes data directory, such as C:\Program Files\lotus\notes\data. This poses a problem in a shared environment since you can't have everyone using the same notes.ini. The solution in Notes R5 was to map a drive letter, such as H:, and put the data directory there, then map the same drive letter for every user who logged in and copy the base Notes data directory.

This worked, but it was painful. First, upgrades are a nightmare. You have to install the new version of Notes then copy all the files in the data directory to all the individual user data directories. This could be scripted, but it's still a pain and had to be done during off hours. Second, the Notes client accesses the notes.ini file a lot. If something happens to delay the Notes client's access, the client will throw up errors or even crash. Third, it's a tremendous waste of space to have the same files duplicated for every user.

... and the new way...


IBM introduced the multi-user setup option starting with Notes 6. This would install the program executables to C:\Program Files, but store all user-specific information in the user's profile on the server, such as C:\Documents and Settings\crobinson. This addressed every problem with the previous solution. Upgrades were greatly simplified and no files had to be manually copied, everything was running locally so there were no network timeout issues, and there was much less duplication.


What about Notes 8?


That's a big unknown, actually. Notes 8 comes in two flavors: Standard and Basic. The Basic client is the traditional C++ implementation. It can be deployed just as Notes 6 or 7 were and is supported on WTS and Citrix.

The Standard client deploys the Lotus Expeditor framework, which is an Eclipse Rich Client Platform framework. This is the one getting all the press and it is not supported in a multi-user OS configuration yet. Lotus does plan to support it with Notes 8.0.1. Numerous people have tried to get Notes 8 Standard running on WTS or Citrix and to the best of my knowledge no one has succeeded yet. It will be interesting to see how IBM/Lotus achieves that.

Sources
Implementing Windows Terminal Server and Citrix MetaFrame on IBM eServer xSeries Servers
Windows Networking - Overview of Terminal Services
msterminalservices.org
Lotus Notes/Domino 8 Public Beta forum

Thursday, July 19, 2007

the merits of writing readable code

I inherited an Access application with 400 forms and 130 reports and I can't even guess how many lines of code. Much of that code looks like this:
Private Sub Command2_Click()
Dim x As String
x = MsgBox("You are about to generate a payroll run. You may do this as many times as you wish before Posting Payroll. Do you wish to proceed?", vbYesNo)
If x = 7 Then Exit Sub
DoCmd.Hourglass True
CurrentProject.Connection.Execute ("dbo.sp_GeneratePayroll")
DoCmd.Hourglass False
x = MsgBox("Generation Finished- would you like to preview the payroll report?", vbYesNo)
If x = 7 Then Exit Sub
DoCmd.OpenReport "prGenDetail", acViewPreview
End Sub

The first issue is the control name. What on Earth is Command2? Looking at the design of the form I see that it's a button with a caption of "Generate Payroll". When you add controls to an Access (or VB) form it gives them default names. The first button on a form will be Command1, the next Command2, etc. It would be like Domino Designer leaving all your fields named Untitled and just incrementing them as you add more. Most developers rename these to something meaningful, for what I hope are obvious reasons. In this application very few controls have specific names, making maintenance much more difficult.

The next issue is the utter lack of formatting. This style of coding is used throughout the application, with everything lined up at the left margin. In some rare instances there is a one or two space indentation. Lines of literal text are left so long they run off the screen. Next up is the variable, whose name doesn't tell you anything. Upon inspection you also see it is the wrong datatype. VB will handle the automatic type conversion, but why should it?

Using magic numbers instead of constants is a big no-no. If X = 7? What's 7? This will make Domino developers drool: VBA (and VB) have constants listed in Autocomplete. Press Ctrl+J and select from the list. Interestingly enough you will see that the previous developer did use the vbYesNo constant in one place, but the values everywhere else.

Finally, the application flow is a little convoluted. If...Then statements are most often done in a single line rather than in an If...Then...End If block. Why are there two Exit Sub calls? Breaking it out into If...Then...End If blocks would provide better logical flow and make it more obvious what is going on.

Here is how this routine looks now, after I addressed all those issues.
Private Sub GeneratePayroll_Click()
Dim response As Integer

response = MsgBox("You are about to generate a payroll run. You may do this as many times " & _
"as you wish before Posting Payroll. Do you wish to proceed?", vbYesNo)

If response = vbYes Then
DoCmd.Hourglass True
CurrentProject.Connection.Execute ("dbo.sp_GeneratePayroll")
DoCmd.Hourglass False

response = MsgBox("Generation Finished- would you like to preview the payroll report?", vbYesNo)
If response = vbYes Then
DoCmd.OpenReport "prGenDetail", acViewPreview
End If
End If
End Sub
This VBA code was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

The object name now makes sense, the code is laid out in a logical manner, the variable name tells you what it does and is of the correct datatype, long lines of literal text are broken to fit on the screen better, and the magic numbers are all gone.

One down, eleventy billion to go.

Wednesday, July 18, 2007

What American accent do you have?

What American accent do you have?

Midland

("Midland" is not necessarily the same thing as "Midwest") The default, lowest-common-denominator American accent that newscasters try to imitate. Since it's a neutral accent, just because you have a Midland accent doesn't mean you're from the Midland.

Personality Test Results

Click Here to Take This Quiz

Rather funny considering I have lived in the Southern US all my life. :-)

Tuesday, July 17, 2007

FTP'ing from Notes

Mike VandeVelde was kind enough to point me to the Sandbox for a few examples of FTP'ing from Notes. This includes both LotusScript and Java agents so there should be something for everyone, and it saves me from having to do it myself. Thanks Mike. :-)

Monday, July 16, 2007

'You Can't Put a Dollar Sign' on Trauma

I've mostly stayed out of political commentary here, except when it affects me directly. Yesterday the Roman Catholic Archdiocese of Los Angeles agreed to a $660 million settlement with the 508 alleged victims of sexual abuse by priests (via the Washington Post). The most disgusting part, to me, is
[the Archdiocese]... agreed to release confidential files that disclose how the church relocated abusive clergy.
The Catholic Church knew there was a problem and rather than take a PR hit, they allowed these predators to continue destroying children's lives. If this happened in a secular daycare center or public school the offender would be eviscerated and the higher-ups would also be held accountable by an outraged public. In this case the pedophiles were simply given a fresh batch of victims and left to do their evil, and the people who enabled them are walking away after frivolously spending hundreds of millions of dollars on their get out of jail free cards.

You may be wondering how this affects me. I'm not Roman Catholic, but I am a survivor of childhood sexual abuse. Starting when I was 3 or 4 and continuing until I was 6 or 7 my brother molested me. I'm still uncovering the ways that has affected me, and have spent years in therapy looking at myself from other angles to understand why I am the way I am. Often it comes back to the sexual abuse and the domino effect it triggered.

A settlement tells victims that their trauma doesn't matter in the face of the almighty dollar. Justice is blinded by money. No matter how hard anyone may try, money can't buy or replace what was stolen from us. There is no restitution for the trauma I and other victims of sexual abuse endured. There is no way to recover what we lost.

At least some within the Catholic Church are willing to buck the system. In the first comment to the Washington Post article, Sister M. Immaculata Dunn says:
The saddest thing behind the actual sexual abuse itself, is that so many of these good, good people have lost faith because of what was done to them in the name of God.
It's largely because of what happened to me that I never had faith in the Christian god to begin with.

smokers, chipmunks and Tyler

I just got back from my trip to Hamilton and Toronto. The wedding was nice and spending time with my sister was a rare treat. She's the only member of my family that I can stand to be around and I don't see her often enough.

We spent a couple of days in Toronto, and other than missing getting together with Stan, we had a wonderful time. A few observations:
  • I've never seen so many people smoking on the street in all my life! They were even congretated in places that were posted "this is not a designated smoking area". Even in the rain and without umbrellas they were still trying to drive nails into their coffins. It was horrifying to witness the grip the addiction had on these people.

  • At the Toronto Zoo I saw at least a dozen chipmunks. Prior to this I had only seen two or three in my entire life. I was amazed that they were so numerous, and at how brazen they were. Many would sit in the path or on the edge of a food dish until we were just a few feet away.

  • While at the zoo it started raining. It was a light rain but we didn't have umbrellas or ponchos and were concerned about getting our digital camera wet. While sitting under the overhang of the Australia Pavilion a young woman came by with her son, Tyler, who I would guess was about 2. Tyler liked playing in puddles. He would run through them, looking down at his feet as he plowed through the water -- and into other people. He would jump and splash and giggle and clap his hands. His mother was annoyed by his lallygagging, but Tyler didn't care. And I'm glad. Tyler's joyful play made me happy.
Pictures to follow shortly. Sadly, none of Tyler.

Saturday, July 07, 2007

is there any interest in using the Windows API from Notes?

I do a lot of work with the Windows API for things such as returning the current user's hostname and IP address; pinging remote systems; FTP'ing files; listing computers on the network; presenting common Windows dialogs; and a whole bunch of UI effects. I do most of that work in VB, but a lot of it could easily be ported to LotusScript. Someone asked me about FTP'ing from Notes so I'm working on that now and will post it shortly. Would there be any interest in a series of posts along these lines that exploit the underlying Windows API?

I realize most of the network operations could be done in Java, and I also accept that doing this with Windows API calls makes it platform dependent.

Thursday, July 05, 2007

My first blogoversary

July 7, 2007, marks the one year anniversary since I first hung my shingle in this corner of the blogosphere. It's been interesting, to say the least. I started blogging specifically to be a voice of dissent. I've said some outrageous and inflammatory things; I've built some bridges and burned others. It's definitely been a learning experience. I want to thank you all for reading my musings and supporting me (or not... that's sometimes useful, too).

So let's see... a blog year in review....

159 posts, including this one
433 comments left here
Up to 249 subscribers (wow!)
I have no idea how many comments I left on other blogs. I'm sure it numbers in the thousands on Ed's alone.
More heroes met than there is space to name them all. And the possibility of meeting even more.
Dozens of friends made.
One friend lost.

any tips on visiting Toronto?

As part of my year of travel I'll be visiting the Toronto area the weekend of July 13th. We fly into Rochester, NY on the 12th and will stop by Niagara Falls on the way to Hamilton, where we're staying the first night. The next day, Friday the 13th, will be mostly tied up with wedding stuff, and we're moving to the InterContinental hotel in Toronto for Friday and Saturday nights.

So far the only things on our must do list are the Toronto Zoo, CN Tower, and Kensington Market. Is there anything else anyone would recommend highly? What about good places to eat? I'm not talking high-end necessarily, just good local favorites. Is there anyone out there in blogosphere land who is in or near Toronto who might want to do dinner one night?

Monday, July 02, 2007

the mud mess saga continues

This past weekend was a mini-reunion for my partner's family at his mother's house. His two brothers from out of town visited, and his other brother that lives locally also dropped by. Unlike my family get-togethers, it was a nice visit. Nobody cried, no death threats were made, no fights broke out... It was kinda weird to me.

During the visit the subject of our geothermal adventure came up. Myron's youngest brother David was a geology major so I told him we were planning on covering over the mud with topsoil and just forgetting about it. I described it, showed him the pictures, and he confidently said it was Cooper marl. He went on to discuss how will set up like concrete and will not decompose. He related a report he had read of some work done where Cooper marl was extracted nearly 30 years ago and left exposed, and you can still see shoe prints and shovel indentations.

I did some research on my own last night and found a geologic survey that said Cooper marl is an effective replacement for concrete in setting building footings and pilings. In other words, this isn't plain old mud, so now it looks like I'll be hauling it off to the dump. Through the magic of Google I calculated that we have approximately 132 cubic feet of this stuff, and also calculated that my truck holds 40 cubic feet, so it looks like this is going to take a while.