About Duffbert...

Duffbert's Random Musings is a blog where I talk about whatever happens to be running through my head at any given moment... I'm Thomas Duff, and you can find out more about me here...

Email Me!

Search This Site!

Custom Search

I'm published!

Co-author of the book IBM Lotus Sametime 8 Essentials: A User's Guide
SametimeBookCoverImage.jpg

Purchase on Amazon

Co-author of the book IBM Sametime 8.5.2 Administration Guide
SametimeAdminBookCoverImage.jpg

Purchase on Amazon

MiscLinks

Visitor Count...



View My Stats

10/31/2003

Over 20000 served here...

Category Blogging

A picture named M2

Yeah...  I realize that many of you probably get that many hits in a month (maybe even a week).  Just let me revel in my small victories...

10/30/2003

A major milestone for the Duff family...

Category Everything Else

Today was an eventful day for our family...  Ian took and passed his drivers test.  We now have a kid who is a licensed driver.

As John Pontefract at our company said today, "That is one of those events that makes you feel older."

I'm still not sure if he was talking about Ian, me, or both of us...  :-)

10/30/2003

Blogger gets the boot at Microsoft...

Category Microsoft

http://yro.slashdot.org/yro/03/10/29/1421223.shtml?tid=109&tid=187

Apparently Microsoft didn't like the fact that this guy had posted a picture of Macs being brought into the MS campus.  


I think this is one of those issues we all deal with if our blogging even remotely touches on our job activities.  Just something to think about when you choose to identify your company affiliation in your blog....


Thanks to Chaz for bringing this one to my attention.

10/30/2003

LZ1 Compression in Notes/Domino 6

Category IBM/Lotus

A good entry in the KnowledgeBase explaining about LZ1 compression that is now used in ND6...  Enjoy!
-----------------------------------

Title:  What Is LZ1 Compression in Notes/Domino 6?

Document Number:  1090049

Problem
What is LZ1 compression?

Content
Notes/Domino 6 (ND6) uses LZ1 compression for file attachments.  LZ1 stands for "Lempel-Zev class 1";  it is a different method of compression from that of the Huffman algorithm, which is the method by which Notes/Domino R5 compresses attachments.

 Important information from the Notes 6 Client help and Domino 6 Administrator help:

"Because LZ1 compression can save you a considerable amount of disk space, it is favored over the Huffman method. Be aware, however, that if you are working in an environment that uses different versions of client and server software and you choose this option, the attachments are automatically recompressed on the server using the Huffman algorithm. This recompression of attachments can add significant extra time to the process."

"If the LZ1 compression option is set on a Domino 6 database, a Notes 5 client will be unable to read the compression. The Lotus Domino 6 server converts LZ1 to Huffman compression for the Notes 5 client. This affects server performance. Implement LZ1 compression in an exclusively Lotus Notes/Domino 6 environment."

10/30/2003

Another win for the Grant High School hockey team!

Category Everything Else


Last night was the latest installment in the 2nd season for Grant's hockey team.  This week, the opponent was Clackamas.  Last year, Clackamas was a powerhouse.  I won't even mention some of the scores we lost by last year.  Unfortunately for them, this year's team is much more human.  Ian felt that Grant and Clackamas were probably the most evenly matched teams in the east division, and the game proved that out.


The first period was tightly contested, with neither team gaining a clear advantage.  Cam made some early stops in goal that looked good, so I was moderately hopeful that he would have a decent game between the pipes.  Ian was laying out some nice checks on the boards, and we exited the first period tied 0-0.  The second period opened up a bit more, and Clackamas finally scored on Cam.  Grant got two goals back (one with an assist by Ian, his first appearance on the scoresheet for SCORING as opposed to penalties), and then Clackamas tied it back up.  Going into the third, we were tied 2-2.  


Gut check time...  Cam was playing pretty well, but his problem is giving up rebounds.  Clackamas came out hard in the third and started unleashing the shots.  It was then that Cam kicked it into high gear.  The kid was sucking in everything.  Probably the best game I've ever seen him play.  When he stoned a 2-on-none breakaway, the place went crazy (all 30 of us!).  Grant got two more goals (another assist by Ian) and led 4 - 2 with three minutes to play.  We gave up a power play goal with a minute left, and the nailbiting began.  But the defense held, and Grant skated away with a 4 - 3 win to advance their record to 3 - 1.  


It is such a rush to watch my kids play hockey on a competitive team (as opposed to last year's fiasco).  It's never easy being the parent of a goalie, where every mistake your kid makes shows up on the scoreboard.  And given Cam's relative lack of experience, it's even worse.  But the combination of his additional experience and the improvement of the team over last year has made a dramatic difference.  I don't mind missing all that sleep any more!

10/29/2003

Well, stick a Red Hat on me and call me a penguin!

Category Linux

I have now joined the ranks of the Linux penguin-heads.  Not what I had in mind when I started this week, but too cool all the same.

It started with that Knoppix CD I blogged about a couple of days ago.  Alex (my co-worker) and I were really impressed by what we saw.  Alex was so impressed that he set his Thinkpad up to dual boot between W2K and Red Hat 8.0 last night.  Not to be left behind, I did the same thing this morning...  I feel so trendy now!  :-)

We were both still stuck in the "command-line" mindset of Linux and didn't feel it was worth messing with.  But once we saw the desktops and the different software offerings that come bundled, we couldn't resist.  I don't plan on ditching Windows entirely, as I'm not necessarily into the "MS sucks" mindset.  Still, it's nice to have choices, and I feel really good that I've taken the first step towards exercising those options.

Mega kudos to Alex for helping me through the Partition Magic reformatting and the Red Hat setup.  

10/29/2003

Book Review - Thinking In Java

Category Book Reviews

I did a review of Thinking In Java by Bruce Eckel for Prentice Hall last night.  You can read the review at the Portland Domino/Notes User Group site.  Basically, it's one of the three Java books that I think all Java programmers should own (the other two being Head First Java and Java In A Nutshell).

10/29/2003

'Latehorn' Time Frame May Be Hard to Swallow

Category Microsoft


Not that I really care all that much, but the analogy was great...

-------------------------------------------
'Latehorn' Time Frame May Be Hard to Swallow
 
October 25, 2003
By Peter Coffee  

When developers arrive this week in Los Angeles for their annual feast at the Microsoft table, they'll get more appetizers than entrees. Considering the ravenous appetites in this crowd, it's surprising to see them flocking to a place where the sign reads "Dinner will be served in three years"-which is when the "Longhorn" version of Windows is scheduled to arrive.

Microsoft promised developers an easy transition from authoring active Web pages to disclosing and consuming Web services. The company's tools and technologies aimed at those ends took a while to deliver, with a gap of many years between the last Visual Studio and the first Visual Studio .Net, but the result satisfied many developers as worth the wait.

