Stop Being Carbon

Icon

Politics

I really don’t understand how Austrian politicians can smile during all those press conferences and media events. They built up the same coalition like in 2006 and they gonna have the same problems like in the last two years. The questionnaire which appeared last week was a bad joke and whole thing looks to me that they just wanna make fun of us.

My advice for a better way? Get some pros for each field, build them up and maybe even introduce a dedicated program for politicians. Get them to know their ressorts, put somebody with a deep knowledge of the subject in the position of secretary. For me the future of a country is too important to put somebody on top of the state who has no clue about what’s going on.

And finally, hope that it gets better.

Flip an image with Scriptaculous

I was the need of a flip effect for scriptaculous and came up with this solution:

Effect.Flip = Class.create();
Object.extend(Object.extend(Effect.Flip.prototype,
  Effect.Base.prototype), {
 
    initialize: function(element, flip_graphic, original_graphic) {
      var options = arguments[3] || {};
 
      this.element = $(element);
      this.flip_graphic = flip_graphic;
      this.original_graphic = original_graphic;
 
      if (this.element.getAttribute('src') == this.flip_graphic) {
        this.flip_graphic = this.original_graphic;
        this.original_graphic = this.element.getAttribute('src');
      }
 
      this.width = options.width || this.element.getWidth();
      this.delta = this.width * 2;
      this.flip = 1;
 
      this.start(options);
    },
 
    update: function(position) {    
 
      var change = this.flip * (0.5 - position) * this.delta;
      var padding = this.width / 2 - change / 2;
 
      this.element.setStyle({
        width: change + 'px',
        padding: '0 0 0 ' + padding + 'px'
      });
 
      if (change < 0)
      {
        this.element.writeAttribute({ src: this.flip_graphic });
        this.flip = -1;
      }
    },
  });

You can use it like that:

new Effect.Flip(element, 'graphics/original.jpg', 'graphics/flip.png', { width: 120 });

I will post a demo tomorrow – I promise, it looks cool!

Mini DVI to Mini DisplayPort

I’m really thinking about getting the new 24″ LED Cinema Display from Apple. Comparable devices from Dell, for example, are a bit cheaper but I really like the idea of connecting my MacBook with the display and getting a MagSafe and USB connection, too. The only question I have is: Is there a Mini DVI to Mini DisplayPort adapter available from Apple? If not, do I need to get a new MacBook to use the new display? Sounds bizarre.

Trip to Madrid

So, I’m finally back from my business trip to Madrid (actually I returned to Vienna Friday in the morning, but I was too tired to blog).

All in all it was a quite, let’s say, interesting journey. We had our first near-death experience on our way to the airport in Vienna when our driver nod off. Arrived in Madrid a few hours later, with a stopover in Munich.

The hotel in Madrid was dreadful, but we quickly made it to the next Tapas bar. Meeting with our customer the next morning, next crazy taxi driver, but I guess we were just not relaxed enough to cross the street just before the truck. On our way to Barajas after the meeting our taxi driver, guess what, was sleepy again. So talking with him about god and the world – quite a challenge because our Spanish is non existing, as is his English.

Our flight was quite late because of some fog in Munich, so we didn’t get our connection flight to Vienna and instead rented a Mini Cooper to get home. Awesome car! Arrived in Vienna at about 3.30 a.m. and took me two days to catch up on lost sleep of the last few days.

Tip for IE users…

…who can’t change their homepage from the internet options dialog, because settings are managed from an administrator: Try the ‘Home’ button in the menu bar, it offers an option called ‘Add or Change Home Page…’ which lets you set your homepage.

Alex Tew’s new startup

Was just browsing the Python Job Board and found this:

Job Description: Lead Software Developer (Python/Django)

PopJam is a new and exciting fast-paced, well-funded web startup based in Soho, London. We’re looking for a top notch lead software engineer eager to build awesome web software used by millions of people. Founded by an Imperial College rocket scientist and the creator of the Million Dollar Homepage, we’re looking to create the next big thing in the rapidly growing content discovery space.

About PopJam:
* We’re backed by world-class investors
* An exceptional response to our Alpha launch with a large pool of users waiting to be invited in
* We love being on the bleeding edge of the web and web tech, and are incredibly open to new ideas and ways of thinking
* Our founders have a proven track record of making money online and know how to do it again

I would love to know what their business is about.

No title

I really think that discussing with myself if I should write ‘can’ or ‘could’ in an email makes me a better person.

acts_as_geocodable in tests

The last few days I wrote some unit tests for a project I’m currently working on (and which, by the way, should be released to public in a few weeks time). To easily be able to change attributes of my models and not rely on fixtures, I’m using the fixture_replacement plugin and actsasgeocodable to easily deal with address translations and that stuff (it introduces various attributes, like street, country, postal code,…). The last one comes with a nice option, normalized_address, which will update the information in your model with the information it got from the geocoding service (and thus will correct invalid postal codes, etc.).

Well, again, this feature is really handy but can lead to problems if you forgot that you activated it and just want to change the postal code of one of your models. Because the geocoder will still find the right address (mainly because the street name is the same) and actsasgeocodable will correct the invalid postal code for you. And you gonna have no clue why it won’t take the postal code you’ve used in fixture_replacement’s helper methods.

A simple fix for that is to add the following setup method into your unit tests:

def setup
  # This ensures that we can set individual attributes of our model
  # without being overridden by acts_as_geocodable.
  Property.acts_as_geocodable_options[:normalize_address] = false
end

Wildcards for phone numbers

Working for quite a big company has the disadvantage that you cannot now all the people there and their respective telephone numbers (especially when you were lucky enough not to get one of those Blackberry things). I’m pretty bad at remembering telephone numbers – which is actually not quite true, I still know all the numbers of my primary school friends – so for me it would be quite useful if my Nokia phone would support wildcards for phone numbers. So that I could even tell that the call is coming from within my company, even if I don’t have the exact name of the caller.

I always knew that coffee is my lifesaver

I guess every Mac users know the problem: You’re talking with your friends, showing them some drawing, snippet of code or website, talk even more with them and your Mac activates its screensaver and locks down the Keychain. For me that results in entering my password three times (one for login, one for iScrobbler and one for Safari’s Keychain access). Annoying.

But I discovered (or merely googled) a small tool which prevents your Mac from activating the screensaver, dimming down the screen or even going to sleep: Caffeine. Trust me, you need this tool.

Flickr

delicious