<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Christian Kaula</title><link href="http://christiankaula.com" rel="alternate"></link><link href="http://christiankaula.com/feeds/all.atom.xml" rel="self"></link><id>http://christiankaula.com</id><updated>2011-11-16T20:25:00Z</updated><entry><title>RESTful Web Applications: Code Less, Do More</title><link href="http://christiankaula.com/restful-web-applications-code-less-do-more.html" rel="alternate"></link><updated>2011-11-16T20:25:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-11-16:/restful-web-applications-code-less-do-more.html/</id><summary type="html">&lt;p&gt;What does web development mean? Usually you build some software that gets data out of some database converts it to HTML and sends it to a browser. Usually that software has to handle the other case, too: Receive input from a browser, make sense of it and write the data into the database. There’s your average web project. &lt;/p&gt;
&lt;p&gt;But, since this is the age of responsive web design, AJAX and web apps, you aren’t done yet. Now you code a bunch of JavaScript, that does the same stuff client-side. Chances are good, you will have to write quite some server-side code for this, too.&lt;/p&gt;
&lt;p&gt;Doesn’t sound very &lt;a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself"&gt;DRY&lt;/a&gt;, you say? Some other people had the same thought. They created &lt;a href="http://django-tastypie.readthedocs.org/en/latest/index.html"&gt;frameworks&lt;/a&gt;, &lt;a href="http://nodejs.org/"&gt;environments &lt;/a&gt; and whole &lt;a href="http://opalang.org/"&gt;programming languages&lt;/a&gt; to counter the problem. But why go for solutions, that are that complicated?&lt;/p&gt;
&lt;h2 id="rest_to_the_rescue"&gt;REST to the rescue&lt;/h2&gt;
&lt;p&gt;Why not try this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write a REST API that translates your data to JSON.&lt;/li&gt;
&lt;li&gt;Write a (semi-)static HTML page.&lt;/li&gt;
&lt;li&gt;Write JavaScript that talks to the API and translates the data for the user.&lt;/li&gt;
&lt;li&gt;Be done.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some people call this client-side assembled web applications. I call it good design. It separates business logic (server-side) from the presentation layer (client-side). A bunch of benefits comes with it, for free. Want a native client for mobile devices? Just put a new interface on top of the API. Need an API for third party developers? You already got one. How about performance? Pure JSON data most likely is smaller than complete server-side rendered HTML pages.&lt;/p&gt;
&lt;p&gt;And don’t tell me this isn’t feasible because it requires JavaScript. Even &lt;a href="http://googlewebmastercentral.blogspot.com/2011/11/get-post-and-safely-surfacing-more-of.html"&gt;Googlebot is JavaScript enabled&lt;/a&gt; these days. &lt;a href="http://esn.me/showcase/battlelog/"&gt;Big players&lt;/a&gt; are &lt;a href="http://lucumr.pocoo.org/2011/11/15/modern-web-applications-are-here/"&gt;doing client-side web applications&lt;/a&gt; already. And if you say &lt;em&gt;but this is hard!&lt;/em&gt;, I recommend reading up on &lt;a href="http://documentcloud.github.com/backbone/"&gt;Backbone.js&lt;/a&gt;.&lt;/p&gt;</summary><category term="rest"></category><category term="webapps"></category><category term="architecture"></category></entry><entry><title>How to Handle Database Views in Django/South</title><link href="http://christiankaula.com/how-to-handle-database-views-django-south.html" rel="alternate"></link><updated>2011-11-14T19:43:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-11-14:/how-to-handle-database-views-django-south.html/</id><summary type="html">&lt;p&gt;In a recent Django project I had to work with Postgres views quite extensively. The problem is that while &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; does a great job handling model related stuff, you’re on your own when handling views and other database level stuff. So I thought I’d share the simple/simplistic solution I came up with.&lt;/p&gt;
&lt;h2 id="hand_written_migrations"&gt;Hand written migrations&lt;/h2&gt;
&lt;p&gt;Since South doesn’t provide much help in writing views for you, you will write your migrations by hand. So let’s add a dandy new view to our database.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# migration 0001&lt;/span&gt;
&lt;span class="c"&gt;# (…) imports and such&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SchemaMigration&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        CREATE VIEW fancy_view AS&lt;/span&gt;
&lt;span class="s"&gt;        SELECT aCol, bCol&lt;/span&gt;
&lt;span class="s"&gt;        FROM stuff&lt;/span&gt;
&lt;span class="s"&gt;        ;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;backwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        DROP VIEW fancy_view;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# (…) loads of frozen models&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now that wasn’t too bad, right? Oh, but now we forgot all about &lt;em&gt;cCol&lt;/em&gt;. No sweat, let’s just write another migration to fix that.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# migration 0002&lt;/span&gt;
&lt;span class="c"&gt;# (…) imports and such&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SchemaMigration&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        DROP VIEW fancy_view;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        DROP VIEW fancy_view;&lt;/span&gt;
&lt;span class="s"&gt;        CREATE VIEW fancy_view AS&lt;/span&gt;
&lt;span class="s"&gt;        SELECT aCol, bCol, cCol&lt;/span&gt;
&lt;span class="s"&gt;        FROM stuff&lt;/span&gt;
&lt;span class="s"&gt;        ;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;backwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        DROP VIEW fancy_view;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="s"&gt;        CREATE VIEW fancy_view AS&lt;/span&gt;
&lt;span class="s"&gt;        SELECT acol, bcol&lt;/span&gt;
&lt;span class="s"&gt;        FROM stuff&lt;/span&gt;
&lt;span class="s"&gt;        ;&lt;/span&gt;
&lt;span class="s"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# loads of frozen models (…)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Okay, that kinda sucks. Now we have to repeat the forward SQL part of migration 0001 in the backwards part of migration 0002.&lt;/p&gt;
&lt;h2 id="what_about_dependent_views"&gt;What about dependent views?&lt;/h2&gt;
&lt;p&gt;And the above example didn’t mention views that depend on each other. Let’s say we have two views, &lt;em&gt;fancy_view&lt;/em&gt; and &lt;em&gt;depending_view&lt;/em&gt;. The drill would look something like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Write migration 0001 for &lt;em&gt;fancy_view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Find out you need &lt;em&gt;depending_view&lt;/em&gt; which depends on &lt;em&gt;fancy_view&lt;/em&gt; because it joins in some stuff from there.&lt;/li&gt;
&lt;li&gt;Write migration 0002 for &lt;em&gt;depending_view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Find out you need to change something in &lt;em&gt;fancy_view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Write migration 0003 which takes care of this:&lt;ol&gt;
&lt;li&gt;Drop &lt;em&gt;fancy_view&lt;/em&gt; and all that depends on it.&lt;/li&gt;
&lt;li&gt;Recreate &lt;em&gt;fancy_view&lt;/em&gt; with changes.&lt;/li&gt;
&lt;li&gt;Recreate &lt;em&gt;depending_view&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Does the same stuff migration 0002 does in &lt;em&gt;forwards&lt;/em&gt; in &lt;em&gt;backwards&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is anything but simple anymore and as such prone to error. Sure you can do a lot with copy and paste but it’s really easy to make mistakes there. (Trust me on that one…)&lt;/p&gt;
&lt;h2 id="why_can+t_my_computer_do_that_for_me"&gt;Why can’t my computer do that for me?&lt;/h2&gt;
&lt;p&gt;Here’s what I came up with: I put my views in SQL files named after the migration they occur in. So for migration &lt;em&gt;0001_add_fancy_view.py&lt;/em&gt; there could be a &lt;em&gt;0001_fancy_view.sql&lt;/em&gt; and a &lt;em&gt;0001_other_fancy_view.sql&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;So let’s assume the situation described above: In migration 0002 we added a view named &lt;em&gt;depending_view&lt;/em&gt; that somehow depends on &lt;em&gt;fancy_view&lt;/em&gt; which was introduced in migration 0001. Now in migration 0003 we want to change something in &lt;em&gt;fancy_view&lt;/em&gt;. For that we have to drop &lt;em&gt;fancy_view&lt;/em&gt; and everything that depends on it and build it up from the ground again.&lt;/p&gt;
&lt;p&gt;This is what that migration could look like:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# 0003_change_fancy_view.py&lt;/span&gt;
&lt;span class="c"&gt;# (…) imports and such&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;file_name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SchemaMigration&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c"&gt;# get rid of fancy_view and all depending views&lt;/span&gt;
        &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;DROP VIEW fancy_view CASCADE;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;# update fancy_view&lt;/span&gt;
        &lt;span class="n"&gt;run_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;0003_fancy_view.sql&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;# re-add depending_view&lt;/span&gt;
        &lt;span class="n"&gt;run_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;0002_depending_view.sql&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;backwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c"&gt;# get rid of fancy_view and all depending views&lt;/span&gt;
        &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;DROP VIEW fancy_view CASCADE;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;# re-add the old version of fancy view&lt;/span&gt;
        &lt;span class="n"&gt;run_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;0001_fancy_view.sql&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;# re-add depending_view&lt;/span&gt;
        &lt;span class="n"&gt;run_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;0002_depending_view.sql&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# (…) loads of frozen models&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Much nicer, in my humble opinion. We let the computer handle most of the boring parts and concentrate only on the order that things should be handled in. Sure there’s loads of room for improvement but it gets the job done.&lt;/p&gt;</summary><category term="database"></category><category term="django"></category><category term="postgres"></category></entry><entry><title>Entrepreneurship Summit 2011 Thoughts</title><link href="http://christiankaula.com/entrepreneurship-summit-2011-thoughts.html" rel="alternate"></link><updated>2011-11-03T11:07:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-11-03:/entrepreneurship-summit-2011-thoughts.html/</id><summary type="html">&lt;p&gt;Sorry for being a bit late with this but after coming back on sunday I seem to have caught a virus (not the digital kind). Anyway, here are some thoughts on the &lt;a href="http://www.entrepreneurship.de/summit/10-2011/"&gt;Entrepreneurship Summit 2011&lt;/a&gt; in Berlin.&lt;/p&gt;
&lt;h2 id="useless_freebies_don+t_work"&gt;Useless freebies don’t work&lt;/h2&gt;
&lt;p&gt;This might be one of my pet peeves. Free ball pens are great. Not so much if mentioned ball pens suck. The ones given out at the Entrepreneurship Summit 2011 looked pretty slick, almost like old school pens really. So I pulled off the cap and wanted to put it on the back of the pen. Won’t fit. Where do I put the cap so I wont lose it then? I put it somewhere on my clothes and start the first writing test.&lt;/p&gt;
&lt;p&gt;Surprise number 2: This actually isn’t a ball pen but a rollerball pen. Meaning it uses a kind of ink that is a lot more liquid than your regular ball pen ink. Meaning one will probably smudge all over the place. A hidden bonus of this: I saw quite a few people with blue fingers (including me).&lt;/p&gt;
&lt;p&gt;So what do you do with a ball pen that isn’t a ball pen and generally is pretty useless? I don’t know but I can tell you what you probably won’t do: use it. And since nobody will use it the grassroots effect (“oh hey what’s an Entrepreneurship Summit as it reads on your ball pen?”) is lost.&lt;/p&gt;
&lt;h2 id="do_it_yourself_networking"&gt;Do it yourself networking&lt;/h2&gt;
&lt;p&gt;What intrigued me the most about the description of the event were the mentions of networking events. It seemed to me the hosts are really keen on bringing people together and helping entrepreneur-hopefuls building a network they can go from. There were mentions of ‘speed dating’ events, you had to register so you had a chance to be paired with the right people and so on.&lt;/p&gt;
&lt;p&gt;Pretty much nothing of this happened as far as I can tell. Granted I was about an hour late to the networking event on saturday evening. But all I did see was people stepping on a little stage and telling the others about their idea and who their are searching for in a few sentences. Sure this isn’t exactly nothing but this aspect can and needs to be vastly improved.&lt;/p&gt;
&lt;p&gt;A few ideas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;give people a topic and make them talk to each other for a few minutes about it (I hear something like that has been done in one of the impulse groups)&lt;/li&gt;
&lt;li&gt;give out soft balls to people and let them throw it into the crowd - whoever catches it is your conversation partner for the next few minutes&lt;/li&gt;
&lt;li&gt;actually do the speed dating thing&lt;/li&gt;
&lt;li&gt;do all of the above throughout the whole event and use it as a replacement for the completely pointless podium discussions&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="solid_event_needs_improvement"&gt;Solid event, needs improvement&lt;/h2&gt;
&lt;p&gt;Don’t take my mostly ranty post as a sign that I didn’t like the whole event. Quite the opposite. Take everything I didn’t mention as a thumbs up. There were some really interesting impulse groups, I met a few interesting people, I learned quite a lot and the whole thing gave me a whole bunch of new ideas.&lt;/p&gt;
&lt;p&gt;If you are thinking about the entrepreneurship thing yourself this definitely is an event you shouldn’t miss. You will get the chance to meet people that do or did exactly the same thing and know the problems and a few tricks to get around them.&lt;/p&gt;
&lt;p&gt;But my number 1 complaint still stands: the actual networking really paled in comparison to the amount of talk about how important networking is. This needs to be changed for the Entrepreneurship Summit 2012. If it is this will be big step towards an event I can wholeheartedly recommend.&lt;/p&gt;</summary><category term="entrepreneurship"></category><category term="networking"></category><category term="event"></category></entry><entry><title>Improving Copy: EntryDNS</title><link href="http://christiankaula.com/improving-copy-entrydns.html" rel="alternate"></link><updated>2011-10-25T12:15:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-10-25:/improving-copy-entrydns.html/</id><summary type="html">&lt;p&gt;&lt;a href="http://entrydns.net/pages/home"&gt;&lt;img alt="image" src="http://christiankaula.com/static/images/entrydns.net.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Above you are looking at the front page of &lt;a href="http://entrydns.net/pages/home"&gt;EntryDNS's homepage&lt;/a&gt;. Quick, tell me what they are selling. &lt;em&gt;Some kind of free DNS service?&lt;/em&gt; I couldn’t tell either. Let’s see if we can make their copy simpler, more to-the-point.&lt;/p&gt;
&lt;h2 id="what_does_it_do"&gt;What does it do?&lt;/h2&gt;
&lt;p&gt;Let’s see what their about page says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;With our service you can create hosts or host your own domains, manage them from the web application or use our API's (simple API and complete REST API) to automate tasks as you wish.&lt;br /&gt;
The service gives you a total control of your DNS records without any restrictions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And this Furthermore these are the listed benefits:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Have total control over your domains and records&lt;/li&gt;
&lt;li&gt;Host your web site using your own internet connection&lt;/li&gt;
&lt;li&gt;Access your computer using a domain name instead of a numerical IP address&lt;/li&gt;
&lt;li&gt;Use your home dynamic IP and always have your domain pointing to it&lt;/li&gt;
&lt;li&gt;Spend your money on more important things&lt;/li&gt;
&lt;/blockquote&gt;

