Goldenseal Bugs (Nov 6)

There are 689 records in TurtleSoft’s Problem Log, nearly all of them for bugs in Goldenseal accounting/estimating software. Most showed up during the first few years, then tapered off. This year there was a slight uptick because of old bugs caught while testing the new accounting app.

257 bugs are marked as Completed. Most of the others were fixed long ago, but didn’t get a status update. A few are user bug reports that we couldn’t duplicate.

Recent bug finds are usually small stuff: slightly annoying or very rare. However, last week we discovered a serious Goldenseal design flaw. It may be the cause for some mystery errors. The problem will linger on in Goldenseal, but not in the new version.

One handy feature in our software is linked records. There are many ways to see something related. Some are commands in the View menu. Others are buttons in records. You can also see links from clairvoyant/smart fields and from double-clicks on report lines. All those actions will activate a window, then jump to a record (some buttons start a new record, instead).

The system is nifty, but we overlooked something important. What happens if the window was already open, with an unsaved record? It’s an “edge case”. Probably rare, but it may happen. The code tries to save changes, but if it’s too incomplete to save, the record sits in limbo after another one is loaded. When you quit the app the dud record will disappear, but it may cause chaos before that.

Fixing it took a while because we discovered another problem. The different ways to see links were added gradually, with slightly different code each time. Rather than fix four different functions, our staff combined them so only one change is needed. That will make future upkeep easier.

The new accounting software now warns about the unfinished record, and cancels the link. Slightly annoying, but better than creating a mess.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Printing & Onwards (Oct 22)

Last week, our new accounting software finally started to print good-looking sales receipts. We used it to run day-to-day TurtleSoft business for a few days, then took a break to fix all the bugs that turned up. That on/off cycle will continue for a while, with longer ons and shrinking offs.

The nastiest bug was in the memory cache system: code that decides which records to keep in RAM. It zapped some records, but also was the easiest to fix. Just one missing line of code when duplicating records. Easy-peasy.

The most complex bug happens for linked records. It’s a basic interface problem. Goldenseal puts everything in separate windows. It makes a cluttered screen, and needs windows-inside-a-window on MS Windows. The new accounting/estimating app has just one main window with tabs, for a more orderly screen. But it adds a new problem. What happens when you want to see a linked record?

The solution is to pop it into a separate window. In fact, you can still put everything in separate windows if you want.

But what happens if it used to be in a tab? The solution for that is to move tab contents into the window, then delete the tab so they won’t get out of sync. That has been working for a while.

But what happens if you close the window? There’s the bug: the tab is still gone. Slightly annoying. Going window-to-tab is the reverse of tab-to-window, but the code is complex and can’t just be flipped. Our staff is working on that now.

Breakdown tables have always been difficult, and there’s also more to do there. Most things display OK, but Billing Records, Bank Transactions and Payroll Records have more than one type of table. They still need a way to deal with that.

Meanwhile, the subcontractor working on networking is making good progress. Some time in the next month or two, we could use help testing the remote access feature. You’d need a static IP address, so clients can find the test server from afar.

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

Multi-User and Mobile (Oct 15)

TurtleSoft just hired a developer to write networking code for our new accounting software. It will allow more than one person to log into a company file over a local area network (LAN), using Ethernet or a wireless connection. The interface will be similar to the one in Goldenseal.

The new accounting app also adds something nifty: log in from remote locations. To make that happen, you’ll need a fast Internet connection on your laptop (Mac or Windows). Also, the server must be on a computer with an Internet connection and a static IP address. That’s something you can get from your ISP (ours costs $10 a month; your service may already include one).

The second half of the project is to build mobile apps for Android and iOS. They will only write a starter version with a user log-in screen and a few fields. Later, our staff will add the guts to make single-function apps for phone or pad. A few ideas come to mind right now:

Material Purchases/Subs/Other Costs, for expenses entered from anywhere.
Labor Hours, so employees can enter their hours from job sites.
Estimates, for quick field generation of quotes.

Networking should be ready soon after the first, early release of the single-user version. Mobile apps will take a bit longer.

Beta versions of our new accounting software are guaranteed to have some bugs and missing features. Hopefully, they will be good enough for daily use. We will update weekly, so bugs won’t linger long.

Goldenseal went through 3 years of alpha and beta status, then a few more years when important features were added gradually.

Fewer things will go wrong in this release, since the accounting and business management code hasn’t changed.  That’s where most of the Goldenseal bugs were during the first ten years.

Dennis Kolva
Programming Director
TurtleSoft.com

Printing & Multi-User (Oct 9)