For some developers, however, another three years' wait is too long. They've made promises to their front-office managers, and they need to eat right now. The open-source deli is open; the Apple bistro is serving fresh-sliced Panther, no waiting. Microsoft is betting that most enterprises are still digesting Web-based applications and that they're willing to wait.

 For those who choose to place themselves in the hands of the Microsoft maitre d', we suggest the following strategies: Request lists of ingredients; any modern establishment is proud to disclose the standards on which its offerings are based. Beware of allergic reactions; be certain that today's and tomorrow's menus can coexist with what you ate yesterday. And if you aren't sure what the menu descriptions mean, ask; aged beef may be a premium delicacy, but sliced "Latehorn" may be merely jerky.

10/28/2003

If you search forums frequently for answers to Notes/Domino questions, check out MartinScott's Domino SuperSearch

Category Software Development

Try out this site if you haven't before:  MartinScott's Domino SuperSearch.  You can pass a single search string to multiple sites at one time, and then sort through the different browser windows to find the answers you were looking for.  This is absolutely the first stop I make when looking for Notes/Domino answers.

10/27/2003

Major Flashback! Lotusphere 1997...

Category IBM/Lotus

I've been reading a few books on improving personal productivity, and part of that has led to going through some piles of reading material and notes to figure out what I want to keep and what I want to ditch.  I happened to come across the pile of my annual Lotusphere notepads, and lo!  I found my first Lotusphere notepad from 1997.  I had been doing Notes for about 5 months, and Lotusphere blew me away.  It completely changed my career and life, and is one of the reasons why Lotusphere is so important to me.

Going through my notes, I remember fondly some of the following...
  • "The Future Of Intranet Applications" - remember Domino.Merchant?  1997 was to be a beefing up of the team development capabilities.  We're finally seeing some of that starting now.
  • "What's New In Notes Release 4.5 Design" - color validated code, calendar controls, import/export LS code, script libraries!
  • "Upgrading To Release 4.5" - should I go to 4.1 or 4.5?  Last 3.x release was 3.37 shipped in 3rd quarter 1996.
  • "Making Your Notes Applications Shine" - still good basic information in there...
  • "Programming Notes With Java" - note to myself - "A little too high level for where I'm at..." - little did I know I'd be doing Lotus Advisor articles and speaking sessions on said subject six years later...  :-)
  • "Best Practices In Notes Application Development" - still one of my favorite sessions to go to.  Great nuggets of info.
  • "The Future Of The Domino Web Server" - Domino 1.5 released December 1996 - integrated into Domino 4.5.
  • "Everything I Know About Explaining Notes I Learned In Kindergarten" - My favorite speaker at LS - Ken Wax.  I only hope that some day I can present as well as he does.

It sometimes takes one of these discovered treasures to see how far you've really come...

10/27/2003

No reason not to play with/learn about Linux...

Category Linux


At our Portland Domino/Notes User Group meeting last week, Carl Prehn from IBM mentioned a website where you could download a bootable Linux CD image.  The website is called
Knoppix, and their package is an ISO image that you burn to a CD and boot from.  All the Linux software runs from the CD, and you don't have to worrry about mucking up an existing box.  When you shut down and reboot, you're back at Windows with no trace of the Linux environment.

I did the download and booted the CD on my IBM Thinkpad.  Without reading a shred of documentation, I had a Linux x-Windows desktop running in less than five minutes.  I don't know how to DO anything yet, but it's a start.  The CD has a ton of open source packages on it, including OpenOffice and an Adobe PDF reader (and games, and, and, and....)  Everything except my wireless card was working automagically.  When Alex (my co-worker) booted with a network connection via cat-5, the system recognized the network connection and he was off surfing with Mozilla.


This is just WAY too cool!  No good reason for me to not start toying with Linux now...

10/26/2003

Well, that's the last Patricia Cornwell/Kay Scarpetta novel I'll be reading...

Category Book Reviews

I got Cornwell's latest book Blow Fly from the library the other day.  I used to really like the Kay Scarpetta character, who is a female medical examiner based out of Richmond, VA.  But over time, the series has gone from action and mystery to psychological examinations of the main characters, with any action taking a back seat to delving into the psyche of everyone.  And some of Cornwell's attempts to write novels outside of the Scarpetta series have been horrendous.  It was my hope that this latest installment would restore my liking of the Scarpetta line.  Sadly to say, the answer is a resounding "no".

Scarpetta has moved to Florida to set up shop as a private consultant after things went bad in Virginia.  One of the characters from a prior novel is on death row but wants to contact her.  Benton, her lover who was supposedly murdered in a prior novel, isn't really dead now.  It was a staged act to put him into the witness protection program.  Her niece, Lucy, is now part of an international group that does vigilante killings.  And her police partner Marino is just flat out falling apart at the seams.  Oh, the plot?  Yeah, I guess there's one in there that could have been written in 100 pages instead of 400+.  And to top it off, the ending is open so that there can be another installment...

Just don't count me in when it comes to reading it.  This was the last Scarpetta novel I'll read, and most likely the last Cornwell novel I'll pick up.  Life's too short to waste on bad psycho-thrillers that aren't.

10/25/2003

Weekend reading review...

Category Book Reviews

Over the last couple of days, I finished off a couple of books that I'll review here...

The first one I finished this morning was The Darwin Awards 3 - Survival Of The Fittest by Wendy Northcutt.  These are real stories of people who have eliminated themselves from the gene pool by rather creative means.  If you're unaware of the concept, go to the Darwin Awards website and check it out.  Just remember...  It's only funny 'till someone gets hurt...  Then it's hilarious!

The other book was The Da Vinci Code by Dan Brown.  I'm somewhat torn in my review on this.  As a mystery novel, it's pretty good.  But I feel the author intends to make it much more than that.  The plot line is that there are secret papers about the life of Christ that have been hidden by a secret society over the centuries.  So as to not ruin the plotline for you, I'll just state that the revelations could destroy the Catholic Church and redefine Christianity.  I believe that the author is presenting what he feels are facts within the context of a novel, and some of his points are thought-provoking.  So if you want to be challenged in your belief system, have at it.  I personally have major issues with his conclusions, but I'll save those for another time (or take it offline with anyone that cares to explore it further).

10/24/2003

Removing unused field names from your Notes application design...

Category Software Development


If you've been doing Notes development for any length of time, you've run into this situation.  You copy an existing application as a starting point for a new app, change the form design, go to create a new view, and your list of field names to select from has both sets of field names from both apps.  And in a worst case scenario, you end up with a damaged design because you have too many unique field names or the length of all the field names is larger than supported by Notes.  You do a search on discussion forums and find instructions on how to remove unused field names, but for some reason they don't quite work.  That's certainly been my lot in life with this process...

