configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.

Computing | Posted by Pep
Jun 24 2010

Are you trying to install the PHP imagick extension but keep getting this error?
Besides the imagick extension there are 2 packages you need: imagemagick and libmagick9-dev.

apt-get install imagmagick libmagick9-dev
pecl install imagick

Don’t forget to add “extension=imagick.so” to your php.ini file and you should be ready to go.

Save MySQL

Computing | Posted by Pep
Jan 01 2010

Quote:

If Oracle buys MySQL as part of Sun, database customers will pay the bill.

In April 2009, Oracle announced that it had agreed to acquire Sun. Since Sun had acquired MySQL the previous year, this would mean that Oracle, the market leader for closed source databases, would get to own MySQL, the most popular open source database.

If Oracle acquired MySQL on that basis, it would have as much control over MySQL as money can possibly buy over an open source project. In fact, for most open source projects (such as Linux or Apache) there isn’t any comparable way for a competitor to buy even one tenth as much influence. But MySQL’s success has always depended on the company behind it that develops, sells and promotes it. That company (initially MySQL AB, then Sun) has always owned the important intellectual property rights (IPRs), most notably the trademark, copyright and (so far only for defensive purposes) patents. It has used the IPRs to produce income and has reinvested a large part of those revenues in development, getting not only bigger but also better with time.

If those IPRs fall into the hands of MySQL’s primary competitor, then MySQL immediately ceases to be an alternative to Oracle’s own high-priced products. So far, customers had the choice to use MySQL in new projects instead of Oracle’s products. Some large companies even migrated (switched) from Oracle to MySQL for existing software solutions. And every one could credibly threaten Oracle’s salespeople with using MySQL unless a major discount was granted. If Oracle owns MySQL, it will only laugh when customers try this. Getting rid of this problem is easily worth one billion dollars a year to Oracle, if not more.

Differentieren, het spoor bijster?

School | Posted by Pep
Nov 24 2009

f(x) = spoor(x)
f’(x) = bijster(x)

PHP Server Monitor version 2.0 released

Computing, Programming | Posted by Pep
Oct 19 2009

Source: PHP Server Monitor project page

It’s been a while since the last release, but finally the new version has arrived: PHP Server Monitor 2.0 has been released.

PHP Server Monitor is a script that checks whether the servers on your list are up
and running on the selected ports.
It comes with a web based user interface where you can add and remove servers or websites from the MySQL database,
and you can manage users for each server with a mobile number and email address.

With version 2.0 comes the support for websites as well. On the “Add server” page, you can choose
whether it’s a “service” or a “website”:

* service
A connection will be made to the entered ip or domain, on the given port. This way you can check if certain services on your machine are still running. To check your IMAP service for example, enter port 143.

* website
The previous version only tried to establish a connection to the server on port 80. If you are running multiple websites on 1 machine, there was no proper way to check each website for possible errors. Also it was impossible to make sure your site was really up and running, all you knew was that the server was still online.
This function takes care of that.
You can enter a link to a website (for example http://sourceforge.net/index.php), it will use cURL to open the website and check the HTTP status code (see http://en.wikipedia.org/wiki/List_of_HTTP_status_codes for details).
If the HTTP status code is in the 4xx range, it means an error occured and the website is not accesible to the public.
In that case the script will return a “status offline”, and will start sending out notifications.

The previous version sent you a notification every time a server was down or unreachable. Version 2 allows you to choose for a different setting. You can choose to only receive notifications if the status changes, if the server goes offline for the first time only, or the way it used to be.

Each server has it’s own settings regarding notification.
You can choose for email notification or text message (SMS). As of version 2.0, there are 3 gateways
available:
* Mollie – http://www.mollie.nl
* Spryng – http://www.spryng.nl
* Inetworx – http://www.inetworx.ch
For these gateways you need an account with sufficient credits.

If logging is enabled in the configuration, it will log any connection errors, emails and text messages sent.
The latest log records will be displayed on your web interface.
The cron/status.cron.php can be added as a cronjob which will keep the server status up to date.

This version of the monitor features 2 languages: English and Dutch. Unfortunately it is not compatible with the old version, since it’s been rewritten from scratch.

I’d appreciate any feedback you might have regarding this script. Please leave it on the sourceforge
project page (tracker), or send me an email (ipdope[at]users.sourceforge.net).

See: http://phpservermon.sourceforge.net

Nominate PHP Server Monitor on SourceForge

Computing, Programming | Posted by Pep
May 14 2009

PHP: Only variable references should be returned by reference

Computing, Programming | Posted by Pep
Apr 24 2009

Take the following code example:
[php]<?php
class myClass {
public $var = 1;

public function &getVar() {
return($this->var);
}
}

$obj = new myClass;
$value = &$obj->getVar();
?>[/php]
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 took me while to figure this out.

Methane tower

Chemistry, School | Posted by Pep
Mar 30 2009

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

Methane tower

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]

Computing | Posted by Pep
Mar 26 2009

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

Chemistry, School | Posted by Pep
Mar 17 2009

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

Methaan toren

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

Other | Posted by Pep
Dec 12 2008

I keep forgetting how to unblock VI after pressing ctrl+s, so this is a note to myself:

CTRL + Q