Soon after the last post, we abandoned the C++ diamonds, and found a better way to modify breakdown tables in our new accounting software. There’s still more we can do in Custom Layouts, but it’s finally good enough for a first release.

Printing also is coming along. Breakdown tables now print a list of items on sales receipts, which was a biggie. But it’s still not finished. Right now, multi-line fields don’t print anything, thanks to some Qt complications. Popup fields and smart fields do print, but they look like a data entry screen. Our staff found a new approach that should solve all those problems at the same time.

Meanwhile, we just posted on UpWork and Guru.com, looking for a subcontractor to write code for the multi-user version. The first day drew 70+ applicants. Narrowing down to those actually qualified is a gradual process. Hopefully, we’ll learn enough about Qt networking along the way to make a good decision.

Part of the project specs is to make a very simple mobile app for iOS and Android. It’s step one in creating links from phone to home computer, so you can manage purchase, estimates and other tasks while in the field.

Dennis Kolva
Programming Director
TurtleSoft.com

Printing Diamonds (Sep 25)

Two months ago, our staff was ready to start serious testing on the new accounting software. Again. We do that by “eating our own dog food”. That means daily use to run TurtleSoft and SmartKnives. It was at least the 30th time we’ve done that. Each attempt gets a bit further.

What stopped us this time was printing: invoices and sales receipts were ugly. Custom Layouts is the way to fix that, but it still was missing some things. While adding those, all sorts of other bugs turned up, and were fixed one by one.

Printing is better now, but still not complete. It’s down to extra gray when drawing rectangles, and an ugly breakdown table. Sales receipts need one of those to itemize multiple items, and it needs to move down a bit to look good. Fonts are different, so some column widths need a tweak.

All that happens in Custom Layouts, and it stirs up a C++ problem. To change the table’s position, it has to act like the other fields: a click shows handles, and a drag moves it around. To edit columns, it has to be a table: double-click in a column shows details to change, drag on the edge of a column changes its width.

TCQ_LayoutField is our C++ class which handles the clicky and draggy stuff. It’s a type of QWidget, the Qt class that draws stuff on the screen (plus other tricks).

TCQ_Table is another C++ class which makes a spreadsheet-like table. It has children that handle each place it is used: in breakdowns, lists, reports, and printed forms. TCQ_Table is also a QWidget.

Custom Layouts has a TCQ_TableLayoutField which acts like both. The C++ way to do that is to give it two different parents. Normally that is no big deal, but this time it creates a dilemma. There are two paths to QWidget: which one to take? It’s called diamond inheritance. Kinda like incest, but for screen objects.

Up until now, TurtleSoft has never made any diamonds. There always has been a way to avoid them. We tried a few ways to make that happen for TCQ_TableField, but all had serious problems. So, right now we’re trying the diamond. When the compiler complains, we just need to tell it which branch to take.

This is a bold experiment in advanced C++ design. Tables still don’t drag right in Custom Layouts, but we’re working on it. Worst case, our staff will toss a few days work and try some other way.

Dennis Kolva
Programming Director
TurtleSoft.com

Net Present Value (Sep 13)

People usually procrastinate when projects begin, then rush around at the last minute to finish. It’s all because of net present value.

NPV is an accounting calculation that gives the current value of a future asset/liability. Getting money today is better than getting it next year, so NPV uses a percentage for risk/interest/opportunity cost to adjust from then to now. Multiply that by the time delay then subtract, and you get present value.

Likewise, spending time or money next year is better than doing it today. The math says: the more you can push to the end, the better.

Net present value is not something we calculate in our accounting software (though depreciation is almost the same). NPV is a planning thing, not bookkeeping. If you need it, Excel has a function to give a number quickly.

Allocating time and effort is important for survival, so every living thing seems to have an internal NPV calculator. Usually, it says “don’t think too far ahead”. In fact, humans have a much longer time horizon than most other species. Excepting beavers and orcas, maybe.

Work on TurtleSoft’s accounting software has gone that way. At first, completion seemed close: just a year or so to finish. So, the project was all-consuming. The expected reward was large, and worth whipping out in that time frame.

When things proved harder than expected, work slowed down. Other projects with nearer rewards took precedence. Then Covid took massive attention for a spell: fear of dying will do that. Despite all the barriers, programming did continue. Just slowly.

Now that the end is in sight, the new accounting software gets more attention and time. That probably will accelerate.

It also helps that TurtleSoft is firmly settled into its new home. The garden did great this summer, thanks to work put in over the past year. Some construction still needs doing, but nothing major. No more relocations are on the horizon. Finances are solid, unlike the final push to finish Goldenseal. That version was built on massive credit card debt. There’s much less anxiety, this time around.

