Google Maps / The Obligatory “Coming Soon” Post.

•30th November, 2009 • 5 Comments

No posts in six months! Tom and I have been slack. We’re off to linux.conf.au (LCA) in New Zealand with a couple of friends in January so we should have plenty to write about then.

I’m currently finishing up my semester of university in Sweden, and will have some musings about that shortly (by “shortly” I mean in the next couple of months.. hopefully).

In the meantime.. Grant may have been photographed by a Google van on Hindley Street in Adelaide, which is both hilarious and upsetting – hilarious for the obvious reasons, but upsetting because this means they could be replacing their current street view images of Australia. And there are some good images on Google Street View, there’s one image in particular that I’m quite fond of and wouldn’t like to see replaced…

Without any further ado, here’s my mother on Google Street View:

Check out that seamless exit from the vehicle. Fantastic.

That’s all for now. Bring on LCA!

Solving ENGN3211 with Minizinc

•25th June, 2009 • 5 Comments

It is compulsory for engineering students at the university I attend to complete an introductory course in economics and accounting (ENGN3211). With exams in full-swing, I’ve been going through the course material for ENGN3211, revising for the exam. After labouriously going through each of the ENGN3211 assignments yesterday, something quite self-evident became apparent: economic type problems are particularly well suited to constraint programming. Having become increasingly interested in constraint programming lately through Jess’ posts on Minizinc, I decided to see how easy it would be to ‘solve’ problems from the ENGN3211 assignments by describing them in Minizinc. Continue reading ‘Solving ENGN3211 with Minizinc’

Eight Queens Problem in Minizinc

•22nd June, 2009 • 7 Comments

There’s a few things that I’m really good at, and one of them is procrastination. I can find anything to do that will delay me getting inevitable tasks done. Today it’s because I have an exam tomorrow and still have a lot of studying that I should do for that. I have also been given a research task to do.

Instead of doing either of those tasks, I’ve knocked up a solution to the eight queens problem using the Minizinc constraints programming language. The eight queens problem simply is, how to arrange eight queens on a chessboard so that none of them are in check.

Not sure if it works correctly – did it in about two seconds flat – so bonus points if you can find problems with it.

include "globals.mzn";

array[1..8] of var 1..8: xpos;
array[1..8] of var 1..8: ypos;

%no two queens can have the same xvalue
constraint
    forall (i in 1..8) (
        forall (j in 1..8 where j!=i) (
            xpos[i] != xpos[j]
        )
    );

%no two queens can have the same yvalue
constraint
    forall (i in 1..8) (
        forall (j in 1..8 where j!=i) (
            ypos[i] != ypos[j]
        )
    );

%none on the diagonals
constraint
    forall (i in 1..8) (
        forall (j in 1..8 where j!=i) (
            (xpos[i] - xpos[j] != ypos[i] - ypos[j]) /\
            (xpos[i] - xpos[j] != ypos[j] - ypos[i]) /\
            (xpos[j] - xpos[i] != ypos[i] - ypos[j])
        )
    );

solve satisfy;

output [ "X: " ++ show(xpos[i]) ++ " " ++
         "Y: " ++ show(ypos[i]) ++ "\n" | i in 1..8 ];

The output that I get is:

X: 4 Y: 8
X: 2 Y: 7
X: 7 Y: 6
X: 3 Y: 5
X: 6 Y: 4
X: 8 Y: 3
X: 5 Y: 2
X: 1 Y: 1

Now to find something else to procrastinate with..

Free (To Make Your Own Choices)

•19th June, 2009 • 4 Comments

Firstly, I have to say that I support open source software.

Now, one of my courses at uni this semester is Operating Systems. I don’t mind the course; I realised with slight shock while reading over the lecture slides for the upcoming exam that I actually found most – if not all – of the content of the course quite interesting. I like it.

But, one of the lectures was a bit interesting in another way. Towards the beginning of the course we were given a lecture entitled “System Software”. A very ambiguous title. As it turned out, the aim of this lecture was to convince any proprietary-software-loving folk in the audience that their views were wrong.

The lecture was incredibly biased, here are a spattering of memorable quotes from the lecture, (Module 2 – System Software, Operating Systems, University of South Australia):
Free software is… the freedom to use your computer, the way YOU want, not the way the marketing and legal department wants” (Very colourful words there, yeah, screw the system!)

(Regarding the EULA for Windows XP) “.. you have the right to do not all that much. You are barely allowed to even run it [the operating system]” (Barely allowed to even run it? If you install and run Windows on the average home computer, you are not breaking the EULA – and yes, I have read it).

Most vendors do not give you source code, so you cannot make changes to it or inspect it for security flaws” (Okay, I consider myself a decent programmer, average at the least – and I have never, ever even felt the need to go through the source code of an open source operating system to “inspect it for security flaws”. Who does that? Not me. If that’s one of the reasons to use open source, we must be scraping the bottom of the barrell..)

OS

This is a third year Operating Systems lecture slide. No joke.

There are lots of software engineers out there that do not have a clue, do you trust them with your airplane/life? Someone could put spying tools into the software they give you” (Scare tactics, much?)

Copy protection can stop you from using software you have legally purchased. What if the next version of Windows prevents a hardware dongle from working because there are no drivers. You may need to illegally crack your software to use software you are legally allowed to use!?!?!” (There really was that much punctuation, and the lecture failed to state the actual intent of copy protection).

The cost is free and you are not held to ransom by other companies who seek to control you for your money” (What…? Very colourful words again).

