return to OCLUG Web Site
A Django site.
October 29, 2010

Bob Trower
Advogato blog for DeepNorth
» 29 Oct 2010

Yeah, you would think I would have something better to put here after such a long absence. Still, it's something.

This is nearly identical to the code for the Credit Card Checksum posted earlier. This code does the validation of the checksum for an Ontario health card. I needed it for a project with the Ministry, found my own code on the Internet (!) and hacked it to fit.

I don't know the exact quote, but someone well known in open source said something to the effect that real men don't do backups, they just publish to the Internet. Here's my backup. Cheers,


'Health Card Validation Routine (Visual Basic)
'Copyright (c) Bob Trower, 2001, 2010
'This source code may be used as you wish, provided
'that these comments remain in the code.
'Returns True if the card number is valid, False otherwise
'Algorithm is the one specified by the Ontario Ministry
'of Health (in turn similar to the 'LUHN' formula
'specified in ANSI X4.13)
'Last Digit of Card Number is the 'check digit'.
'From right to left, take value of check digit and add:
'   double every second number and sum resulting digits.
'   add the non-doubled digits.
'If the Health Card Number is valid, the final sum
'will be an even multiple of ten ((x mod 10) = 0 ).
Function IsValidHCNumber(HCNumber As String) As Integer
   Dim CheckSum As Integer
   Dim ThisDigit As Integer
   Dim i As Integer
      ' Note: Order of Steps is important...
   IsValidHCNumber = False ' Redundant in VB, but good 
   If Len(HCNumber) = 10 Then ' Known Card numbers are 10 
digits long
       CheckSum = Val(Mid(HCNumber, Len(HCNumber), 1)) 'Last 
Digit is CheckSum Digit
       For i = Len(HCNumber) - 1 To 1 Step -2
           ThisDigit = Val(Mid(HCNumber, i, 1)) * 2 ' Double 
these digits
           CheckSum = CheckSum + (ThisDigit \ 10) + 
(ThisDigit Mod 10) ' Add the sum of the resulting digits
       For i = Len(HCNumber) - 2 To 1 Step -2
           CheckSum = CheckSum + Val(Mid(HCNumber, i, 1)) ' 
Add these digits
       If CheckSum Mod 10 = 0 Then ' Resulting number should 
be an even multiple of 10
           IsValidHCNumber = True
       End If
   End If
End Function

March 15, 2008

Bob Trower
Advogato blog for DeepNorth
» 15 Mar 2008

