Archive

Author Archive

Christmas Songs…

December 18th, 2011 makii Comments off

Usually make me fuzzy. I hate it to be WHAMed, but you have no chance when going to a christmas market. The first time I got caught was on an AirBerlin flight, where the famous song was played while boarding.

But there are also nice variations I actually like. Seen on the day after our christmas party in Berlin-Mitte I found a guy playing christmas songs on wine glasses. Lots of glasses, REALLY lots of them. See for yourself:

Genuine idea, totally awesome, and much better than the usual street musicians which I usually hate.

Age verification system, revisited.

May 23rd, 2011 makii Comments off

Modern ego shooter games get more realistic with each generation. So did the new Crysis 2, which was leaked in an unfinished pre-release version earlier this year. Though I don’t play lots of games like this, I was really amazed of the subsequently released gameplay video on various video sites.

And today I stumble upon the following picture on twitter:

Age verification system.

This seems to be the absolutely best age verification system EVER!!!

Though it most likely is a mockup, this actually could work!

Categories: funny Tags:

The Google StreetView incident

October 27th, 2010 makii Comments off

As almost everybody knows by now, Google has recorded data from unprotected WIFI networks everywhere (Frankfurter Rundschau, Reuters). They wanted to record some stuff to get additional accuracy when determining the location of mobile devices in cities. This is pretty useful in large cities where only a few GPS satellites are visible to the device. They claim to have recorded some data by accident, due to a software error. This data includes emails, passwords and lots of other personal data. This is a bad thing, I suppose.

The press writes a lot about this topic, and especially here in germany this release quite a storm of outrage about the evil internet company which wants to know everything about us. Even the german minister of consumer protection, Ilse Aigner (german), got involved. She already has a colorful history with Mark Zuckerberg about privacy issues concerning facebook.com where she threatened the world she will delete here profile there if nothing happens.

My opinion to all this stuff is: If you leave your network visible, or don’t use encryption, it’s your own fault! EVERYBODY could walk down the street with a laptop and record traffic of unencrypted networks. So why harass Google about it if people are simply too lazy to even care about their information? Sure, a scan for SSIDs in the vicinity should have been enough, but so what. Same goes for the insurgence about photographs of the houses for Street View itself. If you don’t want your house to be seen from the street, build a wall around it, or grow a hedge. I might come by with my 12 megapixel camera and take a photo. Hell, I might even put that photo on the internet!!

Categories: Technology, Web Tags: ,

How to make ice cream in 30 seconds – The geek way

August 9th, 2010 makii Comments off

Making ice cream is so easy, if you know how…

Just use a common stirring gear, add your ingredients, mix it and add a small portion of liquid nitrogen – Let the Nitrogen boil out and ready is the ice cream!

Categories: Cooking, Science, Technology Tags:

Howto implement MySQL’s OLD_PASSWORD() in Java

July 23rd, 2010 makii Comments off

Like most Software Engineers I don’t have the luxury to start with an greenfield strategy. Most times we know a good and viable solution to a problem, but cannot implement it due to restrictions which come with legacy systems and stuff out of our control.

Recently I had to migrate Newsletter subscribers to a newly created subscription system which uses an Oracle Database (I would have preferred PostgreSQL) rather than a MySQL, as the old system does.

Programmers are lazy, and as expected the developers of the old system used the OLD_PASSWORD(str) function from the database available to hash the password entered by the user. This is a very convenient way to protect the users’ login credentials, but rather bad when migrating to another system which has different or none implementations of this functionality. So what do we do? The options are:

  • Send every user a new password. Bad, we don’t want to harass them with our technical issues.
  • Force them to set a new password when they log in the next time. See above
  • Try to find a solution to validate the password against the old password hash.

As MySQL is widely used and a lot of data migration happens to and from, someone must have been run in this issue already, and most likely there is a solution to this problem in the net. And there is. I found a reimplementation of the OLD_PASSWORD() function in C# at yourhelpcenter.de (attention, german) and together with my coworker Maurice we ported it to Java, resulting in this piece of code:

public static String mysqlOldPassword(byte[] password) {
        int[] result = new int[2];
        int nr = 1345345333;
        int add = 7;
        int nr2 = 0x12345671;
        int tmp;

        int i;
        for (i = 0; i < password.length; i++) {
            if (password[i] == ' ' || password[i] == '\t')
                continue;

            tmp = (int) password[i];
            nr ^= (((nr & 63) + add) * tmp) + (nr << 8);
            nr2 += (nr2 << 8) ^ nr;
            add += tmp;
        }

        result[0] = nr & ((1 << 31) - 1);
        int val = ((1 << 31) - 1);
        result[1] = nr2 & val;
        String hash = String.format("%08x%08x",result[0],result[1]);
        return hash.toLowerCase();
    }

I give no guarantee this will work in all cases. My IDE complains all over the place about possible integer overflows. The usage of Integer.toHexString()did not work either, as the resulting String is not padded up with zeroes.

