IE 6 is finally recognized as too old

With launching Internet Explorer 8, Microsoft finally admitted that IE 6 is outdated (which is 8 years old by now).
But now they are actually actively urging to upgrade to a newer version.

There are basically 3 groups that are still running IE6:

  1. People who don’t have the technical knowledge to upgrade
  2. Systems that don’t use IE 6 and/or aren’t connected to the internet
  3. Corporate systems that have an enforced policy to use IE 6 (or heaven forbids older)

To get rid of IE 6 they can be approached in 3 ways respectively:

  1. Force an upgrade to a higher version, plain and simple
  2. Non-internet-connected systems can be left as they are, as long as it doesn’t cause other security problems. Connected systems that don’t use it, should be forced to upgrade.
  3. Corporate systems are a little more difficult because of compatibility issues or licenses, but I think corporations have had time enough to switch to a newer version, so here support for IE can be stopped completely both from Microsoft and implementers.

Finally, In my opinion Windows XP is fastly approaching this point as wel. Windows 7 with disabling a few “fancy” features runs perfectly well on those Windows XP boxes.

History of the IMG element

A great look at how the language of the web evolved.

Gmail Notifier 2

Finally I found an answer to my Gmail notifier problem. For security reasons I set my gmail account to only use secure connections. Everything will go over https, this also means checking your mail with the Google notifier.
However this excellent little program, doesn’t support SSL.
After almost a month, I stumbled upon Gmail Notifier 2. I really recommend it.

802.11n Wi-Fi finally official

Just read that the Wireless N standard is finally approved, after 8 years!
Of course there are already some devices supporting the standard, but I’m hoping on a better pick-up of it.

PHP Character encoding in Polish

Just came across an annoying problem when reading and displaying a Polish XML file.
The default character encoding functions don’t work because these characters consist of 2 bytes instead of 1.
So mb_string functions to the rescue. (The mb stands for multi-byte)
Here’s the solution:

mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');
$tmp_info = mb_ereg_replace('Ó', 'Ó', $tmp_info);
$tmp_info = mb_ereg_replace('Ó', 'ó', $tmp_info);

Note that there are HTML entities for those characters as well (Ó and ó respectively), but those are for HTML only. Since I needed to export to XML, they didn’t work.

A nice list of both HTML and XML entities can be found at W3Schools.

X-Men Origins Wolverine

61gu21pmrfl_aa280_It’s been a while since I’ve bought a new Playstation game, let alone played one (I’ve bought a few which are still in their plastic wrapper).
However, I saw X-men Origins Wolverine and just couldn’t resist. I had to see what it was about (Being a relative big fan of X-men).
I’ve played it for 2 days now and think I’m about 70% through the game, so here’s my opinion.

Graphics

I was a bit disappointed about the graphics to be honest. The power-ups and explosions look nice, also the cut-movies do a fairly good job at showing in-game animations. Even the full environments are not too bad to look at, but Wolverine himself… horrible!
You can see the damage from battle on his person and see it heal, but the quality of this damage and healing is bad! He also looks quite sharply edged, more like a previous generation graphic. I’m still waiting for a 3rd person game that looks as good as Assassin’s Creed.

Gameplay

The game handles very nicely. I haven’t had any problems with camera angles so far, the controls react very swiftly and Wolverine is controlled intuitively. The game had basically 2 storylines, three years apart, that you switch back and forth to. The creators tried to mix up the overall 3D hack-’n-slash platform movement with some extras. Also a few nice end-bosses!

Conclusion

It’s a very nice game, with a good storyline, but the lack of good graphics don’t make it worth € 60.
Also some end-boss-fights are so heavily scripted (like the one against Gambit) and a little buggy that I had to restart that fight a few times because the boss got stuck :p

Implode doesn’t work on classes

Implode

The PHP function implode is one I use frequently.
When you have an array of strings and want to put them in a string, separated by commas, you can either write a loop like this:

$arr = array('one', 'two', 'three', 'four', 'five');
$str = '';
foreach($arr as $item)
{
$str .= $item . ',';
}
$str = substr($item, 0, strlen($str) - 1);

or you can use the php function implode like this:

$arr = array('one', 'two', 'three', 'four', 'five');
$str = implode(',', $arr);

This is super!

__ToString Magic Method

On the other hand, there is the __ToString magic method for PHP classes. It allows you to give a string output for your class. Take this simple HTML paragraph class as example:

class p {
private $content = null;
public function __construct($content) {
$this->content = $content;
}
// Some more code
public function __ToString() {
return '<p>' . htmlentities($this->content) . '</p>';
}
}

The problem

Now when you want to combine both, it won’t work:

$arr = array();
$arr[0] = new p('test 1');
$arr[0] = new p('test 2');
$str = implode("\n", $arr);

This will give you a “Warning: implode() [function.implode]: Invalid arguments passed.”

Google unveils secret server design

A nice look at Google’s server design.

5 principles of Object Oriented Class Design

  1. SRP (The Single Responsibility Principle): A class should have one, and only one, reason to change.
  2. OCP (The Open Closed Principle): You should be able to extend a classe’s behavior, without modifying it.
  3. LSP (The Liskov Substitution Principle): Derived classes must be substitutable for their base classes.
  4. DIP (The Dependency Inversion Principle): Depend on abstractions, not on concretions.
  5. ISP (The Interface Segregation Principle): Make fine grained interfaces that are client specific.

And 2 extra ‘guidelines‘ that is actually from procedural programming, but still applies to methods:

  1. One point of return: The function or method should only return a result at 1 location in the code, at the end of the function/method.
  2. Only one functionality: A single function or method should only have 1 functionality. In case it has more than 1, it should be split up.

[Via: ButUncleBob.com]

Crisis of Credit

This thesis on the crisis of credit is one of the most beautiful and understandable visual representations I have seen of the current financial crisis.