&lt;h2 id="tell_me_in_simpler_terms"&gt;Tell me in simpler terms&lt;/h2&gt;
&lt;p&gt;To me it seems their focus lies on two groups. Their front page copy seems to target professionals that need customization and automatization. The about pages seems to speak to private enthusiasts that want to host some websites from home.&lt;/p&gt;
&lt;p&gt;Why not simply let people know:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We provide a kick-ass DNS, for free. Automate your  industry-size project with our API or set and forget to access your home PC from anywhere. Did we mention it’s easy?&lt;br/&gt;
&amp;lt;insert easy example here&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It’s kick-ass, it’s free - people like that. The BigFatCo executive might see it and think:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Automatization means less work. Nobody likes work. I probably should tell Bob from IT. This might just save us millions!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While Joe Shmoe sees it and ponders:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I always wanted to access my home computer from anywhere. But Bob from IT tells me its really complicated. This seams &lt;em&gt;easy&lt;/em&gt;, though. I might just have to try it out.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My advice would be to focus on only one group, though. It may be hard to believe for Joe Shmoe that something BigFatCo uses is easy enough for him. Just like the executive of BigFatCo might think Joe Shmoe’s favorite DNS toy can’t possibly be a fit for his multi-billion dollar corporation.&lt;/p&gt;
&lt;p&gt;I’m in no way affiliated with EntryDNS in case you wonder.&lt;/p&gt;</summary><category term="copy"></category><category term="entrydns"></category></entry><entry><title>How to Come Up With a Good Product Idea (As a Coder)</title><link href="http://christiankaula.com/how-come-up-good-product-idea-coder.html" rel="alternate"></link><updated>2011-10-18T09:50:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-10-18:/how-come-up-good-product-idea-coder.html/</id><summary type="html">&lt;p&gt;Recently I submitted my post &lt;a href="http://christiankaula.com/how-make-better-analog-watch.html"&gt;How to make a better analog watch&lt;/a&gt; to Hacker News. My idea was thwarted, of course (I got the feeling I didn’t describe the idea very well, though). But &lt;a href="http://news.ycombinator.com/item?id=3108350"&gt;one comment&lt;/a&gt; really made me ponder how to break out of the &lt;em&gt;this-is-the-way-it-is-done&lt;/em&gt; thinking.&lt;/p&gt;
&lt;h2 id="what_are_you_doing_all_the_time"&gt;What are you doing all the time?&lt;/h2&gt;
&lt;p&gt;First question you have to ask yourself: &lt;em&gt;“Is there something I do very often?”&lt;/em&gt; &lt;em&gt;Something&lt;/em&gt; in this context can be pretty much anything: Look up words online, visit a certain site for news, share photos with your friends, buy groceries, walk the dog, look up the time. You get the idea.&lt;/p&gt;
&lt;p&gt;In my case it was looking up the time. I do that all day long pretty much. Chances are you do, too. Realizing what it actually is you do all the time is the hard part. Everybody is looking up the time, &lt;em&gt;all&lt;/em&gt; the time. It’s hard to realize you do something that often because, well, you do it so often. We tend to forget the obvious.&lt;/p&gt;
&lt;h2 id="how_many_steps_from_a_to_b"&gt;How many steps from A to B?&lt;/h2&gt;
&lt;p&gt;So now that you have identified something you do often/spend much time on. Now let’s see what a person who writes code does. &lt;em&gt;”Write code, duh.”&lt;/em&gt; I hear you say. And we are right on topic.&lt;/p&gt;
&lt;p&gt;The prime task of a programmer is to break a problem down to its atomic parts. Computers are really dang stupid. &lt;em&gt;“Computer, greet the world.”&lt;/em&gt; doesn’t work. You have to tell it &lt;em&gt;exactly&lt;/em&gt; what to do. Tell it exactly what to say (&lt;em&gt;“Hello World”&lt;/em&gt;), when to say it (&lt;em&gt;“as soon as I run this program”&lt;/em&gt;) and where to say it (&lt;em&gt;“the prompt”&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Reading an analog watch doesn’t happen just like that. We might do it as effectively as we do because we have a lot of training. But that neither says anything about how many steps it takes nor about how many of them are necessary. Which leads us to the next question.&lt;/p&gt;
&lt;h2 id="can_i_skip_some_of_the_steps"&gt;Can I skip some of the steps?&lt;/h2&gt;
&lt;p&gt;Well can you? Why do I have to enter the project I’m working on every time I create a ticket in my time tracker? Why do I need to give up my email if I want to register on a site? Why does my word processor ask me if I want to save this empty document?&lt;/p&gt;
&lt;p&gt;If you can’t give a good answer right on the spot you probably found a skippable step. All that’s left is to figure out how to skip it. Don’t get me wrong, this probably is the most complicated part but it is a &lt;em&gt;concrete&lt;/em&gt; problem. It’s so much easier to work on a problem if you know what the problem is. And after all us coders are used to solving problems, right?&lt;/p&gt;
&lt;h2 id="how_is_this_a_product"&gt;How is this a product?&lt;/h2&gt;
&lt;p&gt;Let’s stay in the software context. What is a program, a service, a product? It’s the solution to a problem/need/want (many) people have. Simply put, a good product makes our life simpler and/or improves it in some way. It’s eliminating the steps nobody wants to or at least shouldn’t need to take.&lt;/p&gt;
&lt;p&gt;There were book shops before Amazon, auction houses before eBay and computers before Apple. They all took a pretty simple concept and improved it in some way. All they did was to eliminate a few skippable steps.&lt;/p&gt;</summary></entry><entry><title>Siri is from the Future</title><link href="http://christiankaula.com/siri-from-future.html" rel="alternate"></link><updated>2011-10-13T19:40:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-10-13:/siri-from-future.html/</id><summary type="html">&lt;p&gt;So you probably heard about the new iPhone by now. And perhaps you are one of the many people that said something along the lines &lt;em&gt;"Meh, so it's just the iPhone 4 with upgraded hardware and that gimmicky feature which allows you to talk to your phone.”&lt;/em&gt; You probably are failing to see the point because it’s too big.&lt;/p&gt;
&lt;h2 id="finally_the_first_pda"&gt;Finally: the first PDA&lt;/h2&gt;
&lt;p&gt;Remember those PDA days? Do you also remember what PDA stands for? It stands for &lt;em&gt;Personal Digital Assistant&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;Quick, give me a job description for a regular, non-digital personal assistant! You say a personal assistant is somebody that does stuff for you? Stuff you don’t care for doing but has to be dealt with? Somebody that does stuff for you? Somebody you can tell to do stuff for you?&lt;/p&gt;
&lt;p&gt;I hope by now you can see where I’m going with this. The PDA was supposed to be you digital assistant that takes care of stuff for you. Which never really was the case. PDAs where more of a gimmicky calendar. They never really &lt;em&gt;did&lt;/em&gt; stuff for you. But you can tell the new iPhone to send an SMS to your wife to let her know you'll be running late.&lt;/p&gt;
&lt;p&gt;Sure this isn’t really &lt;em&gt;super&lt;/em&gt; exciting. Yet. This assitant’s abilities are still quite limited and still Apple put it out there. You know what that means right? Other people will copy, steal, improve.&lt;/p&gt;
&lt;h2 id="enabling_the_disabled"&gt;Enabling the disabled&lt;/h2&gt;
&lt;p&gt;There are people that are forgotten most of the time by us computer people. People that have bodily disadvantages which make it really hard to enjoy living in tech-candy-land. Imagine you have no hands. Now try to use a reasonably recent cellphone. Chances are you'll encounter slight problems there.&lt;/p&gt;
&lt;p&gt;Believe it or not but there are quite a few people that really do struggle with the way technology is headed. Everything gets smaller. All the buttons are going away which makes it really hard to do stuff with touch panels if you are blind. And technology is moving so fast people can't or don't care to provide the benefits to people with disabilities.&lt;/p&gt;
&lt;p&gt;What most people can do however is communicate. Most of us by talking and most of those who have problems with that do communicate with their hands. You can work your smartphone by hand already — actually thats the default. But now you can control your pocket computer (and that's what smartphones are really) with your voice alone.&lt;/p&gt;
&lt;h2 id="where_is_your_computer"&gt;Where is your computer?&lt;/h2&gt;
&lt;p&gt;Siri might be quite nice on a smartphone but imagine what this stuff could do on a real computer. And I don’t even talk about your run-of-the-mill home PC. I’m talking about one of those supercomputer cloud things. Your data lives on the cloud already doesn’t it? Why not let it be joined by your new digital personal assistant?&lt;/p&gt;
&lt;p&gt;There’s your new device agnostic way to easily access all your data. Why search through the hundreds of music files for something that suits the mood if you can let your computer do that for you? Why deal with getting an appointment with the vet if you can let your PDA handle that?&lt;/p&gt;
&lt;p&gt;And as I said it’s device agnostic. All you really need is a way to transfer voice. So a humble phone line will suffice. Imagine the things that would be possible. A decent AI thing with access to all your personal data. An amazing thought — and a scary one, too.&lt;/p&gt;
&lt;h2 id="this_is_right_from_star_trek"&gt;This is right from Star Trek&lt;/h2&gt;
&lt;p&gt;Remember when James T. Kirk and later Jean-Luc Picard said things like &lt;em&gt;"Computer, cross-reference all occurrences of Hercules in ancient greek texts with modern art."&lt;/em&gt;? Now replace the word ‘computer’ with ‘Siri’. Replace ‘cross-reference’ with ‘search Google’. Catch my drift?&lt;/p&gt;
&lt;p&gt;This Siri stuff was Science-Fiction a few years ago. Technology that was so far out that it belonged in the year 2200. You may have to consult your calendar on this, but this kind of technology is early by about 200 years. And if you still don’t see it: This stuff is dang pretty amazing. First it was the Wii, then it was the Xbox Kinect and now this. Imagine what the people that came up with that stuff can do if we give them a few years to combine those things and work out the kinks.&lt;/p&gt;
&lt;p&gt;Oh, and if you think this is all delusional crazy talk, no problem at all. Just tell your phone to send me a note to let me know.&lt;/p&gt;
&lt;p&gt;Discussion at &lt;a href="http://news.ycombinator.com/item?id=3118293"&gt;Hacker News&lt;/a&gt;&lt;/p&gt;</summary><category term="apple"></category></entry><entry><title>How to Make a Better Analog Watch</title><link href="http://christiankaula.com/how-make-better-analog-watch.html" rel="alternate"></link><updated>2011-10-08T08:11:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-10-08:/how-make-better-analog-watch.html/</id><summary type="html">&lt;p&gt;Have you ever thought about the difference of digital watches versus analog ones? I'll tell you: Digital ones are better at their job and here's why.&lt;/p&gt;
&lt;h2 id="the_analog_12h_time_format_sucks"&gt;The analog 12h time format sucks&lt;/h2&gt;
&lt;p&gt;What could be the fastest way to tell which hour of the day you are talking about? Surprisingly it's simply telling somebody which hour of the day you are talking about.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hey Bob let's meet at the 14th hour, okay?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sure makes more sense than this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hey Bob let's meet at the 2nd hour of the day - the one  after noon.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Nobody talks like that? That's because it's so complicated that people invented a way to shortcut it by appending &lt;em&gt;a.m.&lt;/em&gt; or &lt;em&gt;p.m.&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="analog_watches_make_you_search"&gt;Analog watches make you search&lt;/h2&gt;
&lt;p&gt;Think of your standard analog watch. How does looking up the time work?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Find your watch. (Most of times at your wrist.)&lt;/li&gt;
&lt;li&gt;Find one of the hands.&lt;/li&gt;
&lt;li&gt;Find the second hand.&lt;/li&gt;
&lt;li&gt;Find out which is the small and which is the big one.&lt;/li&gt;
&lt;li&gt;Find one of the hands and know the hour/minute.&lt;/li&gt;
&lt;li&gt;Find the other hand again and know the minute/hour.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So that means in your head it works probably something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Okay one is pointing here, is it the big one? Where's the other one… okay it's pointing between 2 and 3 and it's smaller indeed. That means it's 2 something. Where was the first arm pointing at again? Okay so its 2:35. The 2:35 in the morning or the one in the afternoon?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Digital doesn't make you search quite as much:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Find your watch. (Probably still at your wrist.)&lt;/li&gt;
&lt;li&gt;Look at the part before the &lt;em&gt;:&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Look at the part after the &lt;em&gt;:&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Which turns into a inner monologue like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Okay the first number is 14 so it's 2 &lt;em&gt;in the afternoon&lt;/em&gt; and the second number is 35 so its 2 &lt;em&gt;in the afternoon&lt;/em&gt; and 35 minutes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="how_to_change_that"&gt;How to change that&lt;/h2&gt;
&lt;p&gt;Now there are things about analog watches that are quite nice and should be kept if possible. The spirit of the classic watch probably is that it makes you think &lt;em&gt;"Well, this isn't magic after all. If I had some time I could probably build one myself."&lt;/em&gt; Keeping that in mind you can't change the analog watch so radical that it seems too complicated to get.&lt;/p&gt;
&lt;p&gt;On the other hand you want to overcome the 24h problem and try to make the eye search as little as possible. This can be achieved by splitting hour and minute display into two separate areas. Now you still have to search the two faces for the hands, though.&lt;/p&gt;
&lt;p&gt;The simplest solution is often the best one: Don't move the hands but move the number display below them. And while you are at it add an indicator for a.m. and p.m. or even better, change the hour display to 24 instead of 12 hours.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Now we have a watch that combines inner workings that are still simple enough to get with the effectiveness of 24h digital watches. And that's my idea of a better analog wrist watch. If you happen to know where I can get something like that (for less than an arm and a leg) let me know.&lt;/p&gt;
&lt;p&gt;Discussion at &lt;a href="http://news.ycombinator.com/item?id=3108242"&gt;Hacker News&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="updates"&gt;Updates&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;2011-10-16&lt;/strong&gt;: Seems the &lt;a href="http://www.zeiteisen.at/files/6abf15d02b29b0c3b8c264ba698327cd-1185.html"&gt;Fortis B-47 Big Black&lt;/a&gt; is a pretty good example of what I tried to describe. Don’t look at the hands but look at the way the day and date are displayed. Now imagine you do would put both windows for day and date on the same side and make them show not day and date but hour and minute.&lt;/p&gt;
&lt;p&gt;That way you would take away your eyes need to search for the hands because the hour and minute could always be found in the exact same place. Like with digital watches. And there you go.&lt;/p&gt;</summary><category term="device"></category></entry><entry><title>Where to Not Put Django Templates</title><link href="http://christiankaula.com/where-to-not-put-django-templates.html" rel="alternate"></link><updated>2011-10-01T00:00:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-10-01:/where-to-not-put-django-templates.html/</id><summary type="html">&lt;p&gt;Here's a hint for you: You are probably putting your Django template files in the wrong place.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;vim yourdjangoproject/someapp/templates/someapp/sometemplate.html
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Looks familiar? Uh oh — seems I got you.&lt;/p&gt;
&lt;h2 id="so_whats_wrong_with_that_line"&gt;So what's wrong with that line?&lt;/h2&gt;
&lt;p&gt;The most obvious giveaway is the double occurrence of your app's name. Ever wondered why you should have to put your templates in a directory named after the app that the current templates directory belongs to? No? Aww, you disappoint me. Aren't we developer types supposed to be lazy and such?&lt;/p&gt;
&lt;p&gt;Anyway, if you never asked yourself that question, changes are this hasn't occurred to your either: Why would anyone ever want to put a template for one app in the templates directory of another app. Most likely that is because pretty much nobody ever would want to do that.&lt;/p&gt;
&lt;h2 id="but_thats_the_django_way"&gt;But that's the Django way!&lt;/h2&gt;
&lt;p&gt;No, sorry to disappoint you. And no that does not help with a structured project layout. Remember that it's good style to design Django apps as reusable? You probably do and you are probably thinking: &lt;em&gt;"Haha! Right! Now what do you say to that?!"&lt;/em&gt; I answer: My point exactly.&lt;/p&gt;
&lt;p&gt;Let's assume you strife to design your apps in a reusable manner. Good for you. Now think of how often you have multiple projects with equaling HTML layouts. My guess is you don't have those very often. So that means the templates that came with your neat reusable app have to be customized to the project. And suddenly your app isn't that reusable anymore just because you bundled templates with it.&lt;/p&gt;
&lt;h2 id="but_my_web_designer+"&gt;But my web designer…&lt;/h2&gt;
&lt;p&gt;Apart from that you aren't doing your designer a favor either. If you put your templates inside of your app structure the poor guy/girl will have to dig through all those funny &lt;em&gt;.py&lt;/em&gt; and &lt;em&gt;.pyc&lt;/em&gt; files. I hear those contain some of the strange stuff those weird corder guys mess around with.&lt;/p&gt;
&lt;p&gt;Now if you put all your templates in one directory — possibly even outside of your Django project structure — there will be minimum contact of Python code and HTML. That's a nice thing to do for your layout guy/girl. Just point them at the directory and all they will ever see is homely &lt;em&gt;.html&lt;/em&gt;. Once you see the happy smile on their face you will know it was the right thing to do.&lt;/p&gt;
&lt;p&gt;Besides that you might remember that us weird coder people also like to fight the constant battle of parting layout from logic. A battle we lose often enough, so why not cease victory where it comes easy?&lt;/p&gt;
&lt;h2 id="but_you_didnt_cover_my_use_case_at_all"&gt;But you didn't cover my use case at all!&lt;/h2&gt;
&lt;p&gt;Of course I'm speaking generally here. There are loads of use cases in which it absolutely makes sense to bundle templates with your app. Perhaps in your case your templates simply never change because your app provides some add-on functionality like a WYSIWYG editor. Or you want to provide default templates that are at least unlikely to change much — perhaps some email templates.&lt;/p&gt;
&lt;p&gt;The lesson here is that you probably should put your template files in an extra template directory because it makes stuff simpler. And simpler most of times equals better. If you can name a good reason why you still want to bundle your templates with your app, forget I ever said anything and carry on.&lt;/p&gt;</summary><category term="django"></category></entry><entry><title>Camila-overload.de</title><link href="http://christiankaula.com/camila-overload-de.html" rel="alternate"></link><updated>2011-09-08T22:57:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-09-08:/camila-overload-de.html/</id><summary type="html">&lt;p&gt;This was a group assignment done during my final semester while getting my master's degree. It's a simple browser based game, fully HTML5-hype compatible. That means it's completely implemented in JavaScript/WebGL, based on the lightweight &lt;a href="http://spidergl.org/"&gt;SpiderGL&lt;/a&gt; framework.&lt;/p&gt;
&lt;p&gt;My part was to figure out how to write such a game. So I dug through SpiderGL code and tried to make sense of the given code examples. After a while it all began to make sense and I rewrote the whole thing to follow the &lt;a href="http://en.wikipedia.org/wiki/MVC_Pattern"&gt;MVC pattern&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Having worked with WebGL I cannot help but think this is the future — no matter if Microsoft tries to crash the party to push their own proprietary stuff. It was never so easy to get into game programming — and we are even talking platform agnostic here. The only drag I see is the language you have to work with. JavaScript might look like freak-C but then it hits your over the head with closures — like &lt;em&gt;loads&lt;/em&gt; of closures.&lt;/p&gt;
&lt;p&gt;But even with JavaScript being what it is (and let's be honest — C++ itself is one giant hack people have learned to love) the web is getting more important by the minute. I hardly can imagine any technology with more potential right now. If you don't believe me check out what a group of students with no little to no prior knowledge of 3D programming can accomplish in just a few weeks: &lt;a href="http://camila-overload.de"&gt;http://camila-overload.de&lt;/a&gt;&lt;/p&gt;</summary><category term="html5"></category><category term="javascript"></category><category term="webgl"></category><category term="spidergl"></category></entry><entry><title>Studi-tools.de</title><link href="http://christiankaula.com/studi-tools-de.html" rel="alternate"></link><updated>2011-08-03T22:57:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-08-03:/studi-tools-de.html/</id><summary type="html">&lt;p&gt;This is a personal long-term project of mine. The basic idea is to provide all the things I want to know as a student about today at a glance. We have schedule changes, todays mensa menu and which rooms are occupied at what times. It's all pretty basic and I have a huge list of stuff I'd like to do when nothing else is up (you know that's one of those chilly days in hell) but it gets the job done.&lt;/p&gt;
&lt;h2 id="frontend"&gt;Frontend&lt;/h2&gt;
&lt;p&gt;Technology wise this was my first try at a all JavaScript site that accesses a RESTful API as its backend. This allows for a pretty radical caching strategy for the HTML/JavaScript part of the page. Since the page would be accessed via smartphone quite a bit (poor students with high-end hardware and such) I reasoned it wouldn't hurt to go for mobile optimization.&lt;/p&gt;
&lt;p&gt;I saw that as a chance to go all out and pretty much threw all the optimization techniques at the code I could come up with. The JavaScript gets minified with &lt;a href="http://code.google.com/closure/compiler/"&gt;Google's Closure Compiler&lt;/a&gt; then injected into the HTML via &lt;em&gt;script&lt;/em&gt;-tag. All this is run through &lt;a href="http://code.google.com/p/htmlcompressor/"&gt;htmlcompressor&lt;/a&gt; and served with maximum cache expire time. Furthermore I started to reimplement the JavaScript code with &lt;a href="http://ender.no.de/"&gt;Ender&lt;/a&gt; instead of jQuery for minimal redundant code. This aspiring endeavor did not come to fruition yet though.&lt;/p&gt;
&lt;h2 id="backend"&gt;Backend&lt;/h2&gt;
&lt;p&gt;On the backend/API side I went with the &lt;a href="http://www.tornadoweb.org/"&gt;Tornado&lt;/a&gt; framework. If you ask me why I'll tell you to be able to handle the &lt;em&gt;many&lt;/em&gt; request on my small vServer but in reality I just wanted to play around with the hip event driven coding thing. Though having worked quite nicely the last few months it seams the site throws errors these days which probably means I should get around to fid it these days.&lt;/p&gt;
&lt;p&gt;Scraping is done by a few lines of custom Python code utilizing &lt;a href="http://lxml.de/"&gt;lxml&lt;/a&gt; in combination with &lt;a href="http://eventlet.net/"&gt;Eventlet&lt;/a&gt;. Using Eventlet makes it possible to retrieve multiple URLs at the same time which makes the whole scraping affair a whole lot more efficient. The downside of this is that I hit the servers quite often and pretty fast which makes me fear one day they'll notice and ban my scraper. On the other hand my scraper is nothing in comparison to Googlebot I imagine.&lt;/p&gt;
&lt;p&gt;Data is translated to JSON and permanently cached on disk. So whenever the API is hit all there is to answering is to fetch the right answer from the database.&lt;/p&gt;
&lt;h2 id="future"&gt;Future&lt;/h2&gt;
&lt;p&gt;Future plans (of which I have many) include rewriting the backend to use a NoSQL data store. Right now it caches the scraped data as serialized chunks of data in a SQLite database which works but feels a bit too much for the job. So I was playing with the idea of giving &lt;a href="http://code.google.com/p/leveldb/"&gt;LevelDB&lt;/a&gt; a shot. LevelDB seems to be the NoSQL equivalent to SQLite and should simplify storing the JSON data a bit. We will see how that turns out.&lt;/p&gt;</summary><category term="python"></category><category term="tornado"></category><category term="javascript"></category><category term="jquery"></category></entry><entry><title>On CSS Structure</title><link href="http://christiankaula.com/on-css-structure.html" rel="alternate"></link><updated>2011-06-01T01:54:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-06-01:/on-css-structure.html/</id><summary type="html">&lt;p&gt;Because I have to do some collaborative work on CSS files (no &lt;a href="http://sass-lang.com/"&gt;Sass&lt;/a&gt;/&lt;a href="http://compass-style.org/"&gt;Compass&lt;/a&gt;) these days I'd like to take the time and write down some pointers regarding CSS structure.&lt;/p&gt;
&lt;h2 id="alphabetical_order"&gt;Alphabetical order&lt;/h2&gt;
&lt;p&gt;As with a lot of  other stuff that needs to be organized in some way, alphabetical order makes a lot of sense. Capital letters go before lowercase letters. Top do bottom.&lt;/p&gt;
&lt;p&gt;There's no magic to it and it makes stuff that much easier to find. Easier to find means less chance to duplicate things that are already there.&lt;/p&gt;
&lt;h2 id="specificity"&gt;Specificity&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.w3.org/TR/2003/WD-CSS21-20030128/cascade.html#specificity"&gt;Specificity&lt;/a&gt; is one of those things you usually don't think about until it bites you. In short specificity is a value calculated by the browser for every selector and used to check which one of n overlapping selectors takes precedence.&lt;/p&gt;
&lt;p&gt;All in all you can get away with keeping a few simple rules in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;class selectors beat element selectors&lt;/li&gt;
&lt;li&gt;id selectors beat class selectors&lt;/li&gt;
&lt;li&gt;combine selectors to increase the specificity&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="use_newlines"&gt;Use newlines&lt;/h2&gt;
&lt;p&gt;I know a few guys that like to put all attributes of one selector in one line. This is bad for two reasons. First its really hard to read. Have a look at this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;width&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;74px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;height&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;62px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;float&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;margin-top&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;520px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;margin-left&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;b&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;width&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;74px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;height&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;62px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;float&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;margin-top&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;520px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;margin-left&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It should be obvious that the layout of b is much easier on the eyes.&lt;/p&gt;
&lt;p&gt;Second reason is version control. Let's say you need to change the width in the above examples. If you change it for &lt;em&gt;b&lt;/em&gt; you will end up with a diff that encompasses exactly the one line in which &lt;em&gt;width&lt;/em&gt; is set. Do the same thing for &lt;em&gt;a&lt;/em&gt; and the whole definition will show up as changed in the logs. Have fun figuring out what exactly was changed on that line. Not cool.&lt;/p&gt;
&lt;h2 id="putting_it_together"&gt;Putting it together&lt;/h2&gt;
&lt;p&gt;What does a well structured CSS file look like then? Start with element selectors, follow with class selectors and put the id selectors in the bottom of your file. This pretty much reflects the order in which your browser will parse the CSS.&lt;/p&gt;
&lt;p&gt;Order selector names alphabetically. So do for attributes. That way nobody gets confused and attributes won't be duplicated - or at least they are less likely to be messed up.&lt;/p&gt;
&lt;p&gt;In the end you might end up with something like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;color&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;text&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;deocration&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.anotherClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.someClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#imAnId&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;#soAmI&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2 id="why_i_dont_listen_to_my_own_advice"&gt;Why I don't listen to my own advice&lt;/h2&gt;
&lt;p&gt;'I saw your CSS - you don't order your attributes alphabetically!' I hear you cry. And you are right. It's one of my (perhaps not so) little quirks: I like my attributes in semantic order. First the basic stuff like &lt;em&gt;width&lt;/em&gt; and &lt;em&gt;height&lt;/em&gt; followed by stuff concerning position like &lt;em&gt;float&lt;/em&gt; and &lt;em&gt;position&lt;/em&gt; (duh). After that comes &lt;em&gt;background&lt;/em&gt; and text stuff in an order similar to how typographers usually specify fonts (family, weight, size, color). the last three attributes are ordered by going out of the element. First you got &lt;em&gt;padding&lt;/em&gt; followed by &lt;em&gt;border&lt;/em&gt; and lastly &lt;em&gt;margin&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It probably doesn't make sense to you and I don't blame you. Stick to alphabetical ordering as the lowest common denominator and we can all get along.&lt;/p&gt;</summary><category term="css"></category></entry><entry><title>My Take on Indention</title><link href="http://christiankaula.com/my-take-indention.html" rel="alternate"></link><updated>2011-03-28T16:53:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-03-28:/my-take-indention.html/</id><summary type="html">&lt;p&gt;Many battles have been fought about how to indent. And finally it's my time to beat you around the head with my opinion. Here we go.&lt;/p&gt;
&lt;h3 id="use_goddamn_tabs_dammit"&gt;Use goddamn tabs dammit!&lt;/h3&gt;
&lt;p&gt;Why? Because they make sense. One level of idention is one tab. If you want to ident by 4 spaces tell your editor to show a tab as 4 spaces. Your editor can't do that? Get a better editor. Want to align stuff? Don't do that. If you have to: You don't.&lt;/p&gt;
&lt;p&gt;And no spaces don't make sense because so your code looks eactly the same everywhere. If you want that you have to ban syntax highlighting, too. Also you have to get rid of line wrapping, differing fonts, font sizes and all that stuff. Otherwise your code doesn't look the same everywhere.&lt;/p&gt;
&lt;p&gt;Tabs work because they are the simplest solution to the problem.&lt;/p&gt;
&lt;h3 id="no_exceptions++but_there_is_an_exception_to_that"&gt;No exceptions… but there is an exception to that&lt;/h3&gt;
&lt;p&gt;There is exactly 1 (read: one - as in 'not many') case in which it might make sense to use spaces instead of tabs: legacy. And that is that.&lt;/p&gt;
&lt;h3 id="holy_heck_-_thats_not_what_pep8_says"&gt;Holy heck - that's not what PEP8 says!&lt;/h3&gt;
&lt;p&gt;It's a guideline - a pretty fine one - but still a guideline. Spaces don't make sense anymore in my opinion. Most editors are better at dealing with tabs than dealing with spaces (auto indentation, soft tabs etc.).&lt;/p&gt;
&lt;h3 id="one_last_thing"&gt;One last thing&lt;/h3&gt;
&lt;p&gt;If you convert the tabs in my HTML to spaces I will haunt you.&lt;/p&gt;</summary><category term="indention"></category><category term="python"></category><category term="editors"></category></entry><entry><title>Why Web Development is Done in PHP or Java</title><link href="http://christiankaula.com/why-web-development-done-php-java.html" rel="alternate"></link><updated>2011-03-16T18:12:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2011-03-16:/why-web-development-done-php-java.html/</id><summary type="html">&lt;p&gt;These days I'm getting more and more frustrated by my fellow students. It seems everybody is trying to get through with as little work as possible and those who are at least motivated are &lt;em&gt;very&lt;/em&gt; reluctant to learn any new languages/technologies.&lt;/p&gt;
&lt;h2 id="the_reasons_why_everything_but_java_and_php_sucks"&gt;The reasons why everything but Java and PHP sucks&lt;/h2&gt;
&lt;p&gt;Here are some of my favorite quotes (paraphrased).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"No I don't want to start learning a new framework right now."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Right. I mean it's not like studying would be about learning new stuff. That's what you'll do in your day-to-day job when you got the time to mess around without pressure from bosses and/or clients and such.&lt;/p&gt;
&lt;p&gt;Besides that, everybody knows the web hates &lt;a href="http://www.w3.org/html/logo/"&gt;new technologies&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Yeah, I mean Ruby and Rails might be okay but it's not like one needs to follow every single hype."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Exactly. Everybody knows that PHP is for web coding. How on earth would one &lt;a href="http://regulargeek.com/2011/02/09/web-scripting-programming-language-job-trends-february-2011/"&gt;get a job&lt;/a&gt; with that funky stuff that doesn't even look like C anymore?&lt;/p&gt;
&lt;p&gt;Are those languages even stable yet? Couldn't have been around for more than say 1 or 2 years. Java and PHP at least have been around for, like, ever (&lt;a href="http://en.wikipedia.org/wiki/Java_(programming_language)"&gt;1995&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Php"&gt;1995&lt;/a&gt;) - unlike Ruby (&lt;a href="http://en.wikipedia.org/wiki/Ruby_(programming_language)"&gt;1995&lt;/a&gt;) or even Python (&lt;a href="http://en.wikipedia.org/wiki/Python_(programming_language)"&gt;1991&lt;/a&gt;)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Dynamically typed languages just don't work for big projects."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Wow - now you got me. But wait, I think I remember a medium sized site that seems to do pretty good. Now if I could recall the name… I think it started with 'Face' and ended with 'book'. Oh and wait - isn't PHP like dynamically typed or something?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Professor: "[Lengthy reasoning about why it might pay to learn something less mainstream.] Choose any framework you like. Perhaps you have waited for a chance to play around with a certain one - this is your chance."&lt;/p&gt;
&lt;p&gt;Student: "Can we use Java or .NET?"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I guess I don't have to mention those are the exact ones that were covered by our earlier studies.&lt;/p&gt;
&lt;h2 id="so_mr_loudmouth_what_should_we_use_then"&gt;So Mr Loudmouth what should we use then?&lt;/h2&gt;
&lt;p&gt;How would I know what's the right language/framework/whatever for your project? But how do &lt;em&gt;you&lt;/em&gt; expect to know if you never tried anything besides the beaten track?&lt;/p&gt;
&lt;p&gt;To me it seems pretty much none of my contemporaries want to learn anything unless they get a grade for it. And as such they completly miss the point in my humble opinion. You shouldn't get a Masters's degree for barely meeting expectations. You should get one for showing that you are able &lt;em&gt;and&lt;/em&gt; willing to learn stuff and make good use of it.&lt;/p&gt;
&lt;p&gt;We are constantly told that we will most likley end up in managing positions where we will have to make decisions. But how can one make educated decisions if s/he hardly knows anything about the choices save one?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2011-03-16 23:47:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some textual cleanups. Probably shouldn't publish stuff while being angry. But have a bonus quote (and this one is literal):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Oh I never got object-oriented design."&lt;/p&gt;
&lt;/blockquote&gt;</summary></entry><entry><title>Yay for Lanyon</title><link href="http://christiankaula.com/yay-for-lanyon.html" rel="alternate"></link><updated>2010-08-05T16:38:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2010-08-05:/yay-for-lanyon.html/</id><summary type="html">&lt;p&gt;Migrated the site to a &lt;a href="http://bitbucket.org/arthurk/lanyon/"&gt;Lanyon&lt;/a&gt; based setup today. Really nice little HTML generator - probably because one can sense it was made by a &lt;a href="http://www.arthurkoziel.com/"&gt;djangonaut&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Yet there are three things I'm missing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A settings file. Why can't I save settings permanently?&lt;/li&gt;
&lt;li&gt;Better tag handling. What's the point of having tags if there isn't a site-wide list of tags I can work with?&lt;/li&gt;
&lt;li&gt;Better datetime parsing. That one I actually took care of already. Might publish that in my own fork soon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And if one wanted to make Lanyon even more kick-ass here's the thing: Mix it with some &lt;a href="http://github.com/xfire/growl/tree"&gt;growl&lt;/a&gt; ideas. I'm thinking per-site hooks and subclasses of the default &lt;em&gt;Article&lt;/em&gt; class and free-form page metadata. To me that would be the HTML generator to end all HTML generators.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Why My Mac Made My Sansa Clip+ Hang</title><link href="http://christiankaula.com/why-my-mac-made-my-sansa-clip-hang.html" rel="alternate"></link><updated>2010-06-23T11:07:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2010-06-23:/why-my-mac-made-my-sansa-clip-hang.html/</id><summary type="html">&lt;p&gt;Yeah well the other day I got me one of those shiny modern MP3 player thingies — namely a &lt;a href="http://www.sandisk.com/products/sansa-music-and-video-players/sandisk-sansa-clipplus-mp3-player-"&gt;Sansa Clip+&lt;/a&gt;. Really nice gadget and all but whenever I copied some of my OGGs on it it would hang during the library update.&lt;/p&gt;
&lt;p&gt;Long story short after two days of tinkering I found out Mac OS X creates &lt;em&gt;._somefile&lt;/em&gt; files if the file system copied to doesn't support all required attributes. The whole concept is called &lt;a href="http://support.apple.com/kb/TA20578"&gt;Apple Double Format&lt;/a&gt; and frankly not including an option to turn it off in some way seems totally ridiculous.&lt;/p&gt;
&lt;p&gt;Though it seems Apple does indeed know how stupid the concept is since they provide the &lt;a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/10.5/man1/dot_clean.1.html?useVersion=10.5"&gt;dot_clean command&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In case your Sansa MP3 player hangs up after putting music on it this hint might save you some pulled out hair.&lt;/p&gt;</summary><category term="mac"></category></entry><entry><title>Python: Decorate a Method That Gets Passed the Class Instance</title><link href="http://christiankaula.com/python-decorate-method-gets-class-instance.html" rel="alternate"></link><updated>2010-03-24T01:57:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2010-03-24:/python-decorate-method-gets-class-instance.html/</id><summary type="html">&lt;p&gt;The other day I needed to decorate a method with a decorator class that knows about the owner of the method meaning the instance. This works as expected with function decorators:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;some_decorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;instance &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt; of class &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt; is now decorated whee!&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__class__&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;decorator&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nd"&gt;@some_decorator&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dostuff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;do &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you need/want to use a class based decorator you have to do this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeDecorator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;func&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__call__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;instance &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt; of class &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt; this is now decorated whee!&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;func&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__call__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__get__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__call__&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nd"&gt;@SomeDecorator&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dostuff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;do &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Thanks to &lt;a href="http://eoyilmaz.blogspot.com/"&gt;Ozgur&lt;/a&gt; who's &lt;a href="http://eoyilmaz.blogspot.com/2009/09/python-function-decorators-2-decorating.html"&gt;post about the topic&lt;/a&gt; pointed me in the right direction.&lt;/p&gt;</summary><category term="python"></category></entry><entry><title>Django Template Tag to Shorten URLs Like Google</title><link href="http://christiankaula.com/django-template-tag-shorten-urls-google.html" rel="alternate"></link><updated>2010-03-12T22:22:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2010-03-12:/django-template-tag-shorten-urls-google.html/</id><summary type="html">&lt;p&gt;Need to shorten your URLs like Google does? Something like http://example.com/some/really/long/path/ to http://example.com/.../path/? Here's my simplistic approach:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# -*- encoding: utf-8 -*-&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.utils.html&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;conditional_escape&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.utils.safestring&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mark_safe&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;re&lt;/span&gt;

&lt;span class="n"&gt;register&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Library&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@register.filter&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fancyurlize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;u&amp;#39;%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;?&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;char&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;r&amp;#39;(?&amp;lt;!/)/(?!/)&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;...&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="n"&gt;return_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;&amp;lt;a href=&amp;quot;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;/a&amp;gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;conditional_escape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;conditional_escape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;mark_safe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;return_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;fancyurlize&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_safe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="django"></category><category term="python"></category></entry><entry><title>Studi-tools.de is Online</title><link href="http://christiankaula.com/studi-toolsde-online.html" rel="alternate"></link><updated>2009-11-16T22:57:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-11-16:/studi-toolsde-online.html/</id><summary type="html">&lt;p&gt;Just a quick notice that I put &lt;a href="http://studi-tools.de"&gt;studi-tools.de&lt;/a&gt; online today. Its a personal project to make the student life in Hof a little easier.&lt;/p&gt;
&lt;p&gt;As most of my projects its &lt;a href="http://www.djangoproject.com/"&gt;pony powered&lt;/a&gt; and uses the usual apps like &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; and &lt;a href="http://code.google.com/p/django-compress/"&gt;django-compress&lt;/a&gt;.&lt;/p&gt;</summary><category term="django"></category><category term="django-compress"></category><category term="south"></category></entry><entry><title>Nice to Know About Virtualenvwrapper</title><link href="http://christiankaula.com/nice-know-about-virtualenvwrapper.html" rel="alternate"></link><updated>2009-11-13T12:32:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-11-13:/nice-know-about-virtualenvwrapper.html/</id><summary type="html">&lt;p&gt;Since I'm mostly working on various &lt;a href="http://www.djangoproject.com/"&gt;Django&lt;/a&gt; projects I am working with &lt;a href="http://pypi.python.org/pypi/virtualenv"&gt;virtualenv&lt;/a&gt;/&lt;a href="http://www.doughellmann.com/projects/virtualenvwrapper/"&gt;virtualenvwrapper&lt;/a&gt; a lot. It allows to encapsulate environments and keep them identical across all servers your app will run on.&lt;/p&gt;
&lt;h4 id="the_problem"&gt;The Problem&lt;/h4&gt;
&lt;p&gt;All this means setting up pretty much the same Python environment over and over again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create an environment&lt;/li&gt;
&lt;li&gt;enter environment&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://pip.openplans.org/"&gt;pip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://ipython.scipy.org/moin/"&gt;IPython&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install Django&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://pypi.python.org/pypi/psycopg2/2.0.4"&gt;psycopg2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://www.pythonware.com/products/pil/"&gt;PIL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://south.aeracode.org/"&gt;south&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://code.google.com/p/sorl-thumbnail/"&gt;sorl-thumbnail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install &lt;a href="http://code.google.com/p/django-compress/"&gt;django-compress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;install all project specific packages and django apps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Quite tedious after your nth project really.&lt;/p&gt;
&lt;h4 id="the_solution"&gt;The Solution&lt;/h4&gt;
&lt;p&gt;After reading &lt;a href="http://arthurkoziel.com/2008/10/22/working-virtualenv/"&gt;how virtualenv allows bootstrapping environments&lt;/a&gt; and as such reducing tedious work I wondered if that can be done with virtualenvwrapper, too. Turns its absolutely possible.&lt;/p&gt;
&lt;p&gt;There actually are quite a few &lt;a href="http://www.doughellmann.com/docs/virtualenvwrapper/hooks.html"&gt;hooks in virtualenvwrapper&lt;/a&gt; that allow for stuff being run pre- and post- creating/deleting/activating environments. Now my &lt;em&gt;postmkvirtualenv&lt;/em&gt; script looks like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

easy_install pip
pip install ipython
pip install yolk
pip install psycopg2
pip install django
pip install -e hg+http://bitbucket.org/andrewgodwin/south/@stableish#egg&lt;span class="o"&gt;=&lt;/span&gt;south
pip install pil
pip install -e svn+http://sorl-thumbnail.googlecode.com/svn/trunk/#egg&lt;span class="o"&gt;=&lt;/span&gt;solr
pip install -e svn+http://django-compress.googlecode.com/svn/trunk/#egg&lt;span class="o"&gt;=&lt;/span&gt;compress
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now whenever I create an environment with &lt;em&gt;mkvirtualenv someproject&lt;/em&gt; all my standard Python packages and Django apps get installed automagically. And then I'm able to put something like this in my &lt;em&gt;postactiveate&lt;/em&gt; script:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;cd&lt;/span&gt; /Users/me/Projects/someproject/
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So whenever I activate my environment with &lt;em&gt;workon someproject&lt;/em&gt; I get beamed right into my project dir and can start hacking right away. Nice and easy.&lt;/p&gt;</summary><category term="django"></category><category term="python"></category><category term="virtualenv"></category><category term="virtualenvwrapper"></category></entry><entry><title>Having been at Tschitschereengreen</title><link href="http://christiankaula.com/having-been-tschitschereengreen.html" rel="alternate"></link><updated>2009-10-13T13:46:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-10-13:/having-been-tschitschereengreen.html/</id><summary type="html">&lt;p&gt;Okay so my (ex)boss asked me if I'd like to write a post about his company any my internship there. I said yes and after having moved back home and caught up on sleep a bit I finally feel ready to do so. Here we go.&lt;/p&gt;
&lt;h4 id="who_are_we_talking_about_anyway"&gt;Who are we talking about anyway?&lt;/h4&gt;
&lt;p&gt;First let's make it clear what company we are talking about. The official name is &lt;a href="http://tschitschereengreen.com"&gt;Tschitschereengreen - A Brand of the Yoosic Technology GmbH&lt;/a&gt;. Couldn't be any easier, right? Well, I had to write it quite a few time during my half-year internship there, so don't get me started.&lt;/p&gt;
&lt;p&gt;It's a rather small company in the heart of Dresden with only just a hand-full of peeps working there. That was a big reason to go there in the first place by the way. They make up by using technologies that allow them to be agile and rapid and all that buzzwordy stuff. That includes frameworks like Django (&lt;em&gt;dingdingding&lt;/em&gt;) and other open source stuff that Just Works(tm).&lt;/p&gt;
&lt;h4 id="and_you_did_what_there"&gt;And You Did What There?&lt;/h4&gt;
&lt;p&gt;So what did I actually do during my internship there? Surprisingly I worked. Call me crazy but I'm of the opinion that a internship should be just what its name implies: pretend you're a regular employee and do/learn all the stuff a regular employee would do/learn. Work on a tryout basis pretty much - you get the idea.&lt;/p&gt;
&lt;p&gt;Most of my time there I had the chance to endeepen (I know that is no word) my Python/Django skills. Another big reason why I chose Tschitschereengreen right there. Besides hardcore Django coding I also did some HTML/CSS/JavaScript projects and took care of some admin stuff like setting up servers and such. I even had a chance to do a small PHP/Wordpress project. PHP is fun in small doses actually.&lt;/p&gt;
&lt;h4 id="gimme_a_resum+_already"&gt;Gimme a Resumé Already&lt;/h4&gt;
&lt;p&gt;Its been great fun. That's the shortest version. If you want a bit more detail: You probably won't get rich there but hey if money is your main concern you probably will have stopped reading after I mentioned the size of the company. But if you're like me then money isn't your main concern. You rather care about working with nice people and learning stuff by being given responsibility.&lt;/p&gt;
&lt;p&gt;If you're in search of a nice internship in the IT area or searching for a full-blown job you should consider Tschitschereengreen. And hey you might even gain some bonus points if you mention you read about them on my blog. :)&lt;/p&gt;</summary><category term="internship"></category><category term="job"></category></entry><entry><title>A Howto on Django Syndication</title><link href="http://christiankaula.com/howto-django-syndication.html" rel="alternate"></link><updated>2009-09-22T10:08:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-22:/howto-django-syndication.html/</id><summary type="html">&lt;p&gt;Last week I had to implement a customized RSS feed in Django for the first time. Sounded like a fun project to me until I had a look at the documentation which is… well let's just say it's not as good as the core documentation.&lt;/p&gt;
&lt;p&gt;So if anybody runs into the same problems as me here is a simple example on how to do a little customizing of the Django syndication stuff:&lt;/p&gt;
&lt;p&gt;:::python
    from django.contrib.syndication.feeds import Feed
    from django.utils.feedgenerator import Rss201rev2Feed
    from content.models import SomeModel&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c1"&gt;# this is our very own custom RSS feed generator class&lt;/span&gt;
&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;FooFeed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Rss201rev2Feed&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="c1"&gt;# add_root_elements adds xml elements to the root node of the RSS XML.&lt;/span&gt;
    &lt;span class="c1"&gt;# In this case we add a &amp;#39;foo&amp;#39; element to our feed root with a value of&lt;/span&gt;
    &lt;span class="c1"&gt;# &amp;#39;bar&amp;#39;.&lt;/span&gt;
    &lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;add_root_elements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FooFeed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_root_elements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;addQuickElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# add_item_elements adds elements to the actual items in the RSS XML.&lt;/span&gt;
    &lt;span class="c1"&gt;# In this case we add a &amp;#39;foz&amp;#39; element with an attribute &amp;#39;baz&amp;#39;. The values&lt;/span&gt;
    &lt;span class="c1"&gt;# for those two keys are coming out of the passed in item dict.&lt;/span&gt;
    &lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;add_item_elements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FooFeed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_item_elements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;addQuickElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;foz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;foz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;attrs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]})&lt;/span&gt;

