Monthly Archives: July 2007

The Week in Review

Well, I’m just back from a week spent in Launceston partaking in a Winter Unit in Advanced Algorithms and implementation thereof; so I expect this post to mostly talk about that.

Arriving at Launceston, we had dinner, and proceeded to an extended game of Bartog to kick things off, and introduce people to people that hadn’t already met other people. We stayed at the Australian Maritime College’s hall of residence, and in general, I rated the room as better than that of most other colleges I’ve stayed at, apart from the niggling annoyance that the heaters switched themselves off after two hours (permanently), and the blankets were far to thin to compensate for this. Luckily, the point of the trip was not to sleep.

There’s something particularly comforting about spending 15-16 hour days in computer labs at foreign campuses (NCSS, I mean you!), this was no exception. On most days, we’d arrive at the School of Computing building at 9AM, and not properly leave until 10-11PM; barring lunch and dinner breaks. This allowed for lots of problem-solving activities.

Monday consisted of a “Getting to Know C++” session, whereby seasoned C++ coders would get massively bored, and newbies would get overwhelmed. Luckily, I sat somewhere in the middle, and so learned quite a few useful hints. No specific algorithms were studied on the day, but rather, we looked at many ad-hoc examples of algorithm design. Most people seemed to grasp the concept of “Greedy” algorithm design, I certainly did.

Tuesday and Wednesday consisted of Graph Algorithms, which is a very comprehensive field at the best of times; we focused firstly on some extensions on things covered in 2nd-year; followed by an introduction to some NP-complete problems, namely, modification of a graph that contains no Euclid Circuit such that it does, and the Travelling Salesman Problem (whilst using Dynamic Programming). We also touched on things like Vertex Cover and Automaton Matching. All very complex, but I’m definitely looking forward to solving some of these.

Thursday consisted of a basic introduction to Computational Geometry, introducing things such as the Convex Hull, and distance between two pairs. I realised far too late in the piece that remembering some vector calculation concepts touched on in KMA152 would have been useful.

Today introduced some (trivial) arithmetic problems that involve writing classes that represent numbers in a non-native method (i.e. Big numbers, or rational numbers, for example). Would have been interesting, except that the concepts covered were no more complex than they were when I first experienced them (in ACPC, Year 10, incidentally).

Well, bedtime calls, so that’s clearly all the info you’re going to get from me today. I may post some discussions of problems posed as the week progresses — it should help with exam preparation for me :).

Things I’ve learned today

  • Stream of consciousness coding is the most fun, but the code that you get to read the next morning normally isn’t the nicest.
  • There’s a reason why PHP is used for Database Apps more than Python does, and let me give you a clue: it’s got a lot to do with the standard library.
  • chroot is the best sandbox for executing insecure apps under, and I can’t use it for what it is that I’m doing.

That is all

The Directory Lister

Well, it seems as though it’s impossible to go through a life of coding without writing a directory lister… So in the great tradition of this site, I give you my directory lister — It spits out the entirety of your directory structure, either starting at the current dir, or at some specified one. It spits it out in a format suitable for grepping on a Unix system, as for some reason, the Unix


tool doesn’t do so.

Here’s the code in it’s entirety — written in python, under the terms of the GPLv2 or later

#!/usr/bin/env python import os import sys if len(sys.argv) == 1: k = "." else: k = sys.argv[1] for dr,drs,fls in os.walk(k): for i in fls: print dr+"/"+i for i in drs: print dr+"/"+i 

May someone find it useful

Quotes Tracker

I’ve spent tonight writing a simple quotes tracking program for me to immortalise people’s humourous comments on. Please view at this URL.

If you’re interested in the source code for it (it’s written in Python-CGI, and runs on Python2.4 quite nicely), please e-mail me — you know the address, and if you don’t, you’re not very good at looking.