I found the following Knowledgebase item the other day, and decided I was going to work with it until I got it right.  And much to my surprise, I was able to remove unused field names!  I think the key for me was the compact step.  In the KB article, they give you a command line way to run the ncompact task.  I think I was just assuming I could do that through the client (either Notes or Administrator) and it never worked.  When I used the command line version of the compact, it worked like a charm...

So...  To save you the same pain, here's the KB entry...

Deleted Fields Still Showing in List of Fields When Writing Formula

Document Number:  1099697

Problem
:
In Notes R4 and later, fields that you have deleted from your database are still listed when you are writing a formula and click on the Fields & Functions button.

10/23/2003

What Are the Components of a Note ID?

Category Software Development

Ran across this gem in the Knowledgebase the other day...  good reading if you've ever wondered what makes up a Note ID value...

What Are the Components of a Note ID?

Document Number:  7002668

When we troubleshoot the issues related to mail routing/replication, it is helpful to know how a note ID is formed.


This document describes note IDs in detail and explains how different Notes tasks (replicator and so on) use the components of a note ID and how API programs can use them.


Note:  Much of this information is also contained in the Notes C API 5.0 User Guide and Notes C API 4.6 Reference Manual.


The parts of a note ID are:

10/21/2003

Interesting twist on the Nigerian 419 scam...

Category Everything Else


Hadn't seen one like this until two days ago...

Date: Mon, 20 Oct 2003 18:53:14 +0200
From: eaas_lot01@tiscali.co.uk
Subject: YOU'VE WON $2,500,000.00usd!!!
To: eaas_lot01@tiscali.co.uk




E.A.A.S Lottery Headquarters;
Customer Service
580 N Tenth Street
Sacramento, SA8514
Euro-Afro-Asian Sweepstake Lottery an
Affiliate of Pan Africa Games Lottery
Arena Complex km 10 Route de Rufisque
I.P.P Award Dept.
Johannesburg, South Africa.

Ref: E.A.A.S.L/3412PA/03

Winning Notification

We are happy announce to you the results of the draw of the 2003 8th All
Africa Games Lottery held on Saturday, October 4 2003 in Abuja, Nigeria.

Johnson Biya conceived the idea of a Pan Africa Games Lottery as far back
as 1920. The purpose was to encourage sports among the African People by
creating awareness through Lottery participation the duration of the games

Attempts to start up the Lottery proved abortive, because attempts to host
the Games in Algiers (1925) and Alexandria (1928) failed and suffered setback
for three decades in. July 1965, the first Lottery was held in Brazzaville,
Congo. . Participation in the lottery was few and restricted to the African
Race.The Lottery was granted official recognition by FI (Foundmoney International).From
that time till date the Lottery has been held simultaneously along side
with the All African Games recently. We have been getting letters and calls
from people aside Africa Continent indicating their interest to be part
of the Program.During the one held in Johannesburg South Africa (1999),
the Co-ordinates after due consideration and consultation, unanimously agreed
to expand the program to include participants from Europe and Asian Continents.

This year?s (8th) All African Games Lottery is appropriately tagged ?Euro-Afro-Asian
Sweepstake Lottery? (E.A.A.S.L) is currently taking place in Abuja Nigeria.

This year?s program comprises of three (3) categories; one for each continent.

All participants were selected randomly from World Wide Web through computer
draw system and extracted from 100,000 companies.

This promotion takes place every four years.

Your email address attached to serial number E22262 draws the lucky numbers:
6,33,19&9, which subsequently won you the lottery in the 1st category.

You are therefore been approve to claim the total sum of $2,500,000.00usd
(Two Million, Five Hundred Thousand) USD in cash, this is from a total cash
of Ten (10) lucky winners in this category

Please note that your money will be release to you by our security firm
in Valencia Spain only when you provide evidence of participation.

Our Nigeria agent has been instructed to commence processing of evidence
of participation to facilitate the release of your funds as soon as you
contact him.

For security reasons, you are advise to keep your winning particulars confidential
till your claims are processed and your money remitted to you in whatever
way you deem it fit to claim it. This is part of our precautionary measures
to avoid double claiming and unwarranted abuse of this program by unscrupulous
elements. Please be warned.

To file for your claim contact our fiduciary agent in Nigeria
MR George Stone
E.A.A.S Lottery Int.
Email:eaas_lot01@tiscali.co.uk



To avoid unnecessary delays and complications, please quote your reference/batch
numbers in any correspondence with us

Please note that this offer lasts till October 27 2003.

Congratulations! once more from all members and staffs of this program.
I thank you for being part of the 2003 Euro_Afro_Asian Lottery program


Sincerely yours,
Sir C.I. Gidgwick
E.A.A.A Lottery Coordinator

10/20/2003

Finished a couple books...

Category Book Reviews

I've had a number of books going lately, and a couple of them were finished this evening while waiting for Ian and Cam to finish their ice time...

The first one was Getting Things Done by David Allen.  It's a book on "stress-free productivity", and there's some good information on developing a system to track the open items in your life and organize them such that they don't drop through the cracks and they don't take up mental energy in your mind.  There are some definite concepts I plan on taking from this book and implementing immediately.  

The second book was recreational...  It's J. A. Jance's latest novel called Exit Wounds.  A small town sherrif finds herself trying to solve a murder involving bullets from 1917.  The lady who was murdered also had 17 dogs who died of heat in the trailer house where she was found.  The bullets match to a second killing in the desert that happened a couple days earlier, and she has to figure out how/why they are connected.  And to complicate her life, she finds out she's pregnant, and she is also running for reelection against a rather slimy character.  It's a so-so read.  Nothing really jumped out and pulled me in...

10/20/2003

My personal network support is officially outsourced to... my 15 year old son.

Category Everything Else


Let me state for the record here that I'm a software person.  More specifically, I'm a programmer/developer.  I use an OS, but I don't necessarily want to know all the ins and outs of it.  I use a computer, but I don't have a desire to build one myself.  In fact, until W2K and plug-and-pray, I would normally end up breaking things whenever I tried to install a new piece of hardware or make a significant OS change.


Now...  My son was able to get a really nice desktop system last week for $40.  His friend's dad's business is going under, and he was able to get a Dell desktop/monitor/keyboard/mouse/speakers loaded with W2K.  The memory and harddrive are a little small (128 mb and 10 gb), but the rest of the system looks brand new.  For internet connectivity, I use Internet Connection Sharing with my laptop and the other main desktop machine in the house.  In the short term, Cam and I have been sharing the network cable when either of us wants to be connected.


Yesterday he comes home from his friend's place with a hub and a 20 ft cable.  I tried to explain to him that our current crossover cables would not work with the hub, and that we didn't have enough/long enough cables to complete a network between the our two computers in the basement.  But he's normally not one to take no for an answer.


I woke up this morning and wandered down here to the basement.  He somehow found/scrounged enough cat 5 cords that reached, and we're now both networked to the upstairs machine with the DSL connection.


