Thursday, January 4, 2018

Rescuing My First Customer

Many years ago, before I was married, when I was just 22, 1981 to be precise, Toga Computer Services had a customer called Pacific Brewers Distributors.  They've since been merged with other brewery distributors from other provinces into a company called Brewers Distributor Limited. But back then, they were just distributing beer for the three major BC breweries: Carling, Labatt, and Molson.

They had a computer system.  It was a Microdata 1600 (I believe - not 100% sure on the model) with 64 K of core memory and 4 Winchester disk drives that each had 50 MB capacity.  The disk drives looked like top loading washing machines. The computer was the size of a large refrigerator.  The really amazing thing was that their computer system, with only 64 K of core, ran 16 users.  If you do the math, you have 4 kilobytes of memory for each user.  It didn't really work like that. Each user used a lot more than 4 K. The system would page a user's state out to make room for another user to run.  Note: I have 128 Million kilobytes in my phone, and it runs 1 user (it can't even technically multi-task!)  This system ran a multi-valued operating system called Reality.  It was developed with Dick Pick's input, and was a variation of what was known as a Pick system.

Most of those 16 users took orders over the phone.  They would enter the order, which would be put into a phantom processing file.  Then a background process called a phantom processor, would pick up the orders and process them.

Now, there was a problem with the data design. I'll spell it out as simply as I can:

First, Pick predated relational databases.  (The main database at that time was ISAM.)  The idea of Pick was that if you had an invoice, a single record would have all the header information, and also all the detail lines and options for the invoice.  One record, that had multi-values for detail lines, and sub-multi-values (also called sub-values) if the detail lines had multiple options.

This meant a single disk read would get you a small to moderate invoice into memory. A single write would write it out.  The BASIC extensions for handling all this were very easy to use, making the handling of an invoice by a programmer very easy.

Unfortunately, someone decided that they would track all orders for a particular brewer in a single record.  And they also had a consolidated record that tracked all orders for all brewers.  This meant that every order had to update two of these 4 records.

These records recorded, by date, all orders of all products for that brewer (or any brewer for the consolidated record) for all licensed premises or liquor stores in all of BC.  The records got very big.

The smallest one was about 16K, the consolidated one was bumping into the 32K limit that Reality imposed on records. Given that core memory was only double that, the restriction was pretty reasonable.

The other thing you might notice if you are good at simple math, is that two of these records take up almost all of memory. But there's more!

If you add data to a record in the BASIC language, making it longer, there is a likelihood that it will be too big for the buffer the BASIC interpreter had originally allocated. At that point a new, bigger buffer gets allocated, and the data gets copied over to the new buffer along with the changes.  If you do that with the consolidated record, you have two copies of the record in memory and have now used up pretty well all of available core memory. Given some of that memory is used for other things, your working set cannot fit in memory at the same time.  And that's just the phantom processor. If any other users are trying to get work done, their state has probably been pushed out of memory.

Note that the read/write time on these old drives was extremely slow by today's standards, there was no caching to speak of (not even track reads at first), and you read or write 1/2 kilobyte at a time (512 bytes).  So if you are reading a 30K record, you have to do 60 disk reads.  If the copy that the BASIC processor is working with has to be written out to let another user do work, you get to read it back in before you can do any work on it.

I won't go into fragmentation or any of the other problems that this raises. The key thing is, that the system got stuck reading and writing to disk. The industry term is "the system thrashed". The other problem was that if you let the big record hit the 32K limit, it truncated and you had data corruption, that sometimes would result in the phantom program crashing. Because it ran in the background, you might not realize it had crashed for quite some time.

The users would enter orders until 5:00 pm, then the phantom process would try to catch up.  If you hit the size limit on the big record, it would crash. On many mornings the order desk could not open at 9:00 as the phantom was not finished processing.

So, in comes Toga Computer Services, with me, laid off from Fraser Mills Plywood Mill, helping to write a conversion program and change order programs to handle a new data design.

The conversion program took the 3 levels of multi-values in each record and wrote them into 3 different files. We turned 4 records into about 600.  We also had to change the order processing programs to process records from the 3 files, both reads and writes.

We tested and retested, and finally we did the conversion, in January of 1982, as I recall it.

Instead of flushing all of main memory several times over for each order, the system generally processed less than 1K of memory per order. Instead of 60 reads or writes for the consolidated record, we were down to usually just 3.

I was still very rusty and needed a fair bit of help to get it right, but we finally got it good enough to do the conversion in production.

The first day on the new system, we had to fix a few bugs, but the system performance was amazing, and within less than 1 minute of the order desk closing, the phantom processor had caught up all the orders!  The impact of the massive records on performance was exponential! The fix was amazing!

I learned a valuable lesson about data design, and came away with an appreciation of how data design, disk access, system memory management and other factors worked together to affect performance.  I also had the great pleasure of having the CEO and other executives of the company thanking us profusely for saving their system!

These were lessons that have stayed with me over the years!

Next post - Recession Was a Good Teacher...

Wednesday, January 3, 2018

My Journey Into Software

I don't do New Years resolutions. If there's something worth doing, I generally do it when I think of it. But having just published a children's Christmas story eBook and paperback, and as I'm wrapping up the marketing for it, I was thinking, what would I like to do next?

Then I ran into an old web archive of Ken North's ODBC Hall of Fame and the inspiration hit me!

I'd blog about some of the more interesting and sometimes amazing experiences I had in my journey as a software developer!  Here is the first post...

At the time that I got into software, most universities and the few colleges that had a computer department really only trained you for academic work. The types of things most businesses were trying to do with computers simply weren't being taught in most colleges.  You actually got better business programmers out of the technical schools like BCIT than the Universities.

So, I was able to get in through the back door.  And what got me in?  Typing...

When I was in grade 10, I had room for an extra class.  A couple of my friends suggested typing, and I thought that would be cool.  Not to mention that the class had a lot of girls in it. At 15 years old, that was a bit of an attraction, as well, but I think I just liked the idea of being able to type. I always liked machines.

So I took typing. I don't think there was even one boy who could out-type the slowest girl, but we all did pass.

Roll forward several years, and I'm looking for work.  My brother Tony (Antoon) and his friend Gary had started a software company and by combining the first two letters of their names, they came up with Toga Computer Services. Toga had a job programming for the City of St. Albert in Alberta, over a 300 baud datapack modem from Burnaby.  You got 300 baud on a good day.  When the line was bad, it metered down to 110 baud (not sure why the odd number, but that's what it was!)

