Category Archives: Code - Page 2

asciicasts.com

I just stumbled upon asciicasts.com, a cool site that has the goal of transporting the great railscasts.com episodes into plain text so it’s easier to run a full-text search on them. Another benefit is that it can provide translations to other languages, too! I contacted the webmaster a few days ago and will continue translating episodes into german and also set up a repository for coordinating the translation work at github. So if you’re into Ruby on Rails and you’d like to contribute to the community by simply translating a few episodes here and there, feel free to contact me on github or contact the webmaster of asciicasts.com!

These kinds of community-created additions to the rare high-quality tutorials or screencasts in the Ruby on Rails universe are vital! Rails 3 is going to be released somewhere in the near future and with it come lots of changes that many people might not know about.

Ooops, it’s 8 a.m. already… I’d better get up and hurry to my proper job and stop doing so much open-source crap :mrgreen:

The future’s wide open… open source!

Hey, I just released my very first contribution to the world of open source software! It’s basically not a really big thing but while I’ve been researching about a reasonable and stable multi-threaded producer/consumer problem implementation C#, I quickly found out that there are not many resources out there on that topic. Oh wait… That is to say: There are hefty amounts of resources on that topic, but all of them are just forum posts like “can you help me with that” without really helpful answers. A few hits I had were actually trying to solve the problem but most of them were contradicting the other possible solutions. I think you can see where this was going…

I expanded my search and eventually ended up deep-diving into the .net Framework and its crappy documentation and teaching all that fancy multi-threading stuff to myself. I came up with a small, probably helpful example that I wanted to share with the world 😉 It can be used in other projects because it’s completely generic and hides all the threading magic inside the three classes. If you think it’s too much overhead for your project or the way the produce() and consume() methods are called doesn’t fit into the workflow of your project, you still can check it out in order to learn a little bit.

I called it tspcp (thread-safe producer-consumer pattern) and just released it on github. Feel free to fork! :mrgreen:

Testing the syntax highlighting

Just installed a new plugin and want to test it. And what could be better than testing it in several programming languages at once?

# Language: Ruby
# This is so cool because it demonstrates how the String class itself gets opened and augmented
class String
     def say
         puts self
     end
 end
 'Hello, world!'.say
Language: Brainfuck
This is just weird (but funny!)
++++++++++[>+++++++>++++++++++>+++>+<<<<-]
>++.>+.+++++++..+++.>++.<<+++++++++++++++.
>.+++.------.--------.>+.>.
// Language: Objective-C
/*
Hmm... I don't really like this language but it's amazing that most parts
of Snow Leopard, Apple's latest operating system is written in this one
(or at least I think so)
*/
#import <stdio.h>
#import <objc/Object.h> 
 
@interface Hello : Object
{
}
- hello;
@end 
 
@implementation Hello
- hello
{
   printf("Hello, world!\n");
}
@end 
 
int main(void)
{
   id obj;
   obj = [Hello new];
   [obj hello];
   [obj free];
   return 0;
}
// Language: JAVA
// A classic
 public class HelloWorld
 {
      public static void main(String[] args) 
      {
           System.out.println("Hello, world!");
      }
 }
// Language: C#
// Looks almost like JAVA, feels kind of like JAVA, has a really bad IDE - in contrast to JAVA
class HelloWorldApp
{
    static void Main()
    {
        System.Console.WriteLine("Hello, world!");
    }
}
// Language: C
// What should I say? Almost everyone learns programming here!
 #include <stdio .h>
 
 int main(void)
 {
    printf("Hello, world!\n");
    return 0;
 }

I might be a little geeky, actually…

My workplace looks like this at the moment:

I have a desktop PC running Ubuntu Linux. On that machine, I have a Windows XP virtual machine (to be seen on the 30-inch monitor) and on the very right, there’s my Mac. Hmm. I’m seriously working with 3 OSes at the same time 😯

Winter mayhem, Code, Climbing, Solitude

Whoa, time flies when you’re busy, right? I am quite busy, actually 😉

So what has happened since my last post? Ah right, a new year started! Unfortunately, I could not attend the cool party I was invited to due to feeling sick for three days… But fortunately, I was invited to another party at my hometown so I decided to fill myself up with Aspirin and go there to meet lots of friends – of whom I’ve known some for almost 18 years already – at 11 p.m. :mrgreen:

The following days were very calm and peaceful: Just stayed at home, had great food and slept a lot. That’s always a good thing to do when you have the chance to! But on January 5th, I finally emerged from my laziness and hopped over to England where I rejoined the coding team of Booka. Ever since then, I barely left the house because I basically do nothing but working here 😎