Dennis Kolva
Programming Director
TurtleSoft.com

Rich Text (Sep 5)

Back in July, our staff needed to tweak TurtleSoft’s printed forms so we could test the new accounting software in daily use. It meant adding more features to Custom Layouts. Every time work seemed to be finished there, something new came up. There have been many “last on the list” items.

Rich text is last on the list (so far……..). It’s what you see here: text with bold, italic, font changes, and other formatting.

The good news is, rich text was easy to add to our multi-line fields. One line of code, setAcceptRichText(true); was enough to turn it on.

The bad news is, Qt does it in a weird way. From the name, we figured they’d use RTF (rich text format). It’s a simple markup language developed by Microsoft in the 1980s. RTF is supported by MS Office and many other apps, and it would be perfect for our accounting software.

However, Qt uses HTML, instead. It’s probably a wise choice for the long term, since everything seems to be web-based these days. But HTML is way overkill for an accounting app.

For one thing, their approach is bulky. Every field has at least 465 bytes of hidden markup text: even if it’s empty. Basically, they set up a whole web page. Actual content can easily have more hidden HTML tags than text. RTF is much more compact than that.

Also, Qt only has partial support for HTML and CSS. It ignores php and JavaScript completely. So, text pasted from web pages may lose some details. Pasting from RTF has similar problems: some things don’t make it over because the tags are different.

Even worse, there’s no way to edit formats while inside our new accounting software. Text must be created in a word processor or other app that handles HTML, then pasted in. You can’t just type in rich text, nor can you change it after it’s there.

Qt does have classes to set up a rich text editor and/or an HTML viewer. But they’re complex, and meant for whole scrolling windows, not database fields. A mini text-formatting bar would be nice, but Qt doesn’t have one. Our staff does not want to program one from scratch. It’s a several-month project.

For contracts and spec-writing, HTML may be worth the downsides. Elsewhere, probably not. So, rich text is turned off by default in the new software. Custom Layouts has a checkbox to turn it on, for fields where you really want the fancier formats.

Rich text is slightly nifty.

Dennis Kolva
Programming Director
TurtleSoft.com

 

Unicode (Sep 2)

On a whim, our staff pasted some emojis into the new accounting software last week. It worked! The text saved fine to the database, and displayed properly. Much easier than expected. It’s all thanks to Qt’s robust support for UniCode.

Unicode is the standard format for all kinds of text, these days. It includes Ελληνικά (Greek), Українські (Ukranian), 한국어 (Korean), and any other language on this planet. Plus ♔♕♖♗♘♙, 😝🍑🏈🔥💩 and more.

This is one area where it really paid for us to procrastinate. Computer text has had some difficult times, but we missed most of the pain.

A typical English-language typewriter or keyboard has 47 printable keys, give or take a few. With shift and space bar: 95 characters. ASCII is a 7-bit system (128 choices) that’s big enough to handle it. Leftover slots are used for line feeds, tabs and the like.

Apple expanded ASCII to 8 bits. That’s what Goldenseal uses. The extra 128 characters include diacritics (ßàæçñòóôõö etc), Greek letters, extra currency symbols, and fancier punctuation. Other companies also expanded ASCII, but everyone used different setups. It’s why you’ll sometimes get emails with weird symbols.

8 bits is sufficient to cover most European languages. But move east, and there are whole new alphabets. Too much for just one byte.

For a while in the 90s and early Aughts, the solution was wchar_t. It’s 16-bit text, with 65,536 possible characters. That’s enough to hold alphabets for Britain, Thailand, and all points between. Wide characters support العربية (Arabic), کوردی (Kurdish), हिंदी (Hindi) etc.

That era was not fun. Some things still needed ASCII, some needed wchar_t. Use the wrong one and you’d get gibberish or worse.

Microsoft created a special hell, with LPSTR, LPCSTR, LPWSTR, LPCWSTR, LPTSTR, LPTCSTR, CStringA, CStringW, bstr_t, CComBSTR, WCHAR and TCHAR, all for different types of 8 or 16-bit text. There were equally obscure ways to convert between them: CW2A, C2AEX, etc. Use the wrong one and code would crash: sometimes suddenly, sometimes randomly later.

Move on to East Asia and wchar_t had another problem. China/Japan/Korea use ideographs: a different symbol for each word. Many thousands of them in each dialect. 2-byte text lacked space for them, so it wasn’t good enough for global use. It also was twice as bulky for regular Latin-language text.

Unicode fixed all that. It’s a clever system that mixes characters of different sizes: anything from 1-byte Latin to 4-byte 𒁎 (Ancient Sumerian). With over 4 billion possible glyphs, there’s room for every human language, current or extinct. Plus music notation. Emojis. Dingbats. Weird math symbols. And plenty more.

