First Google Wave experiments
October 7, 2009 at 10:16 pm | In Programming | 6 CommentsI did some initial experiments with programming for Google Wave. Basically I got the code from the tutorial and created a robot (called Dalek) which automatically translates the entered text (so called blips) from English to Spanish using the Java version of the Google Translate API. Screenshot of the result:

My first wave
Overall impression so far: very easy to use API. Google Wave itself can be terribly slow. Sometimes the syncing of ‘unsynced waves’ takes more than a minute. Next step: thinking of a more serious application.
And for those interested, the actual Java code:
package dalek;
import com.google.api.detect.Detect;
import com.google.api.translate.Language;
import com.google.api.translate.Translate;
import com.google.wave.api.AbstractRobotServlet;
import com.google.wave.api.Blip;
import com.google.wave.api.Event;
import com.google.wave.api.EventType;
import com.google.wave.api.RobotMessageBundle;
import com.google.wave.api.TextView;
import com.google.wave.api.Wavelet;
public class DalekServlet extends AbstractRobotServlet {
@Override
public void processEvents(RobotMessageBundle bundle) {
Wavelet wavelet = bundle.getWavelet();
if (bundle.wasSelfAdded()) {
addText(wavelet, "We are the Daleks");
}
for (Event e : bundle.getEvents()) {
if (e.getType() == EventType.WAVELET_PARTICIPANTS_CHANGED) {
addText(wavelet, "Exterminate... exterminate... exterminate");
} else if (e.getType() == EventType.BLIP_SUBMITTED) {
addTranslation(e.getBlip());
}
}
}
private void addTranslation(Blip blip) {
if (!blip.getCreator().equals("mjbvrijk@appspot.com")) {
String originalText = blip.getDocument().getText();
try {
Detect.setHttpReferrer("maurits.wordpress.com");
String translatedText = Translate.execute(originalText, Language.AUTO_DETECT, Language.SPANISH);
createChildBlip(blip, translatedText);
} catch (Exception e) {
createChildBlip(blip, "Translation failed");
}
}
}
private void createChildBlip(Blip blip, String s) {
addTextToBlip(blip.createChild(), s);
}
private void addText(Wavelet wavelet, String s) {
addTextToBlip(wavelet.appendBlip(), s);
}
private void addTextToBlip(Blip blip, String s) {
TextView textView = blip.getDocument();
textView.append(s);
}
}
Nice chess puzzle
September 27, 2009 at 1:49 pm | In Chess | 9 CommentsFrom a blitz game I played on FICS. I had the white pieces and could have (I didn’t see it) mated my opponent in 15 moves:

Mate in 8 moves
Try to solve it without the help of a computer.
I started using Twitter last week. My interest was triggered by a very cool workshop on programming in Scala that was given at the company I work for. Twitter has a nice API which is very easy to use from Scala or any other programming language. I still try to figure out what the business case could be for using Twitter, but for the moment it’s quite fun to do a few daily updates on what keeps me busy and/or interested.
My Twitter ID is @mauritsrijk (direct link). I probably am going to use it to give more frequent updates on my GIMP# activities.
Developing on Android
June 30, 2009 at 8:43 pm | In Programming | 2 CommentsI intend to buy an Android phone. It’s probably going to be the HTC Hero mainly because it’s almost available where I live and it also comes without a simlock, unlike for example the HTC Magic which is exclusive for Vodafone. Next I plan to develop some übercool applications but in the meantime I’ll start with porting a very old game I did more than a decade ago: it was called Groundhog. A screenshot:

Groundhog screenshot
So stay tuned for a Groundhog coming to your mobile…
GIMP# with Mono 2.4 and GIMP 2.6
June 8, 2009 at 1:38 pm | In C#, GIMP | 3 CommentsI finally took some time to get GIMP# up and running with the latest Mono and GIMP releases. Not sure how I’m going to continue from here, but I will probably first update the code with the latest C# language features. Also since GIMP 2.6 has been out now for more than half a year, I will only support this version. Stay tuned for a maintenance release soon!
Experiments with the Google Chart API
March 26, 2009 at 9:05 pm | In Programming | Leave a CommentIn 25 years of programming I blogged about the lines of code I have written in several programming languages. I am experimenting with the Google Chart API and created a graphical overview of my personal top 7. Result:
The url to generate the pie chart:
http://chart.apis.google.com/chart?cht=p3&chtt=Top+7&chts=0000ff,32&chd=t:100,70,20,20,5,5,2,3&chs=650x250&chl=C%20(100000)|C%23%20(70000)|Java%20(20000)|C%2B%2B%20(20000)|Pascal%20(5000)|PV~Wave%20(5000)|Basic%20(2000)|Other%20(3400)|
Hacking JIRA with Ruby
March 19, 2009 at 10:13 pm | In Programming | 3 CommentsI have been reading a lot over the last couple of months. Great books like “The World is Flat 3.0″, “Dreaming in Code”, “My Job went to India”, “The five dysfunctions of a team”, “Clean Code” and quite a few more. However I started to realize that although reading is fun, it tends to keep me in my comfort zone. I should really practice writing. People remember great writers. You hardly ever hear people saying “he was such a great reader” about a person that died hundred years ago.
So I just put down here what I’m doing at the moment. Lately I started to automate some things like writing progress reports for customers. Now please don’t stop reading at the word “progress report”. It might become a bit more interesting Continue reading Hacking JIRA with Ruby…
Writing GIMP plug-ins in Object Pascal
October 23, 2008 at 2:46 pm | In GIMP, Programming | 5 CommentsI slowly picked up GIMP# development again. To get my brain in the right mode I added a plug-in in yet another .NET language: Oxygene which is a kind of Object Pascal. From what I’ve seen it is a pretty decent language although I never understood why people would like to type 10 characters (“begin;” and “end;”) instead of 2 curly braces just to open and close a block
For those interested: currently I run Mandriva 2009 with VirtualBox 2.0.2 on my loyal MacBook Pro for development. The fancy IDE I use is called Emacs.
IronRuby and the Fan Programming Language will probably be my next targets.
The end is nigh
June 26, 2008 at 9:33 pm | In Ramblings | Leave a CommentJust recently is finished “Svartir Englar” by Ævar Örn Jósepsson (I read the Dutch version) although I was pretty bored after the first twenty pages. After finishing the book I realized that I should have stopped after those initial pages since this has just been a waste of my time. The question then came up how many books I was going to read about the end of my life. In his book “Metamagical Themas” Douglas Hofstadter learns us that it is actually pretty straightforward to come up with answers to questions such as “how many books are there in all the libraries in the world”. In my case it is far more easy: I will probably live for another 40 years and I finish 1 book per week on the average. So I still have about 2000 books to go. Might be a bit more or a bit less, but for sure I’m not going to finish 10.000 books.
How much shelf space will those books take? Let’s suppose those books are 2 cm thick on the average. That makes a total of 40 meter shelf space I need. In my house I have a wall that is 5 meter long. If I can put 8 shelves against that wall it will be completely covered with books. So my whole life that I have in front of me only fills one single wall.
Maybe I should start selecting my books a bit more critical
GIMP# 0.15 released
May 12, 2008 at 9:05 am | In C#, GIMP | 23 CommentsFinally a new GIMP# release. Major highlights for this release:
- Many improvements to get the Photoshop actions plug-in usable: 10 copyright-free actions are now verified and can be downloaded from SourceForge
- An abandoned plug-in to load GEM image files was ported
- The Russian translation was updated (thanks Alexandre!)
The next GIMP# version will be released as soon as I’ve got 20 correctly working Photoshop action files.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.