Archive for the ‘IT’ Category
Google gadget app for Simplenote
I am that kind of person who likes to keep lists. Mostly because if I don’t, I forget. I the old days I used paper notes, but when iGoogle was launched I quickly started using gadgets to collect my notes. Because I have a PC or laptop arround most of the day, keeping notes with iGoogle was quite efficient. When I bought an iPhone I wanted to have my notes with me everywhere. Because iGoogle did not have a good user experience on the iPhone I started looking for a better solution. I found Simplenote. This service supports serveral devices, browsers and more. It also hase a public Restfull API which you can use to connect.
Unfortunately Simplenote did not have a Google gadget app. Because I got quite attached to my iGoogle page, I decided to create a Simplenote gadget. The gadget I created has basic Simplenote support. It can create, edit, sync and delete notes. I had a lot of fun building the gadget with javascript and JQuery.

You can find the app in the Google Gadget Directory and install it from there. Any comments on this app are greatly appreciated.
IPhone Hello world – Getting started
Today I made my first IPhone app. It was only a Hello World app, but it always feels nice when you try something different. In this case Objective-C for the ios platform. I got my app to open a new view from a button click and change a label to display the current date and time also after a button click.
Some getting started tips.
To get going you need to download the IDE apple provides for ios and osx development: Xcode. Go to the iOS Dev Center, create an apple account. Download and install Xcode and iOS SDK. This website has tons of documentation and also a good Getting started section.
The Hello World app I made was completely programmatic. I used the following guidance:
http://knol.google.com/k/iphone-sdk-helloworld
You can also use the Interface Builder (which comes with Xcode) to create buttons, label and other interface components. To handle the IDE, you need to read to following user guide to understand how this works.
If you want to create your own Hello World, you will want to play arround with buttons and labels. It is wise to understand how views work. Check out the View Programming Guide.
Remove photo’s from camera with iPhoto
Ever since Image capture is not available anymore for Mac OSX, I don’t have an easy way of cleaning up photo’s on my Canon Ixus camera. It’s simply not possible in iPhoto to delete selected photo by pressing backspace or draging them to the dustbin.
You do have the option to delete photo’s after you’ve imported them, but I usually don’t use it because I like to keep recent photo’s on my camera for a little while. But once in while you need to clean up your memory card.
The only way to delete a selection of photo’s I discovered so far is to import already imported photo’s again. At the end of the import, iPhoto will ask you to delete the photo’s on the camera.I wonder if there is a better way.
Upgrade to WordPress 3.0 and iPhone access
For some time now I wanted be able to make posts on my blog through my iPhone. No particular reason, I just seemed cool to me. I decided to make my blog accessible for mobile devices and found some plugins which make this possible. I noticed that WordPress 3.0 was out so I decided to upgrade WordPress as well. I made some backups and downloaded the zip file. Diasabled my plugins and copied the extracted zip to my hosting server. Keep the wp-content folder in tact, only overwrite the files and subfolders which came with the zip file. Next login to the backend and let wordpress patch your database. Activate you plugins again and you’re done.
Looking into iPhone accessibility I found out that there is a Worpress app in the app store. I quickly installed and started writing this post from my iPhone. Although type is a lot slower, it is just fun.
I also wanted to make the frontend more accessible for mobile browsers. I installed the plugin WordPress PDA & iPhone. I gives a simple but effective interface to your blog. I am all happy now
Understanding Zend Framework form decorators
I just watched a very good screen cast on zendcast.com about form decorators. It points out the essences of the zend form decorators which you might not grab right away when reading the reference guide or copying away from examples on the net.
There are 3 important aspects which you need to keep in mind when working with decorators. First of all form decorators change a piece of content, for instance a form element, which is of course what you might expect from the decorator design pattern. Try to picture this piece of content in its simplest form. For instance a <input> element. Your goal is to place this element somewhere in your html content, say a table.
The imput element can be created by instantiating a Zend_Form_Element_Text class. By adding decorators to this object you can influence how the input element is shown. Decorators can change content in 3 ways: prepending the content, replacing the content or appending the content. If you want to render the input element in table cell, you should use a decorator which replaces the content punting <td> tags around it:
<? $content = “<td>” . $content . ” </td>”; ?>
The second important thing to understand is that decorators are rendered in the order they are added to the Zend_Form_Element. This way you are able to render the content in a hierarchical way. Which is also the case in building up html content. You start which a leaf element and wrap around, prepend or append content until the last decorator is reached.Let’s look at the an example:
$this->setElementDecorators(array(
‘ViewHelper’,
array(array(‘data’ => ‘HtmlTag’), array(‘tag’ =>’td’, ‘class’=> ‘element’)),
array(‘Label’, array(‘tag’ => ‘td’)),
array(array(‘row’ => ‘HtmlTag’), array(‘tag’ => ‘tr’))
));
The example above creates a 2 column table structure. The first decorator (ViewHelper) renders the <input> element, the second puts it in a table cell, the third prepends a label which is also put in a separate table cell, the fourth wraps around a <tr> tag and the last decorator puts the rendered content within <table> tags.
The third important thing to keep in mind is that you can do most of the html rendering with the decorators Zend Framework already offers in its library. You don’t need to make many of your own decorators. The decorator you are going to use frequently is the HtmlTag decorator. Use this decorator to change the html tags you want to use. For instance if you want your content to be inside <div>’s. The example uses the HtmlTag decorator 2 times. For this reason you need to use an alias to identify the decorator. In the example the aliases are ‘ row’ and ‘ data’.
Understanding decorators will save you a lot of trial and error programming. So put some time in learning what decorators do. The webcast on zendcast is a good starting point: Zend_Form Decorators explained.
Choosing a PHP IDE (part 2)
In my previous post I highlight some important features of IDE’s. I will try to explain how the well-known IDE’s perform on these features. I will give some comments on the following apps Eclipse PDT, Zend Studio, Netbeans, Aptana and Komodo.
Eclipse PDT
This eclipse version is a special tailored version for PHP development. Eclipse is very well know and popular open source framework. It counts numerous of plugins and the settings in its configuration section are countless. You might see this as a strenght, but I can also work against you. I for one have never managed to run a project the way I want it to. Creating a new project takes a long time. Recently a feature has been added to create a project from source. Which is handy but probably also the reason why creation of a project takes a long time.
A second problem is code completion. You need to enable Automatic assist in the Code assist section of the PHP configuration. But unfortunately code completion seems to be incomplete. It might have something to do with extreme long building process after you created a project. This easily takes more than an hour. Additionally PDT freezes sometimes and I even witnessed some hangups. After running into these problems I don’t need to explain that I gave up on Eclipse PDT quite soon.
Zend Studio
As I stated in part 1 of this article the latest version of Zend Studio is based on Eclipse. This is currently version 7.1. Zend is supporting the Eclipse PHP development (PDT). They bring out Zend Studio with some enhancement like support for Unit testing, remote servers, svn integration, zend framework, code generation and refactoring. In general my experience with 7.1 is that it is slow. Some improvements were made lately but don’t try to run a project from samba shares or ftp servers because you will get disappointed. Other reasons of irritations are the ‘file out of sync’ messages and the long project building time. But when you get your project up and running you’re fine from there. Studio 7.1 offers a good editor and all viewing capabilities you would want to have. A nice feature is the ability to mark and rename a variable, without have to search and replace.
Another Zend Studio option is version 5.5.1. This is ‘the old’ version which is not based on Eclipse but is still downloadable from zend.com. It is fast, has most features you need and is quite reliable. I especially like the remote server options. Just add a ftp folder to your project and you can start working right away. I am not seeing this in any other IDE. Code completion is ready after a few minutes even when working van samba of local folder. And code completion works pleasantly.
A big advantage of using Zend Studio is the integration with the Zend Debugger. When you are using Zend Server or Zend Platform you can connect to the integrated debugger to step through your application. It is also possible to install the Zend Debugger separately on your server. Studio 7.1 even has local debugger integrated although I did not succeed to get it running with complex application like a CMS or Zend Framework app. Especially handy are the browser toolbars Zend offers to start a debug session from firefox or IE.
Netbeans
A free alternative is Netbeans. A project is started very quickly. It builds the project in the background to load code completion in memory, but you can start editing right away. Code completion has a problem when you try to work with samba shares or ftp folders. It is just way to slow which even makes Netbeans freeze for about 20 seconds or more. The problem has been noted and the Netbeans community is working on a solution which should be available in the next version 6.9. Netbeans has ftp projects. Setting up such a project downloads the sources locally. It is not possible to edit direct from server without having the download the complete content, which usually takes a long time before you can start working on the project.
Aptana
The next eclipse variant is Aptana Studio. It’s free. After downloading and installing Aptana you need to install the PHP Development Tool (PDT) plugin. Just like its soul mates, Aptana suffers from slow project creation. It is not possible to create a project from sources immediately. You have to add a folder manually to the project using the advanced button in de folder add dialog. It is strange to see that when I opened files from the project browser, the default php editor on my Macbook was run. To prevent this you need to make Aptana your default editor. Code completion didn’t work. A strong point of Aptana is said to be support for javascript libraries and javascript debugging.
Komodo
Code completion in Komodo IDE is pretty fast but tends to make some mistakes here and there. I could not find out why these errors occur, they seem to be random. Starting a project is quite easy. Just create your project file in the source root and off you go. Komodo analyses the sources quickly so you will have code completion in a few minutes. I think that Komodo is fastest off all IDE’s on this point. Minor point is that I am missing a good class viewer. Only the current class is shown. Extended classes are missing. I also like to keep the project viewer and class viewer visible all the time. This does not seem to be possible in Komodo.
Conclusion
At the moment my prefered IDE is Zend Studio 5.5.1. It’s fast and reliable. Main reason for choosing 5.5.1 is the very good preformance of code completion. Furthermore it supports ftp projects en debugging.
If you want start off with an free IDE, I would advise Netbeans. You need to develop from local sources otherwise Netbeans is unworkable. But from there you will enjoy this editor very much. The performance problem should be solved in version 6.9 which is planned for march 2010.
Although I didn’t test all IDE’s in the same degree, this article gives you some insight into a number of important features of IDE’s. When you’re in the process of making a choice for an editor, just try them for a week. But more importantly, ask yourself the question: “What is important for me when writing code”.
Choosing a PHP IDE
Working with PHP the past 10 years I have been tweaking my code with quite some different editors. From simple text editors to fully featured Integrated Development Environments (IDE). In this article I will outline what I think is important in choosing your editor of preference. Furthermore I will discuss some of my experiences with different editors.
IDE’s offer a lot of advantages in comparison to text editors. Still I think it is useful to learn a command-line text editor. Most of us are deploying on a linux/unix environment. Sooner or later you will have to edit a file directly on the server. Knowing how to use ‘joe’ of ‘vi’ may come in handy. My preference goes to joe (probably because I managed to remember the keyboard commands for saving, searching and copying). One disadvantage is that joe is not always installed. That’s the big advantage of vi. It will probably work on every server. The vi editor is a little more complicated, but can be very powerful If you are able to manage its functions.