Even better, Unicode converts easily to UTF-8. That’s an 8-bit format that programmers can use to treat Unicode just like simple Latin text. Thanks to UTF-8, text-handling code inside our new accounting software accepts Unicode with no need to rewrite anything.

The new accounting app will have a few problems with Unicode, but nothing serious. Find works OK with special characters or emojis, but sorting won’t know what to do with non-Latin text. You’ll need to be careful with fonts: none support the entire gamut of Unicode, and some may be Latin-only. Other quirks may arise.

The next thing for us to test is rich text: with multiple fonts and formats inside. The Qt class we use for multi-line fields supports it. If we’re lucky, that also will be easy.

Dennis Kolva
Programming Director
TurtleSoft.com

Pictures & Links (Aug 28)

Custom Layouts is almost complete in our new accounting software. The biggest item still on the to-do list is pictures.

Goldenseal stores pix as binary data inside the company file. It uses Apple’s PICT format: once the most popular way to store bitmaps and vector images, but now obsolete.

Qt supports BMP, JPEG, PNG and a few less common graphic formats. But it can’t read PICT. We also couldn’t find any C++ code to do that. Sadly, when you convert your company file from Goldenseal to the new accounting app, any pictures will be left behind. Screen shots are the easiest way to salvage them.

The new business software stores all pictures as external files. You can put them in the TurtleSoft folder inside Pictures, or anywhere else that you choose. The database just has some text: a path to the folder location and file name.

There are trade-offs to the new system. On the plus side, it makes the company file smaller: no huge chunks of binary amongst the accounting and estimate data. Editing pictures is easier. There’s no need to export/import, just open them with any graphics app.

On the minus side: backups are more complicated. Switching to a new computer means moving more than just the app and company file.

File paths are good for more than just graphic images. They also can link to PDF documents, Excel spreadsheets, or anything else. Those files won’t display inside the accounting software window. Instead, they’ll launch the app that created them, and open in a separate window. Links also can use an Internet URL: those will open a browser page.

Goldenseal didn’t start out storing pictures inside records. We added them piecemeal to a few classes: first Cost Items, then Estimates, then a few more. In the new accounting app, any record class can store a picture, file link or website URL. The coding is easier that way.

I think pictures and links will be useful in many new places.

Dennis Kolva
Programming Director
TurtleSoft.com

 

 

 

Drawing Lines (Aug 20)

Our staff spent far too much time on line drawing this past week. We need them for printing and data forms in the new accounting software. Here’s a microscope view of one small bit of programmer sweat.

To print a line on screen or paper, it takes four numbers: x and y values for the start point, then x and y for the end. The same four numbers can also make a rectangle: one point for upper left, one for lower right. Qt specs it another way: upper left point, width, height. Both end up the same.

Every GUI uses lots of rectangles. Fields have visible boxes. Text has an invisible one. Ovals and rounded rectangles draw curves inside a box. Many apps have a drawing interface to modify shapes: it’s in all CAD software, MS Excel or Word, OpenOffice, Goldenseal’s Custom Layouts, and many others.

The standard used to be four handle boxes at the corners: drag on them to change size and shape. Drag the middle to move the whole thing. Goldenseal has code to do that in Custom Layouts. Newer software adds handles at the midpoints so you can pull in just one dimension. We now do that too.

Handle-dragging has a possible problem: what happens when you shrink to zero and keep going? Dealing with it is a programmer decision.

Goldenseal flips the numbers, turns the rectangle into a positive, and keeps going. That needed lots of complex code that isn’t easy to duplicate. The new accounting software simply stops before the edge. In fact, it won’t even go to zero, avoiding an itsy rectangle that’s hard to work with. After testing, the new approach seems fine.

Lines are less common, and totally different. In Goldenseal, you click on the handle at either end, and drag that point anywhere. A click in the middle drags the whole line. That code is buggy: some drags leave screen garbage. Getting pure verticals and horizontals isn’t easy.

Our staff tried to make end-dragging work the same way for lines in the new accounting software, but it was just too hard. Every attempt went bonkers. We finally decided to have separate commands for three types of lines: horizontal, vertical, diagonal. They’re now just rectangles that draw a line inside.

That still left one issue: diagonals can go up or down. Goldenseal stores the line slope to figure that: another design flaw. The easy answer was two commands for diagonal lines. Not like you see a lot of diagonals on business forms, anyhow.

Something trivial needed many attempts and much quandary. Multiply that by a few thousand, and it’s the history of TurtleSoft.

Dennis Kolva
Programming Director
TurtleSoft.com