Labels

3G (1) 8600GT (1) AI (4) amazon (1) API (1) apple (3) apple mail (1) atlassian (1) audio (1) bambo (1) Bamboo (1) bloat (1) boost (1) bugbear (1) C++ (5) calling conventions (1) cdecl (1) chromecast (1) CI (1) compiler (1) continuous integration (1) coursera (1) custom domain (1) debugging (1) deltanine (1) diagnosis (1) diy (5) DLL (1) dns (1) don't be evil (1) ec2 (1) education (1) electronics (1) express checkout (1) fail (6) fink (1) firewire (1) free hosting (1) GAE (1) google (1) Google App Engine (4) H170 (1) hackerx (1) hackintosh (1) Haskell (3) homebrew (2) i1394 (1) icloud (2) iOS 9 (1) ipad2 (2) jobhunting (2) lag (1) letsencrypt (2) libjpeg (1) linux (1) mac (2) mbcs (1) mechanic (1) memory (1) MFC (3) Microsoft (1) migration (1) ML (1) mobile (1) movi (1) MSBuild (1) music (1) naked domain (1) NLP (2) o2 sensor (1) obd (1) Optiplex960 (1) osx (1) outlook express (1) payments (1) paypal (1) photos (2) PIL (1) Project Euler (1) projectmix (1) python (2) raspberrypi (3) recruitment (1) renwal (1) skylake (1) soundcloud (1) ssl (2) stdcall (1) stripe (1) subaru (2) supermemo (1) supermemo anki java (1) sync (2) Telstra (1) tests (1) thunderbird (1) udacity (1) unicode (1) Uniform Cost Search (1) university (1) upgrade (2) vodafail (1) vodafone (1) VS2010 (1) vs2013 (1) VS6.0 (1) weather (1) win (1) Win32 (1) Z170 (1)

Tuesday 18 September 2012

The Knights Travail

Recently I was challenged to solve the Knights Travail in C++ - its a fairly simple problem in finding the shortest path between two squares on a chess board that would be legal moves for a knight piece.

The knight can move 2 squares across and 1 square up or down and vice versa. The positions on the chess board are represented using algebraic notation. There are a number of ways to solve this problem, but I chose a simple uniform cost search - which is like a bredth first search with each move on the chess board being having an equal cost, so the shortest path will always have the least number of moves. 

Because this challenge was to demonstrate my knowledge of C++, of course my solution is object oriented and completely over engineered. Anyway, you can find my solution here: The Knights Travail.

It's hosted on ideone.com so you can even execute it and put your own travails in. Just type them in to the input box down the bottom, eg: A1 B2

Happy Travailing!

Sunday 16 September 2012

Google weather api is dead... long live wunderground.com

Recently google retired their free weather api... it was never officially supported, and was always a private API, but nonetheless many, many applications came to rely on it, and were rudely broken last month when the api stopped working.

Anyway, this also broke http://sydneyinlinehockey.com, so after some research I settled on wunderground which has a pretty good replacent which is free for up to 500 requests a day. You have to apply for an api key to call it and the response can come back as xml or json. I prefer json as it is so easy to parse python.

It is this easy to call... what are you waiting for? Fix your apps with broken weather now!