The lecture also gives a run down on Richard Stallman and names him as a visionary. But, of course, there’s no mention of the Steves, or Bill Gates, have they not contributed anything to operating systems over the years? Anything pre-Linux doesn’t exist.

The lecture continues to hammer in the point about free software being amazing, but why is there no mention of any other alternatives? Instead of the colourful words, why not give people some facts and figures, and some info about this horrible, deathly “proprietary software” thing, which is barely mentioned?

I’m all for open source, but I’m also for people being free to make their own decisions.

BASH and Rundle Mall

•12th May, 2009 • Leave a Comment

So… I am going to Adelaide very soon.  On Friday, to be precise.  (I am very excited!)  Searching through tourist information on the city, I came across a publicly accessible web-cam feed for Rundle Mall.  After finding this, I thought to myself “Wouldn’t it be cool if when I was in Adelaide, I got a photo of me and my friends taken by this web-cam.”  Unfortunately, there is a bit of a logistical problem here: How can I save the current web-cam shot when I am standing in Rundle Mall?

Enter BASH scripting.  With a few lines of BASH code, it is possible to save the current web-cam shot at a set interval for an indefinite period.

#!/bin/bash

#A short script to download timed snapshots of a file that undergoes regular updates.

#The url of the file
url="http://www.adelaidecitycouncil.com/netcatapps/webcam/images/rundle.jpg"
#This expression extracts the suffix part of the url from the url
suffixpart=${url##*.}
#The interval at which the file is fetched.
#N.B. Some sites may not take kindly to short intervals.
interval=5s

#Determine which command should be used for downloading given the current platform.
systemname=`uname -s || uname`
case $systemname in
    *Linux)
        cmd="wget $url -O"
        ;;
    *Darwin)
        cmd="curl $url -o"
        ;;
    *)
        cmd="wget $url -O"
        ;;
esac

#Infinite loop that does the downloading.
#The script must manually be interrupted to halt. 
while [ 1 ]
do
    datepart=`date "+%H%M%S"`
    $cmd $datepart.$suffixpart
    sleep $interval
done

The URL of the web-cam feed that the script downloads is easily changed by setting url (line 6) to a different URL string.  Changing the interval at which snapshots are taken is similarly simple.  I’ve made an effort to ensure that the script is compatible with a variety of platforms by performing a run-time check but it is likely that the script may not work on platforms other than Darwin (Mac OSX) as this was the testing platform.

Now all that remains is to leave this script running on a friend’s computer with web-access whilst visiting Rundle Mall.  By syncing a watch to the system time on the computer, it will even be possible to know which shots are relevant without viewing all the snapshots individually (as the filename for each snapshot reflects when it was taken).

My Old Console Addiction (Part II)

•24th April, 2009 • Leave a Comment

I have quite a few old game consoles*, but I only want to write about a couple that I really enjoy. The Gameboy Pocket has already been written about, so this is my other favourite out of my old consoles – the Atari 2600!

This 2600 is referred to as a "Vader" console, you can also get another 2600 which is black/gray and looks quite different (but plays the same cartridges, however).

This 2600 is referred to as a "Vader" console, you can also get another 2600 which is black/gray and looks quite different (but plays the same cartridges, however).

This was the first gaming console that I ever played. I’d even go as far as to say that this machine allowed me to play the first video games that I’d ever played – PC, console or otherwise. I believe this Atari 2600 was selling in the early eighties, and I remember playing it when I was around three – five years old in 1990-1992, so it would have been a little outdated when I had it.

Unfortunately, the console that I’ve got now, the one pictured, isn’t the one I played as a kid, but rather just another one that I purchased of the exact same model that I had. The one I had as a kid was taken to a pawn shop to make way for the next console that my family purchased (the Sega Mega Drive, and I do still have that very one)

I had to get my hands on one of these, there’s just something so cool about it to me – and I’m probably one of the only people who get excited about stuff like this – but how cool is it that this was once the best gaming console out? I played this for hours on end the same way that kids today play the PS3, and it seemed really exciting for the time – it’s a piece of gaming history! But even if you don’t think that’s as cool as I do, the games are still pretty wicked. Space Invaders still remains too hard for me, despite me being at least five times the age of when I first played it.

Here’s a shot of the games I have for it at the moment:

Games!

Games: Berzerk, Pacman, Bowling, Space Invaders, Othello, Missile Command, Basketball, Combat, Sprintmaster, Asteroids, River Raid II, Outlaw, Human Cannonball, Indy 500, Freeway, Slot Machine, Seaquest, Asteroids (again), Crystal Castles. And Kung-Fu Master, Summer & Winter Games.

Berzerk remains my favourite game; it’s just a classic running around with a gun shooting mindless robots kind of game. It used to scare me a bit as a kid, but it’s quite fun. It’s also noted as the first video game that someone has died playing (I think two did, actually). Another version of Berzerk on another console (don’t remember which one) was also one of the first (if not, the first) games to have voices in it.

Anyway, that’s enough mindless babbling for now.

*Other consoles I own include Sega Mega Drive II, Super Nintendo, Gameboy Color, Nintendo 64 and GameCube.

Super Mushroom!

•1st April, 2009 • 1 Comment

So, in a feat of amazing procrastination, Grant introducted me to CubeCraft. And the product of that is this Mushroom from Mario!

It's a Super Mushroom from Mario! (If you don't know what it is, get off this blog. Now.)

If you don't know what it is, then you don't belong here.

I should have been sleeping an hour ago, but it was worth it.

 
Follow

Get every new post delivered to your Inbox.