Gopher Client Aug. 16, 2016 in Java, University
I’ve made a rudimentary gopher client using Java and JavaFX. Download from GitHub.
NES Emulator Jun. 14, 2016 in Games, Java, Simulations
An Imperative Stream Programming Language Apr. 28, 2016 in Algorithms, Text, University
This is the user manual for the Aqua programming language created as part of Programming Languages and Concepts. Visit the project on Github.
Aqua is a C-like imperative language, for manipulating infinite streams. Statements are somewhat optionally terminated with semicolons, and supports both block ( /* ... */)
and line comments ( // ...)
.Curly brackets are used optionally to extend scope. Example code can be found in the Appendices.
Before continuing, it’s helpful to familiarise yourself with Extended BNF. Special sequences are used to escape.
Usage Instruction
Once the interpreter has been compiled using the make
command, you can choose to run an interactive REPL or a stored program. Executing ./mysplinterpreterwith
no arguments will start in an interactive REPL . You should save your program files as <filename>.spl
and pass the location as the first argument to ./mysqlinterpreter
. As data is read from standard in, you can pipe files in using the <
operator, or pipe programs in using the |
operator, allowing you to create programs that manipulate infinite streams.
- Starting the interactive REPL:
./mysplinterpreter
- Executing a saved program:
./mysplinterpreter <file> [ < <input> ]
- Using infinite streams:
<program> | ./mysplinterpreter <file>
Programs are executed in multiple stages:
- Entire program is loaded into a string (Unix line endings required)
- Program is lexed into Tokens
- Tokens are parsed into an Abstract Syntax Tree (Left associative with the exception of lambdas)
- Types are checked to ensure logical behaviour
- Finally the Abstract Syntax Tree is executed
Experimenting with Microsoft Hyperlapse Apr. 9, 2016 in New zealand, Singapore, Videos
Whilst abroad I put Microsoft Hyperlapse to the test, first in Singapore, then in New Zealand.
Then Stopping off in Singapore Apr. 7, 2016 in Photos, Singapore, Travel
Flying Direct to New Zealand Apr. 5, 2016 in New zealand, Photos, Travel
This year I returned to New Zealand. Last time, I explored the country on a road trip, this time, I explore the North Island, and spend time with family.
Auckland
Whitianga
Cathedral Cove
Waiheke
Auckland
CodeCon Finals at Bloomberg HQ Jan. 30, 2016 in Algorithms, Competitions, London, Photos
This week I had the pleasure of competing in the CodeCon Grand finals at Bloomberg’s London headquarters. While unfortunately I didn’t do that well, visiting the headquarters and exploring London was great fun. I didn’t take any pictures inside the event, I thought I would share a few photos taken on during my trip.
The day after the competition, I left the hotel and set of through the city. The Museum of London was nearby, so I checked it out. While there it started raining and a rainbow appeared. Then, a quick walk lead me to St. Paul’s.
While, crossing the Millennium Bridge I took two panoramas of the Thames. Unfortunately the day was overcast, and so the pictures are rather gray.
Finally ending my trip inside the Tate Modern where I saw Abraham Cruzvillegas Empty Lot filling the Turbine room.
The Twelve Days of Rentmas Jan. 24, 2016 in Music, Text
On the first day of renting, My landlord gave to me: A junk pile in the garden.
On the second day of renting, My landlord gave to me: Two dark toilets, And a junk pile in the garden.
On the third day of renting, My landlord gave to me: Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the fourth day of renting, My landlord gave to me: Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the fifth day of renting, My landlord gave to me: Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the sixth day of renting, My landlord gave to me: Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the seventh day of renting, My landlord gave to me: Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the eighth day of renting, My landlord gave to me: Eight worn out cabinets, Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the ninth day of renting, My landlord gave to me: Nine house showings, Eight worn out cabinets, Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the tenth day of renting, My landlord gave to me: Ten disturbances, Nine house showings, Eight worn out cabinets, Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the eleventh day of renting, My landlord gave to me: Eleven cracks tears and bumps, Ten disturbances, Nine house showings, Eight worn out cabinets, Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
On the twelfth day of renting, My landlord gave to me: Twelve quid less a day, Eleven cracks tears and bumps, Ten disturbances, Nine house showings, Eight worn out cabinets, Seven failed traps, Six rats a hiding, Five dank bedrooms, Four wonky desks, Three leaking sinks, Two dark toilets, And a junk pile in the garden.
How to play Grabble Jan. 15, 2016 in Games, Rules, Text
Grabble is a fast-paced word game where players take it in turns to flip over tiles, form words, and steal words from other players. I was taught the game by Samson Danziger, and I am writing this as from a brief search, there is little information on it.
Setup
If missing a set of Scrabble tiles, any similar set of letter tiles will do, or they can bought for a few quid from many online retailers.
- Every player grabs a scrabble tile from the bag, highest value starts, repeat until one victor.
- Spread a set of scrabble tiles, one layer thick on a table.
- Turn each tile over so it is face down.
It is recommended that a dot, question mark, or asterisk is added using a permanent marker to one face of each wild-card to reduce confusion when turned over.
Gameplay
Players turn over tiles one at a time trying to form words at least three tiles long, extend existing words, or steal words from an opposing player. When successful, that player is now the next player to turn over a tile.
- Words must always be at least three tiles long. Shorter words do not count.
- Words can be extended by adding tiles from the centre, combining with other words, or both. When combining words there cannot be any tiles ‘left over’, all tiles must make their way into the new word.
- Words can be stolen (or protected) by rearranging their tiles into a new order. For example if a player claims
T
E
A
, another player can claimE
A
T
. If the first player is clever they can then claimA
T
E
to claim it back.
The game ends when all tiles are flipped and players agree that no more words can be improved or rearranged. This should not take longer than a couple of minutes. Players can enter and exit the game at any time, simply watch the game until they can get a word of their own. If they wish to leave, words remain in play and other players can steal the words when possible.