PHP is not Java!

PHP, Project Management and the Real World

Saturday, October 4. 2008

days in the monastery

first impression
Last week we needed a place for the kickoff meeting of a project that is currently starting. Because everyone is always dragged away when in the office, we needed to find a quiet place with little or no external communication. After a littel research i found what i regarded the perfrect match: Kloster Obermarchtal. It is an old monastery still ran by the church, that can be used as a meeting place these days. So we booked the whole steering team of the project into this place and stayed there for a two days _true offsite. The atmosphere was very inspiring and we got a lot of work done. I personally also liked the sparse interieur of the rooms and the absence of sanitary high tech.
iBuildings arriving
under the cross
backlit
internet on wheels
Posted by Gaylord Aulke at 10:58 | Comment (1) | Trackbacks (0)

Friday, October 3. 2008

by accident

Strange

Funny things happen when you work late and still try to have some social contacts. A few days ago i was dragged by my wife into a live gig of 31knots, a band from portland. I actually liked the performance a lot. And i would really like to know what these guys do to expand their minds when they write their songs... But check yourself: 31knots.

Posted by Gaylord Aulke at 20:21 | Comments (0) | Trackbacks (0)

Sunday, September 7. 2008

Cheap Advertising

Microsoft everywhere
Seen today in Stuttgart's Subway: Microsoft even makes profit from the bugs in their software. The Windows 2000 installation in thousands of media displays all over germany need a reboot every now and then. During this time, the advertising space the computer should fill with paid ads is showing the windows startup logo. This way, microsoft gets free air time in the subway. Another marketing coup of the software giant...

Posted by Gaylord Aulke at 02:14 | Comments (0) | Trackbacks (0)

Thursday, August 28. 2008

Dumping MemcacheD Content (Keys) with PHP

MemcacheD is a very cool piece of software. When i did some optimization of a cluster based webapp lately, i was wondering how Memcache was speading my cache entries over the cluster. So i did some research for monitoring tools. A simple approach to monitoring would be to use Cacti to monitor status values like Cache usage, hits/sec etc. This can be done by a template like this. An alternative was provided by Harun Yayli: His memcache.php which somewhat resembles the APC status page and now is a part of PECL/memcache is easy to setup and works well. It also allows to dive into the data structures but you need to decide for one server first, then click into a "Slab" and then you see the keys. Inspired by this, i wrote a small script that fetches all data from a memcache cluster, gets all keys out of it and then sorts and displays them in a list. Yes it it ugly and yes: the memcacheD is not answering other requests while doing a cachedump. But i found it very useful. Maybe somebody has something more advanced that he wants to point me to? This could save a lot of time...

But here is my naive approach: Assumed you have a memcache object in PHP 5 with some servers registered using addServer Method, the following can be used:

	    $list = array();
$allSlabs = $memcache->getExtendedStats('slabs');
$items = $memcache->getExtendedStats('items');
foreach($allSlabs as $server => $slabs) {
foreach($slabs AS $slabId => $slabMeta) {
$cdump = $memcache->getExtendedStats('cachedump',(int)$slabId);
foreach($cdump AS $server => $entries) {
if($entries) {
foreach($entries AS $eName => $eData) {
$list[$eName] = array(
'key' => $eName,
'server' => $server,
'slabId' => $slabId,
'detail' => $eData,
'age' => $items[$server]['items'][$slabId]['age'],
);
}
}
}
}
}
ksort($list);

I then added a very simple HTML Table output to list the result array and found out some interesting details about my application that i dont want to share here ;-)

It worked for me but it could be that for bigger Memcache Clusters (mine has only 10 servers) or big content tables this will not return the complete content. More to come...

Posted by Gaylord Aulke in PHP at 20:24 | Comments (0) | Trackbacks (0)

Monday, August 18. 2008

Wo er recht hat

Aus dem Blog eines Mitstreiters: Wenn ich so schreiben könnte, würde ich keine Webseiten bauen...
Posted by Gaylord Aulke at 19:26 | Comments (0) | Trackbacks (0)

Sunday, August 17. 2008

Nochmal p1i

