Permacultuur - tuinieren voor luie mensen :)

Ik ben al een tijdje gefascineerd door biologisch tuinieren en dan met name “forest gardening” en “permaculture”. Bij deze laatste twee manieren van tuinieren probeer je zoveel mogelijk samen te werken met de natuur en imiteer je dingen die in de natuur goed werken. Hierdoor creeer je een klein ecosysteempje in je eigen achtertuin, waardoor je op den duur zelf nog erg weinig hoeft te doen. Tuinieren voor luie mensen zeg maar ;)

Als je bijvoorbeeld last hebt van veel Koolwitjes (de rupsen van deze vlinder verslinden je kool in no-time) dan kun je er maggiplanten (Lavas) omheen planten: de vlinders blijven dan bij je kool weg, ze kunnen niet tegen de geur van de maggiplanten.

Bij permacultuur heeft elke plant, elk beestje, maar ook elk object (gebouw, muur) meerdere functies.

Hieronder nog een mooi voorbeeld van permacultuur in actie: een wormencompost systeem: wees lui en laat wormen je tuin bemesten.

Deze post doet het onderwerp permacultuur eigenlijk geen recht, er is nog zoveel meer over te vertellen. Wie weet dat ik er later nog wat meer over schrijf. Als je Permacultuur ook interessant vindt, dan plaats maar even een reactie of stuur me een email.

Papa’s hebben ook gevoel

Vanmorgen hoorde ik bij Giel een schrijver een stuk uit zijn nieuwe boek voordragen, gecombineerd met een liedje (door Nina June) dat de sountrack (!) is van dat boek. De schrijver, Patrick van Rhijn, heeft een boek geschreven over zijn scheiding en de strijd om zijn dochtertje. Tijdens de slepende scheiding had al 3 jaar voor zijn dochtertje gezorgd, toen zijn zweedse vrouw het dochtertje kreeg toegewezen. Best heftig als je zoiets gebeurd.

Luister hieronder hoe Patrick een passage uit zijn boek voorleest en hoe Nina de soundtrack uitvoert. Ik hoorde het vanmorgen op de radio toen de zon net op kwam en kreeg er kippenvel van en een brok in mijn keel. Misschien raakte het me wel extra omdat ik nu ook een papa ben en er niet aan zou moeten denken om ons dochtertje Norah zo te moeten verliezen.

Vanaf nu is dit mijn persoonlijke blog!

Eerst wilde ik op deze blog over mijn vakgebied schrijven, over het web, in het engels. Aangezien deze blog echter op martinhietkamp.info draait heb ik besloten dat deze blog vanaf nu over persoonlijker dingen gaat.

Ik ben nog steeds van plan om over mijn vakgebied te schrijven. Dat ga ik op deze blog doen:

http://webwatching.wordpress.com/

Deze weblog zal ik een wat persoonlijker tintje gaan geven.

BarCamp Ordina | Wisdom 2008


Yesterday was the first BarCamp that I helped organizing (in fact it also was the first BarCamp I attended). Of course a lot of people helped me organizing and volunteered for activities during the BarCamp. It was also the first BarCamp that Ordina | Wisdom, the company I work form sponsored and helped to organize. I think it also was the first BarCamp in Groningen.

Although I got stuck in traffic and it took me two hours to get to the venue (normally it would take me 40 minutes), the Barcamp was a big success! Everybody I talked to really enjoyed it and was really inspired by the great talks and the opportunity to exchange ideas with other interesting people.

Personally, I had no idea what to expect from the Barcamp (even though I initiated and organized it), but I also enjoyed it very much. The Barcamp had a really nice informal atmosphere, lots of interesing people with interesting ideas and the quality of the talks was really good. A lot of people I talked to were also amazed by the fact that a low budget event that is free for the attendees (especially if you compare it to a normal conference where they charge people 1000 euro’s or more) could generate so much buzz and excitement and have so many high quality talks.

If you want to know more, visit the BarCamp site:

http://barcamp.wisdom.nl

Of course you can’t register anymore (the BarCamp was yesterday) but if you follow the weblog link you can read a couple of blog articles, see what people twittered during the Barcamp and find pictures. We will also put up some links there to the presentations (we asked everyone to post their talks to http://www.slideshare.net/tag/barcampwisdom2008) and the video’s when they are ready.

I would like to thank everyone who came to the BarCamp and made it such a big success! Next year we will definitely organize another BarCamp!

P.S.: I might even organize a small BarCamp myself in my own hometown Stadskanaal: not a really buzzing IT city (not even a city), but who knows what people live nearby? Oh well, maybe I am getting a bit too enthusiastic about the whole BarCamp thing now … :)

A stroke of insight

I found this talk from the TED conference really inspiring:

“Jill Bolte Taylor got a research opportunity few brain scientists would wish for: She had a massive stroke, and watched as her brain functions — motion, speech, self-awareness –- shut down one by one. An astonishing story.”

Really inspiring and moving. But also very hillarious :)

RailsConfEurope: I heart complexity

