Korbinus

Jun 06 2008

PHP: isset()

by Korbinus. Filed under: PHP

isset() is a function testing if a variable $var is set or not.

boolean isset (mixed $var[, mixed $var[,...]])

It returns TRUE is the variable is set, and FALSE if it isn’t.

Using isset() for testing a variable saves some times compared to try to use an nonexistent one. It also helps to avoid error messages from PHP:

/* The line below generates the warning message:
* Notice: Undefined variable: var in /path/to/script.php on line 1
*/
$toto = $var;

/* Of course it's possible to silence with @ the warnings from PHP but it's costly */
$toto = @$var;

/* Do this instead: */
if (isset ($var)) {
$toto = $var;
}

As seen in the function definition above, isset can take multiple arguments. But it is faster to have an if statement with one isset() call per variable rather than one isset() call with several variables:

if (isset($a) && isset($b)) { } /* Fast */

if (isset($a, $b)) { } /* Slow */

May 28 2008

Google announces prices for App Engine

by Korbinus. Filed under: Appengine

ReadWriteWeb reports that Google will announce a pricing plan for AppEngine. It doesn’t look expensive, specially considering how the US $ is cheap.

Google is providing as well two new APIs, one for image manipulation and the other for rendering pages faster.

It looks like there’s no plan for supporting other languages than Python. Fine with me, I’m learning Python and that’s interesting :-)

May 23 2008

Code is poetry

by Korbinus. Filed under: Appengine

Everybody knows this beautiful sentence.

The downside of it is that you need inspiration for programming.

So this is my problem: I got an account for Google App Engine three weeks ago and… I’m still waiting some inspiration for using it!

The next issue is to find the time to make something of it :-p

May 15 2008

Talking to 200 persons at once

by Korbinus. Filed under: GBIF, Geo, Microformats

I had a talk this morning for presenting the new portal of GBIF-Sweden to the employees of the Swedish Museum of Natural History.

I talked in Cosmonova, which is a huge dome-theater, and that was really impressive to be there. It was a little bit weird as well since the public was in the darkness, I couldn’t see if people were interested or not.

So I presented our new portal. It features a search function: you can now search among 16 millions of records of specimens and observations from swedish databases. You can see the result as a list of occurences, or displayed on a map, at least for records with coordinates.

It contains also news and documents about GBIF.

On the microformat front, the portal uses geo each time a record has coordinates. So if you have Operator installed, and if the map we provide doesn’t fit you or you want to see the location with satellite pictures, you just need to right click and go to the map provider you like (Google or Yahoo!)

The URL is http://www.gbif.se

It’s all in swedish :-)

Apr 02 2008

Firefox 3 Beta 5 (Final beta) released!

by Korbinus. Filed under: Uncategorized

With more than 750 changes from the previous beta, FF 3b5 has been released today.

Release note: http://www.mozilla.com/en-US/firefox/3.0b5/releasenotes/

Download: http://www.mozilla.com/en-US/firefox/all-beta.html