The kid scares me...

10/19/2003

Book Review - Java Extreme Programming Cookbook

Category Book Reviews

I had the opportunity to review the O'Reilly book Java Extreme Programming Cookbook by Eric M. Burke and Brian M. Coyner.  A more accurate title might be Java Extreme Programming Tool Cookbook, as it covers a number of the open source tools used to continually build and test your code during the XP development methodology.  While not an in-depth coverage of any single tool, it does make you aware of what is out there and how to use them.  I recommend this book to anyone doing Java development.

You can read the full review out on the Portland Domino/Notes User Group website.

10/18/2003

Book review - Purple Cow

Category Book Reviews

I finished a short book from the library today called Purple Cow - Transform Your Business By Being Remarkable by Seth Godin.  The main premise of this book is that the standard ways of marketing products don't work in today's media-rich and noisy society, so you need to stand out to be different.  Trying to target the "mass market" is a sure way to make sure you aren't noticed, as the mass market generally already has what they need and want.  By marketing to the early adopters and pioneers, you create "virusideas" that start to spread and catch on.  It's generally safer and cheaper to go after that market than to spend billions to advertise a product that is a "me too" of stuff that's already out there.  

Very reminiscent of Tom Peters' work, and I recommend it...

10/17/2003

Supported Configurations of Notes and Domino 6.x

Category Software Development


While perusing through the KnowledgeBase this week, I came upon this gem.  It's a very nice layout of what combinations of Notes/Domino 5 and 6 are supported with each other.  It's sorta long, so I'll let you click on the "Read More" to see it all.  


Supported Configurations of Notes and Domino 6.x

Document Number:  7002724

10/15/2003

IBM dumping Windows as an internal standard?

Category IBM/Lotus

Is IBM set to dump Windows, inside?


Wouldn't THAT open a few eyes?  http://www.theinquirer.net/?article=12136

10/15/2003

Be kind to your Domino server when using Java... recycle()

Category Software Development

Joe Litton and I are preparing a session for next month's meeting of the Portland Domino-Notes User Group that will cover Java For The Domino Developer.  The focus will be taking what you already know about LotusScript and relating it to writing Domino agents in Java.  Think of it as a short-cut method to getting started with learning Java...

One of the items we'll cover is the use of the "recycle()" method of each Domino object when coding in Java.  This is a critical item that Joe learned all too well when he was working on a project for a former employer.  As in crashing the mail server each night until he learned about this feature...  :-)

From the KnowledgeBase...

Why it is Important to Use Recycle() Method on Every Java Object That is Created

Document Number:  1097861

Problem
You want to use Java in either an agent, a servlet, an applet or a stand-alone application to access Notes Objects.  This can be used to access information locally on the same server or remotely on a different server, in which case CORBA (Common Object Request Broker Architecture) would be used.  All of the above have been created to mimic the LotusScript Object Model and make it easier for developers to use these tools.  For example, to get a handle on a database using LotusScript, the session contains the current database.  This is also true for the Java classes.  Once you create a session, you may reference a database through the session.  When does a developer need to invoke the method recycle() for this code?

Content
When you create an object in LotusScript, you create two objects - one in LotusScript and one in the Notes back-end (C++ code). The LotusScript object "points" to the C++ object, which really implements the class's behaviors.  When the LotusScript agent or event ends, both objects are destroyed automatically.  If the objects were not, they would stay resident in memory thereby creating a memory leak.

If you create an object in Java, the same applies - it's a pointer that points to an object that is created in C++.  It is common in pure Java coding to set something to null in order for it to be flagged for garbage collection (gc) immediately, and this is called "aggressive" garbage collection.  However, when using the Notes Objects for Java, setting something to null marks the Java object for garbage collection, but does not mark the C++ object for garbage collection.  De-referencing the Java Object flags it for garbage collection, but nothing will be affected on the C++ Object.  Recycle() destroys the C++ object and sets the Java object for garbage collection.  If you mark things null, you could still experience memory issues.  When using objects in an Agent all objects (both Java and C++) are destroyed when the agent ends.  When using servlets, JSPs or standalone applications recycle must be used as Domino will never clean up these backend objects

Conversely, if an object has been set to be recycled, it will not be marked null.  You could, in theory, reference the object again - it shouldn't crash, it would merely throw an exception.  This is important when there are multiple references to the same object; "db = mydb.nsf" as well as, later on "db = yourdb.nsf".  Redefining your reference in this manner is not recommended.  It can be confusing and can therefore yield unreliable results.

In a perfect world, the developer needs to be sufficiently familiar with the application to understand what objects are created, what they are set to and when they are used.  However, developers often inherit code to manage with which they are not familiar.  One thing that's important to know is that the objects form a hierarchy.  That is, recycling a parent - such as a document - will recycle it's children - such as an item.  Since the session object is at the top of the hierarchy, recycling the session will recycle everything that has been used from it.

One thing that you can do is go to the design pane in Domino Designer and click in the code area and do a Find on "recycle" or whatever object for which you may be searching.   Set the scope of the Find for current or all objects.  If you do a search for recycle()s and don't find any, then the first thing that should be done is to remedy the situation by having the developer go through and add this bit of code to all objects after they are finished being used.  One thing to watch out for is the use of New being instantiated in a loop.  For every iteration of the loop and new object is created.  Unless you recycle() the object within the loop this object will stay resident in memory.

Here's an example of using recycle() within a loop as well as using aggressive garbage collection:

