by Pep
Pep
This user hasn't shared any biographical information
Homepage: http://www.dopeh.net
Posts by Pep
PHP: Only variable references should be returned by reference
Apr 24th
Take the following code example:
<?php
class myClass {
public $var = 1;
public function &getVar() {
return($this->var);
}
}
$obj = new myClass;
$value = &$obj->getVar();
?>
This looks like valid code, right? PHP wants you to use the & in both places to indicate that you want to return by reference, and that’s what we have. But how come that this code still generates the notice?
Quote from php “return” manual (http://php.net/return):
Note: You should never use parentheses around your return variable when returning by reference, as this will not work. You can only return variables by reference, not the result of a statement. If you use return ($a); then you’re not returning a variable, but the result of the expression ($a) (which is, of course, the value of $a).
While it’s a very simple mistake, it did take me while to figure this out.
Methane tower
Mar 30th
Methane tower or methane bubbles
Requirements:
- Bucket (5 liters)
- 2 liters water
- 20 milliliters detergent (dishwashing liquid works good)
- Gas separator (for example the top of a camping gas burner or a shower head)
- Methane gas

What makes this experiment interesting is that methane gas has a smaller density than regular air. It’s 0.668 kg/m3 for methane versus 1.205 kg/m3 for air. This means that methane gas will rise up in the air under normal circumstances. We take the bucket and fill it with 2 liters of water plus the soap. Now we want to start making bubbles in the soapy water, the major difference with normal bubbles and these bubbles is that they’re filled with methane gas rather than air. Because of the smaller density for methane gas the bubbles won’t spill over the edge of the bucket but they’ll form a nice column which can grow meters high.
The fun begins when you have a proper methane tower. Make sure the smoke detectors are off!
With some fellow students we’re setting up a workshop “Translating spectacular experiments to the classroom situation” and the methane tower is a part of this. It looks really easy to build when you see the YouTube movies, but when you try it yourself you’ll find out it’s much harder than it looks. It took us a couple of hours to come up with the right ratio. Although methane gas has a smaller density than air, soap does not! So having a lot of soap in your tower will make your tower fall over to the side.
If you want your pupils to experiment with this themselves you could use a 250 ml beaker. Fill it with 100 ml water and 2 ml soap. A pasteur pipette works great as gas separator. You do might want to give it a try yourself before you let your students take off. ![]()
You could use this experiment when you’re talking about density.
Google Earth 100% CPU [solution]
Mar 26th
So I had just finished installing Google Earth on my laptop and was about to explore the brand new street view here in Holland, when, as soon as I open Google Earth, my CPU shoots to 100%. The program did start up but the graphics took ages to load and there was no possibility to navigate at all. After 5 unresponsive minutes I killed the application and restarted it. Same thing, no way to get anything to work.
But, thanks to Google, here’s the deal.. When you go to Tools -> Options, on the right side of your screen you’ll see “Graphics mode” with 2 options and “OpenGL” as the default selected one. Switch to “DirectX”, restart Google Earth and you’re ready to rock!
Hope this works for you!
Methaan toren
Mar 17th
Benodigdheden:
- Emmer (5 liter)
- 2 liter water
- 20 milliliter zeepsop (Dreft werkt erg goed)
- Gas verdeler (bijvoorbeeld de kop van een camping gas brander of een douchekop)
- Methaan gas

Wat deze proef interessant maakt is dat methaan gas een lagere dichtheid heeft dan lucht, namelijk 0.668 kg/m3 voor methaan tegenover 1.205 kg/m3 voor lucht. In de praktijk betekent dit dat het gas opstijgt. We mengen het water en het zeepsop in de emmer. Nu gaan we bellen blazen, maar in plaats van dat we dat met lucht doen, gebruiken we methaan gas. Door de lagere dichtheid zakt de toren niet over de rand van de emmer maar blijft deze netjes staan. Hierdoor kun je een meters hoge toren van zeepbellen gevuld met methaan gas maken, wat er vrij bijzonder uit ziet.
Het spectaculaire gedeelte komt zodra je een mooie toren hebt. Methaan gas is uiterst vlambaar, en als je de toren van beneden af aan steekt krijg je een gigantische vlam. Zodra de zeepbellen knappen kan het methaangas vrij opstijgen en je vlam zal dus een stuk hoger zijn dan je oorspronkelijke toren. Let daarom op, met een toren van een meter kom je al dik tegen het plafond!
De methaan toren! Een spectaculaire proef voor in de klas, maar ook iets om mee uit te kijken. Met een paar mede-studenten gaan we binnenkort een workshop geven met als titel “Vertaling van spektakel naar de klassensituatie”. De methaan toren is hier een onderdeel van. Als je de filmpjes op YouTube bekijkt ziet het er erg simpel uit maar dat valt vies tegen op het moment dat je het zelf gaat proberen. Na veel pogingen kwamen we tot de verhouding 1:100. Voor de emmer was de gasverdeler het beste, als je het op kleine schaal wilt doen kun je een bekerglas van 250 ml gebruiken. Deze vul je voor 100ml met water en 1 of 2 ml zeepsop. In plaats van de gasverdeler kun je een pasteurpipet gebruiken.
Op school
Hier zijn 2 handleidingen die wij hebben gemaakt voor het congres, een is de docentenhandleiding en de tweede is een werkblad voor leerlingen om de proef zelf uit te voeren. Voel vrij om ze aan te passen en te gebruiken!
Methaan toren – docentenhandleiding
Methaan toren – leerlingwerkblad
Als je dit in een klas zou willen doen, kun je bijvoorbeeld denken aan de tweede of de derde klas bij de hoofdstukken dichtheid en eigenschappen van stoffen.
Reminder: VI freezes after ctrl+s
Dec 12th
I keep forgetting how to unblock VI after pressing ctrl+s, so this is a note to myself:
CTRL + Q
PHP Server Monitor v1.0.1 released
Sep 18th
Please see http://phpservermon.sourceforge.net/ for more details.
A minor update of the server monitor has been released.
This release fixes a bug in the log display. In the previous version it ordered the entries by the formatted date & time, rather than using the raw data, which resulted in a wrong list of log entries.
No database changes have been made, the only 2 updated files are “log.php”, and “tpl/log.tpl.html”.
Thanks to everyone for using server monitor. Bug reports and feature requests are most welcome.
PHP Server Monitor v1.0.0 released
Jul 17th
PHP Server Monitor is a script that checks whether the servers on your list are up
and running on the selected ports.
Each server has it’s own settings regarding notification.
You can choose for email notification or text message (SMS). At this moment the only
text message gateway supported is Mollie.nl (Dutch), for which you must have your own account
with sufficient credits.
It comes with a web based user interface where you can add and remove servers from the MySQL database,
and you can manage users for each server with a mobile number and email address.
If logging is enabled in the config file, it will log any connection errors, emails and text messages sent.
The latest log records will be displayed on your web interface.
The monitor.php can be added as a cronjob which will keep the server status up to date.
For more information and downloads see the SourceForge project page
Postbank..
Jun 6th
Een tweede rekening openen bij de postbank: een hele ervaring.
Vorige week vond ik het tijd, ik ging een tweede Postbank rekening openen. Via internet ging dat heel soepel, binnen 5 minuten was de aanvraag verstuurd. Het zou een paar werkdagen duren voordat ie actief werd. Toen ik gister op Mijn.postbank.nl inlogde zag ik tot mijn verbazing opeens de tweede rekening. Ik had net m’n salaris ontvangen dus ik nam gelijk de proef op de som: mijn salaris stond binnen enkele seconden op de nieuwe rekening. Vervolgens moest ik nog wat geld overmaken naar een andere rekening. Nadat ik op “Verzenden” had geklikt ging het mis. “Geweigerd. Deze rekening is geblokkeerd”. Mijn nieuwe rekening was geblokkeerd volgens de computer. Hoe kan dat nou? Ik had daarnet nog geld ernaar overgemaakt. Toch maar even de Postbank bellen. Ik was wel erg benieuwd waarom het niet werkte: al mijn geld stond er nu op. De klantenservice hoefde niet lang na te denken, het bleek een bekend probleem te zijn. Hier gaat ie: Als je een nieuwe rekening opent kun je wel geld erop zetten maar niet van afhalen totdat je het contract, dat je thuis gestuurd krijgt, ondertekent en terugstuurt! Of mijn betaling nog ongedaan gemaakt kon worden. Nee helaas, het spijt ons. Kortom, dag geld, tot volgende week!
Opzich kan ik best in deze regeling komen, alleen maak dat gewoon even duidelijk! Zet het erbij als iemand z’n geld wil overmaken naar zo’n rekening want zo vraag je natuurlijk om problemen. Niet alleen moet ik de komende week nog eten, T-Mobile heeft ook al laten weten dat ze deze week langs komen. Tja, daar zit je dan. Goed bezig Postbank!
For sale: Ford Falcon Panel Van (Sydney, march / april 2008)
Jan 30th
Hi everyone,
At the end of March/beginning of April our Aussie trip will come to an end. Unfortunately we can’t take our car home with us, so we’ll be selling the car for $3800 in Sydney.
The car is a Ford Falcon Panel Van GL built in 1991. It’s an excellent car, reliable and in good condition, and you’ll get lots of camping gear with it.
The rear part of the car is divided into 2 levels. The lower level can be used for storage, while the upper level has a 2 persons bed (see pictures).
Details:
- 4.1 litre unleaded
- automatic gearbox
- airconditioning
- 1 spare tyre
- jack
- registered in New South Wales until Juli 14
- road maps for Eastern- and Central Australia
- radio with mp3 input (cable provided)
- 1 built-in and 2 portable reading lights
- curtains for rear windows, window shades for front windows and windscreen
Camping gear:
- 2 persons mattress
- 2 pillows
- 4 bed sheets and 2 pillow covers
- 2 chairs
- 1 table
- knives, forks, plates and glasses for 2 persons
- 2 pans
- 2 portable gas cookers
- 4 tea towels
- 2 x 20 litre water jerry can
- 1 x 5 litre fuel jerry can
- washing line
- 3 storage boxes
- mosquito net
As a bonus you get 2 foam surfboards (7 feet) with soft covers! An absolute must for the real Aussie experience!!
A couple of pictures of our car:
http://img149.imageshack.us/img149/6107/pc060442zy5.jpg
http://img526.imageshack.us/img526/1058/pc060443bt4.jpg
http://img208.imageshack.us/img208/3425/pc060445lu1.jpg
http://img179.imageshack.us/img179/8153/p1170022bp8.jpg
You can reach us by email or give us a ring at +61 (0)4 04904177
Cheers,
Tamara & Pepijn
