Solving a 18-year-old Core War mystery

Solving a 18-year-old Core War mystery

As some readers might know, I sometimes play a programming game called Core War. This afternoon I was browsing through some old ‘Core Warrior’ newsletters which John Metcalf has collected here. When reading an article about an old successful warrior called ‘Thermite II’ I came across this tiny unsolved mystery:

-- Bug?

John K.W. mailed me with a tiny, suicidal warrior which managed to beat
Thermite once in two hundred times. All I can imagine is that, that one
time, I somehow scanned his code within its few cycles of life, and that
then I crashed as a result. But how?

Program "Thermite II" (length 100) by "Robert Macrae"
;strategy Same old strategy, but nastier...
Killing Hazy Shade Of Winter III wins: 1
Thermite II wins: 199
Ties: 0

How did I get a win against Thermite?!?!
Here is an EXACT copy of what I sent to Pizza...
Thermite would've had to die within 3 cycles! ... :/

;redcode-94
;name Killing Hazy Shade Of Winter III
;kill Hazy Shade Of Winter III
;author John K W

p: ldp.b #0, #0
jmp <-1

Any ideas, anyone :-?

Source: http://corewar.co.uk/cw/cw024.txt

Read more...


Mosaic algorithm

Mosaic algorithm

Today I noticed a new blogpost by William, he wrote a small Python script to create mosaics from thumbnails.

As input he is using thumbnails from the Ludum Dare game programming contest.

To make such a program you basically need four things:

  1. A collection of thumbnails/photos/images to place
  2. Divide the target mosaic image into a grid of tiles
  3. Have a scoring/measuring method for each tile
  4. Have a placement algorithm

Read more...


Creating a chatterbot (Part 1)

Creating a chatterbot (Part 1)

Ever since the first time I heard about the Turing Test I’ve wanted to make my own chatbot. It started probably twenty plus years ago, when the only language I could program in was QBASIC. At that time I never got further than:

Hi computer!
Hello.

…. and now? ….

Current state

Since that first try (aged 10 or something) I’ve never tried to build another chatbot. But a couple of days ago I read a news article about the Loebner Prize, an annual event that tests the best chatbots in the world against some...

Read more...


Hacking your RunKeeper data

Hacking your RunKeeper data

This week I’ve started running/jogging, and I’m using RunKeeper on my iPhone to track my progress.

RunKeeper stores all the GPS data from your runs. This data is displayed per run, including a nice map of your route. Most important data can be reached throught the web interface, things like pace (min/km or min/mile) and distance. The most rewarding thing in running is breaking your own records, and RunKeeper has a couple of records:

  • Longest run (distance)
  • Longest run (time)
  • Most calories burned in a run
  • Fastest average pace
  • etc

As you can see, all those statistics...

Read more...


Stargazing: My first telescope

Stargazing: My first telescope

A couple of months ago I was in the Eifel area in Germany. Surrounded by forests and hills, completely dark, I looked up to the sky and the view was amazing. The milky way was stunning, and there were so incredibly many stars…

That is when I decided: I want a telescope!

Sky-Watcher Heritage 130p

After a lot of searching/reading I decided to go with an entry level Dobsonian telescope design. This type of telescope is usually cheaper to make, and easier to scale up; so for not a lot of money you get the most light-gathering...

Read more...


6 common traits of good programmers

6 common traits of good programmers

I’ve had a lot of colleagues in my career, some good, some bad, some absolutely fantastic. In this post I’ll go into some of the common traits that make them fantastic:

  1. Be inquisitive
  2. Share answers
  3. Community awareness
  4. Programmers pride
  5. Embrace laziness
  6. Spatial visualization

1: Be inquisitive

Always be inquisitive, if you encounter a problem the first thing all the great programmers do:

Google is your friend

This will bring you to StackOverflow questions, news groups, mailing lists, online documentation and more. This sounds very obvious but I’ve had a lot of colleagues that...

Read more...


Developers are (code) artists

Developers are (code) artists

Last week a manager went to an artist for a new painting in his living room:

M: “Hello Mr Artist. I’d like a painting from you”
A: “Hi Mr Manager, what kind of painting do you want?”
M: “It needs to be 100 cm by 50 cm, for in my living room”
A: “Yes, I see, what do you want on the painting? I do abstract art.”
M: “Something with a bit of green and blue”
… some more details …
M: “When are you done with the painting?”
A: “Probably in three...

Read more...


Review: Devoxx 2013

Review: Devoxx 2013