Wer mir in den letzten Monaten begegnet ist, wird mich über mein modernes High-Tech Telefon schimpfend in Erinnerung haben: Voller Funktionen, aber so unendlich langsam in der Ausführung, dass praktisch keine davon verwendbar war. Jetzt habe ich kürzlich ein Software-Update heruntergeladen uns installiert und siehe da: Außer totalem Datenverlust hat sich tatsächlich eine Änderung eingestellt: Sobald man auf eienen Knopf drückt, passiert auch was! So dauert der Aufruf einer eingehenden SMS jetzt nicht mehr wie vor dem Update ca. 10 Sekunden, sondern nur noch 2. Auch das Surfen im WWW macht auf einmal Spaß: Nach der Eingabe einer Adresse wird die Seite innerhalb weniger Sekunden angezeigt. So muß das sein!

Okay, das Zurückspielen der vor dem Update gesicherten Daten klappt nicht. Aber zum Glück hatte ich alle (?) Kontakte in Outlook synchronisiert und konnte sie so wiederherstellen. Nur mein unvergleichlich harmonievoller Klingelton ist leider nicht wieder aufgetaucht. Das Synchonisieren habe ich bislang auch nur einmal noch hinbekommen. Aber vielleicht wirds ja nach dem Neustart wieder. Als nächstes probiere ich wohl mal ein iPhone...

Posted by Gaylord Aulke at 13:26 | Comments (0) | Trackbacks (0)

Friday, August 1. 2008

Temporale Dislokation

Das gute an modernen Kommunikationmitteln ist: Zugfahrten werden plötzlich zu wertvollen Arbeitsphasen, in denen man eine Menge aufgestautes abarbeiten kann. Durch diese neue Art der örtlich wie zeitlich unbeschränkten Arbeit ergeben sich aber plötzlich ganz neue Effekte, die noch weitgehend unerforscht sind. Bekannt ist ja der Effekt, dass man jemanden mitten am Tag auf dem Handy anruft und sich über dessen beschwingten Ton wundert, bis man merkt dass er sich gerade auf der anderen Seite der Welt und 8 Zeitzonen entfernt aufhält und schon zwei Mai-Tais intus hat. Auch bekannt ist das sicher berechtige Bedenken, dass man nun in der Arbeitszeit keinerlei Wartezeiten mehr hat, also demnach 8 Stunden täglich unter absolutem Reaktionszwang wegen der zunehmenden Kommunikationsflut steht und man Arbeit für die man länger als 2 Minuten zusammenhängende Konzentration benötigt, erst nach Feierabend leisten kann (oder eben während einer Zugfahrt). Was mir aber heute erstmals passiert ist: Ich bin aus dem Zug ausgestiegen und wußte die ersten 30 Sekunden nicht, an welchem Bahnhof einer deutschen Stadt ich war. Dazu beigetragen hat sicherlich die gute Arbeit der DB Corporate Identity Abteilung, die daran arbeitet alle Bahnhöfe immer gleicher zu machen. Aber es war noch mehr: Ich bin am richtigen Bahnhof ausgestiegen, aber da der Ort so unerheblich war, habe ich ihn einfach nicht wahrgenommen. Glücklicherweise gibt es ja jetzt location based services für den Rechner, der ja eh immer online ist. Der sagt einem dann durch die korrekten Werbeeinblendungen in den Websites, in welcher Stadt man sich gerade befindet. Welch Segen ...
Posted by Gaylord Aulke at 00:51 | Comments (0) | Trackbacks (0)

Wednesday, July 9. 2008

Wort des Tages

Johann prägte eben in Bezug auf die Mädels im Hinterhof ein (mir) neues Wort:

"Intelligenz-Limbo"

Posted by Gaylord Aulke at 20:06 | Comments (0) | Trackbacks (0)

Saturday, June 21. 2008

Notification Free PHP Coding

Sorry guys, flamebait again. But i need to say this: I HATE NOTIFICATION FREE PROGRAMMING in PHP!
If you want to code Java, go ahead! If you use PHP, enjoy the simplicity it brings!
Today i found this code by someone who really wants to do it right:

   $email = (key_exists('email', $values)) ? $values['email'] : null;
$password = (key_exists('password', $values)) ? $values['password'] : null;
$firstName = (key_exists('firstname', $values)) ? $values['firstname'] : null;
$secondName = (key_exists('secondname', $values)) ? $values['secondname'] : null;

Honestly: This does not make any sense at all. It just pollutes your code with technical constructs that don't contribute to a solution.

