Why I love PhpStorm: JavaScript code completion with dojo

Just a quick post about the new PHP IDE by JetBrains. So far I’ve been working with Aptana Studio. I also tried NetBeans and Comodo Edit, but none was really satisfying, because either dojo or ftp support was missing (if I find time, I’ll write a post in more detail about the differences between those IDEs).

But now there is PhpStorm. I’m really impressed and enthused by its features, especially code completion for JavaScript. Since JavaScript is a loosely typed language, it’s difficult to write a good code assist. But PhpStorm just picks up everything.¬† For example, if I use dojo.hitch to set the scope of a function, it catches what ‘this’ refers to within the anonymous function !

Code Assist in action
PHPStorm’s amazing code assist in action. Notice that setting the scope with dojo.hitch is reflected in code assist!

More PhpStorm love:
SQL table aliases
SQL GROUP BY handling

Review of Solmeta Geotagger N2 for Nikon

Geotagging your photos is very useful because it allows you to display your pictures on a map helping you remember where you took them. Furthermore, you can use reverse geocoding to automatically add location information (country, nearby places) to your image by using a webservice such as geonames.org.

The good stuff

The Solmeta Geotagger N2 makes it very easy for you to add geographical information to your images. It’s a small GPS that you slide into the flash shoe and connect directly to your camera. Every time you take a photo it writes the coordinates directly into the Exif header. Furthermore, it also records the height and the direction using its contained electronic compass. This works perfectly and the big advantage over a separate GPS device is that you don’t have to synchronize the location data with your photos later with specialized software. The manual is also pretty extensive and helpful.

Continue reading “Review of Solmeta Geotagger N2 for Nikon”

Integration of phpDocumentor into Eclipse or Aptana

You can execute phpDocumentor directly from Aptana or Eclipse. The PHP-project you would like to document with phpDocumentor needs to be open and selected in eclipse before you start the following steps:

Continue reading “Integration of phpDocumentor into Eclipse or Aptana”

Check if node in tree is already selected

It took me a long time to figure out how to check if a node in a dijit.tree is already set to selected, when the user clicks on it. So I thought I share what I found out:

dojo.connect(this.tree, 'onMouseDown', this, function(evt) {
  var node = dijit.getEnclosingWidget(evt.target);
  if (node.item == this.tree.attr('selectedItem')) {
    console.debug('selected');
  }
 });

Tutorial Part 1: REST with Dojo and PHP

I only started recently to dig into REST, so I’m in no way an expert in this field. There are not that many tutorials on the internet, and the ones I found were only of limited help. They all seemed to miss something or, rather, I missed something. So I decided to write my own tutorial about my findings to help others that might have the same problems. On the client side, I’ll use the Dojo Toolkit, on the server side, PHP.

I will focus mainly on providing and explaining some working code examples including server PHP code. At the end of this article you can find all code as a downloadable zip-file. As an introduction to REST, read some of the tutorials linked at the end of this article, because I’m not going to repeat some of the things you can read there.

Continue reading “Tutorial Part 1: REST with Dojo and PHP”

Mozilla Testcase for DHMTL Performance

It started 2003 as a little project to learn the basics of 3D-programming and with a question on how to improve performance in the mozillaZine Forums. I was asked to file a bug (Bug 229391) and to create the Mozilla Testcase Slow (3D) DHTML performance compared to IE for it . From there it made it into the performance suites Dromaeo, SunSpider and The Betanews Comprehensive Relative Performance Index (CRPI) to measure browser speed.

The test is also mentioned in the article “Surf-Triathlon – Geschwindigkeit und Speicherverbrauch aktueller Browser” in the German computer magazine c’t from 19/2008 on page 182.