import lotus.domino.*;
public class JavaAgent extends AgentBase {
 public void NotesMain() {
   try {
     Session session = getSession();
     AgentContext agentContext =
     session.getAgentContext();
     Database db = agentContext.getCurrentDatabase();
     View v = db.getView("SomeView");

      // turn off auto-update so that if we make a change to  a document and re-save

// it won't affect the sort order in the view
v.setAutoUpdate(false);

Document doc = v.getFirstDocument();
Document temp = null;                        //sets the temp for garbage collection immediately

while (doc != null)
{
// do something with the document here...
// whatever,  just don't delete it (yet)!
temp = v.getNextDocument(doc);        // get the next one
doc.recycle();                                // recycle the one we're done with
doc = temp;
} // end while

    } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

10/14/2003

From the KB - How to Use LotusScript to Force Users to Use an Edit Button Rather than Edit Menu Command

Category Software Development

This is one of those items I've tried to do before with varying levels of success...  posted here for my own benefit (and anyone else who googles it)...

How to Use LotusScript to Force Users to Use an Edit Button Rather than Edit Menu Command

Document Number:  1086763

Problem
You want users to have to click on an Edit button to put a document into edit mode, rather than than use the menu edit command or <Crtl> <E>, so you can force some other processing to be performed when the document is placed in edit mode.  How can this be done?

Content
To force users to use an edit button to put a document into edit mode, follow these steps

1.        In (declarations) create a global variable for the form:

Dim buttonClickedFlag as Integer

2.        In QueryOpen, you'd want the flag to default to false:

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
        buttonClickedFlag = False
End Sub

3.        In the button code, set the flag to true, along with whatever else you want to do:

Sub Click(Source As Button)
        Dim workspace As New NotesUIWorkspace
        buttonClickedFlag = True
        '... Add additional code for desired functionality here
        Call workspace.EditDocument(True)
End Sub

4.        In QueryModeChange,

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
                        'If the document is changing from edit mode to read mode
        If source.EditMode Then
                        'We want to reset the flag to False
           buttonClickedFlag = False
                        'If the document is changing from read mode to edit mode
        Else
                        'And the Edit button was not clicked
           If buttonClickedFlag = False Then
              Messagebox("Please use the Edit button to modify this document.")
                        'Stop the document from going to edit mode
              continue = False
           End If
End Sub

Supporting Information:

Note that the above method does not prevent the user from opening the document in Edit mode by selecting the document in the view and using the menu command Actions, Edit Document or using the <Ctrl> <E> keyboard shortcut.  If you wanted implement the same processing as in the button when the document is opened directly into edit mode, you could use Source.EditMode in an If statement in the form's PostOpen event to determine that it is opening in edit mode, and add the appropriate code there as well.  For example, in the PostOpen event of the form:

         Sub PostOpen (Source As Notesuidocument)
                If Source.EditMode Then
                '... Add additional code for desired functionality here
                 End If
        End Sub

10/13/2003

And for those of you who liked my link to the Trunk Monkey commercials...

Category Humor

Now we have...

THE BLOG MONKEY!!!

A picture named M2

10/13/2003

Nearly caught up on my book reviews - Essential CVS

Category Book Reviews

Just a couple more books to go, and I'll be out of the hole I dug myself into (until the next set of books show up from the publishers)...  :-)

The book being reviewed today is Essential CVS by Jennifer Vesperman.  CVS is an open source version control/source management system that runs under Unix/Linux.  Normally that wouldn't be something I'd review, but it is also an option for source management when you install Websphere Studio Application Developer.  Since it's always a good idea to have some sort of version control system in place, this is a good option (free!) to pursue.  Of course, the drawback is that open source documentation can sometimes be less than wonderful for anything more than reference.  Essential CVS is a good companion guide to show you the available functionality of the package, as well as help you set up the system.

You can read the full review at the Portland Domino/Notes User Group site.

10/13/2003

From the KB - @UserRoles and caching - I didn't know this...

Category Software Development

@UserRoles Generates Network Traffic and Slow Client Response Time

Document Number:  1096452

Problem
You find that the response time for documents created with particular form that uses @UserRoles in Hide When formulas is very slow when creating, refreshing, or saving the documents.  In your debugging, you see that there is a lot of network traffic occurring.  Is @UserRoles creating this overhead?  Why isn't it also slow when opening existing documents?  Can the network traffic be reduced and performance improved?

Content
This Technote will describe four things about @UserRoles:

  • How does the UserRoles @function work in R5?
  • Why does @UserRoles generate network traffic in Hide When formulas but not field formulas?
  • Why do multiple Hide When formulas containing @UserRoles perform better on some forms than others?
  • What is the recommended design when using @UserRoles in Hide When formulas?

How does @UserRoles work in R5?

@UserRoles does not cache on the client.  This means that whenever @UserRoles is evaluated, it does need to make Notes Remote Procedure Calls (RPC) to access the database Access Control List (ACL) on the server to retrieve the names list.  This is similar to using @DbColumn or @DbLookup with the "NoCache" parameter.  Unfortunately, @UserRoles does not have an option to specify whether to cache or not to cache.  The database designer needs to take this into consideration and make judicious use of the @UserRoles function since it does make RPC calls to evaluate.

Why does @UserRoles generate network traffic in Hide When formulas but not field formulas?

If you have @UserRoles in field formulas for Computed fields, the fields are, by definition, evaluated only when a document is created, refreshed, or saved. You will notice that performance is fine when opening existing documents because the computed fields are not evaluated; hence, you will not experience the network traffic related to evaluating @UserRoles.  You will see slower performance when composing these same documents with @UserRoles in the field formula, because you will have the network traffic associated with @UserRoles evaluation.  Hide When formulas, on the other hand, are evaluated for new as well as existing documents to correctly hide elements of the document in either mode.

Why do multiple Hide When formulas containing @UserRoles perform slower on some forms than others?

While @UserRoles is not cached, during a form refresh, identical Hide When formula are executed only once.  The evaluated result is then used in every place that the identical Hide When exists on the form.  So, while different forms may have the same number of @UserRoles function calls, those forms with multiple different Hide When formulas will be "slower" than forms with multiple identical Hide When formulas.

For instance, create a form that has five fields where each field has a Hide When formula using @UserRoles once.  If each field has a different Hide When formula that uses @UserRoles, Notes will access the server five times, once for each Hide When containing @UserRoles in the formula.  If instead of five different formulas, there is only one Hide When formula with @UserRoles that applies to all five fields, Notes will access the server only once.  It doesn't matter how you apply the Hide When formula to the design elements.  You may apply the Hide When formulas to individual fields or instead highlight all of the design elements and set the Hide When formula all at once.  Still, the Hide When is only evaluated once  if it is the same Hide When formula.  This is the case whether the five fields are in the same paragraph or separated by other fields without Hide When formulas or with different Hide When formula.  

What is the recommended design when using @UserRoles in Hide When formulas?

The best way to resolve the performance issues related to @UserRoles is to improve the design of the forms by eliminating redundant @UserRoles.  Instead of using @UserRoles many times on the same form, evaluate @UserRoles once in a hidden 'Computed for Display' field.  Then refer to this field when roles membership is required.  At the very least, use a temporary variable set to @UserRoles once per formula to eliminate multiple @UserRoles calls within the same formula.

For example, suppose you have a Hide When formula that uses @UserRoles five times to determine membership in five different roles as follows:

@IsMember("[Role1]";@UserRoles) | @IsMember("[Role2]";@UserRoles) |
@IsMember("[Role3]";@UserRoles) | @IsMember("[Role4]";@UserRoles) |
@IsMember("[Role5]";@UserRoles)

Instead of this method, create a 'Computed for Display' field named UserRoles at the top of the form.  Make the formula for this field simply:

@UserRoles

Then, all Hide When formulas that depend on @UserRoles can reference that field:

@IsMember("[Role1]";UserRoles) | @IsMember("[Role2]";UserRoles) |
@IsMember("[Role3]";UserRoles) | @IsMember("[Role4]";UserRoles) |
@IsMember("[Role5]";UserRoles)

Note that all calls to @UserRoles in the first Hide When formula have been replaced by references to the new field, UserRoles.  This reduces the formula to only one @UserRoles network transaction per refresh.

10/12/2003

Wherever You Are, Be There

Category Everything Else


Wherever You Are, Be There
by Jim Rohn


One of the major reasons why we fail to find happiness or to create a unique lifestyle is because we have not yet mastered the art of being.


While we are home our thoughts are still absorbed with solving the challenges we face at the office. And when we are at the office we find ourselves worrying about problems at home.


We go through the day without really listening to what others are saying to us. We may be hearing the words, but we aren't absorbing the message.


As we go through the day we find ourselves focusing on past experiences or future possibilities. We are so involved in yesterday and tomorrow that we never even notice that today is slipping by.


We go through the day rather than getting something from the day. We are everywhere at any given moment in time except living in that moment in time.


Lifestyle is learning to be wherever you are. It is developing a unique focus on the current moment, and drawing from it all of the substance and wealth of experience and emotions that it has to offer. Lifestyle is taking time to watch a sunset. Lifestyle is listening to silence. Lifestyle is capturing each moment so that it becomes a new part of what we are and of what we are in the process of becoming. Lifestyle is not something we do; it is something we experience. And until we learn to be there, we will never master the art of living well.

10/12/2003

Always a little time for recreational reading...

Category Book Reviews

Over the last few days I finished the book The Sinner by Tess Gerritsen.  This is the first book of hers that I've read, and it was pretty good medical/police thriller.  There is a gruesome murder of two nuns in an abbey, and the medical examiner (Maura Isles) and homicide detective (Jane Rizzoli) are called in to work the case.  They are also called into a case where a dead body is discovered in an abandoned building, and efforts have been made to make it impossible to track the identity of the body.  As the two investigations continue, linkages start to form between the two cases as well as a third murder.  The suspense is well-paced and keeps moving along.

The only thing I didn't care for is that this is apparently not the first novel involving these two characters.  There are plot lines that aren't explained well, and I'm sure its because they are continuations from earlier novels.  It's not a major thing, but I did feel like I was missing something...  

10/11/2003

One more review... Real World XML

Category Book Reviews

Yes, today's goal was to get a couple of book reviews done as part of the user group programs I belong to...  And the following is a review of a reference style book, not a "read it from front to back" type book.  Yes, I did go through the book, but no, I did not read it word for word...  :-)

I had the opportunity to review the book Real World XML by Steven Holzner.  If you think XML is nothing more than making up your own tags for a file, you've got a lot to learn.  This book tries to give you a good introduction to each of the XML technologies, as well as a lot of working examples that you can use to get your own solutions going.  I recommend this book to get started with XML.  See the full review at the Portland Domino/Notes User Group site.

10/11/2003

Book Review - Building Accesible Websites

Category Book Reviews

Over the last few days, I've been reading a book called Building Accessible Websites by Joe Clark.  It's a very well written book that covers most of what you need to know in order to build web sites that are accessible to disabled individuals.  I received this book as part of the New Riders User Group program, and you can read my review over at the Portland Domino/Notes User Group website.

10/11/2003

"Even though (Notes) dates back to 1989"???

Category IBM/Lotus

I receive periodic emails from CramSession which deal with certification issues.  The latest issue is focused on Lotus certification.  In the email, there is the following quote...

How important is the Lotus family of products? Well, even though this product dates back to 1989, according to a July 2003 IDC report, IBM Lotus has a huge 49% market share in the collaboration software market! (See Certification Magazine's: Lotus Certification: Premium Skills for Career Success.)

"Even though"???  Someone want to explain how the concept of a products longevity is inversely proportional to market share?

I think I'll be sending a letter (or commenting on their boards) about this statement...  

10/11/2003

Whoo-hoo! Response blocking works!

Category Blogging

A short while back, I added a Response Blocking By IP Address feature to Blogsphere to handle the rash of comment spamming that was occuring in the blog world.  I added a block to 61.181.5.* in order to stop anything from that range, as I don't think I have too many loyal Chinese readers.  All I had to do was wait...

And today, the payoff!  I woke up this morning to the following email from my blog...

A picture named M2

Note the "RESPONSE BLOCKED!" tagline...  I left the actual comment out in the referenced blog entry so that you can see how it shows up in the blog...

Nice to know the change actually works in the real world.  The spammer (I'll assume it's the same party) has changed subjects, but it's no less obnoxious.

This feature will be in the next release of Blogsphere due in a couple of weeks... Check it out and feel free to use this address range as your first official block!

10/09/2003

Another late, short night (but worth it)...

Category Everything Else


And no, this is not an R-rated post about yesterday being our anniversary...  :-)


Yesterday was the kickoff of the high school hockey season.  Both of my kids (Ian and Cam) play on the team, with Ian as forward and Cam as the goalie.  Now, if you've been hanging around the blog for awhile, you'll remember that last year was the team's first year.  They were bad.  Really bad.  B-A-D.  18 -1, 24 - 2, you get the idea.  Not a single win all season, and in nearly all cases the game was over within the first 10 minutes.  So when the opening game got pushed from 6:15 pm to 9 pm, you can imagine my despair.  Another short night, not enough sleep, and I get to watch the team get mauled.  Oh yeah, I'm just living the dream...


This year is different (so far)...  They actually picked up some decent "at large" players as they gained the respect of the other coaches by hanging in last year.  They now have a coach who knows the game and actually cares.  The players who could barely skate last year are actually quite improved.  Cam (my goalie) went to summer hockey camp and learned a lot.  But would it translate into better play?


At the end of the 1st period, we were down 1 - 0 and had outshot the other team 8 - 4.  Last year there were occasions where we didn't get 8 shots on goal in two games!  And the end of 2, the score was still 1 - 0.  Even if the game ended there, it would have been a huge success.  They played well and had a defense in front of the goalie.  In the 3rd, we finally scored but quickly went down 3 - 1 with about 9 minutes left.  But in a flurry of effort, we tied it with about 4 minutes left to play.  Two minutes left, we score the go-ahead goal, and closed it out with an empty-net goal with less than a minute.  Final score, 5 - 3, and the first win for the Grant high school hockey team.  Yee-haw!


It doesn't get much better than this...  My son in goal winning his first game and not being the reason why they lost.  My other son grabbing the puck at the end of the game and giving it to Cam for his first win.  The knowledge that, although this is only game one of a season that goes until February, they actually look competitve and will not lose just by showing up.


A few more games like that, and I won't mind going to work the next day on about 4 hours of sleep...  :-)

10/08/2003

How DOES she do it???

Category Everything Else


Today marks my 21st wedding anniversary....


I don't have a CLUE as to how Sue put up with me that long...

10/08/2003

This book will make you uncomfortable...

Category Book Reviews

I've been reading Black Ice - The Invisible Threat Of Cyber-Terrorism by Dan Verton.  This book examines the nation's vunerability to "cyber-attacks" and how it could totally disrupt life as we know it.  Verton was a former intel officer for the Marines, and he uses many references back to government studies and activities in these areas.  He doesn't paint a pretty picture...

After reading this book, you wonder how we've avoided anything more serious than September 11th.  The dangers are numerous...

10/05/2003

Saw Blue Man Group last night in Portland...

Category Everything Else


I bought tickets to see the
Blue Man Group in the Complex Rock Tour stop in Portland last night.  Quite the experience...

If you've never seen nor heard of BMG, check out the website.  The best way to describe the "music" is percussion rock.  Apparently the CR tour is different than the permanent theatre shows you'd find in Las Vegas.  For CR, they move to more of a rock concert experience with the BMG flavor.  I get the impression you hear more "music" in that show.


The opening act was so-so.  Some local talent female singer (who's name escapes me at the moment) with a two-man band.  Sort of a "Jewel" sound to the music, and it didn't do much for me.  But when she kicked in with the violin/fiddle pieces, she was outstanding.  She also provided some of the vocals during the BMG show.  The second act was someone called Venus Hue, and she was strange.  The two man band played a techno-ambient track, and I liked that.  But I couldn't understand most of what she said, and her movements on stage had an Elvis Costello look that was very distracting.  Fortunately her set was short, and she only returned for one vocal during the BMG show.


Finally we got 90 minutes of BMG.  Lots of humor and unique percussion instruments.  It was amazing how much "music" they could produce with tubes and sticks.  At the end they did a number called "Exhibit 13".  As BMG played a softer percussion number, the video screen showed scraps of paper floating down.  They would then focus on a single sheet, complete with charred edges.  These were scraps of paper found from the World Trade Center after September 11th, and they had floated down in a nearby neighborhood.  Very thought-provoking...


If you get a chance to see them, I highly recommend it.  

10/04/2003

Codesaw - browser-based "IDE" for learning...

Category Software Development

I ran across a website called CodeSaw today.  It's a site that allows you to work on programming examples in selected tech books through a browser-based environment.  You install the CodeSaw software, and then go to their site.  Pick your programming technology and then select a book you want to explore.  The CodeSaw package will launch and display a list of all the programming samples in the book.  Select your example and it shows up in the editing pane.  You can modify the code, compile it, and run the results.  It's a little on the slow side, but it might be a good option for learning a language if you don't want to install a full IDE.

10/04/2003

Saturday morning humor - The Trunk Monkey!

Category Humor

There's a local car dealership here in Portland, Oregon called Suburban Auto Group.  They've created a series of commercials touting a revolutionary new service...  The Trunk Monkey!  I'd love to have one of these...

Go watch the commercials...  they are great!  Clip 2 and 3 are very similar, but 3 has some nuances that you won't see in 2.

10/02/2003

Rotating email signatures... They work now!

Category Software Development

I finally delved into Win32 API coding today for the first time.  Using that, I was able to solve my rotating signature problem I was working on the last few days. Give it a try and see how it works for you.  

1. Create a private agent in your mail file and call it something like "Add Signature File". (Additional info 10/02/2003 - make sure the Target of the agent is set to "None" or you will get a "Document Has Not Yet Been Saved" error).
2. Choose LotusScript as the code type.

3. Paste the following code into the Declarations section of the agent:


' This declaration will allow us to send keystrokes to Windows

' This code is from a posting on Notes.Net.  Here's an explanation:

' First off, "user32.dll" is the dll that will process the keys that we're going to send.

' Parameters:

'        bVk = byte holding the hexcode of the virtual key (Alt, Control, etc)

'        bScan = (not used here)

'        dwFlags = 0 for keyDown; 2 for keyUp

'        dwExtraInfo = (not used here)

Declare Sub keybd_event Lib "user32.dll" (Byval bVk As Integer, Byval bScan As Integer, Byval dwFlags As Integer,Byval dwExtraInfo As Integer)


4. Paste the following code into the Initialize section:


Sub Initialize

       
       Dim ws As New NotesUIWorkspace

       Dim session As New NotesSession

       Dim uidoc As NotesUIDocument

       Dim doc As NotesDocument

       Dim userName As NotesName

       
       Dim strTagLine() As String

       Dim strNumberNextTag As String

       Dim intNumberNextTag As Integer

       Dim intNumberNextTagPlus1 As Integer

       Dim strSignature As String

       Dim ctrLength As Integer

       
       '--------------------- STUFF YOU NEED TO CHANGE FOR TAG LINE CUSTOMIZATION

       'NOTE - the NUMBER_OF_TAGLINES constant must match the number of taglines you have

       Const NUMBER_OF_TAGLINES = 3

       Redim strTagLine(1 To NUMBER_OF_TAGLINES)

       strTagLine(1) = |Tag #1|

       strTagLine(2) = |Tag #2|

       strTagLine(3) = |Tag #3|

       '--------------------- END OF TAG LINE CUSTOMIZATION

       
       'Get the last tag line used variable from your Notes.ini file, initialize it to 1 if not found, and convert it to a numeric value

       strNumberNextTag = session.GetEnvironmentString("sigLastTagUsed")

       If Isnumeric(strNumberNextTag) Then

               intNumberNextTag = Cstr(strNumberNextTag)

       Else

               intNumberNextTag = 1

       End If

       
       'Increment the next tag line to use based on the number of tag lines you have stored, and store it in the Notes.ini file

       If intNumberNextTag + 1 <= NUMBER_OF_TAGLINES Then

               intNumberNextTagPlus1 = intNumberNextTag + 1

       Else

               intNumberNextTagPlus1 = 1

       End If

       Call session.SetEnvironmentVar("sigLastTagUsed", Cstr(intNumberNextTagPlus1))

       
       '--------------------- STUFF YOU NEED TO CHANGE FOR SIGNATURE CUSTOMIZATION

       'NOTE - the NUMBER_OF_NEWLINES constant must match the number of "Chr(10)" occurances in your signature.

       Const NUMBER_OF_NEWLINES = 9

       Set userName = New NotesName(session.UserName)

       strSignature = ""

       strSignature = strSignature + Chr(10) + Chr(10)

       strSignature = strSignature + "______________________________" + Chr(10)

       strSignature = strSignature + userName.Common + Chr(10)

       strSignature = strSignature + "Your company" + Chr(10)

       strSignature = strSignature + "Your website" + Chr(10)

       strSignature = strSignature + "Your phone number" + Chr(10)

       strSignature = strSignature + userName.Addr821+ Chr(10)

       strSignature = strSignature + strTagLine(intNumberNextTag) + Chr(10)

       
       '--------------------- END OF SIGNATURE CUSTOMIZATION

       
       'Get a handle to the current document we're working on.

       Set uidoc = ws.CurrentDocument

       Set doc = uidoc.Document

       
       'Here is where we remove the existing signature if this is the second time (or more) through the routine on the
       'same email.  We'll look for the LengthOfSignature field on the email.  If it's there from the first run, we'll do Win32 API

       'keystroke simulation to erase the signature.  If the field isn't there or is 0, we'll just insert the new signature.

       If doc.HasItem("LengthOfSignature") Then

               'Keystroke back up to the top of the new and old signature (this happens after the new signature gets put on the form).

               For ctrLength = 1 To NUMBER_OF_NEWLINES * 2

                       keybd_event &h26,0,0,0   ' <Up Arrow> key down

                       keybd_event &h26,0,2,0   ' <Up Arrow> key back up

               Next

               'Keystroke delete the original signature...

               For ctrLength = 1 To doc.LengthOfSignature(0)

                       keybd_event &h2E,0,0,0   ' <Delete> key down

                       keybd_event &h2E,0,2,0   ' <Delete> key back up

               Next

               'Keystroke back down to the end of the new signature

               For ctrLength = 1 To NUMBER_OF_NEWLINES

                       keybd_event &h28,0,0,0   ' <Up Arrow> key down

                       keybd_event &h28,0,2,0   ' <Up Arrow> key back up

               Next

       End If

       
       'Insert the signature...

       Call uidoc.InsertText(strSignature)

       
       'Write out the length of the signature field so that we can backspace over it if the button is pushed a second time

       doc.LengthOfSignature = Len(strSignature)

       
End Sub


5. Change/add/delete tag line and signature line info in the two "STUFF YOU NEED TO CHANGE SECTION"

6. Add a SmartIcon button with the following code (change the name of the agent to be whatever you called in step 1):


@Command([ToolsRunMacro];"Add Signature")

10/01/2003

A conversation with Tom Peters...

Category Everything Else


I'm a fan of
Tom Peters, author of such books as In Search Of Excellence and Thriving On Chaos.  He has a new book coming out called Re-Imagine!, and I'm looking forward to reading it.

Here's a link to a
conversation with Peters touching on business in the post-dot-com-bust.  Interesting thoughts...  This one struck me hard:

"On September 11, 2001, a tiny band of Internet-savvy fundamentalists humbled the world's only superpower.  ...  The concept of the virtual organization is essential to understanding how new business works. ... The new terrorists have proved to be masters of that concept."

10/01/2003

I don't think I can get there from here...

Category Software Development

More on the signature icon formula...

I looked at the comments from the last post and started examining things again.  Turns out part of my problem was syntactical and the other was due to multi-value field processing.  I had a @SetEnvironment statement that didn't have quotes around the field name to be saved.  I HATE it when that happens.  And the Signature field was being treated as a multi-value field delimited by carriage returns.  When I implode the field using "~" as a separator, I get the entire value (instead of just the first carriage return which made it look as if the field was blank).

Now, having said all that, I STILL can't get it to work...  Following is the current code...

REM {Insert as many signature tag lines as you'd like};
TagLine := ("Tag Line #1":
"Tag Line #2":
"Tag Line #3");

REM {Store the number of tags you are using, along with the number of @NewLine commands in your signature};
NumberOfTagLines := 3;
NumberOfNewLines := 9;

REM {Get the environment variable of the next tagline to use, or set it to one if it's never been set before};
NumberNextTag := @Environment("sigLastTagUsed");
NumberNextTag := @If(NumberNextTag = "";1;@TextToNumber(NumberNextTag));

REM {Increment the value by 1, or reset it to 1 if you've reached the end of your tags.  Store it, too.};
NumberNextTagPlus1 := @If((NumberNextTag + 1) > NumberOfTagLines;1;NumberNextTag + 1);
@SetEnvironment("sigLastTagUsed";@Text(NumberNextTagPlus1));

REM {Get the signature info that was last used...};
LastSignatureUsed := @ReplaceSubstring(SignatureImploded;"~";@NewLine);

REM {Remove the old signature before writing the new one.  This will be blank the first time through...};
@ReplaceSubstring(@ThisName;LastSignatureUsed;"");

REM {Pick the next tag to use, build the signature field, and place it in the Body field};
ChosenTag := TagLine[NumberNextTag];
Signature := "";
Signature := Signature + @NewLine + @NewLine;
Signature := Signature + "___________________________" + @NewLine;
Signature := Signature + @Name([CN]; @UserName) + @NewLine;
Signature := Signature + "Your Company." + @NewLine;
Signature := Signature + "Your Email Address" + @NewLine;
Signature := Signature + "Your Phone Number" + @NewLine;
Signature := Signature + @Name([Address821]; @UserName) + @NewLine;
Signature := Signature + ChosenTag + @NewLine;
Signature := Signature + "";
@Command([EditInsertText];Signature);

FIELD SignatureImploded := @ReplaceSubstring(Signature;@NewLine;"~");

REM {Now reposition the cursor back at the top of the signature so that it can be run over again if necessary};
@For(loopCtr:= 1; loopCtr <= NumberOfNewLines; loopCtr := loopCtr + 1;
@Command([EditUp]))


The key line of code is the @ReplaceSubstring.  There seems to be no way to match that signature against what was put in the body of the email and replace it with "".  And with @Commands, there seems to be no way to select a portion of text that could be erased with EditClear.

I thought about trying this as a LotusScript agent called from an icon, and to use the NotesUIDocument methods and properties to do this.  But I run into the same issue in my mind.  No way to select text for erasure, and no way to potentially use an ASCII "Delete" character to overwrite what you just put out.

What I'm thinking now is that perhaps a LotusScript agent to put the signature out there and to count the number of characters in the signature.  Leave the cursor at the end of the signature and save the value of the signature length.  Then using Win32 API calls, do delete keystrokes to erase the signature if the button is clicked two or more times in a single email.

I've not done Win32 API calls before, but I know that Joe Litton has some code I could stea...  LEARN from...

This is driving me crazy!  It's one of those little "I should be able to do this, and it's not THAT important, but I just can't put it down"...

10/01/2003

RSS should be fixed, and let's get edumacated!

Category Blogging

First off, my apologies if you've been getting RSS validation errors.  Ben Poole sent me an email informing me of that problem, and I emailed Rocky and Joe asking if they had seen the same thing.  To my pleasant surprise, Rocky had fixed that exact error yesterday!  He sent me the code and I just applied it...  Thanks!

Second, if you want some serious education for free, head over to MIT OpenCourseWare.  This is incredible stuff!  Thanks for passing on the link, Bas!

Want to support this blog or just say thanks?

When you shop Amazon, start your shopping experience here.

When you do that, all your purchases during that session earn me an affiliate commission via the Amazon Affiliate program. You don't have to buy the book I linked you to (although I wouldn't complain!). Simply use that as your starting point.

Thanks!

Thomas "Duffbert" Duff

Ads of Relevance...

Monthly Archives