UPDATE: Just to make this clear: I am not talking about not input filtering here! Of course every input needs to be whitelist-filtered. And every ouput escaped to prevent XSS. What i mean is internals of you script: You can count on PHP to do things for you. This is exact because PHP does it in exact the same way everytime the script is executed.

Posted by Gaylord Aulke in PHP at 16:22 | Comments (26) | Trackbacks (0)

Sunday, June 15. 2008

Amsterdamned

fietsen
I visited the Dutch PHP Conference in Amsterdam over the weekend. It was a very nice event with about 400 attendees and some interesting international speakers. The conference was on Saturday. Since the dutch team won in the football game 4
houses
:1 against france on friday night, most participants came in a very positive mood. My personal highlight on the conference was the talk of Terry Chay who - according to the statements of people who had seen him talking before - cursed surprisingly few times in this presentation. It was fun, meeting the PHP guys from iBuildings and Johann, Sebastian, Derek, Stefan and of course Zeev. After a lot of talking and discussions about PHP (cool), Java (uncool) and Ruby (hype but kind of uncool though oftern referred to as cool - accidentially), i had some time left and took a walk in Amsterdam. It is a beautiful city. One of my favorites actually. I even found time for a quick look at the exhibition of World Press Photo in the Oude Kerk.
Posted by Gaylord Aulke at 20:43 | Comments (2) | Trackbacks (0)

Thursday, June 12. 2008

Grenzwertberechnung

Heute ist uns ein Naturgesetz aufgefallen: Die geschätzte Restzeit eines Projekts aus Sicht eines Entwicklers konvergiert offenbar mit fortlaufender Projektzeit gegen einen konstanten Wert: 2 Wochen.

Wenn man also einen Entwickler nach der Restdauer eines Projekts fragt, bekommt man ab einem bestimmten Zeitpunkt immer die selbe Antwort: 2 Wochen. Auch nach weiteren 2 Wochen sind es noch 2 Wochen. Anders ausgedrückt: "Fertig wirst'e nie" oder à la Hornbach: "Es gibt immer was zu tun" (Yippijaaajaaa-Yippijippi-yeah). Das Projektende muß dann vom Projektmanagement per Definition herbeigeführt werden. Interessanterweise klappt das in der Regel auch.

Oder um eine alte Weisheit aus dem Projektmanagement zu zitieren: Projekte zu leiten ist Fleißarbeit, Projekte zu beenden ist Kunst...

Posted by Gaylord Aulke at 09:59 | Comments (2) | Trackbacks (0)

Wednesday, June 11. 2008

Perry Rhodan Index

Today i invented a new measure for my workload: The Perry Rhodan Index (PRI). Currently i am running a PRI of 25, which is all-time-high.

What this is? I read this SciFi Series called Perry Rhodan about this guy who landed on the moon in the 70s with man's first space ship. There he met some extraterrestrians and made friends with them. A little later he became immortal due to the fact that he went into a partnership with a SuperIntelligence called ES to save the universe. Now (Episode 2442) he is 3000 years old and has lead man kind to one of the leading forces in the known universe.

Anyway: There is a new episode every week (since 1961). And usually, since quite a couple of years, i read these 60-pagers every week. But now they stack unread on my desk at home. The number of unread issues i call my PRI. 25 means that i am half a year back now. I wonder if i will ever be able to catch up again. Maybe in a long holiday someday ;-)

Posted by Gaylord Aulke at 20:42 | Comments (2) | Trackbacks (0)

Tuesday, June 10. 2008

vmware-tools on ubuntu 8.04 Hardy

I love virtualisation: Download VMWare Player, download an appliance from http://www.vmware.com/appliances/

, run it and you have a new Linux installation ready. The only problem: How to access the host file system (yes, there were some security issues with that bus since the VMWare image i am using is just for development and i am the only user, i ignore that for a moment).

The appliance should come with the VMWare-Tools and then it should be a question of setting in your vmx file:

isolation.tools.hgfs.disable = "FALSE"
sharedFolder.maxNum = "1"
sharedFolder0.present = "TRUE"
sharedFolder0.enabled = "TRUE"
sharedFolder0.readAccess = "TRUE"
sharedFolder0.writeAccess = "TRUE"
sharedFolder0.hostPath = "my-files>"
sharedFolder0.guestName = "<name-of-share>"
sharedFolder0.expiration = "never"

So far, so good. Next, you need to mount the share on the guest fs. If