&lt;span class="c1"&gt;# this is our actual feed class that provides data for the RSS feed&lt;/span&gt;
&lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;JobPostingFeed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Feed&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# this will use our custom RSS feed generator class from above&lt;/span&gt;
    &lt;span class="n"&gt;feed_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FooFeed&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;FooFeed stuff&amp;#39;&lt;/span&gt;
    &lt;span class="nb"&gt;link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;Freaky FooFeed stuff.&amp;#39;&lt;/span&gt;

    &lt;span class="c1"&gt;# this definies which objects are passed into the feed generator&lt;/span&gt;
    &lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;SomeModel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;-created_at&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# This took me the most time to figure out even though the idea is pretty&lt;/span&gt;
    &lt;span class="c1"&gt;# simple. We used the item dictionary in add_item_elements above which is&lt;/span&gt;
    &lt;span class="c1"&gt;# filled with the values we define here. Since we are accessing the keys&lt;/span&gt;
    &lt;span class="c1"&gt;# &amp;#39;foz&amp;#39; and &amp;#39;baz&amp;#39; above we have to make sure those kyes/values actually&lt;/span&gt;
    &lt;span class="c1"&gt;# exist in the &amp;#39;item&amp;#39; dict.&lt;/span&gt;
    &lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;item_extra_kwargs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s"&gt;&amp;#39;foz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;some_method&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="s"&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;some_attribute&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Update: Fixed add_item_elements. Thanks for pointing it out John.&lt;/em&gt;&lt;/p&gt;</summary><category term="django"></category><category term="syndication"></category></entry><entry><title>The Difference Between Work and Play</title><link href="http://christiankaula.com/difference-between-work-and-play.html" rel="alternate"></link><updated>2009-09-18T08:19:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-18:/difference-between-work-and-play.html/</id><summary type="html">&lt;p&gt;The other day I was wondering what the difference is between work and the screwing around I do at home for fun. After putting quite some thought into it and coming up with the typical explanations like not getting paid, being able to choose what you want to do and stuff it struck me: There are no deadlines for stuff.&lt;/p&gt;
