Category Archives: Programming

Hobby. Career. There are times when I wish I could quit it, but they’re remarkably few.

A Cook’s Tour of Excel 2010 VB Macro Development

I have my preferred technologies to develop in, it’s true. But I happily go where the requirements lead, even if it’s into technologies I wouldn’t use by choice.

Lately, I’ve been working on building out the most complex thing that’s ever been asked of me with Visual Basic macros in Excel 2010. It’s currently about 6.5 thousand lines of code, and I’m pretty certain now that there’s not much of the Excel macro space I haven’t had to look at.

Because it’s not a common choice, but it is an uncommonly technically challenging build, I want notes to remind me of what Excel can (and can’t) do for me with macro support.

So, here’s a (very dense) cook’s tour on programming with Excel macros.

Continue reading

How Accurate is my Algorithm?

I wrote an algorithm.

It was fast.

It worked.

It was wrong.

Replicant tears did fall.

Fast… a couple of minutes versus the hours needed by its R cousin.

Worked… Final results showed an optimised selection of sites and management actions remarkably similar to the test-results that came with the R script.

Wrong… Optimised, but with species penalties reporting a value of 490, where the R script reported zero species penalty. 490… the smallest it would go. 490… a bizarre artefact, where it otherwise seemed to have work as intended.

Tears… in the rain. Lost in time… all those moments…

Buy a unicorn, stingemeister!

Buy a unicorn, stingemeister!

Continue reading

Curious Breaches of the Rule of Least Surprise in R

R is a language for statistical computing. For the past few months, I’ve been tasked with cutting a prototype modelling tool from R to a .NET framework that does something similar in a previous project here.  Though I’ve skirted around the edge of R on occasion with my succession of contracts, this project is the first time where I had to really go deep.

There was pain, and its source was primarily assuming that R was ‘just another language’, similar enough to the set of languages I’m familiar with that I’d be fine.

It’s not, and I wasn’t.

If you’re experienced with other programming languages and are coming to R for the first time, here be dragons.  If you’re considering going to another language from R, for the love of efficient computation, leave your dragons there with R.

What follows is a number of insights I’ve gained in contrasting R against the more ‘traditional’ languages out there. They’re essentially breaches of the rule of least surprise, where ‘no surprise’ is a baseline of ‘I can expect this assumption to hold regardless of programming language’.

Continue reading

Access Granted: Commencing Download in 3.. 2..1..

Well, what a ride this past year’s been, on several fronts.  I’ve been away from the blog for nearly 6 months, by the looks.   Mostly, that’s because a) I managed to seal myself out of my WordPress account, then b) was too damn distracted with everything else to deal with “this too”.  So, now that the amazing staff at have gotten me back into my own account, let’s try for a catchup summary, shall we?
Continue reading

On the Forgetting of Gource

Alright.  This is the very last time I figure out how to get gource producing visualisations of my development activities from scratch. Today’s post is me leaving notes on this for next time, so I can cut straight to the chase.

A couple of times now, I’ve had occasion to want to give the people I write software for some insight into what I’ve been doing. This project last completed was one such example. A lot of work was done under the hood to enable the code-base to have a replaceable user-interface, and possibly also spatial database. The user-interface had a few new features, but the lion’s-share of it ‘looks’ exactly the same as it was when I started.

I can guarantee you though, that the source looks absolutely nothing like how it started out. Most of my time was spent in taking a code-base “designed” to be a single-user desktop application, and turn it into something that would be relatively easy to make multi-user (it is, now) and optionally, web-enabled (one particular large data-set stops this from progressing just yet).

How then, do I convince the people paying me to tear up their code-base that even though the user-interface is the same, things are now radically different under the hood? Enter gource, and some discussion on how it visualises the git repository as the source-code evolves through the project.

Continue reading

Git Recovery with git-fsck: A Too-Short Tale

Beloved Reader.

Forgive me for I have softwared.

I’m on the tail-end, or possibly tale-end, of a project that was pretty rough as such things go. Not the toughest gig I’ve done, but no cake-walk either.

Anyone who’s professionally played in this space knows that Murphy’s law is drawn to tight-deadline software development projects like a wunch of salivating, button-eyed bankers racing to the reading of the last will and testament of Marley & Marley. Continue reading

Java’s JTabbedPane CAN run custom behaviour per tab hover.

I’ve been getting quite a bit of time lately to my own hobbies. I finally got around to implementing some user-friendliness with PersonalFinancier, involving a status-bar at the bottom of the application for supplying a little user guidance.

Unfortunately, part of what I wanted to do was have a custom message per tab appear as I hovered the mouse over a tab. Like in the screenshot below.
Continue reading