As promised, here is my write-up for Devoxx 2013, the best Java conference in the world (maybe on par with JavaOne).

Day 0

Having work to do I arrived tuesday evening, day zero.

Devoxx wristband

For the second year in a row there was no line at all picking up the awesome wristband with NFC chip. This already is much better than most conferences which have lanyards with huge badges (yes, I’m looking at you JFall!). The Devoxx NFC chip is used by sponsors to get your email address and it is also used to check off...

Read more...


Devoxx and my online identity

Devoxx and my online identity

This week I was at Devoxx 2013 in Belgium. Like the previous years I helped film the event. Together with other a couple of Devoxx4Kids organizers we also did a session and an informal BoF talk. I might do some more posts on the actual conference sessions later, lot of cool things to talk about, from making live music with Clojure and OverTone to flying quadcopters with digital bracelets.

Digital me

For me the biggest eye opener was during the pre-conference speakers dinner. Three times during this dinner/reception I was talking to someone and only...

Read more...


RuntimeExceptions within @Asynchronous methods

RuntimeExceptions within @Asynchronous methods

Since the introduction of EJB 3.1 we can use the @Asynchronous annotation. It provides a simple way to create a new asynchronous process in your application.

If a method with the @Asynchronous is invoked it will spawn a new thread and return immediately. The invocation can return either a void or a [Future][Future_T]. When returning a **Future** it starts out completely empty, but the @Asynchronous can return something called **AsyncResult** to fill the **Future** with a value. The original method can, at a later moment in time, call .get() or .get(long timeout, TimeUnit unit) to see the result of...

Read more...


Java 'default' methods, future problem?

Java 'default' methods, future problem?

In Java there is one golden rule, we don’t break backwards compatibility. Not in the JVM interpreter/compiler and not in the JDK classes.

Extending interfaces

With the introduction of Lambda’s in Java there was a suddenly a big need to extend some of the Collections interfaces. And this is something that breaks backwards compatibility. If Java wants to add List.forEach all custom implementations of the List interface won’t compile anymore. This breaks one of the most treasured rules in JDK development, the backwards compatibility.

default

To counter this the ‘default’ keyword is introduced. Just like an abstract method...

Read more...


OpenJDK and XKCD: Random number

OpenJDK and XKCD: Random number

A couple of days ago a our JPoint hackathon we discussed building (Adopt) OpenJDK. After finding out a better way to build OpenJDK on Windows (read it here), I’ve made my first improvement to OpenJDK.

This is a famous XKCD cartoon I wanted to implement:
getRandomNumber() { return 4; } // chosen by fair dice roll, guaranteed to be random

Where do we get started? Actually it turned out it is fairly easy to make this ‘improvement’. We just need to find the correct source file and do a build as described

Read more...


Building OpenJDK on Windows

Building OpenJDK on Windows

Tomorrow I’ll be enjoying an OpenJDK hack session with Martijn Verburg (aka The Diabolical Developer). To prepare for this session he told us to follow the AdoptOpenJDK build instructions.

Most cool developers today seem to be using OS/X, but some of us are stuck on Windows laptops. I actually choose to stick with Windows 7 because every single client I’ve worked for has Windows workstations and only require the application to run on Windows. But anyway Martijn said: “Getting OpenJDK to build on Linux/Mac would be easy, Windows can be dicey”

With a bit of Googling and some small...

Read more...


To be or not to be... Agile!

To be or not to be... Agile!

In my career I’ve seen a lot of misconceptions about Agile. And I’d like to do a step back and explain what being Agile means to me.

We ‘do’ Agile

This is the biggest misconception of all, and the main reason for my blogpost. Again and again I’m hearing people/companies say: “We do agile”. And this is just wrong… Agile isn’t some system you ‘do’. It isn’t a selection of things you can learn from a book. It is just a mindset and all the other stuff are consequences, let me explain that!

The meaning of ‘Agile’

If...

Read more...


Congratulations to Devoxx4Kids!

Congratulations to Devoxx4Kids!

If you haven’t heard about Devoxx4Kids, first read the following post and watch the video: here!

The people behind Java (Oracle) have recognized the great potential behind Devoxx4Kids and decided to award the ‘concept’ with a Duke’s Choice award!
This was presented to Stephan Janssen (the original mastermind behind the concept) at JavaOne this year. Because I filmed the original event and also our Dutch event in Amsterdam I was asked to make a very short impression video which was shown at the JavaOne Community Keynote.

You can see it here (including a great shout-out to me...

Read more...