Euler Problems

January 29th, 2010

A collegue showed me the Project Euler website, a site with interesting and challenging problems to solve using a programming language of your choice. The fun part in most of these problems is to find a smart way to solve it rather than brute-force your way to a solution.

Take this challenge: how many months in the 20th century began on a Sunday? Remember that the 20th century began on January 1st 1901, and ended on December 31st 2000.

There are a few ways of solving this. Given VB.Net you’d be tempted to iterate through all years and months of the 20th century and use the built-in methods to get the day-of-the-week for each month. Then simply keep track of how many Sundays you find. But that’s not very satisfactory smart-wise.

Let’s say you have a language that does not have this built-in support. All you have is the number of days in each month, a way to determine if a year is a leap-year, and a reference point: January 1st 1900 was a Monday.

Continue reading this entry »

Uncategorized | No Comments | Trackback

Cronensteijn

January 24th, 2010

BrugCronensteijn

Uncategorized | 1 Comment | Trackback

Hooglandse kerk

January 17th, 2010

Ingang Hooglandse kerk
Looking up to see the angels

Enter Freely, And Of Your Own Free Will 
Enter freely, and of your own free will

Uncategorized | No Comments | Trackback

Restaurant no. 2

January 10th, 2010

I posted a picture of a restaurant near De Vliet not too long ago, and I came across this picture which may have been the source of the earlier one. I like this one much better than the overly-cropped first published picture. I can still see what I was trying to do (isolate the building on the right and show the darkness of the water), but the source material just doesn’t allow for it.

Restaurant aan de Vliet II

Uncategorized | No Comments | Trackback

Vlietlanden

January 10th, 2010

Vlietlandwolken

Uncategorized | No Comments | Trackback

Got me a part!

January 7th, 2010

I’ve auditioned at Imperium last Monday and Wednesday, for Eric Siebel’s play Sansevieria’s. I wasn’t a member of Imperium before, but since Marjolein told me it was a really friendly and young club and that there were semi-public auditions this week, I decided to take a look. Auditioning was very exciting, because I did not know any of the people there and I had no idea what to expect. So, trembling slightly with nerves and cold (nobody knew how to turn on the heater so it wasn’t until we were halfway through the evening that somebody else came round to do it for us). Everybody was very friendly and I was impressed by some of the things people showed on stage.

So I got a part in Sansevieria’s. Which means I am now also a member of Imperium! Rehearsals start next week, twice a week, and the premiere is somewhere in May. The cast consist of 11 people and the play is a comedy about burials.

Can’t wait! :D

Uncategorized | No Comments | Trackback

Bands I discovered in 2009

January 4th, 2010

As gathered from my iPod collection this morning:

Uncategorized | No Comments | Trackback

My 2009 list

December 24th, 2009

As 2009 is drawing to a close, I can’t help noticing (even though I try) that blogs around me are looking back on 2009 and summarize things by condensing them into top ten lists of best things, worst things, funniest things, or most unexpected things.

Now, I am not one to look back too much for fear of drowning in nostalgia and melancholy, but a hasty rerun of 2009 does bring some experiences to mind that made an impression on me, and that I would like to share with you. Some of these things are personal. I’m primarily writing this blog for myself, so you can skip them if you wish. They are # 5, 4, 3, 2, and 1.

Ok, here goes. My list of things in 2009 that will stay with me for a long time:

5. The death of my grandmother. She was the warmest person I know on this world. I hope I can do her memory justice by making an effort to be warm and open to others, including all strangers and people that I find annoying or stupid, and including those who are different.

4. Getting a new job at the CAK in Den Haag. I wanted to find a job that emotionally, intellectually and nerdy binds me, and I think I actually found it as medior system-developer in the .Net technology.

3. Breaking up with Aleksandra. It is hard to say goodbye to a dream, and I am very glad this dream turned into an enjoyable friendship.

2. Going on a holiday with Kirsten and Remco to Spain and France (and visiting Belgium, Luxembourg and Andorra as we went along). Never before did I go on a holiday with two people I barely knew, let alone spending 10 days with them in a car. We visited Ignasi in Barcelona, the Tour-de-France, some of Kirsten’s friends in France, Mont St. Michel, Omaha beach, the Tourmalet mountain (on foot!). I have taken a lot of openness from this holiday, and hope I can contribute to the Twitter and Couchsurfing community.

1. Visiting Auschwitz. Since meeting Aleksandra (who lives in the South of Poland) I have been reading about the concentration camps the Nazi’s built, and visiting Auschwitz in January 2009 has coloured my perception of the world. The mindless effort of those who built these camps and the incomprehensible loss I felt on the off-loading platform at Birkenau are so shocking that they will never leave me.

Uncategorized | No Comments | Trackback

Leiden in snow and darkness

December 19th, 2009

Fiets op brug

Oude Rijn

Nuon schoorsteen

Hooglandsekerkplein

Uncategorized | No Comments | Trackback

City grid in Processing

December 14th, 2009

I’ve taken a small step towards generating a city layout in Processing, by implementing a boxing-algorithm to divide space into smaller spaces. This algorithm is actually a lot simpler than I thought it would be, and it leaves a lot of opportunity to randomize its behaviour. My code is rather ugly, but it is a recursive method that breaks out when either the width or height of the current square is below a certain value. When broken out, it fills the square. Otherwise it continues to divide the square into two.

Here is the result of a fully drawn grid:
Full grid_small

And here is one where I tried to make the grid less obvious and more organic by leaving random plots empty:
City grid layout_520

All I need to do now is make the roads curved, so that the pattern doesn’t represent a modern city grid, but rather an ancient city center.

Uncategorized | No Comments | Trackback

About me

My name is Marco Hokke. My blog is about the things that interest me and things I might forget if I would not blog them.

Some of my favourite things are coding, photography, beer, theater and dance, Brian Eno's ambient music, Rammstein, purple, and reading.

Archives

Blogroll

Comics

Sites

Rijksmuseum

My Tweets

Currently Reading

Meta