&lt;p&gt;Example: A colleague of mine was to configure a server to do some port forwarding to a virtual machine a few days ago. Since I usually don't get to do much administrating these days and am always keen to learn new things I kinda hijacked the project and tried to get it to work with him. We couldn't figure it out and after a few minutes he said: "Well this was the hour scheduled for it. Let's see if we can back to it Monday."&lt;/p&gt;
&lt;p&gt;That's something I pretty much never do when I'm doing projects for myself: quit. Usually I just keep on poking and prodding the problem till it gives up and goes away. I would even go so far and call it one of my greatest strengths.&lt;/p&gt;</summary><category term="work"></category></entry><entry><title>Nginx is Even Better Than I Thought</title><link href="http://christiankaula.com/nginx-better-i-thought.html" rel="alternate"></link><updated>2009-09-09T08:27:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-09:/nginx-better-i-thought.html/</id><summary type="html">&lt;p&gt;So for quite a few months I was pretty sure having HTTPS on multiple domains with the same IP was a no-go on nginx. &lt;a href="http://www.ruby-forum.com/topic/156637#690017"&gt;I was wrong&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have a OpenSSL version &amp;gt;= 0.9.8f with &lt;a href="http://en.wikipedia.org/wiki/Server_Name_Indication"&gt;SNI&lt;/a&gt; support compiled in and a half-way recent nginx version you are good to go. Just set up as many virtual domains as needed.&lt;/p&gt;
&lt;p&gt;Quick example from memory (I'm quite positive it is correct though):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;somedomain.example.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;keepalive_timeout&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl&lt;/span&gt; &lt;span class="no"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_protocols&lt;/span&gt; &lt;span class="s"&gt;SSLv3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_certificate&lt;/span&gt; &lt;span class="s"&gt;/some/file.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_certificate_key&lt;/span&gt; &lt;span class="s"&gt;/some/file.key&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;someotherdomain.example.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kn"&gt;keepalive_timeout&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl&lt;/span&gt; &lt;span class="no"&gt;on&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_protocols&lt;/span&gt; &lt;span class="s"&gt;SSLv3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_certificate&lt;/span&gt; &lt;span class="s"&gt;/some/other/file.pem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;ssl_certificate_key&lt;/span&gt; &lt;span class="s"&gt;/some/other/file.key&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;evenotherdomain.example.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Keep in mind though, that enabling SSL in any way leads to a kind of catch-all situation. Meaning if you access &lt;em&gt;https://evenotherdomain.exmaple.com&lt;/em&gt; you will most likely end up on one of your SSL-enabled domains (&lt;em&gt;domedomain.example.com&lt;/em&gt; or &lt;em&gt;someotherdomain.example.com&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Here is what I did to prevent that:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;443&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;evenotherdomain.example.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;rewrite&lt;/span&gt; &lt;span class="s"&gt;^(.*)&lt;/span&gt; &lt;span class="s"&gt;http://example.com&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="s"&gt;permanent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="nginx"></category></entry><entry><title>Clear Up Gelato CMS' Gibberish</title><link href="http://christiankaula.com/clear-gelato-cms-gibberish.html" rel="alternate"></link><updated>2009-09-05T12:14:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-05:/clear-gelato-cms-gibberish.html/</id><summary type="html">&lt;p&gt;My search for a nice and easy tumble blog I can host myself lead me in a pretty straight line to &lt;a href="http://gelatocms.com/"&gt;Gelato CMS&lt;/a&gt;. But when I looked into the database after I had been playing around with it a bit I saw that all umlauts (äöü for you non-umlaut knowing ignoramus people) turned to garbage.&lt;/p&gt;
&lt;p&gt;After I had tried to change the database collation a few times (gotta love MySQL for having like a bangzillion of encodings) I struck me that Gelato probably just didn't talk UTF8 to the database. A few minutes of code review later (heck who writes code in Spanish or Italian or whatever that is? and encodes it in latin?!) I came up with a minimal patch that makes Gelato speak proper UTF8.&lt;/p&gt;
&lt;p&gt;In the file &lt;em&gt;gelato/classes/mysql_conenction.class.php&lt;/em&gt; search for the function &lt;em&gt;conectar&lt;/em&gt; and change the return lines (around line 64) to this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nb"&gt;mysql_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;SET NAMES utf8;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;mid_conexion&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;        
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;mid_conexion&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="x"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="gelato"></category><category term="php"></category></entry><entry><title>Don't Listen to the Idiot</title><link href="http://christiankaula.com/dont-listen-idiot.html" rel="alternate"></link><updated>2009-09-03T08:20:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-03:/dont-listen-idiot.html/</id><summary type="html">&lt;p&gt;Okay so yesterday I talked about how Snow Leopard went random on me when it comes to switching keyboard layouts. Disregard that. Turns out I had the keyboard shortcut assigned twice (well I guess one could argue that the leopard shouldn't do that).&lt;/p&gt;
&lt;p&gt;Talking about keyboard shortcuts: the new menu is great. Sure, a endless list with about 400 entries is fun and all but splitting it up into categories doesn't seem the worst idea to me.&lt;/p&gt;
&lt;p&gt;And one more thing: It appears Quicklook learned quite a few new formats. Most code even gets highlighted now.&lt;/p&gt;</summary><category term="mac"></category><category term="snowleopard"></category></entry><entry><title>Snow Leopards' Bad Sides</title><link href="http://christiankaula.com/snow-leopards-bad-sides.html" rel="alternate"></link><updated>2009-09-02T08:47:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-09-02:/snow-leopards-bad-sides.html/</id><summary type="html">&lt;p&gt;Yesterday I got me Snow Leopard since a computer store specialized in Apple stuff is right around the corner of my worky place. When I stood there at the counter waiting for someone to take my money I watched one of their sales clerks leisurely chatting with another customer and another one google some stuff and checking emails. Well, after someone finally decided they wouldn't like me to leave without paying for stuff I had my very own Snow Leopard copy. Yay for me.&lt;/p&gt;
&lt;h4 id="cut_out_the_crap_and_give_some_details"&gt;Cut Out the Crap and Give Some Details&lt;/h4&gt;
&lt;p&gt;Of course I had to install it right when I got home to get all those super duper improvements and speed ups and all the great stuff. The one that caught my eye first was the new default background. It actually doesn't differ that much from the Leopard one but enough to make me smile. (I never was a great friend of the Leopard aurora thingie background.)&lt;/p&gt;
&lt;p&gt;The second thing I really had been looking forward to was the new Wi-Fi dialog which shows a quality indicator for all available networks. I tried it, I liked it. &lt;/p&gt;
&lt;p&gt;Oh and the Exposé thing got an overhaul I really like. It actually tries to remove clutter now by aligning windows and adding some spacing.&lt;/p&gt;
&lt;h4 id="its_not_all_sunshine_in_snow_leopard_ville"&gt;Its Not All Sunshine in Snow Leopard Ville&lt;/h4&gt;
&lt;p&gt;One thing nearly ticked me off after 5 minutes. Its possible to have another keyboard layout for every window again. And to me it seems you cannot switch that off (besides the option that does pretty much nothing). If you are used to US layout but have to switch to DE from time to time its really handy to be able to switch per keyboard. But Snow Leopard pretty much said: "You know what? Fuck that I'll just switch it for you at random."&lt;/p&gt;
&lt;p&gt;Another thing that kept me busy for a few hours: Snow Leopard breaks a lot of stuff. &lt;a href="http://harnly.net/software/letterbox/"&gt;Letterbox&lt;/a&gt;? Dead. &lt;a href="http://www.sente.ch/software/GPGMail/English.lproj/GPGMail.html"&gt;PGP for Mail&lt;/a&gt;? Very dead. &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt;? Oh, why do you ask - just reinstall and recompile the whole thing.&lt;/p&gt;
&lt;p&gt;Oh and did you wonder how they reduced the hard drive space requirement by 50%? They stole the idea from Microsoft who gave up on it in Windows 2000 or something. They simply don't install stuff you might not need. And once you do something stupid like try to run old software it asks you if you really want to install &lt;a href="http://en.wikipedia.org/wiki/Rosetta_%28binary_translation_software%29"&gt;Rosetta&lt;/a&gt; and pulls it out of the net.&lt;/p&gt;
&lt;h4 id="your_conclusion"&gt;Your Conclusion?&lt;/h4&gt;
&lt;p&gt;To be honest: Had I remembered how all this happened to me when I got Leopard already - even after I had waited a month or so before getting it - I would have waited. I just don't see that many great improvements yet but I do see loads of broken software I use daily.&lt;/p&gt;</summary><category term="mac"></category><category term="snowleopard"></category></entry><entry><title>Make Django Send Mails to Admins Only</title><link href="http://christiankaula.com/make-django-send-mails-admins-only.html" rel="alternate"></link><updated>2009-08-19T08:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-08-19:/make-django-send-mails-admins-only.html/</id><summary type="html">&lt;p&gt;Image you are running a staging system for your Django project on which all the testing for the production system is done. You are using a dump of the production database to have some actual data you can play around with. And you have this one/many function/s in which you send email to some/all users. They probably will not be happy to get all those emails from your staging system while not having the slightest idea what's going on.&lt;/p&gt;
&lt;h4 id="the_code"&gt;The Code&lt;/h4&gt;
&lt;p&gt;Here is a solution I came up with:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmailMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DjangoEmailMessage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Wrapper for the original DjangoEmailMessage.&lt;/span&gt;
&lt;span class="sd"&gt;    Responsible for sending emails only to admins instead of original&lt;/span&gt;
&lt;span class="sd"&gt;    addressees if application is in testing mode.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STAGING&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;admin_addresses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ADMINS&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;These people:&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;Would have received this:&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;recipients&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;Staging: &amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;unicode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;admin_addresses&lt;/span&gt;
            &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bcc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EmailMessage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send_mass_mail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datatuple&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fail_silently&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;auth_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;auth_password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Overridden to use own wrapper EmailMessage class.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SMTPConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;auth_user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;auth_password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fail_silently&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fail_silently&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;EmailMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recipient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recipient&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;datatuple&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send_messages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send_mail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;from_email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recipient_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="n"&gt;fail_silently&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;auth_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;auth_password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class="sd"&gt;    Overridden to use own wrapper EmailMessage class.&lt;/span&gt;
&lt;span class="sd"&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SMTPConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;auth_user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;auth_password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;fail_silently&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fail_silently&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;EmailMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;from_email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recipient_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;h4 id="okay_what_does_this_do"&gt;Okay what does this do?&lt;/h4&gt;
&lt;p&gt;I added a setting &lt;em&gt;STAGING&lt;/em&gt; to my &lt;em&gt;settings.py&lt;/em&gt; which is set to &lt;em&gt;True&lt;/em&gt; on the staging system (makes sense no?). That setting controls if emails are actually send to the original receivers or if all outgoing mail is sent to the admins only.&lt;/p&gt;
&lt;p&gt;Of course that only works for cases in which you use your own &lt;em&gt;EmailMessage&lt;/em&gt;, &lt;em&gt;send_mass_mail&lt;/em&gt; and &lt;em&gt;send_mail&lt;/em&gt; class and functions.&lt;/p&gt;</summary><category term="django"></category><category term="python"></category></entry><entry><title>How to Fix Portage</title><link href="http://christiankaula.com/how-fix-portage.html" rel="alternate"></link><updated>2009-08-14T19:31:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-08-14:/how-fix-portage.html/</id><summary type="html">&lt;p&gt;And all of a sudden I got this on my Gentoo server no matter what I tried to emerge:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;#&lt;/span&gt; emerge portage
&lt;span class="go"&gt;Calculating dependencies... done!&lt;/span&gt;

&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&amp;gt;&amp;gt; Verifying ebuild manifests

&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&amp;gt;&amp;gt; Emerging &lt;span class="o"&gt;(&lt;/span&gt;1 of 1&lt;span class="o"&gt;)&lt;/span&gt; sys-apps/portage-2.1.6.13
&lt;span class="go"&gt;[Errno 8] Exec format error:&lt;/span&gt;
&lt;span class="go"&gt;   /usr/lib/portage/bin/ebuild /usr/portage/sys-apps/portage/portage-2.1.6.13.ebuild fetch&lt;/span&gt;
&lt;span class="go"&gt; * Fetch failed for &amp;#39;sys-apps/portage-2.1.6.13&amp;#39;, Log file:&lt;/span&gt;
&lt;span class="go"&gt; *  &amp;#39;/var/tmp/portage/sys-apps/portage-2.1.6.13/temp/build.log&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After some fiddling around and searching through Gentoo's Bugzilla I found out that all that was actually needed was this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="gp"&gt;#&lt;/span&gt; rm /usr/bin/python
&lt;span class="gp"&gt;#&lt;/span&gt; ln -s /usr/bin/python2.5 /usr/bin/python
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;(If your portage was built with python 2.4 you should link that of course.)&lt;/p&gt;</summary><category term="gentoo"></category><category term="linux"></category></entry><entry><title>Archive Twitter Stuff With Python</title><link href="http://christiankaula.com/archive-twitter-stuff-python.html" rel="alternate"></link><updated>2009-08-13T08:49:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-08-13:/archive-twitter-stuff-python.html/</id><summary type="html">&lt;p&gt;Just read &lt;a href="http://morethanseven.net/2007/11/23/archiving-twitter-data-with-python/"&gt;this article&lt;/a&gt; which gives a description on how to archive Twitter stuff with Python. I saw the code and thought 'heck why so complicated?'.&lt;/p&gt;
&lt;p&gt;Get &lt;a href="http://code.google.com/p/python-twitter/"&gt;python-twitter&lt;/a&gt; and do like so: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;twitter&lt;/span&gt;

&lt;span class="n"&gt;api&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;twitter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Api&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetUserTimeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;twitter&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;twitter.txt&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;w&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;utf8&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This code will get the last million posts of the user &lt;em&gt;twitter&lt;/em&gt; and write it to the file &lt;em&gt;twitter.txt&lt;/em&gt; in the same directory as the script itself lies in. If your username should not be &lt;em&gt;twitter&lt;/em&gt; or if you have more than a million posts you might want to change those values (and in the latter case consider getting professional help).&lt;/p&gt;</summary><category term="twitter"></category><category term="python"></category></entry><entry><title>Wee Free Icons</title><link href="http://christiankaula.com/wee-free-icons.html" rel="alternate"></link><updated>2009-08-11T08:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-08-11:/wee-free-icons.html/</id><summary type="html">&lt;p&gt;I'm talking about the little images - not the star people everybody goes crazy about. Anyway, after having used the &lt;a href="http://famfamfam.com/lab/icons/silk/"&gt;Silk Icons&lt;/a&gt; for what seems an eternity (they &lt;em&gt;are&lt;/em&gt; good you know) it was time for something new.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.pinvoke.com/"&gt;Fugue icon set&lt;/a&gt; not only surpasses the Silk icons in sheer number but also includes the source Photoshop files and a guide to mix and match the Icons.&lt;/p&gt;
&lt;p&gt;Definitely the best icon set I know - for now. &lt;/p&gt;</summary><category term="icons"></category></entry><entry><title>The Problem With Django, Nginx and FCGI</title><link href="http://christiankaula.com/problem-django-nginx-fcgi.html" rel="alternate"></link><updated>2009-08-07T01:49:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-08-07:/problem-django-nginx-fcgi.html/</id><summary type="html">&lt;p&gt;Alright after about a whole day of near-continuous downtime I finally found the bug that I overcame few months ago already. I'm using &lt;a href="http://nginx.net/"&gt;nginx&lt;/a&gt; as proxy to Django per FCGI. Now after upgrading nginx the site started to misbehave. No matter which location I tried to access I always ended up on the index page.&lt;/p&gt;
&lt;p&gt;So after loads of trial and error I came to the conclusion that the problem is in the &lt;em&gt;fastcgi_params&lt;/em&gt; file. Consider this line:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;fastcgi_param&lt;/span&gt;  &lt;span class="s"&gt;SCRIPT_NAME&lt;/span&gt;  &lt;span class="nv"&gt;$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What Django expects is not &lt;em&gt;SCRIPT_NAME&lt;/em&gt; but &lt;em&gt;PATH_INFO&lt;/em&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;fastcgi_param&lt;/span&gt;  &lt;span class="s"&gt;PATH_INFO&lt;/span&gt;  &lt;span class="nv"&gt;$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So in case you ever wonder why your Django app only shows you the index page no matter which URL you try to access this might just have to do with the FCGI params.&lt;/p&gt;</summary><category term="django"></category><category term="nginx"></category><category term="fcgi"></category></entry><entry><title>New Design</title><link href="http://christiankaula.com/new-design.html" rel="alternate"></link><updated>2009-07-27T09:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-27:/new-design.html/</id><summary type="html">&lt;p&gt;And there we go again. Since I didn't really feel comfy with the old design anymore I created a new one. I like to call it 'slimbuthappy'.&lt;/p&gt;
&lt;p&gt;This is the first step to my three strep world domination, err, I mean site upgrade plan. Since I don't know when I'll be able to make the second step I won't talk about how great and super and totally awesome* all that is which I'm planning. You'll have to check back regularly and see for yourself.&lt;/p&gt;
&lt;p&gt;*lies&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Pink Ponies for Everybody!</title><link href="http://christiankaula.com/pink-ponies-everybody.html" rel="alternate"></link><updated>2009-07-21T11:21:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-21:/pink-ponies-everybody.html/</id><summary type="html">&lt;p&gt;These days I'm quite amused by all the rage about HTML5 and CSS3. Don't get me wrong I absolute am for it. There are so many hacks and 'techniques' around to archive stuff that should just be in there that sometimes people seem to forget that it could be different.&lt;/p&gt;
&lt;p&gt;But people tend to get freak out about all the new features and possibilities and all those new buzzwords (CSS! HTML5! columns! rounded corners! world peace!) that their seem to forget that all that is nice and surely a Good Thing™ but it all will lead to nothing as long as IE6 and 7 are around and need to be supported.&lt;/p&gt;
&lt;p&gt;So my proposal: why don't we first stop to support IE6. Because the more new stuff we get the more work we will have to make it all work in the crappy legacy browsers. And don't give me that 'oh but when we don't support IE6 our customers will go somewhere else!'. That is why I said &lt;em&gt;we&lt;/em&gt;. If support for IE6 is dropped globally (or at least reduced to a minimum) then we all will be well. And all those poor webdevs that have to write horrible hacks for IE6 will be able to ride their pink ponies all day long.&lt;/p&gt;</summary><category term="css"></category><category term="html"></category><category term="internetexplorer"></category></entry><entry><title>Whoosh Makes the Haystack</title><link href="http://christiankaula.com/whoosh-makes-haystack.html" rel="alternate"></link><updated>2009-07-20T13:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-20:/whoosh-makes-haystack.html/</id><summary type="html">&lt;p&gt;In search of a workable search pluggable for Django I played a bit with &lt;a href="http://code.google.com/p/django-sphinx/"&gt;Django Sphinx&lt;/a&gt; some time ago. Its potentially nice but involves a lot of work to configure &lt;a href="http://sphinxsearch.com/"&gt;Sphinx&lt;/a&gt; itself. So it was difficult enough to configure for me to drop it.&lt;/p&gt;
&lt;p&gt;But now with &lt;a href="http://haystacksearch.org/"&gt;Haystack&lt;/a&gt; there seems to be a new project that tries to be for search what &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; is for migrations: awesome. &lt;/p&gt;
&lt;p&gt;So since I am working on a major update for this site anyway I thought I'd give it a shot and finally implement a search function. To make a short story even shorter: I was done in about 30 minutes. (That includes almost going crazy because I got no search results and realizing I made a typo...)&lt;/p&gt;
&lt;p&gt;What makes the whole thing nice is the fact, that its able to use &lt;a href="http://whoosh.ca/"&gt;Whoosh&lt;/a&gt; (which itself is a quite an awesome name already). 'And what the heck is a Woosh?' I hear you ask. Well its a pure Python search engine and should do for most sites that don't have hundreds of megabytes of searchable data. No fiddling with external configs, no extra dependencies.&lt;/p&gt;
&lt;p&gt;So if you are still searching for an easy way to integrate search features into your project this might be well worth checking out.&lt;/p&gt;</summary><category term="django"></category><category term="whoosh"></category><category term="haystack"></category></entry><entry><title>Selenium is Pretty Neat</title><link href="http://christiankaula.com/selenium-pretty-neat.html" rel="alternate"></link><updated>2009-07-17T10:42:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-17:/selenium-pretty-neat.html/</id><summary type="html">&lt;p&gt;I've been playing with &lt;a href="http://seleniumhq.org/"&gt;Selenium&lt;/a&gt; at work for some time now and the more I saw of it the testing framework the more I was impressed.&lt;/p&gt;
&lt;p&gt;You start out by creating some testcases in Selenium IDE which is a Firefox add-on. It mostly involves recording stuff you do on a website followed by fine-tuning and adding checks if everything works as expected.&lt;/p&gt;
&lt;p&gt;After that you export your tests to a language of your choice (Java, Python, Ruby, etc.) and now can fine-tune even more since now you have a real programming language at your disposal.&lt;/p&gt;
&lt;p&gt;Then all that's left to do is fire up the Selenium server (written in Java) on some machine enter its address to your test and let it do its magic. From what I understand the server takes care to start instances of the chosen browser, injects the needed JavaScript and (if desired) acts as a proxy for all tests.&lt;/p&gt;
&lt;p&gt;It's really fun to watch how browser instances get spawned and do their work, bound by high magic. And all that while being tremendously useful. Highly recommended.&lt;/p&gt;</summary><category term="selenium"></category><category term="testing"></category></entry><entry><title>OpenID for Free</title><link href="http://christiankaula.com/openid-free.html" rel="alternate"></link><updated>2009-07-14T08:55:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-14:/openid-free.html/</id><summary type="html">&lt;p&gt;After I see more and more sites offering &lt;a href="http://openid.net/"&gt;OpenID&lt;/a&gt; authentication and more and more people using it I finally got interested enough to see for myself what it all is about. I didn't do so earlier because I just am getting a little paranoid and OpenID just seemed to me like giving some big, faceless company access to virtually anything I do on the web. Turns out that is not the case.&lt;/p&gt;
&lt;p&gt;All you really have to do it set up your own ID provider which is nothing more than a smallish script (depend on which you choose/what features you need) and creating a profile for yourself/whoever you want to be able to identify.&lt;/p&gt;
&lt;p&gt;I don't have need for much features so I chose &lt;a href="http://simpleid.sourceforge.net/"&gt;SimpleID&lt;/a&gt;, a really lightweight PHP script - hence the name. It didn't give me any problems but I still couldn't use it to auth me on bitbucket until I realized I didn't allow cookies from bitbucket (yes I really do have a paranoid streak).&lt;/p&gt;</summary><category term="openid"></category><category term="php"></category></entry><entry><title>Multi-Object-Edit With Django FormSets</title><link href="http://christiankaula.com/multi-object-edit-django-formsets.html" rel="alternate"></link><updated>2009-07-09T08:39:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-09:/multi-object-edit-django-formsets.html/</id><summary type="html">&lt;p&gt;I had to write a multi-object edit table the other day for a Django project and as such I dove into the &lt;a href="http://docs.djangoproject.com/en/dev/topics/forms/formsets/"&gt;FormSet Documentation&lt;/a&gt;. Django's documentation is really good usually but the part abut the FormSets was a bit of a letdown.&lt;/p&gt;
&lt;p&gt;So in case anybody else is in the same situation here is some code of how I did it (written from memory - should still be okay I hope).&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# forms.py&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.forms.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;modelformset_factory&lt;/span&gt;