England… It’s so funny! We got a little bit of snow here and the whole country descends into pure mayhem… Seriously – in many parts of Germany these amounts of snow are just normal and the same procedure as every year! But because the snow clearing services are not that good (or, seem not to be existing) here, it takes days or even weeks until several roads are clear again. Combined with the fact that snow tires are almost unknown here… Well, you can imagine what’s going on! 😉 All airports face severe problems, too!  So I can call myself lucky that I came home on December 24th without bigger delays… But the view I get to see is great:

Alright, back to my topic-checklist: climbing! Yes, climbing! Even though my skin has not yet recovered from my first attempts in December, I couldn’t resist going bouldering together with the other guys 😀 and now my hands are wrecked again… But it’s fun and I’ll just continue until my skin turns into leather :mrgreen:

Next topic? Ah yes, solitude. Solitude? You ask? Well, it seems we’re having some kind of epidemic here: Adrian’s sick, Booka’s sick, Miri doesn’t feel so well… So therefore I’m sitting at my desk all alone 🙁

My workplace

No comment :mrgreen:

Booka's and my workplace

Cereals’n’Java

Hello, world! I’ve been quite busy working here in England at a 14/6 pace and just didn’t find the time for blogging… Ok, that sounds worse than it actually is:

  • I’m coding together with my cousin Booka which is always fun
  • The project is really interesting and challenging
  • I finally get to use Java and not just study it in theory
  • We go climbing every now and then
  • We live in this fancy palace-like house
  • Everything’s taken care of: cooking, laundry, shopping, etc.

To be honest, it’s really cool here. I like working together with Bookie in this environment where everything’s tuned for maximum efficiency and creativity at the same time. The only problem is: We have three four-hour slots of work per day which drives your feeling of time totally bananas. At the end of one day, events from the very same day’s morning feel like as if they’ve happened two or three days in the past because one’s usually not adjusted to three half work days per day 🙂

But because it’s the Booka and he’s the biggest climbing-nerd I know, we often go bouldering or climbing and it’s awesome! Finally, I get to train that crap properly 😀 My very personal problem is: I’m too heavy for my forearms! Damn, gotta slim…

Alright, gotta start working. Here are two random pics:

London – A first summary

Hey! I’ve been here for a few days already and still no post? Sorry ’bout that, but I’ve just been busy coding with Booka! 😉 And even though this post and the one mentioning my flight here are called something with “London” I am not in London, actually… The house we’re living in is in a relatively small village near Sutton and it’s a blast! Huge rooms, too many bathrooms, extremely quiet etc. so we really can focus on the programming we’re supposed to do here.

Today finally, we had some free time and Booka, Wolle and me could stroll around in London, take some pictures and have a good time, of course :mrgreen: We rode the train to Victoria station (yeah, that’s the one that’s to be seen in almost every Harry Potter movie as “King’s Cross” because Mrs. Rowling mistook it for the latter, by the way) and took a walk from there. We passed by Buckingham Palace where by coincidence some ceremony was going on and we were forced to wait until it’s over 😉 After that, we crossed Green Park and finally arrived at Picadilly Circus. Haaah, finally. I’ve been here before and even though it’s like one of the no. 1 tourist-spots in the city, it’s actually quite lame and cool at the same time 😀 It feels like a tiny version of the Shibuya crossing, doesn’t it? Anyways, we had lunch and continued our trip in the direction to Trafalgar square and Chinatown and finally headed down to the Thames where we “met” Downing Street, Big Ben and The Eye.

After that we entered The Tube at Waterloo station and went to Tottenham Court Road where we took a long walk down Oxford Street, had some Starbuck’s coffee (which sucked, by the way) and went back to Leicester Square to have dinner. Eventually, Miri joined us and after having drinks at a nice bar, we finally cruised back home. And London traffic is hell – seriously. 9:30 p.m. and all roads are still packed with cars? Seriously folks, where do you all wanna go? Why don’t you ride your beloved Tube? :mrgreen:

Update: I just had to step up to that DDR machine… Just like the good ol’ times with my English class from school when we were in London back then! 😀

iPod Touch lottery at allyve.com

Hehe, I just found out about the lottery at allyve.com. They’re going to draw one iPod Touch 3G from all participants right here and I want to win 😉

If you don’t know what allyve.com is all about, read through the allyve-Tutorial. In my opinion, it’s a very cool idea (damn, to be honest, I was thinking about implementing something like this for a longer period of time but didn’t find the time to do it…). :mrgreen:

“All thumbs” (Grobmotoriker) – AS IF!

Hah, here’s proof that our robot was highly sophisticated and not just all thumbs at all

(@ Matze 😛 )