Didn’t have time to work on anything Android related this week.
Time was running out on my hosted rxkinetics.net site, the free host is scheduled to kick me off next month. I decided to purchase a two year server lease and move rxkinetics.net over this week. I went with LunarPages, they host rxkinetics.com and have always been good to me. Unfortunately they don’t allow remote database connections, so I was unable to use any of those sweet Microsoft desktop tools like SQL Server Management. I wasted hours trying to install and use SQL Server Database Publishing Wizard, what a joke that was. I finally ended up hand coding the SQL scripts for the table CREATE statements and then was able to import the data from CSV files using the LunarPages online Db administrator. I had to ask them to install the ASP.NET 2.0 Membership tables, since the only way I could find was a desktop tool aspnet_regsql.exe, and, again, no remote connections allowed.
Now I have to learn how to implement memberships. I was nice enough (or simply naive?) to put these webapps online with no strings, asking pharmacists to donate if they use the site. In the year I’ve had it up, I’ve received 6 donations of $10 each. One donation was from a German pharmacist. So, from all these rich American pharmacists with their $600 iPhones using rxkinetics.net, only 5 are willing to part with a tenspot? How foolish of me, I forgot that everything on the internet is free? Free apps, free music, free movies, free news, free tv. Our freedom, that’s what they hate. That’s what our boys are fightin’ and dyin’ for, so we can get ever’thin’ for free through those free interweb tubes. God bless ‘merica.
I’m still reading about ASP.NET memberships and trying to figure out how to add an unobtrusive login. The site will use the carrot approach. People who haven’t donated will be able to try out the apps, but not have complete access to all the features. Full access to the apps will be given to those who donate. I found a good deal on a two year server lease on a Windows hosted site with ASP.NET 2.0, hopefully I can recoup my investment.
I spent the rest of the week trying to help a UD Labels customer from Texas. She complained about the size of the bar codes, which were too small for her printer. The program uses an ActiveX control from Mabry, who have since gone out of business, so there is no support available. The control saves the barcodes as bitmaps instead of metafiles, so, if the screen and printer resolutions differ, then, yes, the barcode size will differ on the label. Since Mabry is out of business, and I’m NOT going through the hassle of finding and coding yet another ActiveX control, I decided to hand-code a Code 128 bar code routine. Everything seemed to work fine except that occasionally the printed code would not scan. I asked her to send me a list, and quickly realized that all the non-scanners were 11 digit NDC’s. I knew right where the problem was.
There are 3 variations in the Code 128 barcode family. Code A encodes uppercase letters and numbers only. Code B adds lowercase letters and common symbols. Code C encodes numbers only, but only 2 digit numbers. NDCs of an even number are relatively easy to code with Code C and the barcode is quite compact. The problem for me was, what to do for odd numbered NDCs? I could find no guidelines, there are some simplified explanations on various web sites, nothing in detail, and most are out to sell you something. Basically I had to go with my gut.
My original solution was to start out with Code C and switch to Code B for the last digit. Worked in all my tests, but then, in the real world, cracks usually appear and thus the list of non-scanners. So, I decided to take the easier route and use Code B for all 11 digits, it would require a smaller bar, but I was able to fit it on the label, and it worked well in my tests. Unfortunately, when she printed, it was one black bar across the page, instead of a nice 1.5 inch bar code. Back to the drawing board, double checked my code, double checked the check digit calculation, all good. Re-coded with B first, then switch to C, no go, tried again with A first then C, no go, then tried C first then A, all no good. So, I spent a day searching the internet for a program that would read the code raw so I could see what the hell was going on. No such luck, although I did find two online scanners, but they simply returned ‘invalid code’.
Finally I checked all 100 of the strings used for the Code C numbers from 00 to 99 and found two transcription errors, 07 and 23. The web site I had originally copied the codes from was wrong. Success? Nope! Still a black bar across the page. Although, once again, it worked fine on my printer tests. I had to sleep on this one. The only other thing that had changed was the bar width determiner. Originally the width was hard-coded at 0.0125 inches. Subsequently I used a variable, and set it depending on the length of the string, 0.0065 for strings with more than 120 characters, otherwise 0.0125. Apparently the use of a variable of type single made the printer go crazy. I went back to my original solution, Code C and switch to Code B, and hard-coded the bar width. Finally, it worked, took most of 5 days to get it to print right. I hate bar codes.
There is no comprehensive authoritative source on programming barcodes, there are tidbits here and there, but no one book or web site to find all the information needed. It’s been a both research project and a work in progress. I posted a write up here:

