19.
02.
2010
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 Array, javascript, prototype.
5.
02.
2010
Posted in fun.
Tagged with fun, youtube.
16.
01.
2010
Jungs, das war ein tolles Wochenende! Bleibt nicht viel zu sagen, wir sehen uns hoffentlich wieder!
Posted in fun, other, photos.
Tagged with Fondue, friends, fun, other, Tanne.
9.
10.
2009
Sorry, this entry is only available in Deutsch.
Posted in fun.
Tagged with fun.
5.
10.
2009
Some 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 fun, php.
27.
08.
2009
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 2009, karlsruhe, photos, plugins, wordpress.
21.
08.
2009
Who is visiting my blog?? Help, I am observed:

Screenshot aus der Blog-Statistik
(Just found in my Blogstatistics…)
Posted in Security, fun, other.
Tagged with fun, Parteien, Wahl, wordpress.
Letzte Kommentare