Skip to content


Array.diff

Just had some fun with Javascript (and Prototype):

/**
 * Will return those elements which are added in cmp
 * @author Michael Jostmeyer
 * @param {Array} cmp
 * @return {Array}
 */
Object.extend(Array.prototype, {
    diff: function(cmp) {
    var res=[], resi=0, neq, cmpi=cmp.length, thisi, thisl = this.length;
    while (cmpi--) {
        thisi=thisl;
        while (thisi-- && (neq = cmp[cmpi] !== this[thisi]));
        neq && (res[resi++] = cmp[cmpi]);
    }
    return res;
}});

With this you are able to get those values which are additionaly in the cmp-Array. These values are returned in a new Array.

var a = [1,2,3,5,6]; var b = [1,3,5,7,9];
var x = a.diff(b);
//x=[9, 7]
var y = b.diff(a)
//y=[6, 2]

Enjoy it! ;-)

Posted in javascript.

Tagged with , , .


I don’t like mondays

Posted in fun.

Tagged with , .


Tanne 2010 – Männer allein im Wald

Tanne 2010 - Männer allein im Wald

Jungs, das war ein tolles Wochenende! Bleibt nicht viel zu sagen, wir sehen uns hoffentlich wieder!

Posted in fun, other, photos.

Tagged with , , , , .


Frohe Weihnachten!

Frohe Weihnachten!

Frohe Weihnachten!

Posted in other.


Don’t forget to check your kid’s homework

Sorry, this entry is only available in Deutsch.

Posted in fun.

Tagged with .


PHP 505

PHP 505Some time ago, this car was driving in front of me on my way to work: P-HP 505

As you see, taking a photo with my cellphone failed and I decided to delete it. But Sascha saw it and told me about his post

Posted in fun, photos, php.

Tagged with , .


Interchange Karlsruhe

Interchange Karlsruhe

Over the three-leg motorway interchange Karlsruhe. This is one of my first long time exposure photos and a test fo the YAPB-plugin I’ve just installed. Comment’s welcome!

Posted in photos, wordpress.

Tagged with , , , , .


Schäuble’s agents

Who is visiting my blog?? Help, I am observed:

Screenshot aus der Blog-Statistik

Screenshot aus der Blog-Statistik

(Just found in my Blogstatistics…)

Posted in Security, fun, other.

Tagged with , , , .


Twitterers Favorite Pets

via geekandpoke

Posted in fun.

Tagged with , .


Fast Help for Ulla Schmidt?!

Dienstwagen geklaut?just found on google ;-)

Posted in fun.

Tagged with .