I am a big fan of planning. I spend a lot of time on increasing my future capabilities. I learn new programming languages, explore new environments and try to stay up to date on research directions. All of this means that I don’t do as much right now as I probably could. Hopefully, however, it does mean that I do more now than I could have done if I hadn’t followed this strategy in the past. My industry has a name for getting more stuff done up front: Front End Loading, hence the title of this post.
Author: alchemyst
-
Front end loafing
There is a fine balance between getting more done now and being more productive later. I tend to be a ‘sharpen the axe‘ kind of guy — I believe that you work more efficiently with sharp tools, that sharp tools require some time to learn and maintain and that that time tends to be less than what you save. Unfortunately, like any habit, this needs to be kept in check as well. When times are tough, my first instinct is to take a step back and find a better tool. Sometimes that is just procrastination. Sometimes it is time to put your head down and keep chopping.PS: This whole post was really just a test of twitterfeed. -
Optimal diamond cutting

So, they found a big diamond in Argyle the other day, which got me thinking about finding the optimal way of cutting a rough diamond. Key parts of this is knowing the value of different cuts of different sizes, which a colleague of mine told me is documented in a thing called the rapaport. This gives the value of certain cuts of diamond for different weights and qualities.So I was thinking that one could scan the diamond, build a 3d map of it and then try to maximise the value realised from the diamond by fitting cut diamonds into the rough diamonds. Things to consider:
- Inclusions reduce the value of diamonds,
- Diamond prices are nonlinearly related to weight
- Cutting and polishing is a time-consuming and expensive process
Some of these points have been addressed with some significant simplifications in this paper, but there is a lot of scope for improvement. Too many ideas, too little time.
-
How can GUI programming be so hard (for me)?
I do a lot of casual programming every day, to solve problems that I have at that moment. This mostly involves a quick one-liner in bash. Examples of this: finding out which of my students are repeating the subject by comparing this year’s class list to last year’s, figuring out which episodes of a series I still need to download, and so on. When I find myself doing the same thing more than once, that one-liner gets pushed into a script file that I can call at a later time. The shell allows me to pipe the output from one of these scripts into another or prepare input in many different ways, filtering by multiple criteria and allowing me to select files easily.
From time to time, I get the urge to convert one or more of these things into a nice GUI. To paraphrase a quote, now I have two or more problems (Apologies to Jamie Zawinski). First I need to choose a GUI toolkit that supports the platforms I use every day: Mac OS on the laptop and Linux on my desktop at work. All my scripting stuff ‘just works’. I use a blend of (in order of size of job) grep, sed, awk, bash and python, all of which are transparently available on both platforms and have never given me a day of trouble (except perhaps python, but that’s a different story). Enter the GUI and things get seriously complicated. Python ships with Tkinter, which is universally acknowledged to be pretty bad. It also has bindings for GTK, Qt and wxWidgets. I have not succeeded in getting any of these to work on both my computers at the same time.
A prime motivation for GUIfying these utility scripts is so that other people can use them more easily. Unfortunately that also means that this all has to work on Windows as well. This consideration, along with the fact that getting a fully functional version of Python running on a windows box takes time if not that much effort, has led me to consider Java for my GUI stuff.
So, now the problem — I remember doing a lot of GUI programming with Delphi back in the day (when I was still at school). I wrote several programs that did useful things and didn’t think it was all that hard. But now that I have mastered the command line, everything I need to do seems so hard in the GUI environment. Java has no standard GUI editor, so I have kind of drifted toward Netbeans for the nice GUI layout tool that it has. No matter how hard I try, though, I can’t find the motivation to stick with figuring out GUI programming for the hours that it takes me to get a useful result; where useful is defined as something that actually does something instead of just popping up a window with buttons and all. I get that all of that functionality (having a clickable widget appear on screen, being able to close the window etc) comes at a cost, but figuring out the details takes be ages, and seems entirely orthogonal to the problem I am actually trying to solve.For instance, here’s the python code for a program that gives me a list of students in common between a couple of files:
import sys, csv
classlists = dict((f, [r for i, r in enumerate(csv.reader(file(f))) if i > 1]) for f in sys.argv[1:])
numbers = [set(student[0] for student in classlist) for classlist in classlists.itervalues()]
uniqnumbers = reduce(set.intersection, numbers)
for n in sorted(uniqnumbers):
print nHow long would that have taken to GUIfy? Frustratingly long.