Finally, some Unit Tests for the interested user:

    @Test
    public void testOldPassword() throws Exception {
        final String expected = "0414ac6137ee1adc";
        byte[] bytes = "fooo".getBytes("UTF8");
        String foo = mysqlOldPassword(bytes);
        assertEquals(expected, foo);
    }

    @Test
    public void testOldPassword2() throws Exception {
        final String expected = "3fa0dce62ba931b5";
        byte[] bytes = "hastewas".getBytes("UTF8");
        String foo = mysqlOldPassword(bytes);
        assertEquals(expected, foo);
    }

Have fun with it!

Categories: Java, Technology, Web Tags: , , , ,

Java – The Movie

June 27th, 2010 makii Comments off

For all you out there who code java like me :-)

And everyone else…

via @pommesbude

Update:Youtube seemingly has killed the video, but the original version is still available here.

Update to the Snow Leopard

June 6th, 2010 makii Comments off

After a long time and struggle I finally decided to update to the snow leopard. Remembering each and every update on my former windows systems, as well as the dist-upgrade on a deb-based system, I was really astonished how smooth the update went by. Sure, concerning the Apple software, everything works as expected, no problems there. But a lot of third-party software simply stops working, which also was to be expected. This is, I think, the big advantage of a Linux system: usually all the software in the repository, which mostly is all you need, is available in a working version, so it just continues to work. Here the minor and major problems I had to struggle with.

GPGMail

As it seems, GPGMail, a plugin which integrates a local installation of GnuPG to Apples Mail, seems to use a lot of internal API which of course is not supported officially and subject to frequent change, stopped working. The GPGMail maintainer seems to have no time to update it to the new API, but fortunately Lukas Pitschl stepped up to update it. Up to now now official release of GPGMail was rolled out, but reasonable stable versions are offered by Lukas via hist Dropbox or Github. The latest 1.2.3-v61 works for me so far. Thanks!

Macports

Having a history with Gentoo Linux I simply love the ports system, so I chose Macports over Fink to add additional Unix/Linux software to my Mac.

After upgrading Macports does will simply stopp to work with a somewhat strange Tcl error message, at least this was the case with me. Thus a sudo port selfupdate failed as well. So I downloaded the Snow Leopard version and installed it to get a working port command again. Even after this some port commands will fails, mostly due to architecture constraints of the older 32bit parts on Leopard vs. the new Snow Leopard 64bit.

After upgrading to the new Macports for Snow Leopard, the Migration page in the Macports wiki describes how to upgrade your installed ports to a new system. As I don’t need all installed ports any more I took the manual approach described, by simply removing all ports and re-building the parts I still need on my system. It needs some effort to upgrade, but with the view ports I use took just a few minutes to select the ports I need and a few hours of building while the system is still usable for other things.

iStat Menu

I like these little nerdy monitor items in the menu bar which tell me how much RAM I use, how the system load is or how much traffic is on the network. On Leopard I used the iStat menus in version 1.3, but these don’t work on Snow Leopard. iStat Menus version 3 comes as a trial version and will stop working after some time, so this is unfortunately no permanent solution. A friend of mine got a beta release of version 2 in preparation for the Snow leopard release which works well as long as you disable the update mechanism, but I couldn’t find the download link to this package.

So I started looking for alternatives to this proprietary software and found MenuMeters by Raging Menace which is GPL software. It does not look as nice the iStat menus look, and does not offer monitors for the temperature sensors, but basic Network/HD IO, CPU and memory usage are covered, which will suffice for me for now.

So much for now on this topic, let’s see if this was it all…

Categories: Mac, Technology Tags: , ,

Cardiopulmonary resuscitation in sexy

May 21st, 2010 makii Comments off

Ein Erste Hilfe Kurs ist in Deutschland ja Pflicht für jeden, der sich motorisiert im Straßenverkehr fortbewegen will.

Für alle bei denen der Führerschein schon ein wenig länger her ist, hier mal ne kleine Auffrischung wie man eine Herz-Lungen-Massage richtig ausführt!

So, jetzt wissen wieder alle Bescheid! Weiterfahren! Oder hier mal nachsehen was es noch gibt.

The iPad – OMFG!!! The iPad!!!

May 1st, 2010 makii Comments off

Ok, jeder schreibt und bloggt über dieses komische iPad, das irgendwie alles können soll, oder auch irgendwie nicht. Und jetzt bietet sich mir die verführerische Gelegenheit dieses Ding mal auszuprobieren. Dann kann man ja auch Mal ein paar Absätze drüber schreiben, oder? Also dann:

