Author Archives: johnny

About johnny

Computers have interested me since I can remember and conveniently I studied computer science. I also enjoy performing in a local amateur theatre group and cycling. This is where I post solutions to problems I've had in the office or any other project, hopefully clearly enough to refer back to in the future.

Efficient algorithm for finding incorrect transactions in double-entry bookkeeping

I wanted to find an efficient algorithm for finding missing or problematic transactions with YNAB Debt Sync. The naïve O(n²) approach of comparing all transactions from both budgets would obviously not scale. This post explains how I achieved an average time … Continue reading

Posted in Uncategorized | Leave a comment

Managing short-term lending with two-way YNAB

This post explains the reason behind my latest personal project, YNAB Debt Sync. Shortly after I started using YNAB I ran into a problem. How was I meant to borrow cash from —or spot cash to— family and friends? The … Continue reading

Posted in Uncategorized | Leave a comment

How to build PeaZip installer for Windows

Some notes on how I built PeaZip from source, including the working x64 installer for Windows. Preparation Before building PeaZip you need: PeaZip source code Missing binaries (7zip, etc) Missing files Lazarus, an open source Free Pascal IDE Inno Setup … Continue reading

Posted in Uncategorized | Leave a comment

git error: unable to create file (Invalid argument)

A file was added to a project's git repository at work with an illegal filename (under Windows). The filename had an invalid character in the extension: a question mark. When I tried fetching/rebasing with TortoiseGit an error message popped up … Continue reading

Posted in Uncategorized | Leave a comment

Moodle sending text files with incorrect text/html MIME type

Our Moodle installation was serving .txt files via file.php with an incorrect text/html MIME type instead of the correct text/plain MIME type. This was breaking the exercises from a new authoring tool we're trying out. Adding .htaccess directives wasn't an … Continue reading

Posted in Uncategorized | Leave a comment

Grub2: Boot Windows by default

Grub2's default boot setting configuration is different from regular Grub. Whenever I search for it on the internet I have to sift through tonnes of advice regarding the menu.lst file. Here are the steps for setting Windows as the default … Continue reading

Posted in Uncategorized | Leave a comment

Setting contact's group in Android 2.3 Gingerbread

A huge issue I have with Android is its contact management. I have a lot of contacts, many of whom I only have an email address for. I have created a "Mobile" group for those contacts I do actually want … Continue reading

Posted in Uncategorized | 1 Comment

Irrefutable proof: two spaces after a period on the web is evil

I noticed a few years ago that Americans often type two spaces after a "period". I've always thought it was a practice that should have died years ago; valid when all that was available was a typewriter's monospaced typeface, but … Continue reading

Posted in Uncategorized | Leave a comment

Windows-7–like window management with Ubuntu (and Compiz)

Windows 7 introduced great window management keyboard shortcuts. Pressing (and holding) the Windows key and then tapping the arrow keys allows the window to quickly be maximised, restored and docked to the left/right half of the screen. One of the … Continue reading

Posted in Uncategorized | Leave a comment

Check HTTP headers (specifically MIME type) for file downloads

A client called us up saying they had problems downloading files from our e-learning portal. After some back and forth on the phone I found out the problem was their browser and/or the files' MIME types. Either the MIME type … Continue reading

Posted in Uncategorized | Tagged | Leave a comment