You took an old style dial phone, and put the receiver into the modem, and it squealed your data into it over a carrier signal.  This was called an acoustic coupler.  You could pick up the phone from the modem and if you hissed the right pitch into it, it would get confused and hang up.  I could out-type the modem at 300 baud, and 110 baud was annoyingly slow, but I was getting paid, and more than minimum wage, so I was quite happy!

Image result for picture of acoustic coupler
Acoustic Coupler



























For a chuckle, here's an old clip of someone using an acoustic coupler. You can see how slow it is, and at the end of the clip you can hear the carrier signal.

My brother would mark up program listings that he had printed off, and he would have me type the changes in, then compile them for him.  I'd gone with him the odd evening when I was attending BCIT for Mining Engineering Technology, and helped out a bit, but this was the first time he actually paid me.  It let him work on the next set of listings while I was typing over that annoyingly slow modem.

So that was my first software job. I had no idea how the software worked at first, but was intrigued, and started trying to learn.

At that time, Antoon decided to do some overnight training classes for me and some of his friends who were interested, and that, coupled with some books that we were told to read, began our journey into software.

Although I did not have formal college training in computers, I got to work with some truly brilliant people over the years, some of which I'll refer to in future blog posts.

At this point, I was employed part time temporarily, and didn't get paid for the training, but I really enjoyed what I was learning, and it was better pay than unemployment insurance!

Next post will be about rescuing a local customer.

Saturday, January 10, 2015

Four Lessons That Taekwondo Has Taught Me


It's my belief that everyone should do something outside of their comfort zone from time to time. There's no great thrill in doing something that you always knew you could do. You really experience life when you take on something where you are not certain of your ability to succeed.

When my son was 13, my business travel had fallen off and because I had the time to do something organized with him, I signed the two of us up for Taekwondo classes.

For the first while, we attended a class right after the senior black belts.  I'd watch what they did and had great doubts that I'd ever be able to do that. (I was mid-40s, initially in moderately poor shape, and not very flexible.)  For the time, I decided to focus on what I could do, which was the first upcoming test - I was doing this to be with my son, so the long term picture was secondary.

This began a journey of struggling to be ready for the next test.  It was generally challenging but that next test looked mostly achievable.

Fast forward 4 years, and I was looking at the black belt, and I knew I could do it! It would be tough, but it would be achievable!

Since then my son moved on, but I've stayed in Taekwondo.  This last year (2014) just one week before Christmas, I tested and passed my 3rd Dan Black Belt.

The experience has reinforced four things for me that I believe have helped me in all areas of my life:

It Pays to Look Ahead: 

Matthew and I at each test would watch what the people at the next belt level had to do.  We'd also watch them while we were practicing alongside them leading up to the test.  That way we knew what we would need for that next test.

We also attended a black belt test when we were still about 5 tests away from getting our own black belts.  There were things that were part of the black belt test that were not standard for a regular colour-belt test.  This was an eye opener for us, and valuable information.  Whenever you plan to do something new and different, it pays to ask lots of questions and do some research. Then plan what you will do to prepare.

Teamwork is Powerful: 

There is something powerful about teamwork.  When people really work together, 1+1 is greater than 2.  2+2 becomes greater still.  There's a dynamic that makes a group more powerful than just an individual, and up to a certain size, which seems to be dependent on the activity to some extent, the more team members you have that are really focused on getting results the more powerful the effect.

This requires the team members to have a common goal and works best in sports like martial arts, where (apart from sparring) team members are not competing with each other, but are all working to help each other.  That's a lot like many teams I've worked with in business situations, where we are all working to a common goal and seeking to help each other achieve our various objectives so that we can all win.