Als aller erstes fällt mir auf dass der Safari auf dem iPad es nicht hinbekommt den WYSIWYG-Editor von meinem Blog hier richtig darzustellen. Das ist natürlich ziemlich doof wenn man bloggen will, und man nicht einmal den Fokus auf das Eingabefeld setzen kann… Und die Eingabe im Code-Modus ist genau so schlimm, denn man muss zwischen drei Modi der On-Screen-Tastatur hin- und herspringen um nur ein blödes Paragraph-Element zu öffnen oder zu schließen. Ebenso komisch ist es Umlaute zu tippen: hierzu muss man einfach länger auf dem a bleiben, um ein ä (oder andere Abwandlungen davon) zu bekommen. Für iPhone User ist das natürlich Usus und perfekt, die waren noch nie was anderes gewohnt. Fazit: Die Tastatur ist soweit nicht schlecht, aber effizient mit 10 Fingern erfordert Übung. Zumindest mehr als man an einem Abend rumspielen schafft. Auch wenn die Tastatur auf dem Bildschirm in etwa so breit wie die eines Laptops ist, der Winkel ist meiner Meinung alles andere als bequem und ich kann mir nur mit viel Fantasie vorstellen mit dem Gerät auf dem Schoß lange Emails zu tipppen.

So, nach zwei Absätzen der Pein bin ich jetzt wieder auf die gewohnte Tastatur meines Laptops umgestiegen. Nach den zwei Absätzen auf dem iPad hat sich doch eine gewissen Routine eingestellt. Ich konnte schon halbwegs blind tippen und sogar Umlaute gingen relativ intuitiv. Ebenso das Positionieren des Cursors im Text, wenn man sich vertippt hatte, sowie Copy & Paste. Auch wenn das alles schön und gut ist, und mit längerer Verwendung die Eingabe noch flüssiger geht: die fehlenden Umlaute auf der Tastatur (was natürlich dem Format geschuldet ist) stören den Fluss bei der Eingabe doch erheblich, und der ständige Modi-Wechsel für Ziffern oder Sonderzeichen ebenso. Soviel mal zur Texteingabe.

Mit dem mitgelieferten Safari hatte ich auch meinen Spaß. Wie weiter oben schon erwähnt weigert er sich den WordPress-WYSIWYG Editor benutzbar darzustellen. Selbiges sind mir mit einigen weiteren AJAX-Webseiten aufgefallen. So war es mir unmöglich den Google Reader zu steuern, sowohl in der Mobil- als auch in der Full-Fledged Variante. Auch wenn es solche Anwendungen sicher gute Programme für das iPad gibt sollte ein Browser doch zumindest reine HTML5+AJAX Funktionalitäten unterstützen, was Apple ja in seiner öffentlichen Diskussion mit Adobe bezüglich der Unterstützung von Flash auf Apples mobilem Betriebssystem ja als unterstützenswerte Standards angibt. Apple mutiert was sowas angeht tatsächlich zu einem kleinen Goliath.

Die restlichen Navigation ist Apple-typisch absolut intuitiv. Des öfteren habe ich mich über kurze Auswahl-Seiten wie z.B. im iTunes Laden gewundert, um dann festzustellen dass man da auch nach unten scrollen kann. Der Scrollbar (oder eine “Positionsanzeige”) wird beim Scrollen (und nur dann!) über dem Inhalt dargestellt. Diese Darstellung kenne ich auch von meinem N900, jedoch wird dort beim Laden der Seite im Browser der Balken immer eingeblendet, wird dann ausgeblendet, aber beim Scrollen auch wieder Sichtbar. Gut, das ist nicht wirklich wichtig, ich bin dieser Unzulänglichkeit aber auf den Leim gegangen.

What the iPad really is!

So, mal von der Eingabe weg zur Hardware. Unabhängig davon ist das ganze schon ein sehr beeindruckendes Gerät. Absolut sexy Format. Es fühlt sich, ohne jetzt in den Apple-Fanboy-Talk verfallen zu wollen, einfach alles Richtig an. Auch wenn es prinzipiell nur vier aneinander-geklebte iPhones sind…

Mein Fazit ist demnach: Alles in allem ist das iPad ein typisches Apple Gerät: Hard- und Software sind qualitativ hochwertig, es fühlt sich gut an und erfüllt seinen Zweck. Wie die meisten anderen Apple-Produkte unterliegt das Gerät und die Software natürlich den Apple-Typischen Restriktionen: Nur Software aus dem App-Store von Apple, den Dock-Connector als einzige, proprietäre Schnittstelle. Hiermit haben sich die Apple-Fan-Boys/-Girls ja schon abgefunden. Das heisst: Wenn man ein kleines Surf-Brett für den Balkon oder das Bett, oder ein kleines Gerät für die tägliche Arbeiten wie Mails checken oder kleinere Dokumente schreiben haben will, und natürlich zum Zocken, kann sich die Anschaffung ernsthaft überlegen. Ich bin noch unentschlossen ob ich sowas brauche.

Categories: Mac, Technology, Web Tags: , , ,

Dan The Man!

April 21st, 2010 makii Comments off

How true …

Categories: Web, funny, video Tags: , ,