Opendeur Landcomponent Leopoldsburg

Geplaatst in Every day life Nog geen reacties

Vandaag met z’n allen nog eens naar de opendeurdag op de legerbasis van Leopoldsburg geweest. We zijn een aantal jaren terug al een keer of 2 geweest maar de laatste jaren is het een beetje in het water gevallen tot vrienden met de vraag kwamen of we niet mee wouden gaan. Natuurlijk, waarom niet, de kleine en de buggy in de auto en hup, op naar Leopoldsburg.

Ik moet zeggen dat ze daar alles netjes georganiseerd hebben, als het leger iets gedaan heeft vandaag is het een goede indruk nagelaten op mij. Nog voor we op de lange rechte baan die recht door het leger domein loopt aankwamen werden we al rechts een terrein op geleid waar we onze wagen konden parkeren onder het toeziend oog van een heel peloton militairen. Nog nooit is mijn auto zo goed bewaakt geweest.
Daarna werden we keurig in (weliswaar zeer warme) bussen geladen en werden we naar het terrein vervoerd enkele kilometer verderop.

Toen alles gedaan was weer van hetzelfde, met z’n allen de bus op tot aan de parking waar weer een aantal militairen het verkeer stonden te regelen. Dit is de eerste keer dat ik naar een evenement ga waar zoveel bezoeker zijn en je niet moet aanschuiven of wachten om tot de parking te komen. Het leger krijgt van mij vandaag 10 op 10, alleen verdedig je geen land door opendeurdagen te houden.

Oh ja, en onze Torn vond het allemaal geweldig, hij heeft zich eens goed laten gaan en heeft alle hoeken van het terrein gezien, en zelfs een handje gekregen van een echte militair. Waauw :)


PHP’s function naming and argument order

Geplaatst in PHP, Webdevelopment Reeds 3 reacties

Just got back from PHPVikinger, a unconference, traveling around the world, organised by Derick Rethans. This year’s conference was held in Leuven, and since that is only a 30 minute drive from where I live I had to attend ofcourse.

For the summary of the event itself I’m happy to point you to Jeroen’s blog but I’d like to talk about something Stefan Koopmanschap brought up during Scott’s and Derick’s session on the PDM.

During the Q&A Stefan asked why the developers of PHP didn’t grab the opportunity to clean up the seemingly random and sometimes messed up functionnaming and argument ordering in some of PHP’s internal functions. Stefan by far isn’t the first one to bring this issue up, there are dozens of people reporting and asking this on the mailinglist and even filing bugs for it (with questionable degrees of success) but he did make a very valid point by stating that the release of PHP6 is the moment of choice to introduce these kind of changes in the core functionality of the language.

Function Naming

So what is this all about? Well really, as much as I love PHP, in several area’s it’s a mess. Especially in function naming.
Take the isset() function for example. Why is the is_null() function written with an underscore, these functions seem to me like they belong together since they both inspect a variable and return true or false if the state of the variable is as the function requested. Well then why is is_null written with an underscore and isset not? Doesn’t really make sense unless you want to confuse people.

Another example is the htmlentities() function, this function encodes some characters in a string with their entity value, the function that does the exact opposite is called html_entity_decode(). Again one is written with underscores, the other without. And again without an obvious reason.

Other examples are all the string functions, there are a dozen function that start with str_ and alot more of them that just start with str.

Argument order

Another issue is argument order. There are several functions that seem rather random in the way they order arguments. Especially function that required needle/haystack arguments.

String functions, like strstr() for example, accept $haystack as a first argument and $needle as a second while array function like array_search accept them in the reverse order. It just seems counter intuitive to me.

PHP 6

What disturbs me the most was the reply Scott and Derick gave Stefan at the conference, their reply simply was that it won’t be fixed because otherwise a lot of developers would be upset about the changes and lacking backwards compatibility.

Well they have a valid point there … if you’d consider fixing it in a minor version upgrade like from PHP 5.2 to 5.3. But if we are talking upgrading from PHP 5 to PHP 6 I’m absolutely sure the majority of PHP developers wouldn’t mind giving up backwards compatibility in exchange for fixing these issues. Over time the amount of functions in PHP really isn’t going to decrease so I’d prefer to have it fixed before it really runs out of control. But who am I?

I hope that with this blogpost I’ve inspired some people to think about this subject too and maybe undertake some action and write about it on their blog or twitter it since this isn’t something that is going to change unless us, PHP users, are asking for it and making the PHP core developers aware of these issues and that fixing them is important to us.


