Archive for Februar, 2009

Brief look at new WhiteHouse.gov

Montag, Februar 2nd, 2009

While Barack Obama was inaugurated to become the new president of the US, it took the tech department behind him only a couple of minutes to update the presidential website — getting rid of some (in more than one way) out-dated designs.

Finally I took a look at what’s inside:

  • XHTML 1.0 Transitional (sort of valid)
  • jQuery (currently 1.2.6 minified) feat. jcarousel and others
  • swfobject
  • lt IE 7 delta CSS
  • print CSS
  • atom+xml feeds
  • whole bunch of inline JS

Aside of the technical details, there are a couple of interesting meta keywords… Barck, Barek, Barak, Barrack, Barrak, Obma, …wonder who did the research on the top 6 typos for his name.

Most surprisingly tracking is provided externally by webtrendslive.com. Suprising to me, as I always thought there was a high level of concern regarding data security.

Richard Hammond wearing ear piece

Sonntag, Februar 1st, 2009

It caught my eye a couple of times, but today I looked it up on the interweb — just to find no satisfying answer. Or did I?

Why is Richard Hammond (sort of) always wearing a wire-based ear piece in the studio?

You may reckon its the standard TV presenter thingy, but why aren’t Clarkson and May wearing one, too? Is he somewhat more „important“, coordinating the on-stage appearance of the show?

Just for those of you who were living under a stone the last couple of years, or so — the show in question is Top Gear.

Carolo – German mini car DARPA clone

Sonntag, Februar 1st, 2009

This year’s Carolo challenge will be held at the university of Braunschweig on February 10.

Like in the famous DARPA urban challange the vehicles will have to completely rely on their onboard sensors and processing power, as no external (i.e. human) help is to be provided. Major difference — the cars are in scale 1:10, a fact which also may be influenced by the available budgets. All competitors are teams of students.

http://www.wdr.de/mediathek/html/regional/2008/03/07/lokac_01.xml  [video, german] – link defunc

Strategy pattern á la „Head First Design Patterns“

Sonntag, Februar 1st, 2009

<?php

/**
* Strategy design pattern example realized in PHP
*
* Inspired by „Head First Design Patterns
*
* @author <php@tschagrass.de>
*/
abstract class Animal {

protected $soundBehavior;
protected $moveBehavior;

public function performSound() {
$this->soundBehavior->performSound();
}
public function performMove() {
$this->moveBehavior->performMove();
}
public function setMoveBehavior($moveBehavior) {
if ($moveBehavior instanceof MoveBehavior) {
$this->moveBehavior = $moveBehavior;
}
}
}

// ——

interface SoundBehavior {
public function performSound();
}

interface MoveBehavior {
public function performMove();
}

// ——

class Barking implements SoundBehavior {
public function performSound() {
echo „I’m Barking \n“;
}
}

class Meowing implements SoundBehavior {
public function performSound() {
echo „I’m Meowing \n“;
}
}

class Doggystyling implements MoveBehavior {
public function performMove() {
echo „I’m Doggystyling \n“;
}
}

class Catwalking implements MoveBehavior {
public function performMove() {
echo „I’m Catwalking \n“;
}
}

class Jumping implements MoveBehavior {
public function performMove() {
echo „I’m Jumping \n“;
}
}

// ——

class Dog extends Animal {
public function __construct() {
$this->soundBehavior = new Barking();
$this->moveBehavior = new Doggystyling();
}
}

class Cat extends Animal {
public function __construct() {
$this->soundBehavior = new Meowing();
$this->moveBehavior = new Catwalking();
}
}

// ——

function makeAninimal() {
$i = rand(0, 1);
if ($i == 0) {
return new Dog;
}
return new Cat;
}

echo „<pre>“;
$animal = makeAninimal();
$animal->performSound();
$animal->performMove();
$animal->setMoveBehavior(new Jumping());
$animal->performMove();
echo „</pre>“;