15May/081

SnTT: Notes R5 SuperHumanSoftware Lunch Box

How many out there still have this? I've used it as a mini pharmacy ever since.

r5_superhumansoftware.jpg

If memory servers, during the R5 launch they distributed lunch in it.

Sorry for the low res picture... I used my Curve.

8May/080

SnTT: Mail Folder Count

If you've ever wondered how many folders are in your Notes mail databases...

  • Add the code below your catalog.nsf as a new agent
  • Select the agent properties similar to the image below; tweak as you wish.
  • Paste the sub in.
  • Run againt selected documents in any view.
  • The field FOLDERCOUNT will be created and populated.

Make sure you have access to the databases you are running it against and access to edit the catalog document. Also note that this is temporary because cat docs are disposable, rebuilt, live a short life, blah, blah. Also x2: Tweak the default folder exclude list as needed. I collected the list below from v7.

sntt_mail_folder_count.txt

Agent Properties

Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Dim collection As NotesDocumentCollection Dim doc As NotesDocument Set db = session.CurrentDatabase Set collection = db.UnprocessedDocuments Set doc = collection.GetFirstDocument() Dim i As Integer Dim dbc As NotesDatabase Dim views As Variant While Not(doc Is Nothing) Set dbc = New NotesDatabase(doc.Server(0), doc.Pathname(0)) views = dbc.Views i=0 If Not(Isempty(views)) Then Forall v In views If ( v.IsFolder ) Then If (v.Name <> "($JunkMail)")_ And (v.Name <> "(Group Calendars)")_ And (v.Name <> "(Rules)")_ And (v.Name <> "($Alarms)")_ And (v.Name <> "($Inbox-Categorized)")_ And (v.Name <> "($Inbox)")_ And (v.Name <> "($Trash)") Then i=i+1 Print doc.Pathname(0)+ " - "+ v.Name End If End If End Forall End If doc.FolderCount = i Call doc.Save(False,False) Set doc = collection.GetNextDocument(doc) Wend Messagebox Cstr(collection.Count)+ " database(s) processed. ", 64, "Folder Count" End Sub

 

This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
also... A web version of Julian's tool that converts LotusScript to html (used in this post). Sweet tool!Additions to this could include populating a text list with the actual names. Feel free to add other options or ways to make this code more efficient below.

31Jan/081

SnTT: @Unique. Everything you ever wanted to know.

I've had this for almost 10 years now. It came from an internal Lotus source back when I worked there as a developer. I took the examples out so its a partial document. For the record it was flagged 'Public' when I obtained it. I have removed the 2 paragraphs that were marked <<End of Public Information>>.  If I can loose my house over this, please someone let me know asap and i will take it down.

Warning, what you are about to read is ubergeek.

-------------

The string that @Unique returns when invoked with no arguments consists of two parts: the first part (the prefix) is generated using the common name of the Notes ID in use.  The second part (the suffix) is generated from the current time.  The two parts are separated using a hyphen ("-") .

For a given Notes ID,  the prefix will be constant.  The suffix will vary depending on both the system time and the frequency of invocation.

The prefix is (usually) a four-letter string, consisting of uppercase alphabetic characters (A-Z); this gives an absolute maximum of 26^4 unique prefixes, or ~450,000 strings.  In practice, however, the number of prefixes generated will be reduced since people's names do not contain a uniform distribution of letters.

The prefix is selected using the following algorithm to select the four-character prefix, stopping when four characters are selected:

-  Select the alphabetic uppercase characters in the common name.

-  If three characters have been selected, use the last character in the common name; if not, select the character after the last selected.

-  Translate the four characters to uppercase.

The suffix is a six-letter string, consisting of digits and uppercase characters from the set [2-9A-HJ-NP-Z]; this gives an absolute maximum of 32^6 unique suffixes, or ~1000,000,000 unique strings.  In practice the number of unique strings is reduced as the value of the strings is not random.  The first three characters are based on the number of days since a fixed date, the last three characters, is based on the number of seconds since midnight.

The first three letters of the suffix are therefore identical for all sequences generated on the same day, and different for any sequences generated on different days.

The last three characters of the suffix are generated based on the number of seconds since midnight.  Within a Notes session a check is made to ensure that the last three digits are not based on the same time (e.g. using the F9 key to refresh will generate sequential (base 32) numbers). If the Notes client is restarted, however, the sequence is generated from the time directly without regard to any previously generated sequence.  This means that the sequences may 'restart' earlier than those generated using the F9 key.  For example, if F9 is pressed 30 times, the sequence number corresponds (roughly) to 90 seconds in the future.  If Notes is restarted, and a sequence generated less than 90 seconds later a sequence number may be reused.

In practice for non-automated use of @Unique the sequence should be unique if:

1. The prefix differs

2. The sequence numbers were generated on different days

3. The sequence numbers were generated using a time for which the
effective clock time differed

This information is provided to assist in assessing if the @Unique function is appropriate for a given application.  It is possible that the algorithm used may differ between releases, and may be changed in a future release. Applications should not depend on the behavior of @Unique documented in this document other than that the value returned should under most circumstances be unique.