Oracle koopt Sun Microsystems

Geplaatst in Applicaties, Internet, Webdevelopment Nog geen reacties

Het moest me even van het hart maar ik weet nu niet of ik blij moet zijn met de overname van Sun door Oracle of dat ik er bij moet beginnen te huilen?

Door deze overname krijgt oracle niet alleen Java (en NetBeans), maar ook Solaris, VirtualBox, Open Office én MySQL in handen. Als dat geen joekel van een investering is dan weet ik het niet. Dat heeft den Larry weer goed geregeld zou ik zo zeggen. Het is ook niet zo gek dat het bestuur van Oracle de overname unaniem heeft goedgekeurd.

Ik denk en hoop dat Microsoft zich stilaan serieus zorgen begint te maken. Google blijft hun steeds een stapje (met een zevenmijls laars) voor op het internet en op het niveau van besturingssystemen beginnen de verhoudingen ook steeds meer en meer te kantelen. Er zijn steeds meer mensen die overschakelen van Windows naar Mac of een ander OS zoals Linux.

Als we de productportfolio van Sun even bekijken dan zie je al direct 4 direct concurrerende producten van Microsoft;

  • OpenSolaris vs WindowsServer
  • Java vs .NET
  • OpenOffice vs Microsoft Office
  • VirtualBox (xVM) vs VirtualPC (VirtualServer)

En wat gaat er met Open Office gebeuren? Als Oracle zijn schouders onder het project zet wordt het eens te meer een zware concurrent van Microsoft Office, want laten we eerlijk zijn, waarvoor jij en ik office gebruiken hoef je geen €600 neer te tellen, hetzelfde bereiken we met sprekend gemak ook met Open Office. Het enige wat me dan misschiens nog een beetje tegenzit in Open Office is een compleet alternatief voor Outlook. Dat Oracle daar dan maar mee begint, dan hebben ze er al één klant bij … als ze met hun fikken van MySQL af blijven tenminste :)


Dojo Dijits in Zend_Layout

Geplaatst in PHP, Webdevelopment, Zend Framework Reeds 4 reacties

A quick tip on using the Dojo implementation in Zend Framework.

Yesterday I was trying to put a borderContainer on my application. Following the code samples in the manual I had it set up pretty fast in my View, but since all pages should utilize this it seemed normal to me that I would integrate this in my Zend_Layout instead of each View separately.

Thus I moved all the code to my Zend_Layout and tada … no more Dojo, it just stopped working. The code below is the (simplified) code of my Zend_Layout at that time.

< ?php
$this->headTitle()->setSeparator(' :: ');
$this->headTitle()->append('Skyrocket Admin');

echo $this->doctype() ?>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
	< ?= $this->headTitle() ?>
	< ?= $this->headLink() ?>
	< ?= $this->headStyle() ?>
	< ?= $this->headScript() ?>
	< ? $this->dojo()->setLocalPath('/admin/scripts/dojo/dojo.js')
	                ->addStyleSheetModule('dijit.themes.tundra');?>
	< ?= $this->dojo() ?>
</head>
<body class="tundra">

< ?
// Load the Dojo helpers
$this->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');

// The page layout is a borderContainer, the views
// get rendered in the Center pane
$this->borderContainer()->captureStart('masterLayout',
                                       array('design' => 'headline'),
									   array('style' => 'width: 100%; height: 100%'));

	$this->contentPane()->captureStart('leftPane',
	                                   array('region' => 'left', 'splitter' => true),
									   array('style' => 'width: 200px'));
		?>
		<ul id="navigation" style="margin: 0">
			<li><a href="/admin/pages">Pages</a></li>
			<li><a href="/admin/auth/logout">Logout</a></li>
		</ul>
		< ?
	echo $this->contentPane()->captureEnd('leftPane');

	$this->contentPane()->captureStart('contentPane',
	                                   array('region' => 'center'));
		echo $this->layout()->content;

	echo $this->contentPane()->captureEnd('contentPane');

echo $this->borderContainer()->captureEnd('masterLayout');

?>
</body>
</html>

Back then it was almost 2AM so I didn’t feel like going after the solution. I dropped a post on Zfforums.com and went to sleep. Today on the other hand I felt like digging through the classes that are responsible for creating the dijits and it didn’t took too long to realize what was wrong.

