Money, Progress Bars & Old Macs (Sep 22)

Our staff has gradually been getting the Reconcile and Pay Bills commands to work. The process has meant going down many different rabbit holes. Working on very old parts of the accounting software code.

When we started to program Goldenseal, the C++ language was young. Things like dates, time, currency and text required long stretches of home-made code to function. They are not simple.

Take money, for an example. First of all, it’s important how you store it. Computers have “float” values for decimals, but they are dangerous for money amounts. The problem is, floats can’t store cents and other fractions precisely. It’s a basic number problem. 1/100 is not an even number of binary bits, so you can only get close to it, never exact. If you ever see something like $99.999999997 or $100.0000000013 on a website, their programmers used floats for money and forgot to round them.

For Goldenseal accounting, we wrote a CMoney class that stores dollars in 32-bit integers, and pennies in 16-bits. That way it’s exact. CMoney can handle up to $4 billion, and down to 1/100th of a penny. No risk of weird rounding errors. Some day we probably will switch to 64-bit integers and extend the ranges, but it will mean a ton of rewriting and testing, for not much gain.

Money has more quirks. There are dozens of currency symbols. Some are on the left, and some on the right. The decimal point may be a period, or a comma. The thousands separator may be a comma, period or something else. In some countries the separators aren’t every 3 digits.

Back in the early 90s, we wrote a lot of raw C++ code to handle all that. Then Apple released easier ways to localize for different countries- money, dates, other stuff. We rewrote some of the interface for that. Then rewrote it again for Cocoa. Now we are rewriting yet again to use Qt. Each framework does basically the same stuff, but always with quirks and gotchas. For example, Qt has built-in currency formatting, but it only accepts floats. No option for integer dollars and pennies. It probably has built-in rounding to avoid the $99.999999997 problem, but maybe it doesn’t. We’ll have to test it to find out.

It’s also time to redo progress bars. When tasks take a long time, the current Goldenseal puts up a small window with a moving bar. Sometimes it has a Stop button. Everything runs faster now, so TurtleSoft Pro will just have a small built-in progress bar at the bottom of the window. Most of the time it will just flash by, and a pop-up box would be annoying. The new method is simpler, but it means rewriting about 100 different places that show the bar.

For the actual accounting work, the new interface connects with Reconcile and Pay Bills code that is 20 years old. To understand how those work, we use the debugger to step through the current Goldenseal source code. 32-bit Goldenseal runs on anything pre-2019, but the Xcode project that builds it requires pre-2009.

We were down to just two older Macs able to build the app, then one of those died. It’s getting too risky. Fortunately, there is plenty of older hardware on eBay. The challenge is to set them up with MacOS Leopard. Or else figure how to update the project so it runs on Snow Leopard, which is easier to find and install.

Fun trips down memory lane…

Dennis Kolva
Programming Director

Covid-19 in New York #8 (Sep 13)

Back in April I really thought the Covid-19 pandemic would soon be over. Vaccines were rolling out. It looked like herd immunity was about to kick in. Time to move on to other things.

For a while, life was great around here. Active cases declined to single digits. Restaurants and bars filled up. People stopped wearing masks, even inside stores. There were parties and crowds. Everyone declared victory.

But the virus said nope. Active cases increased, then took off like a rocket. Last week the number of active cases hit an all-time high.

However, this surge is different. In the county, roughly 80% of adults are vaccinated. At Cornell it’s even better: 95% of students. Most of the Covid cases are happening in vaccinated folks, and they usually are less serious. Ten local residents are currently hospitalized: worse than anything before December 2020, but 1/3 of last January’s peak.

Tompkins County Covid Cases 2021

In the early days of the pandemic, Fox News kept saying this new disease was no worse than the flu. They were wrong. Lots of people found that out the hard way.

However, vaccines tame Covid-19 into a less serious respiratory infection. I couldn’t find local data for flu cases, hospitalizations or deaths to compare, but that’s kinda the point. Influenza is a normal part of winter, and rarely a crisis.

After 18 months of pandemic, Covid-19 is still worse than the flu, but it’s getting closer to being ordinary around here. So far this new surge has not affected daily life by much. Shops are open. Restaurants are busy. The hospital is not overwhelmed.

Sadly, Ithaca is not typical of the US.

Vaccination rates are lower in most areas. Sometimes a lot lower. In general, vaccinations seem to map pretty closely to wealth and education levels, plus Native Americans. I’m not sure what’s going on in Virginia and Georgia: maybe politics, or local culture, or just a data glitch. Texas is going la-la-la it’s not a problem if we don’t report it.

If you zoom in, our county is that dark blue dot in the middle of light and lighter blue Upstate NY. People took the pandemic very seriously around here, and they still do. Almost everyone is wearing masks in stores again. Some even outdoors. That’s not the case one or two counties over.

It has paid off. We’re a dark blue dot in the death map, too. Most nearby counties have been 3x to 4x worse. People in the dark red areas were over 20x more likely to die.

The way each region responds to the pandemic really is a matter of life and death. I suspect it’s going to be another tough winter. Delta is bad, but Mu sounds badder. Most likely Covid-19 will use up the entire Greek alphabet before it’s over.

BTW here’s a website that does a great job of calculating Coronavirus risk for you. Plug in a location, an activity and the details, and you can see the odds that it will make you sick.

Dennis Kolva
Programming Director

Bank Reconciling (Sep 3)

In our current accounting software, it takes several steps to reconcile a bank account. First, you open the window for the account or its transactions. Then you choose Reconcile from the Bank menu. It shows a modal dialog: you can’t do anything else until it’s closed. You fill in a reconcile period, then click a button to load items that haven’t yet cleared.

To get the list, the app must check every bank transaction. It may take minutes if it reads them from a hard disk. Even with an SSD it may take many seconds.

One the list is filled, you mark off items that have cleared. The screen calculates an end balance. Most likely you didn’t enter everything that’s on the statement. So, you hit the Reconcile button to save current changes. Close the dialog and add more stuff. Then repeat until the end balance matches the bank statement.

When we wrote that code in the 90s, 9″ to 13″ screens were still the norm. Not many pixels to work with. Computers had 4 to 16 megabytes of RAM: also pretty tight. We used a framework (PowerPlant) which was very limited. We did what we could, using the tools at hand.

TurtleSoft Pro is a chance to redesign the entire interface, thanks to a better framework and much better hardware. Reconciling bank statements will be a whole lot easier.

The Reconcile dialog is now non-modal. If you’re interrupted, you can do something else and come back to finish later. You can reconcile several statements at once without closing the dialog. Just switch to a different period, or hit the Bank Account popup and switch over to a different account.

We also improved the way bank accounts store their data. It makes record loading much faster.

Right now, the new Reconcile dialog is close to completion. It probably needs a couple more days work to finish off all the details.

There are a eleven more action dialogs to do, but most them are very similar. They’ll go faster. The first is always the hardest.

Once Pay Bills and Deposit Funds are working, we can start to use TurtleSoft Pro for our own accounting. At first, we’ll run it side-by-side with the current Goldenseal. It’s a good way to test the app. We can see whether both versions produce the same numbers, and act the same.

Dennis Kolva
Programming Director