Now let’s focus on PHP IDE’s. Before looking at the products out there, what is important when you’re dealing with PHP code. First of all there are the default functions you will find in all IDE’s: code highlighting for PHP, html and javascript, project management and file browsing. Differences can be found on other functionality:
1. Code completion. Being able to see methods in a class and parameters in functions makes a programmer much more efficient. If you are a serious programmer, you actually can’t do without code completion.
2. Ftp projects. When you work on many projects because of short lead time or long support agreements, you want to have quick access to staging or production environments. It would be best practice to use version control tools such as CVS or SVN to manage your code on remote servers, but not all servers are equipped this way.
3. Class information. Easy overview of methods and properties and access to extended classes makes your life easier.
4. Text search. Every programmer searches trough code to find code snippets. How did I do this before? Does the framework already have what I need?
5. Variable highlighting. Because PHP is weakly typed, you will not easily notice typo’s in variables when running your app. If your editor can manage these variables, you are likely to make less mistakes.
6. Debugging. Stepping through code can help you to find complicated bugs quickly or learn to understand a new application. The best know debuggers are XDebug and Zend Debugger
IDE’s most used by PHP programmers are Eclipse PDT, Zend Studio, Netbeans, Aptana and Komodo. Open source and free are Eclipse PDT and Netbeans. Komodo has a free community edition (Komodo edit), but this version is stripped. To make a valid comparison you need to buy the commercial version (Komodo IDE). Zend Studio 7, Eclipse PDT and Aptana are based on the Eclipse framework. A few years ago Zend made the decision to base Zend Studio on Eclipse. The old Zend Studio is still available. The last old Zend Studio version is 5.5.1.
You’re probably tired reading by now. Well… a least I’am tired writing. I will continue this article in my next post in which I will discuss the pro’s and cons on these IDE’s. And to give away a little secret…. I am still using the old Zend Studio.
Hello blog!
Today I started something which I wanted to do for a long time, but just didn’t find time for. I installed my own blog!
This blog will be about IT and Sports (you may have guested this already from the domain name). I love sports, practising it and watching it. This blog will have posts on IT subjects and sports. Posts on IT will be in English, posts on sports will mainly be in Dutch. If you are not interested in one or the other just use the filter option or the RSS feed for your interest.
As a Web developer I mainly have experience with PHP and MySQL. I have been working in all kinds of roles: developer, achitect, team leader, project manager, functional analyst. In this blog I will try to bring something on all the different aspects of Web development. Sometimes very technical and somethings more on processes.
You are currently browsing the archives for the IT category.