&lt;span class="c"&gt;# creating a FormSet for a specific Model is easy&lt;/span&gt;
&lt;span class="n"&gt;FooFormSetBase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;modelformset_factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;Foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;somefield&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;someotherfield&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# now we want to add a checkbox so we can do stuff to only selected items&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FooFormSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FooFormSetBase&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c"&gt;# this is where you can add additional fields to a ModelFormSet&lt;/span&gt;
    &lt;span class="c"&gt;# this is also where you can change stuff about the auto generated form&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_fields&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TracImportTestcaseFormSet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_fields&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;is_checked&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BooleanField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;somefield&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;widget&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attrs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;class&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;somefieldclass&amp;#39;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After writing the FormSet itself here is the view:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="c"&gt;# views.py&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.shortcuts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;redirect&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.template&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;RequestContext&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;fooproject.fooapp.forms&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FooFormSet&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fooview&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;POST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c"&gt;# we have multiple actions - save and delete in this case&lt;/span&gt;
        &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;POST&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;action&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;formset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FooFormSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;queryset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Foo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;formset&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_valid&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;save&amp;#39;&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;formset&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cleaned_data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;is_checked&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
                        &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;u&amp;#39;delete&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;formset&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_valid&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;

            &lt;span class="n"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;someview&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;formset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FooFormSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;queryset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Foo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render_to_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;sometemplate.html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;&amp;#39;formset&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;formset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;context_instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;RequestContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now all that's missing is the template:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;.&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;post&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;accept-charset=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;is_checked&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;somefield&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;someotherfield&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
        &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;form&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;formset.forms&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                    &lt;span class="c"&gt;{# don&amp;#39;t forget about the id field #}&lt;/span&gt;
                    &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;form.id&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
                    &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;form.is_checked&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;form.somefield&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;form.someotherfield&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
        &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;        
        &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;{# and don&amp;#39;t forget about the management form #}&lt;/span&gt;
        &lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;formset.management_form&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;action&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;save&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;chunk&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;save&amp;quot;&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;action&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;delete&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;chunk&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;delete&amp;quot;&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Of course there is stuff still missing - you won't see errors in your form for example. But you get the general idea.&lt;/p&gt;</summary><category term="django"></category></entry><entry><title>CSS is the New C - Sass is the Future</title><link href="http://christiankaula.com/css-new-c-sass-future.html" rel="alternate"></link><updated>2009-07-08T09:03:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-08:/css-new-c-sass-future.html/</id><summary type="html">&lt;p&gt;So the other day I started to look for tools that let me use variables in CSS. This mainly was because it really gets old to copy paste the same colors over and over again. Thanks to Twitter soon I was pointed in the direction of &lt;a href="http://lesscss.org/"&gt;LESS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After playing around with LESS a bit I came to the conclusion that it was nice and allowed for variables and a shortened syntax but overall didn't offer enough flexibility.&lt;/p&gt;
&lt;p&gt;Played with some more tools and finally tried &lt;a href="http://sass-lang.com/"&gt;Sass&lt;/a&gt;. And to spoil the surprise: In my humble opinion that thing is the future of CSS. It allows to use variables, mixins (which can work a bit like functions), imports and uses a syntax that reminds me of Python (which always is a major factor) and saves heaps of unnecessary typing work.&lt;/p&gt;
&lt;p&gt;The only gripe I had with it was that it didn't allow for a &lt;em&gt;--watch&lt;/em&gt; parameter that takes care of always recompiling my CSS files when the SASS source changes. But that was quickly taken care of by using &lt;a href="http://compass-style.org/"&gt;Compass&lt;/a&gt; which sees itself as a kind of meta-framework.&lt;/p&gt;
&lt;p&gt;Really liking the idea I dumped my &lt;a href="http://960.gs/"&gt;960gs&lt;/a&gt; CSS files and replaced them with the 960gs Compass plugin. This really impacted my site big time - but not in a positive way. After kicking out the 960gs plugin again and reinstalling my old official CSS files all was back to normal.&lt;/p&gt;
&lt;p&gt;Closing thoughts: We have frameworks for everything in web development today, so why not have a real one for CSS, too? I mean just think about how much CSS we write all the time - all the same stuff over and over again. And thanks to the syntax of CSS most of what we write could be put into a library and reused. That's where Sass and Compass come into play. Though Compass might not Just Work™ its approach is definitely right and should be watched closely.&lt;/p&gt;</summary><category term="css"></category><category term="960gs"></category><category term="sass"></category><category term="compass"></category></entry><entry><title>Where Asimov was Right</title><link href="http://christiankaula.com/where-asimov-was-right.html" rel="alternate"></link><updated>2009-07-06T10:42:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-06:/where-asimov-was-right.html/</id><summary type="html">&lt;p&gt;Have you ever read &lt;a href="http://www.multivax.com/last_question.html"&gt;The Last Question&lt;/a&gt; by Isaac Asimov? If not please do because I think Asimov is describing the not so far-off future there.&lt;/p&gt;
&lt;p&gt;The point is humanity is changing right now - fast. Some 20 years ago the Internet wasn't much more than a dream of some computer geeks and today it changes humanity itself. How you ask? I do think a lot about things like &lt;a href="http://wikipedia.org/"&gt;Wikipedia&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Cloud_computing"&gt;Cloud Computing&lt;/a&gt;, Online Communities and &lt;a href="http://en.wikipedia.org/wiki/Open_research"&gt;Open Research&lt;/a&gt; these days and it dawns on me that this is where the future is.&lt;/p&gt;
&lt;p&gt;'Duh!' I hear you say. But I might have a bigger scope in mind than just some mid- to long-term business plans and social changes. Give the Internet a few years time and we will become part of it - not just as part takers but as a real part of the net. The net will grow smart over time and it will be all around us and we will all be in it.&lt;/p&gt;
&lt;p&gt;My humble opinion is that we will merge with the net at some point in the future. There won't be a Internet and a user but some kind of hive mind that we all are part of.&lt;/p&gt;
&lt;p&gt;This might sound like freaky stuff and totally science fiction like but even Stephen Hawking hints in that direction: &lt;a href="http://www.dailygalaxy.com/my_weblog/2009/07/stephen-hawking-the-planet-has-entered-a-new-phase-of-evolution.html"&gt;"Humans Have Entered a New Stage of Evolution"&lt;/a&gt;&lt;/p&gt;</summary><category term="internet"></category></entry><entry><title>The Webdesigners Arch Fiend: IE6</title><link href="http://christiankaula.com/webdesigners-arch-fiend-ie6.html" rel="alternate"></link><updated>2009-07-03T23:08:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-03:/webdesigners-arch-fiend-ie6.html/</id><summary type="html">&lt;p&gt;I just read this article: &lt;a href="http://www.usabilitypost.com/2008/09/05/drop-ie6-support-give-people-a-reason-to-upgrade/"&gt;http://www.usabilitypost.com/2008/09/05/drop-ie6-support-give-people-a-reason-to-upgrade/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When I read through all those comments saying something along the lines of "You cannot tell a user to switch browsers! Just make the site work for the user and stop whining!" I couldn't help but feel sorry for these guys. Either they are afraid to have to learn new stuff ("new flashy features") or ... well that's the only reason I can think of really.&lt;/p&gt;
&lt;p&gt;Of course you cant just drop support for IE6 on your site and close out those users. But who says you have to make sure s/he doesn't even realize s/he's on a browser that should have been dead and buried years ago? I actually rather like &lt;a href="http://en.wikipedia.org/wiki/Lynx_%28web_browser%29"&gt;lynx&lt;/a&gt; you know. Does your site work in lynx? What do you mean you never tried? You might just have lost a customer there.&lt;/p&gt;
&lt;p&gt;Tell the client that making the site look on IE6 the same as on a remotely modern browser will cost time and money - lots of it. Ask if it would be enough to just make it work/look okay and display a notice to upgrade that dreaded thing. If not: charge them for it big time!&lt;/p&gt;
&lt;p&gt;Sorry I can't link to it directly so I'll just quote the comment that made me nod my head in agreement:&lt;/p&gt;
&lt;p&gt;Shoghon:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I am being paid to know more about the web than my customer. He is paying for my expertise. I don’t pretend to know what my auto mechanic is doing specifically and stand over his shoulder giving him instructions on how he’ll make a repair.&lt;/p&gt;
&lt;p&gt;It seems a lot of people struggle with this concept. We are professionals. Our job is to not only know what we are doing, but to be able to clearly communicate why we are doing it.&lt;/p&gt;
&lt;p&gt;We shape the industry. If we let our customers dictate everything we’ll end up with 2 billion blog-sites and ’swiss army knife’ styled messes.&lt;/p&gt;
&lt;/blockquote&gt;</summary><category term="internetexplorer"></category></entry><entry><title>Die Cache, Die</title><link href="http://christiankaula.com/die-cache-die.html" rel="alternate"></link><updated>2009-07-02T08:44:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-02:/die-cache-die.html/</id><summary type="html">&lt;p&gt;If you ever need to remove a cache fragment that has been created by the cache template tag do like so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.core.cache&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.utils.hashcompat&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;md5_constructor&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.utils.http&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urlquote&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;invalidate_cache_fragment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fragment_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;cargs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;md5_constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;u&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;urlquote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
    &lt;span class="n"&gt;cache_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;template.cache.&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fragment_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cargs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cache_key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="django"></category></entry><entry><title>What if Twitter Stopped to be Tomorrow?</title><link href="http://christiankaula.com/what-if-twitter-stopped-tomorrow.html" rel="alternate"></link><updated>2009-07-01T08:55:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-07-01:/what-if-twitter-stopped-tomorrow.html/</id><summary type="html">&lt;p&gt;So a combination of two Tweets made me go to thinking mode the other day. The first one asked: "What would you do/think if Twitter didn't exist tomorrow?" And the second one: "I'll leave Twitter in the coming weeks - 140 characters aren't enough."&lt;/p&gt;
&lt;p&gt;Twitter is the hot stuff right now but what if people suddenly really started to realize they aren't that happy with the service? What would happen then?&lt;/p&gt;
&lt;p&gt;Imaging somebody would come up with a open, decentralized protocol that does pretty much the same thing as Twitter does only, well - better.&lt;/p&gt;
&lt;p&gt;In my humble opinion that is what would happen: Somebody would come up with something better that allows you to do the same stuff. Who knows that might even be Google Wave. The three important factors are: open, decentralized and in one word better.&lt;/p&gt;
&lt;p&gt;The service that Twitter provides will probably, over time replace blogs and even a few instant messaging protocols. Or perhaps it will merge with XMPP's pub/sub capability. (Which would be quite cool - why has nobody seen the potential of XMPP yet?) At least that is my prediction.&lt;/p&gt;</summary><category term="twitter"></category><category term="jabber"></category><category term="xmpp"></category></entry><entry><title>Django Performance Tuning - Speed Up!</title><link href="http://christiankaula.com/django-performance-tuning-speed.html" rel="alternate"></link><updated>2009-06-30T08:53:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-30:/django-performance-tuning-speed.html/</id><summary type="html">&lt;p&gt;So these days I spend a lot of my workday trying to get a Django app up to speed that... wasn't exactly written with performance in mind. Here are a few things that helped me speed up that thing (all without going down to SQL level):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you need to check if a foreign key points to an existing model or simply need the id of a related object instead of using &lt;em&gt;foo.user&lt;/em&gt; you can use &lt;em&gt;foo.user_id&lt;/em&gt;. That way you won't hit the database without really needing the related object.&lt;/li&gt;
&lt;li&gt;Same as above but for assignments. Instead of &lt;em&gt;foo.user = bar.user&lt;/em&gt; you can do &lt;em&gt;foo.user_id = bar.user_id&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Same as above but for filters. No need to do &lt;em&gt;Foo.objects.filter(somefk=bar.user)&lt;/em&gt; if you can do &lt;em&gt;Foo.objects.filter(somefk=bar.user_id)&lt;/em&gt; and save a trip to the database in the best case.&lt;/li&gt;
&lt;li&gt;The &lt;a href="http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4"&gt;select_related&lt;/a&gt; queryset method is your friend. But only if you treat it right and don't throw it at any queryset that comes into view. Take some time and consider what related objects you will need and include only those.&lt;/li&gt;
&lt;li&gt;If you don't need objects but only some values in those objects don't let the ORM build a pile of objects just to grab some integers. Read up on &lt;a href="http://docs.djangoproject.com/en/1.0/ref/models/querysets/#values-list-fields"&gt;values_list&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Read up on the &lt;a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#with"&gt;with template tag&lt;/a&gt;. Use it, love it - it will make you a better person.&lt;/li&gt;
&lt;/ul&gt;</summary><category term="django"></category><category term="performance"></category></entry><entry><title>Django Members That are in Fact Raw SQL</title><link href="http://christiankaula.com/django-members-are-fact-raw-sql.html" rel="alternate"></link><updated>2009-06-29T08:32:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-29:/django-members-are-fact-raw-sql.html/</id><summary type="html">&lt;p&gt;So the other day I wondered if it wasn't pretty cool if Django models would have something like members that are in fact raw queries. On the bus home it occurred to me that this functionality already exists. Just add a custom manager to a model which always returns querysets with extras.&lt;/p&gt;
&lt;p&gt;Something like this (not tested so don't complain if it contains errors):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.db&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Manager&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_query_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SomeManager&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_query_set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;select&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;somecount&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span class="s"&gt;                SELECT COUNT(*)&lt;/span&gt;
&lt;span class="s"&gt;                FROM someapp_somemodel&lt;/span&gt;
&lt;span class="s"&gt;            &amp;#39;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,}&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;objects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SomeManager&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="django"></category><category term="sql"></category></entry><entry><title>What to Do if You Have to 'Make All Strings Editable'</title><link href="http://christiankaula.com/what-do-if-you-have-make-all-strings-editable.html" rel="alternate"></link><updated>2009-06-25T16:02:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-25:/what-do-if-you-have-make-all-strings-editable.html/</id><summary type="html">&lt;p&gt;Well that's what I was told the other day. So I came up with the proposal to misuse &lt;a href="http://bitbucket.org/hakanw/django-better-chunks/wiki/Home"&gt;django-better-chunks&lt;/a&gt; as a makeshift database based i18n system. But since I made quite a few changes to the code and wrote some utility functionality I thought 'heck somebody might need just this'.&lt;/p&gt;
&lt;p&gt;Long story short: I published my own &lt;a href="http://bitbucket.org/chrkau/django-chunks/"&gt;django-chunks&lt;/a&gt; fork on github.org.&lt;/p&gt;</summary><category term="django"></category><category term="chunks"></category></entry><entry><title>Twitter is Even Worse Than I Thought</title><link href="http://christiankaula.com/twitter-even-worse-i-thought.html" rel="alternate"></link><updated>2009-06-24T08:48:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-24:/twitter-even-worse-i-thought.html/</id><summary type="html">&lt;p&gt;Well yesterday I got me one of those hip Twitter accounts. Yesterday I also got annoyed like hell by it. I'm getting tweets from people that I don't give anything about. Tim O'Reilly? Thanks but no thanks. Who the heck is that Om Malik and Stege Agee anyway and why should I care? And Souljaboy and Ashley Tisdale? Are you fucking kidding me?&lt;/p&gt;
&lt;p&gt;They don't even show up as followers. So I try to use the manual commands. Those tell me they are successful and I'm not following them anymore. I try to follow them and kick them out of my list again. Nope. I kill my complete list and it changes... nothing.&lt;/p&gt;
&lt;p&gt;So the status page of Twitter says something along the lines of 'well we got follower/following probs let's see what we can do about it'. But those people I get annoyed by seem to be quite well known. Now nobody would say that of course, but what if there is this funky new feature on Twitter that sends tweets to people no matter if they care or not as long as you put enough money on the table? Seems an appealing thought to if I was one of the people in charge.&lt;/p&gt;
&lt;p&gt;If this is the Twitter everybody is so crazy about... I don't get it. Why don't we go back to IRC again?&lt;/p&gt;</summary><category term="twitter"></category></entry><entry><title>A Little Birdy Told Me…</title><link href="http://christiankaula.com/little-birdy-told-me.html" rel="alternate"></link><updated>2009-06-23T09:05:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-23:/little-birdy-told-me.html/</id><summary type="html">&lt;p&gt;Okay I finally gave in and got me one of those hip Twitter accounts. Find me under &lt;a href="http://twitter.com/chrkau"&gt;chrkau&lt;/a&gt; on Twitter (I presume you haven't lived under a rock for the last few months and know what that is).&lt;/p&gt;</summary><category term="twitter"></category></entry><entry><title>With Django Debug Toolbar You Can Debug Django… Duh</title><link href="http://christiankaula.com/django-debug-toolbar-you-can-debug-django-duh.html" rel="alternate"></link><updated>2009-06-19T09:07:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-19:/django-debug-toolbar-you-can-debug-django-duh.html/</id><summary type="html">&lt;p&gt;So since right now I'm playing the performance optimizer again I searched for a nice profiling/debugging tool for Django. Loads of snippets I found, loads of middleware, loads of scripts and stuff. And then a colleague of mine said "you know I always used something called Django debug toolbar or something". I'm like "alright let's google for it and see if it's any good".&lt;/p&gt;
&lt;p&gt;The next few minutes I tried to pick up my jaw from the floor again.&lt;/p&gt;
&lt;p&gt;This thing is the hot stuff. It does all the stuff you need when hunting for performance eating stuff. Shows you queries, their speed, the templates and their rendering times and a lot more.&lt;/p&gt;
&lt;p&gt;There is one problem though: you have to choose between the original version which just works and does the Good Stuff(tm) but looks... let's say functional and a fork that gave me slight problems with jQuery and error pages but is most stylish and has some bells and whistles that are definitely useful (show unique queries and their respective counts especially).&lt;/p&gt;
&lt;p&gt;But no matter which you use it will definitely a big boon in your development process.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://github.com/robhudson/django-debug-toolbar/tree/master"&gt;Django Debug Toolbar (original)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/dcramer/django-debug-toolbar/tree/master"&gt;Django Debug Toolbar (fork)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><category term="django"></category><category term="performanceoptimization"></category></entry><entry><title>Lackeying Some Trading Card Fun?</title><link href="http://christiankaula.com/lackeying-some-trading-card-fun.html" rel="alternate"></link><updated>2009-06-16T14:12:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-16:/lackeying-some-trading-card-fun.html/</id><summary type="html">&lt;p&gt;Just the other day I tried &lt;a href="http://www.lackeyccg.com/"&gt;LackeyCCG&lt;/a&gt; which allows you to play different trading card games (Magic and WoW amongst others) over the net. I didn't have time to really play a game with somebody yet, but this seems really interesting.&lt;/p&gt;
&lt;p&gt;Don't get me wrong I love me old Magic cards - but these thingies do get expansive if you really want a nice deck. Furthermore the layout of the new cards is quite… lacking in my eyes. Though I heard there will be a major rules revamp with &lt;a href="http://www.wizards.com/magic/Magazine/Article.aspx?x=mtg/daily/feature/27a"&gt;Magic 2010&lt;/a&gt; next month. Let's see what that brings. Who knows I might even buy some cards again.&lt;/p&gt;</summary><category term="magic"></category><category term="tcg"></category></entry><entry><title>By the Power of CSS… I Revisit You</title><link href="http://christiankaula.com/power-css-i-revisit-you.html" rel="alternate"></link><updated>2009-06-15T09:49:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-15:/power-css-i-revisit-you.html/</id><summary type="html">&lt;p&gt;Thinking about my last entry about CSS I'm thinking I probably didn't really get the structure across the right way. So let me try again.&lt;/p&gt;
&lt;p&gt;I do not first define all tags and after that all tags with IDs, classes etc. but rather I do define tags in alphabetical order from the bare tag, over the same tags that have IDs and classes to tags that are children of the current tag.&lt;/p&gt;
&lt;p&gt;Like so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.something&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nf"&gt;#singleton&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.special&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.special&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;q&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* some code */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="css"></category><category term="codeconventions"></category></entry><entry><title>Jabberbot is Coming</title><link href="http://christiankaula.com/jabberbot-coming.html" rel="alternate"></link><updated>2009-06-12T09:36:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-12:/jabberbot-coming.html/</id><summary type="html">&lt;p&gt;Yesterday I reached a point where my Jabberbot groupchat framework started to actually work. Since I couldn't really figure out anything to do with it I thought I could replace all the inherited code with my own stuff. That meant I would pretty much create my own Jabberbot framework.&lt;/p&gt;
&lt;p&gt;After thinking that it occurred to me that this might be my fist project anyone might find useful other than myself. Yay for me.&lt;/p&gt;</summary><category term="jabberbot"></category><category term="jabber"></category><category term="xmpp"></category></entry><entry><title>MacS are Like Tools</title><link href="http://christiankaula.com/macs-are-tools.html" rel="alternate"></link><updated>2009-06-11T08:47:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-11:/macs-are-tools.html/</id><summary type="html">&lt;p&gt;So I will say this and then I'll be out of the whole Mac/PC flamewar again.&lt;/p&gt;
&lt;p&gt;For all those people that constantly complain about how super expansive Macs are and that you can get a PC with the same specs considerably cheaper I want to give you two things to think about.&lt;/p&gt;
&lt;p&gt;Firstly: Did you ever really calculate things through? Go on pop up the specs table of all the current Macs and then try to get a PC that has the same CPU (not hard), same RAM (sure why not), GPU (don't make me laugh) same HD (erm... a 2.5" in a desktop?), Screen (PVA please), in case of a notebook the battery (5/7 hours that is) all the other stuff (built in Bluetooth, WiFi, IR, webcam, Firewire and good keyboard and mouse etc.) in a case that is of similar quality (full Aluminum) and try to get the newest Windows (Vista I guess) on top of it. No, really - go ahead and let me know what price you get.&lt;/p&gt;
&lt;p&gt;Secondly: If you don't want a Mac because it's too expansive for your taste I can absolutely understand you. Macs aren't cheap. Though they aren't really that expansive either for their quality either. If you are one of those people that are hobby craftsmen you will want good tools. You will be willing to spend more on a good tool set than other people most likely. Nobody would argue that good tools are to expansive, right? Think about that for a second.&lt;/p&gt;
&lt;p&gt;And now if you are still willing to keep the argument up with stuff like 'but why won't they release a cheap Mac for the people that don't need all the bells and whistles?' I answer this: Why would they? Apple wants (in my opinion) to sell stuff that just works no matter what you want to do with it. That's their thing. And if that isn't the thing you want I beg you to keep your frustration to you or do some sports - I hear that helps.&lt;/p&gt;</summary><category term="mac"></category></entry><entry><title>Jabber With Me Over XMPP</title><link href="http://christiankaula.com/jabber-me-over-xmpp.html" rel="alternate"></link><updated>2009-06-10T08:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-10:/jabber-me-over-xmpp.html/</id><summary type="html">&lt;p&gt;At the moment my personal project is to write a Jabber bot (yes I know it's XMPP now you stingy people). That project was actually kicked off by accident when a friend of mine mentioned writing one and I started to google around out of curiosity. When I stumbled over &lt;a href="http://thpinfo.com/2007/python-jabberbot/"&gt;jabberbot&lt;/a&gt; my thoughts went among the lines of 'well now this doesn't seem too hard...' and the next thing I know is that I was coding away into the night.&lt;/p&gt;
&lt;p&gt;It's really fun to do something that doesn't have to do with the web directly once in a while. No need to care about 'how it looks' since, well, its only text.&lt;/p&gt;
&lt;p&gt;Pro tip:
If you check out the page and think: 'Heck, where are the docs? Two links to the docs of another project and the XMPP specs themselves - that's all?' I can assure you: that actually is all you need. Just have a peek at the actual jabberbot code and the XMPP specs - they surprised me with readability and candy. Well one of those was a lie.&lt;/p&gt;</summary><category term="jabber"></category><category term="xmpp"></category></entry><entry><title>By the Power of CSS…</title><link href="http://christiankaula.com/power-css.html" rel="alternate"></link><updated>2009-06-09T08:47:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-09:/power-css.html/</id><summary type="html">&lt;p&gt;… One is able to write really nice HTML without any inline styles and stuff that is boo-boo. And since I wrote about a bangzillion lines of CSS the last few weeks I was a bit nervous to find out that my way to structure CSS would turn out to be stupid. Turns out it isn't.&lt;/p&gt;
&lt;p&gt;'So you super-duper CSS guru tell me how you do it then' I hear you say. Alrighty I say. Here is the general structure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;html and body tags&lt;/li&gt;
&lt;li&gt;tags&lt;/li&gt;
&lt;li&gt;tags with id&lt;/li&gt;
&lt;li&gt;tags with class&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If I have a case of needing to put multiple selectors on top of one code block I put it right before the first occurrence of the first selector. So in general my CSS files look like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;html&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;a&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nf"&gt;#something&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.somethingelse&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="nc"&gt;.somethingelseyet&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="nc"&gt;.somethingelse&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="nc"&gt;.somethingelseyet&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* css */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="css"></category><category term="codeconventions"></category></entry><entry><title>Why I Barely Ever Read Comments</title><link href="http://christiankaula.com/why-i-barely-ever-read-comments.html" rel="alternate"></link><updated>2009-06-08T08:37:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-06-08:/why-i-barely-ever-read-comments.html/</id><summary type="html">&lt;p&gt;Alright, after some out-time mainly due to work-overload in the last few weeks (and the general laziness of my person) let's see what we can do.&lt;/p&gt;
&lt;p&gt;Yesterday I checked on &lt;a href="www.smashingmagazine.com"&gt;Smashing Magazine&lt;/a&gt; and saw there was another article about Macs. That's nice and stuff and sometimes I even find some interesting info in those but it definitely always means one thing: Flames, flames and even more flames - and then some.&lt;/p&gt;
&lt;p&gt;Every time I see one of those comments among the lines of 'this is why Macs suck and Windows is the only real thing' or 'this is why Windows sucks and Macs are the real thing' I cannot help and wonder if some of those are actually paid. I mean there can't be that many stupid people, right?&lt;/p&gt;
&lt;p&gt;…right?&lt;/p&gt;
&lt;p&gt;I probably still haven't lost my faith in humanity somehow.&lt;/p&gt;</summary><category term="mac"></category><category term="windows"></category></entry><entry><title>Internet Explorer 6 on Mac - Actually Easier Than IE on Windows</title><link href="http://christiankaula.com/internet-explorer-6-mac-actually-easier-ie-windows.html" rel="alternate"></link><updated>2009-05-14T23:20:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-14:/internet-explorer-6-mac-actually-easier-ie-windows.html/</id><summary type="html">&lt;p&gt;In case you ever need to test a site on Internet Explorer 6 on Mac you should check this out: &lt;a href="http://www.kronenberg.org/ies4osx/"&gt;http://www.kronenberg.org/ies4osx/&lt;/a&gt;&lt;/p&gt;</summary><category term="mac"></category><category term="internetexplorer"></category><category term="ies4osx"></category></entry><entry><title>Bash and the Secret of the Lost Folders</title><link href="http://christiankaula.com/bash-and-secret-lost-folders.html" rel="alternate"></link><updated>2009-05-13T09:17:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-13:/bash-and-secret-lost-folders.html/</id><summary type="html">&lt;p&gt;This bit me majorly yesterday. Nobody tells Bash when the current folder is renamed.&lt;/p&gt;
&lt;p&gt;Consider this in a first shell:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;mkdir foo
&lt;span class="nb"&gt;cd &lt;/span&gt;foo
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now fire up a second shell and do this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;mv foo foo.old
mkdir foo
&lt;span class="nb"&gt;cd &lt;/span&gt;foo
touch hellothere.txt
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Try this in your first shell:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
ls
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So what do you see? Missing something? Perhaps the &lt;em&gt;hellothere.txt&lt;/em&gt; file? Well sorry nobody told Bash the folder was renamed. You actually aren't in the new folder but still in the old one which now is called &lt;em&gt;foo.old&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;If you really want to make sure you actually are in the folder pwd says you are, do this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="bash"></category></entry><entry><title>MAME on Mac - Already Like the Sound</title><link href="http://christiankaula.com/mame-mac-already-sound.html" rel="alternate"></link><updated>2009-05-12T15:42:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-12:/mame-mac-already-sound.html/</id><summary type="html">&lt;p&gt;Yesterday I wanted to install &lt;a href="http://mamedev.org/"&gt;MAME&lt;/a&gt; on my MacBook to always have some classy arcade action with me on the go. So my first stop is &lt;a href="http://mameosx.sourceforge.net/"&gt;MAME OS X&lt;/a&gt; of course. It's got all the MAME fun in a nice clean package, all ready for some delicious Mac gaming.&lt;/p&gt;
&lt;p&gt;Then I made the mistake to check what the actual status of MAME itself is just in case they now have some total far out feature I haven't heard of, yet. After realizing they finally have a homepage that doesn't look like it's been designed around 1998 (hey who knows... MAME &lt;em&gt;is&lt;/em&gt; kinda old) and is even pretty slick looking, I see the newest version is 0.130. MAME OS X in it's latest release uses 0.124. Well I cannot have that, of course.&lt;/p&gt;
&lt;p&gt;So after some searching and some more searching and yet some more, I finally found &lt;a href="http://sdlmame.parodius.com/"&gt;SDLMAME binaries for Mac OS X&lt;/a&gt;. Which didn't work and instead complained about missing SDL libraries. So I start to worry that I would have to compile SDL now and that it all would end in tears. Well nope, just had to go to the &lt;a href="http://www.libsdl.org/download-1.2.php"&gt;SDL homepage&lt;/a&gt; and download the Mac SDL framework. &lt;/p&gt;
&lt;p&gt;Now all I did was configure MAME to use OpenGL (-video opengl - actually I put it into mame.ini) to get better speeds, and that was that. Until I realized I didn't have any games to play...&lt;/p&gt;</summary><category term="mac"></category><category term="mame"></category><category term="sdl"></category></entry><entry><title>Python - Strings Very Much Attached</title><link href="http://christiankaula.com/python-strings-very-much-attached.html" rel="alternate"></link><updated>2009-05-08T21:04:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-08:/python-strings-very-much-attached.html/</id><summary type="html">&lt;p&gt;Now this is what you do all the time to strings in Python:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;text&amp;#39;&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;some &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But what if you don't know what you want to insert into a string during programming time? Well then you need the &lt;a href="http://docs.python.org/library/string.html"&gt;Python string module&lt;/a&gt;. It contains all kinds of &lt;a href="http://docs.python.org/library/string.html#template-strings"&gt;light templating tools&lt;/a&gt; which allow you to do this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;string&lt;/span&gt;

&lt;span class="n"&gt;some_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;hello $something&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;some_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;substitute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;something&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;world&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="python"></category></entry><entry><title>Fun With Forms in Django</title><link href="http://christiankaula.com/fun-forms-django.html" rel="alternate"></link><updated>2009-05-07T16:00:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-07:/fun-forms-django.html/</id><summary type="html">&lt;p&gt;Now here I got another pearl. It bugged me to no end that one cannot have a &lt;em&gt;ModelForm&lt;/em&gt; and override only certain attributes of a certain field without having to overwrite the whole field with all of its default attributes. Well, seems that is actually possible, like so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelForm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SomeModel&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SomeForm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;some_field&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;min_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;some_field&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;some_other_field&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;widget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PasswordInput&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href="http://collingrady.wordpress.com/2008/07/24/useful-form-tricks-in-django/"&gt;Useful form tricks in Django&lt;/a&gt;&lt;/p&gt;</summary><category term="django"></category><category term="python"></category></entry><entry><title>Subversion: Ignore More</title><link href="http://christiankaula.com/subversion-ignore-more.html" rel="alternate"></link><updated>2009-05-06T14:08:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-06:/subversion-ignore-more.html/</id><summary type="html">&lt;p&gt;Just a little reminder for myself, since I never am able to recall how to ignore stuff in Subversion:&lt;/p&gt;
&lt;p&gt;You ignore stuff by adding an ignore to the containing directory. Either shorthand per file:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;svn propset svn:ignore somefile .
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Or you can edit the properties manually (which I prefer):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;svn propedit svn:ignore .
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href="http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/"&gt;Command Line svn:ignore a file&lt;/a&gt;&lt;/p&gt;</summary><category term="subversion"></category></entry><entry><title>It's Time for Python Dateutils</title><link href="http://christiankaula.com/its-time-python-dateutils.html" rel="alternate"></link><updated>2009-05-05T23:11:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-05:/its-time-python-dateutils.html/</id><summary type="html">&lt;p&gt;Since I often have to do with date and time arithmetic, &lt;a href="http://labix.org/python-dateutil"&gt;Python dateutil&lt;/a&gt; seems quite interesting. Loads of additional features concerning date and time stuff. I have play a bit with it sometime.&lt;/p&gt;</summary><category term="python"></category></entry><entry><title>That is Why Developers Aren't Called Testers</title><link href="http://christiankaula.com/why-developers-arent-called-testers.html" rel="alternate"></link><updated>2009-05-04T20:51:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-04:/why-developers-arent-called-testers.html/</id><summary type="html">&lt;p&gt;One idea that I encountered and that I just didn't like right from the start is this one:&lt;/p&gt;
&lt;p&gt;Why not let the developers test their own code? I mean they know how it's supposed to work and where it's weaknesses lie. So since they know their code like nobody else they should be qualified to be testers like nobody else, right? Plus it's cheap.&lt;/p&gt;
&lt;p&gt;Well, no. If you wrote the code you probably aren't too keen on finding bugs in it. I guess it's a subconscious thing - you already had the work of creating it, and now your job is to find bugs in the code you just wrote. It's just no fun.&lt;/p&gt;
&lt;p&gt;Furthermore it's not a good idea to let the same brain work on the same problem for too long, in my opinion. It's all about fresh ideas and stuff.&lt;/p&gt;</summary><category term="testing"></category><category term="development"></category></entry><entry><title>Now With Legacy Tag-URLs</title><link href="http://christiankaula.com/now-legacy-tag-urls.html" rel="alternate"></link><updated>2009-05-04T01:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-04:/now-legacy-tag-urls.html/</id><summary type="html">&lt;p&gt;Okay just fixed a stupid bug that Google has been bugging me for for the last few days already. Now the old URLs for tags should work again.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Html Validator - Valid HTML - Profit</title><link href="http://christiankaula.com/html-validator-valid-html-profit.html" rel="alternate"></link><updated>2009-05-01T21:51:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-05-01:/html-validator-valid-html-profit.html/</id><summary type="html">&lt;p&gt;If you are into web development you probably have to code some HTML from time to time if not constantly. And if you are anything like me you always try to get your HTML as valid as possible (I mean, come on - there are cases when you just say 'screw it'). So while the &lt;a href="http://validator.w3.org/"&gt;W3 Markup Validation Service&lt;/a&gt; is nice and stuff, its not really what you call convenient.&lt;/p&gt;
&lt;p&gt;So if you don't know it already you should get &lt;a href="http://users.skynet.be/mgueury/mozilla/index.html"&gt;HTML Validator&lt;/a&gt; which is a Firefox plugin. It validates all sites or just the ones you explicitly enabled it for. It also shows where there are mistakes in your HTML and will give you the same hints the W3 validator gives. That is because both use the &lt;a href="http://openjade.sourceforge.net/doc/index.htm"&gt;OpenSP SGML parser&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;All very convenient (I'm over-using this word a bit no?) and perfect for people that constantly are short on time or simply are lazy like me.&lt;/p&gt;</summary><category term="html"></category><category term="htmlvalidator"></category></entry><entry><title>More Fun With Tracebacks</title><link href="http://christiankaula.com/more-fun-tracebacks.html" rel="alternate"></link><updated>2009-04-30T15:59:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-30:/more-fun-tracebacks.html/</id><summary type="html">&lt;p&gt;Okay if you - unlike me - did actually read the &lt;a href="http://docs.python.org/library/traceback.html"&gt;documentation of the Python traceback module&lt;/a&gt; you probably know that what I wrote &lt;a href="http://christiankaula.com/categories/hints/fun-python-stracktraces/"&gt;here&lt;/a&gt; can be archived much easier if you just do this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;traceback&lt;/span&gt;
    &lt;span class="n"&gt;traceback&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;print_exc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And if you want to do something with your traceback like send it per mail you can do like so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;traceback&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;StringIO&lt;/span&gt;

    &lt;span class="n"&gt;fp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StringIO&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;traceback&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;print_exc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getvalue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="python"></category></entry><entry><title>jQuery That Python</title><link href="http://christiankaula.com/jquery-python.html" rel="alternate"></link><updated>2009-04-30T14:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-30:/jquery-python.html/</id><summary type="html">&lt;p&gt;Okay I got another nice idea for a (not so) little project I should start sometime. Why is it, that you can do these really amazing queries with jQuery, which is written in stupid old JavaScript while you have to traverse till gray matter drops out of your ears which real programming languages like Python?&lt;/p&gt;
&lt;p&gt;To be honest I never really thought of &lt;a href="http://www.crummy.com/software/BeautifulSoup/"&gt;BeautifulSoup&lt;/a&gt; as the holy grail of HTML parsing. Why you ask? Cause I can't even select the last sub-object of a DOM object without traversing my shoes off.&lt;/p&gt;
&lt;p&gt;There has to be some smarter way.&lt;/p&gt;</summary><category term="python"></category><category term="beautifulsoup"></category><category term="jquery"></category></entry><entry><title>Django Can be Too Convenient</title><link href="http://christiankaula.com/django-can-be-too-convenient.html" rel="alternate"></link><updated>2009-04-29T12:08:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-29:/django-can-be-too-convenient.html/</id><summary type="html">&lt;p&gt;Django is nice, I think I have made my point clear on that. As a framework it lets you some truly short code that does quite a lot. It's convenient. But you should be careful to not let yourself fall into the trap of convenience. Here's an example of what I mean:&lt;/p&gt;
&lt;p&gt;So we wrote our super nice model like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;foo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now we need a form so data can get into our little app. We don't need much code for that:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeModelForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelForm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SomeModel&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So after a while our project has grown to a reasonable size and suddenly there is demand for another field in SomeModel that holds extra important secret data nobody ever should be allowed to see save the user herself and our trusty admins. Our new model might look like this now:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;foo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;secret_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;'So what's your point?' you I hear you shout. Sure it's all valid code and everything is working and all is fine. Except your long-forgotten &lt;em&gt;SomeModelForm&lt;/em&gt; now will show an input field for &lt;em&gt;secret_data&lt;/em&gt; if you didn't think of changing it. You would never forget you poor little forms, would you? Well I do, chances are you do forget them too sometimes.&lt;/p&gt;
&lt;p&gt;And because I'm pretty good at forgetting some of the important details when it would be most important to remember them, I trained myself to always write my forms like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SomeModelForm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;forms&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelForm&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SomeModel&lt;/span&gt;
        &lt;span class="n"&gt;fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I'm sure you noticed the fields attribute of the Meta class. This way when I forget about my models they will show too less info instead of too much. Sure the application might still crash in some way because it's missing data, but with an important difference: Now I will get info mails about missing data errors instead of users looking at secret data without me being noticed.&lt;/p&gt;
&lt;p&gt;Yep I know your app will go through a staging phase before it's actually deployed on the production server and stuff like this is found by your legion of professional testers. But still - it's one point on the 'stuff I don't have to worry about' side.&lt;/p&gt;</summary><category term="django"></category><category term="python"></category><category term="codeconventions"></category><category term="security"></category></entry><entry><title>Long Live the South</title><link href="http://christiankaula.com/long-live-south.html" rel="alternate"></link><updated>2009-04-28T10:20:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-28:/long-live-south.html/</id><summary type="html">&lt;p&gt;Just in case you missed it: &lt;a href="http://south.aeracode.org/wiki/ReleaseNotes/0.5"&gt;New stable version of South 0.5 is out.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/categories/hints/news-south/"&gt;I mentioned all those cool new features already.&lt;/a&gt;&lt;/p&gt;</summary><category term="django"></category><category term="south"></category></entry><entry><title>Get Windows for Free (For Internet Explorer Testing on Mac)</title><link href="http://christiankaula.com/get-windows-free-internet-explorer-testing-mac.html" rel="alternate"></link><updated>2009-04-27T14:18:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-27:/get-windows-free-internet-explorer-testing-mac.html/</id><summary type="html">&lt;p&gt;Alright so you're one of those web developer/web designer guys, too? And you're on a Mac and still need to test those websites on the loathed abomination known as Internet Explorer? If you don't want to shell out any money to be able to do what you probably hate here's a quick guide:&lt;/p&gt;
&lt;p&gt;Microsoft has those neat &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;amp;displaylang=en"&gt;virtual images for most versions of Internet Explorer&lt;/a&gt;. Get one. The exe file can be unpacked with &lt;a href="http://wakaba.c3.cx/s/apps/unarchiver.html"&gt;The Unarchiver&lt;/a&gt;, which is free and GPL and all kinds of nice. You can use whatever you like instead of course.&lt;/p&gt;
&lt;p&gt;While you're at it grab a copy of &lt;a href="http://www.virtualbox.org/"&gt;VirtualBox&lt;/a&gt;. Don't worry its free, too.&lt;/p&gt;
&lt;p&gt;Once you got all the basic stuff you can add the now unpacked virtual image file to VirtualBox. You can do that in the &lt;em&gt;Image Manger&lt;/em&gt; or something. In any case you open the dialog with command-d. After you added it you create a new virtual machine and it will probably offer you your just added image as primary partition. Just say yes and click through the process.&lt;/p&gt;
&lt;p&gt;If you start your shiny new Windows image you will most likely get a bluescreen telling you something about some &lt;em&gt;processr.sys&lt;/em&gt; error that just crashed your system to bits. But don't give up just yet.&lt;/p&gt;
&lt;p&gt;Instead fire up regedit and search for &lt;em&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Processor&lt;/em&gt;. Change the value of &lt;em&gt;Start&lt;/em&gt; to 4.&lt;/p&gt;
&lt;p&gt;Now you should be able to start your virtual Windows. But you still won't be able to access any network stuff since the Microsoft image is missing network drivers. And this is the hardest part. You need to get a hold of a file called &lt;em&gt;pcntpci5.sys&lt;/em&gt;. I had no luck finding it online so I had to grab it from an existing Windows installation. You will probably find it somewhere in &lt;em&gt;C:\windows\system32\drivers&lt;/em&gt; or something. Sorry I can't remember the exact location right now.&lt;/p&gt;
&lt;p&gt;And once you jumped through all these loops its time to lean back and enjoy your brand new free windows installation (for web testing purposes). Now wasn't that easy?&lt;/p&gt;
&lt;p&gt;Original links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.mozmonkey.com/2008/vpc-ie6-ie7-ie8-on-mac-os-x/"&gt;Running IE6, IE7 and IE8 on your Mac&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/virtual_pc_guy/archive/2005/10/24/484461.aspx"&gt;Problems with Intelppm.sys and processr.sys under Virtual PC / Virtual Server&lt;/a&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;</summary><category term="mac"></category><category term="windows"></category><category term="virtualbox"></category><category term="theunarchiver"></category></entry><entry><title>Viva! Vista! Worms Armageddon!</title><link href="http://christiankaula.com/viva-vista-worms-armageddon.html" rel="alternate"></link><updated>2009-04-26T13:37:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-26:/viva-vista-worms-armageddon.html/</id><summary type="html">&lt;p&gt;So a friend and me wanted to play Worms Armageddon (&lt;a href="http://christiankaula.com/categories/games/open-a-can-of-worms/"&gt;which you should buy too&lt;/a&gt;) this weekend. One reboot to Windows on my Mac and one installation of Worms on his Vista laptop later we find out it doesn't work. Asked him if he installed the latest update and he tells me he did. Ask him the version number. He tells me it's the latest he found which makes me think it actually is the latest.&lt;/p&gt;
&lt;p&gt;After some more investigation it turns out he installed update 3.0.6.28.0 or something which is the last one that isn't titled beta (I guess). So if you got one of those fancy pancy Vista PCs make sure you get the &lt;a href="http://wormsarmageddon.team17.com/main.html?page=supp&amp;amp;area=upda&amp;amp;file=15"&gt;v3.6.29.0 Update&lt;/a&gt;. And you do want to play Worms - trust me on this.&lt;/p&gt;</summary><category term="game"></category></entry><entry><title>Fun With Python Stracktraces</title><link href="http://christiankaula.com/fun-python-stracktraces.html" rel="alternate"></link><updated>2009-04-23T15:58:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-23:/fun-python-stracktraces.html/</id><summary type="html">&lt;p&gt;Today while happily hacking away at my Python code I found myself in the following situation: I needed the traceback of an exception while not wanting the whole app to exit because of the exception being raised.&lt;/p&gt;
&lt;p&gt;Turns out there is a &lt;a href="http://docs.python.org/library/traceback.html"&gt;traceback module&lt;/a&gt; which in conjunction with the &lt;a href="http://docs.python.org/library/sys.html"&gt;sys module&lt;/a&gt; allows to do some neat things with exceptions.&lt;/p&gt;
&lt;p&gt;Have a look at this quick and dirty example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;foo&lt;/span&gt;

&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="ne"&gt;NameError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nn"&gt;traceback&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="n"&gt;traceback&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;print_tb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exc_info&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This code actually works and doesn't crash (meaning it doesn't do anything but not crash :P), but still prints a nice little traceback so you know on which line the exception occurred.&lt;/p&gt;
&lt;p&gt;All this is very hacky of course - but for debugging purposes its mighty convenient.&lt;/p&gt;</summary><category term="python"></category></entry><entry><title>So Sweet the Crons - Sweetcron</title><link href="http://christiankaula.com/so-sweet-crons-sweetcron.html" rel="alternate"></link><updated>2009-04-22T14:28:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-22:/so-sweet-crons-sweetcron.html/</id><summary type="html">&lt;p&gt;If you are one of those people that totally are into life feeds/streams of... well anything then you will perhaps be interested in &lt;a href="http://www.sweetcron.com/"&gt;Sweetcron&lt;/a&gt;. It's one of those hip lifestream tools - but if you're a bit paranoid about your personal data (like me) than you probably would rather host something like that yourself. Well with thing thing you can.&lt;/p&gt;
&lt;p&gt;By the way I didn't play with it yet but it looks like I'd like to. :P&lt;/p&gt;</summary><category term="sweetcron"></category></entry><entry><title>News From the South</title><link href="http://christiankaula.com/news-south.html" rel="alternate"></link><updated>2009-04-21T15:49:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-21:/news-south.html/</id><summary type="html">&lt;p&gt;Okay this is exciting news. My favorite Django migration tool &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; has received a major update. I just stumbled over some changes to the documentation when I browsing the site the other day. And what did I see? South now does &lt;a href="http://south.aeracode.org/wiki/Autodetection"&gt;automatic migrations&lt;/a&gt; now. What does that mean? You don't have to specify what has changed about your models (most of the time) - south is clever enough to find out for itself (again: most of the time).&lt;/p&gt;
&lt;p&gt;Furthermore the tool now supports ORM freezing. 'What the heck is that?' I hear you ask. Well imagine the following situation: You have one model and need to change some fields. Now that the fields change you also have to jumble around some data in your migration. Let's say you want to split your name column into first_name and last_name. That means adding two columns, splitting the names and deleting your old column. When you add another column to you model now the migration will fail on another computer because during the name splitting your actual database layout doesn't fit to the models Django is trying to read from the database.&lt;/p&gt;
&lt;p&gt;It's actually a bit complicated so I was pleasantly surprised when I found out there is &lt;a href="http://south.aeracode.org/wiki/Tutorial3"&gt;new documentation&lt;/a&gt; that describes exactly this case: Changing database layout and manipulating data.&lt;/p&gt;
&lt;p&gt;And since there is a &lt;a href="http://groups.google.com/group/django-developers/browse_thread/thread/c95dfa1f480c3772"&gt;petition on the official django-developers mailing list&lt;/a&gt; to include South in the core distribution I'm more happy than ever with my choice of migration tool.&lt;/p&gt;</summary><category term="south"></category></entry><entry><title>VoodooPad - Its a Wiki on Your Desktop</title><link href="http://christiankaula.com/voodoopad-its-wiki-your-desktop.html" rel="alternate"></link><updated>2009-04-20T19:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-20:/voodoopad-its-wiki-your-desktop.html/</id><summary type="html">&lt;p&gt;So the other day I bought &lt;a href="http://www.flyingmeat.com/voodoopad/"&gt;VoodooPad&lt;/a&gt;. Yes I actually paid money for it. If you knew me you would know that means something.&lt;/p&gt;
&lt;p&gt;First you have to know that I'm a huge fan of wikis. They just have something about them that helps me being creative. Write something, see something, link something, write something and so on. But up to now I never found the perfect wiki for me. Well &lt;a href="http://www.dokuwiki.org/dokuwiki"&gt;dokuwiki&lt;/a&gt; comes close but, you know, its written in PHP and it doesn't use a database backend.&lt;/p&gt;
&lt;p&gt;Furthermore web stuff always feels sluggish to me. Sure with all that hip new AJAX stuff things are quite smooth these days and still there always is a slight delay that starts bugging me after a while. Click, wait, click, wait, you get the idea.&lt;/p&gt;
&lt;p&gt;Well with a desktop app you don't have that problem. Problem is a wiki isn't a desktop application - or so I thought. Turns out &lt;a href="http://en.wikipedia.org/wiki/Personal_wiki"&gt;there are quite a few wikis that are intended for desktop use&lt;/a&gt;. Most are written in JavaScript or something though which doesn't help me with my original problem. But there really are a few implemented as apps. And one of the original ones was VoodooPad.&lt;/p&gt;
&lt;p&gt;And VoodooPad got all the good stuff. All the linky writy stuff I want. Plus: its a desktop application written in a real programming language. Oh: aaand its written for Macs. What more can one want? So I tell you to give it a try. There even is a &lt;a href="http://www.flyingmeat.com/voodoopad/voodoopadlite.html"&gt;free version&lt;/a&gt; in case you don't want to shell out any money. You got no excuses left. You know what to do.&lt;/p&gt;</summary><category term="voodoopad"></category></entry><entry><title>Heeyoo, SEO</title><link href="http://christiankaula.com/heeyoo-seo.html" rel="alternate"></link><updated>2009-04-19T13:38:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-19:/heeyoo-seo.html/</id><summary type="html">&lt;p&gt;So if you, like me have no idea about what all this &lt;a href="http://en.wikipedia.org/wiki/Search_engine_optimization"&gt;SEO stuff&lt;/a&gt; is all about but are eager to learn I got a nice site for you. Have a look at the &lt;a href="http://www.seomoz.org/blog"&gt;SEOmoz Blog&lt;/a&gt;, and especially at &lt;a href="http://www.seomoz.org/blog/rewriting-the-beginners-guide-part-ix-myths-penalties-and-spam"&gt;this post&lt;/a&gt; tailored to give beginners a crash course about how search engine optimization really works and how it dosn't.&lt;/p&gt;</summary><category term="seo"></category></entry><entry><title>Take a Note on the Side With Sidenote</title><link href="http://christiankaula.com/take-note-side-sidenote.html" rel="alternate"></link><updated>2009-04-17T15:10:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-17:/take-note-side-sidenote.html/</id><summary type="html">&lt;p&gt;So you're coding for a living and every few minutes there is this snippet of code you would like to keep around just in case but don't know where to put it? Or perhaps you're one of these people that have great ideas constantly but just never got a piece of paper?&lt;/p&gt;
&lt;p&gt;Well in both cases you should check out &lt;a href="http://www.chatelp.org/?p=50"&gt;Sidenote&lt;/a&gt;. It's quite a smart little tool that hides behind the edge of your monitor until you need it. Then it scrolls out smoothly and is ready to take your color coded, date sorted notes of any kind.&lt;/p&gt;</summary><category term="sidenote"></category></entry><entry><title>Piwik Even Sounds Cooler Than Google Analytics</title><link href="http://christiankaula.com/piwik-even-sounds-cooler-google-analytics.html" rel="alternate"></link><updated>2009-04-16T13:20:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-16:/piwik-even-sounds-cooler-google-analytics.html/</id><summary type="html">&lt;p&gt;For all of you who like me are getting a bit paranoid about Google these days and still would like to have the nice stuff that a tracker like that provides I got one nice tool for you: &lt;a href="http://piwik.org/"&gt;Piwik&lt;/a&gt;. This thingie tries to be the free, open source Google Analytics (they actually say that) and it actually comes pretty close for its price. &lt;/p&gt;
&lt;p&gt;You just set it up once and can track an unlimited amount of other sites with your installation. All you need to do to set up another site is add a code snippet to the HTML. And from then on you can enjoy a whole torrent of information about the people visiting your site. Ever wanted to know if you're more attractive to wide screen users or the old regular type? With this thing you can.&lt;/p&gt;
&lt;p&gt;Personally I enjoy using it a lot. I'm getting my feet wet with SEO and this tool helps a good bit with figuring out what the heck is going on with ones site.&lt;/p&gt;</summary><category term="piwik"></category><category term="googleanalytics"></category><category term="seo"></category></entry><entry><title>Pixen, Pixel… Editor</title><link href="http://christiankaula.com/pixen-pixel-editor.html" rel="alternate"></link><updated>2009-04-15T23:45:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-15:/pixen-pixel-editor.html/</id><summary type="html">&lt;p&gt;Okay I couldn't come up with a witty title this time - sue me. But nevertheless I have a real treat for you today. Sure we all use Photoshop and there surly isn't anything that can compare. Yeah, yeah we know that. But &lt;em&gt;what about those times you fire up the big beast that Photoshop is just to edit some tiny little graphic&lt;/em&gt; or need to come up with a simple icon?&lt;/p&gt;
&lt;p&gt;Now that is when you fire up &lt;a href="http://opensword.org/Pixen/"&gt;Pixen&lt;/a&gt; which pretty much is loaded instantly. This thing is &lt;em&gt;made for pixel artists&lt;/em&gt; so it shines with all things small. &lt;em&gt;Icons&lt;/em&gt;? Check. &lt;em&gt;Avatars&lt;/em&gt;? Sure. Perhaps one of those &lt;em&gt;hip stripe backgrounds&lt;/em&gt;? Please go ahead. Or perhaps you need an &lt;em&gt;animated GIF&lt;/em&gt;? Pixen does it. So please, please do me a favor and grab a copy of Pixen. That thing is just so much fun to use.&lt;/p&gt;</summary><category term="pixen"></category><category term="photoshop"></category></entry><entry><title>Long Hard Road Out of Hell</title><link href="http://christiankaula.com/long-hard-road-out-of-hell.html" rel="alternate"></link><updated>2009-04-14T00:29:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-14:/long-hard-road-out-of-hell.html/</id><summary type="html">&lt;p&gt;Aaand we're back again. Well okay the content is missing for now. That's cause I switched the whole place to English only for now. The German stuff will be back with one of the next updates. Getting up the English version of the content will be my main goal in the next few days. Bare with me.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Suspicious SuspiciousOperation Exceptions</title><link href="http://christiankaula.com/suspicious-suspiciousoperation-exceptions.html" rel="alternate"></link><updated>2009-04-09T08:38:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-04-09:/suspicious-suspiciousoperation-exceptions.html/</id><summary type="html">&lt;p&gt;Using Apache and Django is throwing SuspiciousOperation Exception in your face and you have no idea why? Chances are you are using absolute paths. Django doesn't like that. It expects you to be a good boy/girl and put all your stuff under MEDIA_ROOT with relative paths. Everything else is perceived as suspicious behavior it seems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;update 2011-03-16:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks to Oto for giving me a heads up:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You can fix this by linking to the folder you need to put your images in
using&lt;/p&gt;
&lt;p&gt;ln -s /my/uploads/ /my/project/static/media&lt;/p&gt;
&lt;p&gt;Django will write to the media folder and it will really write to the uploads
folder.&lt;/p&gt;
&lt;p&gt;Just wanted to let you know in case you wanted to update your blog post to
give an alternative. I ran into this issue when working on a multi-front
store with a backend master app controlling all the data/assets.&lt;/p&gt;
&lt;/blockquote&gt;</summary><category term="django"></category><category term="apache"></category></entry><entry><title>Apple Mail AKA Hides-Best-Things</title><link href="http://christiankaula.com/apple-mail-aka-hides-best-things.html" rel="alternate"></link><updated>2009-03-29T14:01:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-29:/apple-mail-aka-hides-best-things.html/</id><summary type="html">&lt;p&gt;After almost getting used to Mail not supporting identities, today I finally found a way to use them too. Mail supports an infinite number of alias-sets consisting of E-mail and full name. To make Mail actually provide this feature you have to create them manually though. Here's and example entry in &lt;em&gt;~Library/Preferences/com.apple.mail.plist&lt;/em&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;MailAccounts&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;AccountName&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;User@example.com&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;AccountPath&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;~/Library/Mail/IMAP-user@example.com&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;AccountType&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;IMAPAccount&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;EmailAddresses&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;user@example.com&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;EmailAliases&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;alias&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;alias1@example.com&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;name&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Name 1&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;alias&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;alias2@example.com&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;name&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Name 2&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;FullUserName&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Official Name&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;By the way if you only need alias email addresses you can do that directly per user interface. Just put all the email addresses you need into the *Email Address" field separated by commas.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.macosxhints.com/article.php?story=20051213200935504"&gt;Original comment by xSmurf&lt;/a&gt;&lt;/p&gt;</summary><category term="mac"></category><category term="mail"></category></entry><entry><title>Don't Bring Me Down…</title><link href="http://christiankaula.com/dont-bring-me-down.html" rel="alternate"></link><updated>2009-03-29T03:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-29:/dont-bring-me-down.html/</id><summary type="html">&lt;p&gt;"It’s finally time to take IE6 behind the shed and shoot it." Hell Yeah.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bringdownie6.com/"&gt;http://www.bringdownie6.com/&lt;/a&gt;&lt;/p&gt;</summary><category term="internetexplorer"></category></entry><entry><title>Me and the Boys</title><link href="http://christiankaula.com/me-and-the-boys.html" rel="alternate"></link><updated>2009-03-27T23:34:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-27:/me-and-the-boys.html/</id><summary type="html">&lt;p&gt;Okay so after the Simpsons episode "Take My Wife, Sleaze" was on again tonight I remembered I never actually found out the name of the song that's playing while the bikers crash the Simpsons' house.&lt;/p&gt;
&lt;p&gt;After some digging I'm smarter now: It's &lt;a href="http://www.youtube.com/watch?v=i0yOx1nc5TI"&gt;Me and the Boys by Dave Edmunds&lt;/a&gt;. Really nice song.&lt;/p&gt;</summary><category term="simpsons"></category></entry><entry><title>I Have a Dream</title><link href="http://christiankaula.com/i-have-a-dream.html" rel="alternate"></link><updated>2009-03-25T22:57:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-25:/i-have-a-dream.html/</id><summary type="html">&lt;p&gt;Wouldn't it be quite nice if there was a django-pluggable in which let's you edit a few configs and suddenly your project knows where and how it has to be deployed? Then all there's left to do is hack in ./manage deploy watch a few log entries scroll by and bingo: new version running on the server. That would be quite cool wouldn't it?&lt;/p&gt;
&lt;p&gt;Well let's see - perhaps I'll sit down sometime and hack something together.&lt;/p&gt;</summary><category term="django"></category></entry><entry><title>Compress This Mess</title><link href="http://christiankaula.com/compress-this-mess.html" rel="alternate"></link><updated>2009-03-25T00:13:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-25:/compress-this-mess.html/</id><summary type="html">&lt;p&gt;I think my new favorite Django-pluggable is &lt;a href="http://code.google.com/p/django-compress/"&gt;django-compress&lt;/a&gt;. Since I still haven't figured out how to install the &lt;a href="http://developer.yahoo.com/yui/compressor/"&gt;YUI Compressor&lt;/a&gt; globally, I now can leave it all to the Django-app.&lt;/p&gt;</summary><category term="django"></category><category term="yuicompressor"></category></entry><entry><title>Ack, Knowledged</title><link href="http://christiankaula.com/ack-knowledged.html" rel="alternate"></link><updated>2009-03-23T23:11:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-23:/ack-knowledged.html/</id><summary type="html">&lt;p&gt;Really nice and handy tool: &lt;a href="http://github.com/protocool/ack-tmbundle/tree/master"&gt;ack Bundle&lt;/a&gt;. It's about a bangzillion times faster than the ordinary 'Search in Project' thing of &lt;a href="http://macromates.com/"&gt;Textmate&lt;/a&gt;. That probably doesn't make it the optimal tool for &lt;a href="http://dropular.net/content/_fixed/wiy02sbg0k_whypeopleseemtohavefreetime.png"&gt;your daily office work&lt;/a&gt;.&lt;/p&gt;</summary><category term="textmate"></category></entry><entry><title>Plug in TextMate</title><link href="http://christiankaula.com/plug-in-textmate.html" rel="alternate"></link><updated>2009-03-22T22:22:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-22:/plug-in-textmate.html/</id><summary type="html">&lt;p&gt;Funny that I didn't know until a short while ago that my favorite text editor &lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt; supports plug-ins. Even funnier: With &lt;a href="http://ciaranwal.sh/2008/08/05/textmate-plug-in-projectplus"&gt;ProjectPlus&lt;/a&gt; the lighty light TextMate almost becomes a mini IDE.&lt;/p&gt;
&lt;p&gt;Funny.&lt;/p&gt;</summary><category term="textmate"></category></entry><entry><title>Put Into Grand Perspective</title><link href="http://christiankaula.com/put-into-grand-perspective.html" rel="alternate"></link><updated>2009-03-14T16:41:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-14:/put-into-grand-perspective.html/</id><summary type="html">&lt;p&gt;I've been searching for a Mac app that allows me to see where all my precious hard drive space has gone. There is quite a nice little app called &lt;a href="http://w3.win.tue.nl/nl/onderzoek/onderzoek_informatica/visualization/sequoiaview//"&gt;SequoiaView&lt;/a&gt; which is really good at that task - sadly it's not available for my beloved Mac.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://grandperspectiv.sourceforge.net/"&gt;Grand Perspective&lt;/a&gt; to the rescue! This thingie does exactly what I want it to and even looks better than SequoiaView. Well you know - we Mac people are suckers for looks.&lt;/p&gt;</summary><category term="mac"></category><category term="grandperspective"></category><category term="sequoiaview"></category></entry><entry><title>Code-A-Robot</title><link href="http://christiankaula.com/code-a-robot.html" rel="alternate"></link><updated>2009-03-11T11:29:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-11:/code-a-robot.html/</id><summary type="html">&lt;p&gt;The idea behind &lt;a href="http://robocode.sourceforge.net/"&gt;Robocode&lt;/a&gt; is nice. Why does it take 7 semesters till somebody thinks of letting students program some silly combat bots to let them learn to code and have some fun at the same time? Even people that usually don't even touch code with a 10 foot pole suddenly hack away happily at their killer algorithms, high on motivation.&lt;/p&gt;
&lt;p&gt;Somebody came up with a really smart idea: Show what you can use all those boring code stuff for. Perhaps even have fun while competing with other people around you and getting a kick out of it. And what does one learn programming with? Double linked lists and sorting algorithms that have been coded about a bangzillion times already.&lt;/p&gt;</summary><category term="robocode"></category></entry><entry><title>Sub Fine Mecum Nemo Non Consentiet</title><link href="http://christiankaula.com/sub-fine-mecum-nemo-non-consentiet.html" rel="alternate"></link><updated>2009-03-11T00:41:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-11:/sub-fine-mecum-nemo-non-consentiet.html/</id><summary type="html">&lt;p&gt;I find it interesting that everybody that had the chance (was forced) to work on a Mac for a period of time buys one sooner or later. Most probably do cause these thingies are really good lookin' - I'm not deluding myself there. But I also think that once used to Mac OS nobody really wants to go back to Windows that soon.&lt;/p&gt;</summary><category term="mac"></category></entry><entry><title>DNS - the DNA of the Web</title><link href="http://christiankaula.com/dns-the-dna-of-the-web.html" rel="alternate"></link><updated>2009-03-11T00:12:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-03-11:/dns-the-dna-of-the-web.html/</id><summary type="html">&lt;ul&gt;
&lt;li&gt;d-lb-a01.isp.t-ipnet.de 217.237.148.70&lt;/li&gt;
&lt;li&gt;h-lb-a01.isp.t-ipnet.de 217.237.149.142&lt;/li&gt;
&lt;li&gt;k-lb-a01.isp.t-ipnet.de 217.237.150.115&lt;/li&gt;
&lt;li&gt;l-lb-a01.isp.t-ipnet.de 217.237.149.205&lt;/li&gt;
&lt;li&gt;m-lb-a01.isp.t-ipnet.de 217.237.151.115&lt;/li&gt;
&lt;li&gt;n-lb-a01.isp.t-ipnet.de 217.237.148.102&lt;/li&gt;
&lt;li&gt;s-lb-a01.isp.t-ipnet.de 217.237.151.142&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.atelier89.de/users/dirk/t-o/010.html"&gt;Adressen der lokalen DNS-Server von T-Online&lt;/a&gt;&lt;/p&gt;</summary><category term="dns"></category></entry><entry><title>Open a Can of Worms</title><link href="http://christiankaula.com/open-a-can-of-worms.html" rel="alternate"></link><updated>2009-02-28T18:51:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-28:/open-a-can-of-worms.html/</id><summary type="html">&lt;p&gt;Everybody should always have at least one copy of &lt;a href="http://wormsarmageddon.team17.com/"&gt;Worms Armageddon&lt;/a&gt; on every computer available. It's just one of the best and timelessest (that isn't a word is it?) games ever made. It's got everything: strategy, tactic, skill and the insane laughter that follows the blasting 5 worms with a Mad Cow Herd dropped while dangling from a Ninja Rope. And with all that it's easy to learn and hard to master.&lt;/p&gt;
&lt;p&gt;And besides all that this game is this game so old (and still quite up-to-date through patches) that it has no hardware and or software requirements to speak of. But the kicker is this: This game costs next to nothing these days. So what the heck are you waiting for? Get this game - and while you're at it buy a copy for your friends too.&lt;/p&gt;</summary><category term="game"></category><category term="worms"></category></entry><entry><title>You Don't Print the Web Do You?</title><link href="http://christiankaula.com/you-dont-print-the-web-do-you.html" rel="alternate"></link><updated>2009-02-27T10:56:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-27:/you-dont-print-the-web-do-you.html/</id><summary type="html">&lt;p&gt;Somehow I find it funny that so many web designers and agencies advertise their services with &lt;em&gt;'pixel perfectness'&lt;/em&gt;. That probably would mean the site looks like the Photoshop template - down to the pixel. Just like with print stuff where you define positions with a precision of three positions after decimal point and it will look &lt;em&gt;exactly&lt;/em&gt; like that when it's done.&lt;/p&gt;
&lt;p&gt;Well someone must have missed the point that the web isn't your average print medium. The web isn't meant to be printed and put into magazine form. It's not important that a site looks the same no matter what - it's important that it looks &lt;em&gt;good&lt;/em&gt;. And even more important: that it works.&lt;/p&gt;</summary><category term="webdesign"></category></entry><entry><title>Postgres on Mac Revisted</title><link href="http://christiankaula.com/postgres-on-mac-revisted.html" rel="alternate"></link><updated>2009-02-20T21:33:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-20:/postgres-on-mac-revisted.html/</id><summary type="html">&lt;p&gt;Whops seems like I missed to write down that you always have to set up a default database with Postgres before you can do anything else.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb
sudo su postgres -c &lt;span class="s1"&gt;&amp;#39;/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb&amp;#39;&lt;/span&gt;

sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href="http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition"&gt;Installing Ruby on Rails and PostgreSQL on OS X&lt;/a&gt;&lt;/p&gt;</summary><category term="postgres"></category><category term="mac"></category><category term="macports"></category></entry><entry><title>What the Heck is a KeePass?</title><link href="http://christiankaula.com/what-the-heck-is-a-keepass.html" rel="alternate"></link><updated>2009-02-20T21:26:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-20:/what-the-heck-is-a-keepass.html/</id><summary type="html">&lt;p&gt;Sometimes I don't get people: "Oh heck what was my ICQ again? Could you give it to me?" Or how about "Oh... what was my login and pass for my web space again?"&lt;/p&gt;
&lt;p&gt;Know this kind of statement? Did you ever say that? Well the solution is really simple: Write it down. Or even better: Encrypt all your login data with &lt;em&gt;one good&lt;/em&gt; password. &lt;a href="http://keepass.info/"&gt;KeePass&lt;/a&gt; respectively &lt;a href="http://www.keepassx.org/"&gt;KeePassX&lt;/a&gt; have been a great little tool for me on Windows, Linux and my trusty old Macs.&lt;/p&gt;</summary><category term="keepass"></category></entry><entry><title>Saving and Its Massive Effects</title><link href="http://christiankaula.com/saving-and-its-massive-effects.html" rel="alternate"></link><updated>2009-02-20T21:21:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-20:/saving-and-its-massive-effects.html/</id><summary type="html">&lt;p&gt;The 21. Keeper is in the embassy. But cause there's a bug it isn't visible most of the time. Simply enter the room, save and load the savegame.&lt;/p&gt;
&lt;p&gt;If you don't know what I'm talking about: get Mass Effect. It's a pretty cool game - especially story wise. But blasting aliens with full automatic rifles and shotguns also has a certain entertainment factor.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://masseffect.bioware.com/forums/viewtopic.html?topic=598327&amp;amp;forum=123&amp;amp;sp=15"&gt;Thread auf Bioware Foren&lt;/a&gt;&lt;/p&gt;</summary><category term="masseffect"></category><category term="game"></category></entry><entry><title>I'm Too Cheap for .Mac</title><link href="http://christiankaula.com/im-too-cheap-for-mac.html" rel="alternate"></link><updated>2009-02-20T21:19:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-20:/im-too-cheap-for-mac.html/</id><summary type="html">&lt;p&gt;Got multiple Macs and don't feel the need to spend money on .Mac? &lt;a href="http://www.cis.upenn.edu/~bcpierce/unison/index.html"&gt;Unison&lt;/a&gt; to the rescue! This little tool lets you synchronize directory trees and acts like its some kind of simple CVS, meaning it detects conflicts (for example when a file has been changed on multiple Macs) and lets you resolve them.&lt;/p&gt;
&lt;p&gt;And did I mention it also does &lt;em&gt;backups&lt;/em&gt;? Although you probably shouldn't use it as a backup tool. The backup functionality is more like a extra safety measure to make sure you don't overwrite your precious files with versions 3 years old.&lt;/p&gt;</summary><category term="unison"></category><category term="mac"></category></entry><entry><title>You Can Even Calibrate Batteries These Days</title><link href="http://christiankaula.com/you-can-even-calibrate-batteries-these-days.html" rel="alternate"></link><updated>2009-02-19T17:28:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-19:/you-can-even-calibrate-batteries-these-days.html/</id><summary type="html">&lt;p&gt;If you are a proud fellow-owner of a MacBook you probably like it as much as me. And since you like it that much you want to keep it in good shape for as long as possible, right? Well here I got one for you: Calibrating the battery will help to increase its lifetime.&lt;/p&gt;
&lt;p&gt;Here's how:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Charge Battery fully (green MagSafe light) and keep the cable plugged for some 2 hours.&lt;/li&gt;
&lt;li&gt;Disconnect MagSafe and wait for battery to discharge itself so much that MacBook goes to sleep.&lt;/li&gt;
&lt;li&gt;Let MacBook be for at least 5 hours straight.&lt;/li&gt;
&lt;li&gt;Charge Battery fully again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;From what I gathered you should do this about once a month for full effect.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.apple.com/kb/HT1490"&gt;Calibrating your computer's battery for best performance&lt;/a&gt;&lt;/p&gt;</summary><category term="apple"></category><category term="mac"></category></entry><entry><title>Don't Mind Me - Just Passing Through</title><link href="http://christiankaula.com/dont-mind-me-just-passing-through.html" rel="alternate"></link><updated>2009-02-10T23:01:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-10:/dont-mind-me-just-passing-through.html/</id><summary type="html">&lt;p&gt;Just a few CSS changes that in my opinion help readability on the site.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Virtual Python Revisited</title><link href="http://christiankaula.com/virtual-python-revisited.html" rel="alternate"></link><updated>2009-02-10T22:59:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-10:/virtual-python-revisited.html/</id><summary type="html">&lt;p&gt;Alright now everything should be okay again.&lt;/p&gt;
&lt;p&gt;One only has to know that &lt;a href="http://pypi.python.org/pypi/virtualenv"&gt;virtualenv&lt;/a&gt; handles everything on its own if you let it. Just use the Python binary in the according environment. Handy.&lt;/p&gt;</summary><category term="update"></category><category term="virtualenv"></category></entry><entry><title>Going South</title><link href="http://christiankaula.com/going-south.html" rel="alternate"></link><updated>2009-02-10T08:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-10:/going-south.html/</id><summary type="html">&lt;p&gt;Okay so after taking a few hours to find out how to get a &lt;em&gt;unique SlugField&lt;/em&gt; into the database per &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; here's what I found out:&lt;/p&gt;
&lt;p&gt;Adding the unique index is the last thing South does in a forward migration. That means all you need is a few lines of code after the call to add_field that take care of the empty entries getting unique data that would otherwise violate the unique constraint.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;string&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;random&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;do_stuff&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;letters&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;
    &lt;span class="n"&gt;newpasswd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;newpasswd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newpasswd&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;newpasswd&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Migration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;forwards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c"&gt;# Adding field &amp;#39;Category.slug&amp;#39;&lt;/span&gt;
        &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;forum_category&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#39;slug&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SlugField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;sdf&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unique&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;keep_default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;Category&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;do_stuff&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;South is really neat - once you figured out how it works.&lt;/p&gt;</summary><category term="django"></category><category term="south"></category></entry><entry><title>These Windows Aren't Clear at All</title><link href="http://christiankaula.com/these-windows-arent-clear-at-all.html" rel="alternate"></link><updated>2009-02-07T04:18:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-02-07:/these-windows-arent-clear-at-all.html/</id><summary type="html">&lt;p&gt;Curious that every operating system I know can be installed on pretty much any partition one desires - save Windows of course.&lt;/p&gt;
&lt;p&gt;I'm quite sure I knew this once already: Windows can only be installed on the first hard drive of the system. My pretty worry free life as Mac user probably made me forget some of this... let's call it wisdom. It took me about an hour to remember this Windows 'specialty'. And the error message 'no usable partitions' didn't really help me either.&lt;/p&gt;
&lt;p&gt;The solution? Simple: deactivate all other hard drives in the BIOS. Windows will think it will have its earned place right in front and will generously allow you to install it. Voila.&lt;/p&gt;</summary><category term="windows"></category></entry><entry><title>Database Switcheroo</title><link href="http://christiankaula.com/database-switcheroo.html" rel="alternate"></link><updated>2009-01-06T14:56:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2009-01-06:/database-switcheroo.html/</id><summary type="html">&lt;p&gt;Switching the database is quite fun with Django. In my case I'm slowly migrating my sites from MySQL to Postgres.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;manage dumpdata&lt;/em&gt; will produce a database independent XML or JSON dump&lt;/li&gt;
&lt;li&gt;&lt;em&gt;manage syncdb&lt;/em&gt; will take care of producing a almost empty database skeleton&lt;/li&gt;
&lt;li&gt;the tables &lt;em&gt;auth_permission&lt;/em&gt; and &lt;em&gt;django_content_type&lt;/em&gt; in the database sekelton need to be cleaned completely&lt;/li&gt;
&lt;li&gt;&lt;em&gt;manage loaddata&lt;/em&gt; reads the data from the dump and writes it back into the your new database&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Rejoice.&lt;/p&gt;</summary><category term="django"></category><category term="mysql"></category><category term="postgres"></category></entry><entry><title>Django? Isn't That Something Like Rails?</title><link href="http://christiankaula.com/django-isnt-that-something-like-rails.html" rel="alternate"></link><updated>2008-12-07T14:59:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-12-07:/django-isnt-that-something-like-rails.html/</id><summary type="html">&lt;p&gt;Rails is great. At least better than anything I know that is done with PHP. PHP is really some nasty stuff. Seems like more and more people realize that and jump on the Ruby on Rails band wagon. Well since everybody else says its that great it has to be, no?&lt;/p&gt;
&lt;p&gt;Sadly somehow most are missing Django. At least here in Germany. Some have heard of it and but nearly nobody has really worked with it. Which I find rather sad personally. Rails is great in many ways but there are just as many things that just don't feel right or make stuff harder than it should be. But nobody has noticed that yet since nobody dares to try something else than the stuff that is hyped beyond any reason right now.&lt;/p&gt;
&lt;p&gt;I can't resist a chuckle when people tell me, all thrilled: "In the new version of Rails they have X!" Cause most of the time I'm thinking: "Heh, didn't Django have that when I started to use it already?"&lt;/p&gt;</summary><category term="django"></category><category term="rails"></category><category term="php"></category></entry><entry><title>Magical Ponies</title><link href="http://christiankaula.com/magical-ponies.html" rel="alternate"></link><updated>2008-12-06T02:04:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-12-06:/magical-ponies.html/</id><summary type="html">&lt;p&gt;As you can plainly see I'm a big fan of the new (still) unofficial Django mascot: the magical &lt;a href="http://www.djangopony.com/"&gt;Django Pony&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A mascot gives a face to a product and helps recognition while burning the image into the brain on first exposure. This works pretty well with pink, magical ponies I guess. ("What the heck is that pony doing there?")&lt;/p&gt;
&lt;p&gt;Even though pink ponies rock I have to admit the &lt;a href="http://avalonstar.com/blog/2008/sep/9/web-framework-ponies/"&gt;green version&lt;/a&gt; suits the Django style a good bit better.&lt;/p&gt;</summary><category term="django"></category></entry><entry><title>Yay for Automatic Deployment</title><link href="http://christiankaula.com/yay-for-automatic-deployment.html" rel="alternate"></link><updated>2008-12-05T02:45:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-12-05:/yay-for-automatic-deployment.html/</id><summary type="html">&lt;p&gt;This is the first version of the site that has been deployed automatically with my super duper deployment script. Well actually its nothing more than a combination of 2 not-so-fancy bash scripts.&lt;/p&gt;
&lt;p&gt;Still: its fun.&lt;/p&gt;</summary><category term="django"></category></entry><entry><title>A Quick Comparison of JavaScript Frameworks</title><link href="http://christiankaula.com/a-quick-comparison-of-javascript-frameworks.html" rel="alternate"></link><updated>2008-12-04T00:01:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-12-04:/a-quick-comparison-of-javascript-frameworks.html/</id><summary type="html">&lt;p&gt;I think I used &lt;a href="http://mootools.net/"&gt;MooTools&lt;/a&gt; wrong up to now. One should probably code a lot more object oriented to not produce whole KLOCs for simple stuff.&lt;/p&gt;
&lt;p&gt;So to do some testing I created a few mini projects to compare MooTools, &lt;a href="http://mochikit.com/"&gt;Mochikit&lt;/a&gt;, &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; and &lt;a href="http://www.dojotoolkit.org/"&gt;Dojo&lt;/a&gt;. And I guess I slowly begin to understand why everybody and his dog uses jQuery. When it comes to amount of source needed for one functionality this thing beats them all. Seems they really mean it  when they say 'write less do more'.&lt;/p&gt;
&lt;p&gt;Mochikit I don't get. The documentation they give as one of their strongest points didn't help me at all. There are a few examples, but no really simple examples. Really, really bad for me. I just couldn't figure out how all that Deffered stuff is supposed to work.&lt;/p&gt;</summary><category term="javascript"></category><category term="jquery"></category><category term="mootools"></category><category term="mochikit"></category><category term="dojo"></category></entry><entry><title>Apples and Pears</title><link href="http://christiankaula.com/apples-and-pears.html" rel="alternate"></link><updated>2008-12-03T23:56:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-12-03:/apples-and-pears.html/</id><summary type="html">&lt;p&gt;After there not even being a link to the Apple on Campus store on our super-great Uni site - here it is:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://http://store.apple.com/de_aoc_119848/"&gt;http://store.apple.com/de_aoc_119848&lt;/a&gt;&lt;/p&gt;</summary><category term="mac"></category></entry><entry><title>What I Forgot to Mention…</title><link href="http://christiankaula.com/what-i-forgot-to-mention.html" rel="alternate"></link><updated>2008-11-24T13:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-24:/what-i-forgot-to-mention.html/</id><summary type="html">&lt;p&gt;Alright now I got totally needless stuff like a contact page... ahem...&lt;/p&gt;
&lt;p&gt;Yeah, yeah but like I said before this site was cranked out in pretty much no time so stuff like that is pretty much expected.&lt;/p&gt;
&lt;p&gt;Anyway I wrote me some handy deploy scripts to be able to handle that kind of hot fixing with a bit more gracefully. Now it's almost as comfortable as Rails deployment. Well... kinda...&lt;/p&gt;</summary><category term="django"></category><category term="rails"></category><category term="bash"></category></entry><entry><title>Good Friends</title><link href="http://christiankaula.com/good-friends.html" rel="alternate"></link><updated>2008-11-21T01:41:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-21:/good-friends.html/</id><summary type="html">&lt;p&gt;Using nginx, webalizer and logrotate together almost lets you feel the synergies unfold.&lt;/p&gt;</summary><category term="nginx"></category><category term="webalizer"></category><category term="logrotate"></category></entry><entry><title>Me vs Virtualenv</title><link href="http://christiankaula.com/me-vs-virtualenv.html" rel="alternate"></link><updated>2008-11-20T13:16:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-20:/me-vs-virtualenv.html/</id><summary type="html">&lt;p&gt;As soon as I've found out how to run a single command with a complete user environment the site should be up reliably again.&lt;/p&gt;
&lt;p&gt;One of these little annoying bugs again.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>Where to Buy Apples Cheap</title><link href="http://christiankaula.com/where-to-buy-apples-cheap.html" rel="alternate"></link><updated>2008-11-18T15:19:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-18:/where-to-buy-apples-cheap.html/</id><summary type="html">&lt;p&gt;&lt;a href="http://store.apple.com/at_aoc_121143/"&gt;Apple Mac on Campus Store&lt;/a&gt;&lt;/p&gt;</summary><category term="mac"></category></entry><entry><title>First Post!</title><link href="http://christiankaula.com/first-post.html" rel="alternate"></link><updated>2008-11-18T14:53:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-18:/first-post.html/</id><summary type="html">&lt;p&gt;Alright - for 3 days of slack coding this doesn't look too bad. Also loads more professional and stuff. But I'm sure I'll come up with thousands of things that aren't quite right yet in time.&lt;/p&gt;</summary><category term="update"></category></entry><entry><title>MacGre</title><link href="http://christiankaula.com/macgre.html" rel="alternate"></link><updated>2008-11-18T08:23:00Z</updated><author><name>Christian Kaula</name></author><id>tag:christiankaula.com,2008-11-18:/macgre.html/</id><summary type="html">&lt;p&gt;PostgreSQL on Mac OS&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist
&lt;/pre&gt;&lt;/div&gt;</summary><category term="postgres"></category><category term="mac"></category><category term="python"></category></entry></feed>
