Mrz 07 2012

Random Hacks of Kindness in Hamburg

Random Hacks of Kindness ist eine weltweite Organisation (www.rhok.org) die Programmierevents für einen guten Zweck veranstaltet. Zu diesen Events treffen sich Programmierer und Kreative sowie Aufgabensteller an einem weltweit koordinierten Termin um gemeinsam Software zu entwickeln die einen Unterschied macht. Die Aufgaben kommen von NGOs, Stiftungen und sonstigen gemeinnützigen Organisationen.

Bis jetzt haben die Events in Deutschland nur in Berlin stattgefunden, Zeit das ganze auch in Hamburg zu organisieren. Hamburg wird am 2. und 3. Juni erstmals an einem globalen Event teilnehmen. Organisiert wird das ganze von einer Gruppe von interessierten: Florian Holzhauer, Wolfgang Wopperer vom Betahaus und einer Gruppe von freiheit.com, zu der auch ich gehöre. Den Ort müssen wir noch wählen, aber wir haben da tatsächlich den Luxus das wir Auswahl haben.

Aktuell befinden wir uns in der Phase das wir Aufgabenstellungen suchen die einen lokalen Bezug haben, oder zumindest deren Ideengeber in Hamburg sitzen, damit diese an dem Event teilnehmen können. Dazu haben wir schon mal eine kleine Ankündigung bei der Socialbar gemacht. Um die Ideen schon mal für das Event vorzubereiten treffen wir uns am 27. März um 19 Uhr im Betahaus um schon mal über die Ideen zu sprechen. Dazu sind alle die Interesse haben herzlich eingeladen. Wenn ihr kommen wollt tragt euch in diesem Doodle ein, damit wir ein wenig Überblick haben wieviele Leute kommen.

Wir werden ein großartiges RHoK HH machen. Es gibt auch schon ein Twitter Account über den dann Neuigkeiten kommen werden: @RHokHH.

 

Permanentlink zu diesem Beitrag: http://blog.thiesen.org/archives/2012/03/07/random-hacks-of-kindness-in-hamburg/

Nov 23 2011

Programming Concurrency on the JVM

The fun thing about Venkat Subramaniam’s latest book is the way he jumps to and fro between a couple of JVM based languages: Java, Scala and Clojure. He shows interesting ways to do given tasks in different languages and introduces a couple of interesting frameworks I at least have not heard of before. The most interesting frameworks he shows are Akka, which is an Actor Based Concurrency Framework, written in Scala but which comes with an API that is just as well usabale from Java. Furthermore, I knew the concepts of Software Transactional Memory but did not know that there are working implementations for the JVM. One of them beeing Multiverse.

 

I really liked the book, because I really like the idea of using a framwork implemented in Scala through its Java API in Groovy. Sometimes it gets quite tiresome to have many of the same examples just shown in different languages, but it is always good to practice Scala or Clojure reading skills. If you feel safe in Java concurrency, i.e. you now Concurrency in Practice by heart, I warmly recommend this book.

Permanentlink zu diesem Beitrag: http://blog.thiesen.org/archives/2011/11/23/programming-concurrency-on-the-jvm/

Nov 21 2011

Secrets of the JS Console

For some reason, up to until three weeks ago, I didn’t know that there is more to an API in the JS console than “console.log”. They API has been defined by Firebug first and is now more or less considered standard in all major browsers. Here is a short list of usefull commands:


$$('.foo') // gives you a shortcut to querySelectorAll

$0 // gives you the result of the last executed call

$1 // gives you access to the currently selected DOM Element in the Inspect view

clear() // clears the console

time('foo') // start Timing for foo

timeEnd('foo') // end Timing for foo

inspect( domElement  ) // shows the given dom element in Inspect view

The documentation can be found either in the Firebug Wiki or at Chromes Devtools Docs.

Permanentlink zu diesem Beitrag: http://blog.thiesen.org/archives/2011/11/21/secrets-of-the-js-console/

Nov 20 2011

Code with style: “get” means Getter

Properties are always accessed via method calls on their owning object. For readable properties there will be a getter method to read the property value. For writable properties there will be a setter method to allow the property value to be updated.

Java BeansSpec  (08.08.1997)

These three sentences have done something weired to my brain. The somehow completely rewired my brain to believe that every method that starts with get means Getter. And this comes with a price: I usually expect a getter to be an O(1) operation. I expect it to be the same three bytecode sequence that is a simple field access and a return. Nothing more. The same goes for a method that starts with set. I don’t expect them to throw exceptions, I don’t expect them to talk to the filesystem or to the network. Just a simple field access, nothing more.

And I am not alone.

Most of the Java programmers are somehow hardwired to have this JavaBean asumption. So naming a method that does more than a simple get or a simple set to an object field should not be named get or set.  If it creates something name it “create”, if it finds something name it “find”, if it stores something name it “store”. You get the idea. As I’m always on the reading side of code, I believe that the these naming conventions are quite good, but they are not only a convention on how to name something, but also a convetion on how to not name things. So if it is not a getter, do not name it get! When looking for alternatives,  Stephen Colebourne did a nice collection on common prefixes in the Java world.

Permanentlink zu diesem Beitrag: http://blog.thiesen.org/archives/2011/11/20/code-with-style-%e2%80%9cget%e2%80%9d-means-getter/

Nov 18 2011

Google Merchant Module for ROME

Google Merchant is the way a company can feed their products into Google Shopping and ROME is a Java Library to create and parse RSS and ATOM feeds. Google Merchant allows RSS as one of the feed formats you can use to feed them their data. In order to get additional information into ROME created feeds you have to implement 4 classes, so it is not really easy to get your data there.

I created a small Library to make RSS feeds that conform to Google Merchants requirements:

        final SyndFeed feed = new SyndFeedImpl();
        feed.getModules().add( new GoogleMerchantModuleImpl() );

        final SyndEntry entry = new SyndEntryImpl();

        entry.setTitle( "Title" );

        final GoogleMerchantModule merchantData = new GoogleMerchantModuleImpl();
        merchantData.setImageLink( "SOME IMAGE URL" );

        entry.getModules().add( merchantData );

It’s under MIT License up in Github, you can direct download the Version 0.1 here.

Permanentlink zu diesem Beitrag: http://blog.thiesen.org/archives/2011/11/18/google-merchant-module-for-rome/

Ältere Beiträge «