Last talk I followed today was titled “I heart complexity” by Adam Keys (http://therealadam.com/). It turned out to be quite an interesting talk.

Rails was designed to be as simple as possible, but sometimes you just have a complex application domain. Adam looked into making complex problems more tractable by splitting them up.

His approach:

1. Domain modelling
Domain Driven Design. Bring programming language up to level of domain (DSL?), and vice versa to the point where they meet. This will result in an ubiquitous language, which reduces the amount of documentation you will have to write. This is expressed in your code as Entities (e.g. ActiveRecord models), Values (these are the glue /metadata, non unique things e.g. money), Services (they tie things together to get things done, e.g. routingservice). Then focus on the essence: essence = domain + intention. This will result in less ceremony of your technology.

2. Stateful logic
Instead of flags, use a statemachine (e.g. use the AASM plugin)

3. Monies
Don’t use floats, use a Money object with currency and cents (integer). Tthere is a Money gem for this that can even convert between currencies.

4. Time Travel
You could use something like acts_as_versioned.

5. Asynchronous Processing
You could use a message queue for this.
Adam shows an example of keeping track of moderations to a product catalog that need to be approved. Instead of a messagequeue he uses a statemachine to model a queue. Nice example.

Resources

AASM plugin (state machine)
Money gem
acts_as_versioned

RailsConfEurope: How NOT to build a webservice

After a confusing and weird talk called Treading the Rails with Ruby Shoes by Eleanor McHugh and Romek Szczesniak (note to self: remember these names, I had the same weird experience with these people at RailsConfEurope 2006), I followed a talk titled How Not to Build a Service by Mike Perham of FiveRuns.

Quite an interesting and honest talk about the lessons they learned from building a (paid) webservice (a monitoring webapp for Rails apps). You can read the details in the slides. Worth the read if you ever want to run a startup that develops a product, but also if you develop a product for a client.

Interesting point he made was that you have to recognize when you are making a decision, keep track of them (e.g. document them) and determine your level of ignorance (how much do / don’t you know). Then determine what level of ignorance you are comfortable with / can afford.

Another intersting point he made was about groupthink (e.g. the whole group acts on the believes of a performance expert, but the expert does not have expertise on webapps. Then the group could obsess over the performance on the serverside, but looking at the images / css + js files / browser cache will make a much bigger impact on your webapps performance! See also post on Jeremy Kemp’s keynote).

Resources

Slides: later on conference site

RailsConfEurope: Advanced RESTful Rails

Next session was Advanced RESTful Rails by Ben Scofield of Viget Labs, which turned out to be an interesting in depth talk about advanced REST concepts and how to implement them in Rails. This talk and the talk RESTful Everything - Towards a Complete Resource-oriented Workflow yesterday, reignited my interest for REST (it kind of faded out a bit lately).

REST is basically about two things: resources (which don’t have to map to tables / models) and representations (each resources can have different representations e.g. book/1, users/1/favoritebooks/2).

RAILS implements REST quite nicely. Ben discussed some more advanced REST techniques that aren’t know very well or that are not used very often:

- singleton resources (e.g. for session, profile, password (for current user), search)
- namespaces (e.g. to group admin stuff)
- nesting
- polymorphism (e.g. “map.resources :user, :has_many => [:readings]” and “map.resources :book, :has_many => [:readings]“.
- custom routes (changing url’s and getting to views with a nice url)

There are a couple of plugins that try to DRY up RESTful controllers:

- resource_this
- resources_controller
- make_resourceful
Ben Scofield finds them too much magic and prefers to see the actual REST code. I tend to agree with him.

Modelling advice
Ben’s tips on how to get from a messy domain to a nice set of RESTful resources:
- identify resources
- select HTTP verbs to expose
Some tips:
- when in doubt, add a resource (you can also roll it up later = easier)
- respect the middleman (join models)
- resources != models

Examples:
- homepage /dashboard might be the index of a resource (look what it’s function is)
- Search: over a single resource then add filter with query param to index. Multiple resources? Then use a new (non-db) model (e.g. Searcher). Most cases you should use GET.
- Wizards (see slides)
- Bulk actions: Rails REST doesn’t handle bulk actions on resources well. Just override the normal map.resource with a custom route! (see slides)
- Transactions: can also be moddeled RESTfully (
- Administration: also no problem (use map.namespace, http basic auth)

Stumbling blocks (for Rails)
- Rails helpers (e.g. link_to … method => ‘delete’) are not very accesible
- default routing (in bottom of routes.rb) overrides all RESTful routest (they are not protected anymore). So remove it
- unused actions (e.g. formatted variations)
- collections (see previous comment on Bulk Actions)
- ARes Avalanche (always check server log)

At the end Ben also mentioned a couple of framework that might be worth looking at in the context of REST: Sinatra, Waves and Halcyon.

After the presentation I asked Ben for some advice for refactoring my controllers to be more RESTful. He gave some really good tips. Thanks for that Ben! If I implemented the RESTful controllers I might write a separate post on how I did that. I also bought the book RESTful webservices by Leonard Richardson and Sam Ruby, so it won’t be a long before I will be a REST guru too :)

resources
http://www.viget.com/extend
http://www.culann.com