Taekwondo fosters the principles that support this type of teamwork.  The master and instructors of the school I attend, S. C. Kim's Taekwondo in Burnaby, BC, Canada are strong advocates of these attitudes and life-skills.  In the best companies that I've worked for, those same principles have existed to differing degrees and have been critical to the success of those projects!

Strike "Can't" From Your Vocabulary:

The word "Can't" has no place in Taekwondo, unless you have an injury, and even then, you will be given alternate things you can do.  In Taekwondo, you are not competing against the next student, but really you are competing against yourself. The battle's in your head and heart far more than in your body.

Even when I am sparring, it's less important to me that I get more points than my "opponent" but rather that I learn and improve myself.  I expect my opponent to do the same.

I guess if I was sparring in a competition with someone from another school that would change a bit, but in our school we all work to better both ourselves and each other.

When you are competing against yourself, the limitation is not what another person is doing, it's usually believing that I can do better than the last time.  It's getting that level of focus that will take me to the next level.  Sometimes it's about taking that focus home so I do the workouts and stretches I need to do in order to succeed.  When my limitations come in (injuries, lack of flexibility, etc...), it's often about finding a way to improve my technique so that the quality of what I deliver still improves despite the physical limitations

I'm now mid-50s and my body has some definite limitations - but my technique still has room to improve, so I'm still improving!  I've had lots of opportunity to say I "can't", but I always strive to change that to a question: "What other options do I have to improve?"

In short, there's always room for improvement for all of us!

Always Strive for More:

The final lesson that I'd like to share with you is to never stop growing.  There's always more to achieve. A black belt is not an end-point as much as it is a door to another chapter of your growth!

When I got my first Dan black belt, I felt a bit lost at first. There's a big time gap between first and second Dan, so it felt like there was nothing short-term to strive for. This was an important opportunity for me to realize that I could set myself personal interim goals. I didn't need to have someone else tell me what the next test was - I could make that test whatever I felt would challenge and improve me!

While there are other principles that are reinforced by Taekwondo, these four lessons are the ones that stand out for me, and that seem to resonate throughout both my work, my volunteering and my personal life!

I hope that this little post has given you some encouragement to step out and try something different to better yourself!

Thursday, December 23, 2010

Merry Christmas from FusionWare Integration Corp.



Well, another year has come and almost gone! We’ve been quietly busy getting ready for big things in 2011, while continuing to support our customers. We just wanted to take a moment to wish all our friends and customers a Merry Christmas and a Happy New Year!

Click on the link below to get a Dickensian perspective of where we’ve been and where we’re heading:

http://www.fwic.net/NewsInfo/MerryChristmas.aspx?s=bsts

Saturday, November 27, 2010

More readable version of blogs

I've been looking at my blogs here, and noticed that they are not being converted very well. These are actually poorly transfered copies of my real blog, which is much more readable (and has more entries, too.)

My real blog site is http://sototallybc.blogspot.com

I'll continue to keep a copy here, but the better copy is at that link.

Sunday, January 31, 2010

This blog has moved for now

For the time being, my new blog posts about software will be hosted at the FusionWare Integration Software blog site at: http://www.fwic.net/NewsInfo/FusionWareIntegrationBlogs/tabid/163/BlogID/3/Default.aspx.

In June of last year, the original founders of Liberty Integration Software, and later contributors to the software assets of FusionWare Corporation formed a new company to support their former customers and carry on the tradition of providing technology solutions to enable users of high-captivity legacy platforms to extend their investments with W3C standards and BI solutions from the leading vendors of these technologies. We bridge IBM i (AS/400) and Multivalue (PICK) systems to Web and BI technologies from Oracle, IBM, Microsoft, Business Objects, Cognos and many others.

Monday, May 11, 2009

Twitter Limitations

Before I do part 2 of my Twittering from U2 series, I thought I should explain some limitations of this technology.

First, you are limited to 140 characters. Actually, this is not a big deal as you can usually indicate status pretty effectively in a lot less than this, and longer strings tend to be slow to process, anyways.

Next up, there is a limit to the number of tweets you can do in a day or hour. As near as I can tell, these are the current limits:

  • 1,000 total updates per day, for your account.
  • 1,000 total direct messages per day, for your account.
  • 100 API requests per hour, for your account.

Then there are follow limits. Here is twitter's own commentary about it:

http://help.twitter.com/forums/10713/entries/14959

The entry is from last Nov., but I could not find a newer one.

You can request white list status and these limits will disappear. Note that the limits on follows are a bit more complex, and they are quite controversial. I found this link:

http://www.marrubiumwriting.com/?p=296

Interesting stuff. Note that whitelisting is not likely to happen for an automated app. Twitter is a social networking site and they are free, which means they can't afford to take bandwidth from a ton of high-volume commercial apps. Low volume notification of status stuff is probably OK, and especially if you are personally monitoring it, it falls more or less within the confines of a social networking use.

So, to summarize:

If you are thinking about using Twitter to automate something between systems, you need to find something where timeliness and reliability are not an issue (our next blog will address some of that), you need something where you are not talking about high volume. And for now, you probably need to avoid those parts of the API that involve following other Twitter accounts, unless you can keep the volume very low.