The problem lies in the order of execution, the Zend_Dojo_View_Helper_Dojo class is responsible for outputting the javascript code that converts your basic html elements into Dijits. But in the code sample above I was outputting the dojo() helper before I was actually creating Dijits. Thus the HTML elements got created but the javascript code to convert them into Dijits is never outputted.

The solution is to simply move all your dijit creation code to the top of the page or to move the output of the dojo helper to the bottom. My advice is using the first option, simply because if you output it at the bottom you get to see the un dijitized html for a brief moment which is not nice.

Here is the working code for the borderContainer Layout in a Zend_Layout

< ?php
$this->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$this->dojo()->setLocalPath('/admin/scripts/dojo/dojo.js')
		     ->addStyleSheetModule('dijit.themes.tundra');

$this->borderContainer()->captureStart('masterLayout',
                                       array('design' => 'headline'),
									   array('style' => 'width: 100%; height: 100%'));

	$this->contentPane()->captureStart('leftPane',
									   array('region' => 'left', 'splitter' => true),
									   array('style' => 'width: 200px'));

		if (Zend_Auth::getInstance()->hasIdentity()):?>
		<ul id="navigation" style="margin: 0">
			<li><a href="/admin/pages">Pages</a></li>
			<li><a href="/admin/auth/logout">Logout</a></li>
		</ul>
		< ?
		endif;

	echo $this->contentPane()->captureEnd('leftPane');

	$this->contentPane()->captureStart('contentPane',
									   array('region' => 'center'),
									   array());

		echo $this->layout()->content;

	echo $this->contentPane()->captureEnd('contentPane');

$data = $this->borderContainer()->captureEnd('masterLayout');

$this->headLink()->appendStylesheet($this->autover('/admin/css/style.css'));

$this->headTitle()->setSeparator(' :: ');
$this->headTitle()->append('Skyrocket Admin');

echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	< ?= $this->headTitle() ?>
	< ?= $this->headLink() ?>
	< ?= $this->headStyle() ?>
	< ?= $this->headScript() ?>
	< ?= $this->dojo() ?>
</head>
<body class="tundra">

	< ?= $data ?>

</body>
</html>

I hope this helps at least some of you out, and if there are any questions or remarks i’d be glad to hear them!


Name the band

Geplaatst in Every day life, Music Nog geen reacties

Metal bands, I like them, da’s geen geheim maar soms vraag ik me toch af waar ze mee bezig zijn, en vooral waar ze hun namen vandaan halen? Die mannen moeten soms toch wel serieus onder invloed zijn van rituele slachtingen en drugsgebruik. Hier volgen mijn favoriete exemplaren.

In de categorie fauna & flora:
Cattle decapitation, Archgoat, Cuntworm, Goat Semen, …
Of we Ozzy Osbourne nu verantwoordelijk kunnen stellen voor deze trend door het “verwerken” van vleermuizen en kippen tijdens zijn act maakt niet uit maar dieren in een metalband zijn niet cool, en zeker niet als ze te maken hebben met hun ingewanden. Mijn persoonlijke favoriet hier is zeker Archgoat of vertaald: Aartsgeit
Onder Sexueel gefrustreerd:
Cliteater, Corpsefucking Art, Ultraphallus, Bloodgasm, Cock and Ball Torture, Prostitute Disfigurement, Anal Blast …
Ofwel is het dat de meeste van de bandleden nog nooit van de grond zijn geraakt ofwel zijn ze gewoon op de verkeerde vrouwen gestoten maar hoe komde begot op zulke namen? Hier kon ik trouwens ook een lachbui niet onderdrukken bij het horen van “Anal Blast”, zouden ze zich bewust zijn dat ze hun band gewoon naar een scheet hebben genoemd?
De categorie hoe-komde-er-op:
Intestinal Alien Reflux, Jumpin’ Jesus, The Tide That Turns The Christians Souls Into Dust And Summons Satan To His Infernal Palace, Paracoccidioidomicosisproctitissarcomucosis, …
Huh? Ofwel een overdosis aan inspiratie ofwel gewoon gebrek er aan. Vooral die laatste is niet te schatten, zoveel ziektes in 1 woord zouden ze moeten verbieden bij wet. Ik hoop dat de bandleden geen inspiratie zijn gaan zoeken bij hun eigen medisch dossier.

Trouwens bij de meer bekende rockbands zitten ook wel wat bizarre namen als je er bij nadenkt: Def Leppard, Puddle of Mud, Gwar, Hoobastank, iwrestledabearonce, … en er zijn er nog veel meer!