The base64 source code that I released in 2001 ( has found very wide application and is used in remarkably diverse software. Below are some examples.

In the preamble to the code, I say that 'Generally' "This program is designed to survive:" I would say that it has done admirably in that regard. However, it is not form, nor even function that I think is responsible for its travel. It is a combination of there being few reasonable alternatives, this *being* a reasonable alternative AND the function itself is ubiquitous. Nearly every kind of non-trivial software eventually deals with mail (there is an old programmer's joke about this) and mail means attachments and attachments mean MIME and MIME means base64 encoding. Chances are; this is not even that well traveled as such. It may just be the 'luck of the draw' that there are so many requirements for this that mine was adopted by chance. I like to think the fact that there were (and are), no known bugs after seven years of use has something to do with it. I also fancy it was well written. I like to think it pleased other programmers, as it was intended to do. YMMV. Note that at least *some* of these programmers had a clue.

Editing application The World Wide Web consortium's HTML editor. This is the body responsible for setting the standards for web pages on the Internet

Secure Operating System Stanford University -- Histar Secure Operating System.

Gammu utility and library for mobile phones

WebClaire Claire language kernel.

Asterisk Voice over IP Appliance (

ziproxy -- HTTP proxy server

Epona Internet Relay Chat (IRC) libraries

Word Document to PDF file converter

Colorado State University Network Security -- Reflected DNS daemon

OpenQM post-relational database

HDTV Set Top Box (Digital Television)

WinRSA -- Public key encryption for Windows

Partman-Crypto (use in Debian Installer -- Note that the b64.c code is used in a number of places in most major Linux Distributions.

SMTP Stress Testing Tool

Philips Flat Panel Television Sets (i.e.

Technical University of Denmark, Key Management in Cryptographic Access Control (Thesis)

eMail -- Command line SMTP email utility.

Recommended by IBM for use with IBM Communications Server

Spam Decoding Tools

Research Software

Voice over IP telephony (software telephone) openwengo

February 21, 2007

Bob Trower
Advogato blog for DeepNorth
» 21 Feb 2007

What gives with the Wikipedia mob? I know that they have gotten an (undeserved, I hope) bad rap for altering pages with wild abandon. However, I really did not expect to see what just happened.

I had a client to whom I was sending a copy of my company's development methodology. Unfortunately, with more than a million files on the companies network here, I can't find the doc in question. However, I did find the nice image that accompanied the document.

I thought that I would do a 'reality check' against articles on software development at Wikipedia and I did not find quite what I was expecting. If our (relatively simple) take on what is actually done on software projects is not represented there, it makes me wonder.

FWIW, the diagram merely shows the flowchart (arrows, docs, decision diamonds, 'things', etc) of the following development cycle:

    • Identify needs/opportunities
    • Create requirements
    • System design
    • String (sub-system) design.
  3. CODE
    • Unit Design, build and test
    • String (multiple units) Design, build and test.
  4. BUILD
    • String Assembly
    • Full System Build
  5. TEST
    • System Test (all works together)
    • User acceptance Test (System is acceptable to client)
    • Release to Pilot
    • Release to production.

What is nice about the diagram is that it shows in a tidy way how these stages flow into one another both forward and back and shows the entire life-cycle from conception to system retirement. It also shows how (and why) it's possible (as happens) that a system could make it all the way to release into production and then almost immediately retired.

I wonder: how many other people like myself have been discouraged by such actions at Wikipedia? My time is limited and that article may now not see the light of day. That's a shame.

I would link to the offending pages, but unfortunately that appears to be considered bad practice at Wikipedia and might even get me banned (oh my)!

September 12, 2006

Bob Trower
Advogato blog for DeepNorth
» 12 Sep 2006

I see that Advogato is in danger of going away.

Note that I would have posted a reply, but someone has changed the level of my certification to 'observer' and I can't post. I am not sure what they have in mind in terms of gauging how many people are interested if they have taken away the ability to indicate opinions. I am sure they have their reasons, but I confess to some annoyance about this.

FWIW -- I would prefer that Advogato stay and I do not see Blogs as an alternative for the way I use this resource.

It would be a shame if Advogato went away. I do not look here as frequently as I used to, but I do still check from time to time. It is one of the few places where you can find something worth reading without wading through all kinds of nonsense.

I also find this a very mannerly community. I like that.

It is rather a shameful secret, but I really liked this forum to publish an article when the need struck me. I knew that the article would get some eyeballs and those eyeballs would be ones I expected would understand what I had to say. I took a little care before posting, but did not torture myself with the level of care I would before a normal publication. That was good (sometimes).

Best wishes to everyone in this community. If anyone needs to find me, they can just 'Google' my name or even my handle and they will likely find me soon enough.

Ironically, I was just getting prepared to publish some things and would likely have announced them here. I am at a loss as to what would be a similar venue. I did not check them all out, but places like Blog Farms, etc. are not nearly the same (for me) as this is. I have plenty of my own sites and servers if I just want to blather...

Again, my best wishes to everyone.

March 13, 2005

Bob Trower
Advogato blog for DeepNorth
» 13 Mar 2005

Jiminy Crickets! I see it has been a while.

I posted a bunch of code for an md5 hashing utility on the front page. Hope that does not lead to a host of flames...

I think the thing is newsworthy, because a whole bunch of people either are or should be swapping out any SHA1 code they are using, pronto. I had to. Problem was, there was simply no code that I could work with out there.

I rant on this all the time, but I simply must harp on it again: some of that stuff does not work. People do something rather difficult, like the md5 hashing code and then just seem to run out of gas. They do not test/package/test and they seem unable to comprehend that other people's development environments may be different.

Now, on the topic of 'different environments', I am sure I will be flamed because I took all the 'endian' junk out of the md5 code. Sue me. 99.999% of all the machines that are likely to use my md5 utility/library code don't need that junk cluttering the code. It's easy to find elsewhere and slap back in if you need it. Meantime, with all the crap stripped out, this code stands a good chance of compiling without any tweaks on just about any box out there.

Anyway, as aggravating as this exercise was, it is nice to have something reasonably publishable from all the mountains of code I have written.

Oh -- BTW -- I am out of town for a while and may not even look at the web. Don't go nuts if you don't see a response from me.

October 28, 2004

Bob Trower
Advogato blog for DeepNorth
» 28 Oct 2004

Cleaning up a whole bunch of stuff on my network and in archival storage. I am having major troubles converting all of my data, sources, documents, etc. to modern formats. Some of this stuff goes back to 1984 and earlier. Naturally, I am ditching tons of stuff. I am pretty much tossing all of my some thousand or so diskettes. Some of the disks have become unreadable after a decade or more of aging. Stuff that was once dreadfully important, like sources for various commercial products are being tossed because it's not worth the effort to sort through it all. Same goes for the million or so files on hard disks.

If I come across stuff like the below that can just be cut and pasted onto the net, I'll try to do so.

Here is a piece of code that might be useful to someone googling for credit card validation. Enjoy.

'Credit Card Validation Routine (Visual Basic)
'Copyright (c) Bob Trower, 2001
'This source code may be used as you wish, provided
'that these comments remain in the code.
'Returns True if the card number is valid, False otherwise
'Algorithm is the 'LUHN' formula specified in ANSI X4.13
'Last Digit of Card Number is the 'check digit'.
'From right to left, take value of check digit and add:
'   double every second number and sum resulting digits.
'   add the non-doubled digits.
'If the Credit Card Number is valid, the final sum
'will be an even multiple of ten ((x mod 10) = 0 ).
Function IsValidCCNumber(CCNumber As String) As Integer
   Dim CheckSum As Integer
   Dim ThisDigit As Integer
   Dim i As Integer
      ' Note: Order of Steps is important...
   IsValidCCNumber = False ' Redundant in VB, but good practice
   If Len(CCNumber) > 10 Then ' Known Card numbers are more than 10 digits long
       CheckSum = Val(Mid(CCNumber, Len(CCNumber), 1)) 'Last Digit is CheckSum Digit
       For i = Len(CCNumber) - 1 To 1 Step -2
           ThisDigit = Val(Mid(CCNumber, i, 1)) * 2 ' Double these digits
           CheckSum = CheckSum + (ThisDigit \ 10) + (ThisDigit Mod 10) ' Add the sum of the resulting digits
       For i = Len(CCNumber) - 2 To 1 Step -2
           CheckSum = CheckSum + Val(Mid(CCNumber, i, 1)) ' Add these digits
       If CheckSum Mod 10 = 0 Then ' Resulting number should be an even multiple of 10
           IsValidCCNumber = True
       End If
   End If
End Function

August 23, 2004

Bob Trower
Advogato blog for DeepNorth
» 23 Aug 2004

This post is really about personal stuff. Read if you dare, but it's pretty boring unless you know me personally or are mutually affected by various problems I've had of late.

A lot of my/our troubles would have had much less impact had the tech economy not imploded. It must come back and continue to grow, but the timing of it and the nature of the comeback may not help North Americans that much. A lot of my business has been with Telecomms and related enterprises and we know how that has been.

We are many orders of magnitude of bandwidth below where we all need to be, so this has to make a strong comeback at some point. However, recovery has been spotty so far.

Some friends have had various troubles of late including near death experiences and moving half way across the world. Family have also been having health problems. My goodness. If anyone of you are reading this, my best wishes to you.

Many things have been just a drag on me and my little company this past year or so. I was really hoping to get some time to publish some of my stuff on Sourceforge, but have just been interrupted by one thing or another. Just got back from a trip to Europe for 30 days. It was ok, but really for the wife and kids. I would have liked to take the time to just put my head down and write code, but family comes first these days (as it should).

Like if anybody cares, friends are starting a commercial music site
I am wishing them luck and they have a great idea. Despite note about commercial stuff below, I hold out hope that someone ethical can actually make money in cyberspace. We shall see.

Note that nobody asked about the radix sort, so I have still not prepped this for publication. I am so short on 'hobby time'... This is unfortunate, since that seems to be the stuff that lasts and speaks the best about a person. (Sighs). All of this website activity over the years has been a sink for time/money. I believe in it, but it still seems that only the unscrupulous (sp?) make a financial go of things in cyberspace.

Have struggled with downed sites due to a failed failover (long story) and an unscrupulous primary hosting operation. Oh my.

Sites affected:

Had Advogato not gone down for a while itself, I would have beaten myself up over this, even though all reasonable precautions were taken.

Unlike Advogato, there are a lot of sites affected here and they had more than one backup strategy since they vary in age. It has been a real challenge to restore all of these sites.

Clients sites whose backups we maintain went up quickly once we switched servers. However, a couple of clients maintained their own backups and one is still recovering (very long story here).

We, of course, are the shoemaker's children. Our own sites are the last to be dealt with and we are still in the midst of restoring these. Things could be worse, but disaster-recovery-wise, this was a worst-case scenario.

Looking on the bright side, though, my strategy of paranoid multiple systems and backups paid off. We at least have been able to recover.

January 9, 2004

Bob Trower
Advogato blog for DeepNorth
» 9 Jan 2004

Have posted some additional material about Migrating From Microsoft"

It is astonishingly cold here today -- approaching the point where Celsius == Farenheit. No bother for me. I am wearing "performance underwear".

Am about to start some prototype coding for a 'vector translation' engine pursuant to research into 'advanced data packaging' -- whatever that means.

Mulling over the idea of preparing a GPL'ed version of a 'raw radix' sort in ANSI C. For short records of -non-degenerate' data it is the fasted sort I have tested -- much faster than quicksort on large files. Would anybody care?

August 19, 2003

Bob Trower
Advogato blog for DeepNorth
» 19 Aug 2003

Have posted another article. Things really do move slowly here. If I wanted to and had the time, I could post the majority of articles on this site.

I note that diary entries take place fairly frequently, but I wonder who reads them. I have scanned a few and it seems a totally mixed bag -- not worth wading through. Some of the stuff could/should have been posted as articles and some of the stuff could/should have been better left unsaid. Maybe this entry is one of the latter :)

July 12, 2003

Bob Trower
Advogato blog for DeepNorth
» 12 Jul 2003

I'm wondering now if things are not slower here than they have been in the past.

Even though I've never joined before, I've been here before and it seems to me it was more active. What has happened, I wonder? I never went in for the mayhem that is slashdot, but they are active -- I'll give them that.

I like the minimalism of the site, but I wonder if that has anything to do with the apparent lack of interest. My sites are similarly (well, not quite) minimalist and we have been criticised for not being 'jazzy enough'. I would have thought a lot of serious hackers would go for this sort of lean content driven stuff. However, there seems to be a lack of interest, going by the number of articles and replies.

OTH -- maybe less is more with respect to the traffic here. I noticed that the replies to one of my articles here were quite thoughtful. Maybe a lower amount of high quality traffic is best. I will ponder this.

July 10, 2003

Bob Trower
Advogato blog for DeepNorth
» 9 Jul 2003

Well. After grousing for a grand total of about 48 hours I was certified as a 'Journeyer'. That's ok by me. I think with respect to the standards here I AM a Journeyer. Imagine that. Thanks to the guys that jumped in to certify me.

I got to post my reply about the voting stuff and due to breaking news, I even had an excuse to post an article about it. Mmmmm.

I also posted an article about making forge-proof bills from plain paper. I would love it if some geek actually did the legwork and printed a few. <rant>

Am currently slugging away with code for my websites. It is just drudgery right now as I attempt to 'beta-ize' hacks for session management, table management, etc. PHP is a thing of great beauty, but it does not really have a client-side counter-part. I am trying my best to minimize the java code needed on the client, but it keeps growing anyway. Why can't the browser guys get together and make SIMPLE standards that work everywhere and do what you actually need. Do you think the stinking browser could send a little RELEVANT information to the server???

I am currently trying to work my way around a nasty hack to resize the page without destroying the automatic 'printability' of my pages. It's a joke.

Realistically speaking, a modern page should be a document that reformats for different media like screen and print. I have CSS that deals with some of this, but obvious document stuff is missing from the HTML specs and the browsers implement these fine points differently.

The code I am currently working on is supposed to allow you to put up a set of presentation pages that can be viewed as a presentation but then go through a few filters to produce a reasonable printed document. Why do I have to code the GD filters??? This should be standard out of the box stuff, but instead the people working on this stuff have gone off into outerspace producing plugins for everything under the sun and extending things like java to the point where the browser is becoming an operating system. Meantime, some of the obvious stuff (like pagination in a printed document) is missing.

This diary is a case in point. There is no way to specify that a new body of HTML code has started or ended. That means that all these editors have to restrict the HTML tags you can use. Blah!

As a programmer of long standing, I can tell you the reason that things are like this: Programmer's do not use their own code as extensively as users do. If they did, they would fix the bugs in the vanilla stuff instead of constantly hacking in new features. Mea Culpa as well, but still... As a user, I object. </rant>