Start an Android Intent without pushing on the history stack

I was wondering how to create an Intent with the Android SDK which will not be pushed on top of the history stack. Which means, if another Intent will be started, the back button pressed event will not move back to the specific Intent. Actually this is done pretty easy with setting a FLAG_ACTIVITY_NO_HISTORY. An example the is given with the following code snipped.
Continue reading

Annotations with Symfony2

With Symfony2 much configuration can be added directly to actions with annotations. With Symfony1 there have been cache.yml, route.yml, security.yml and many more configuration files for a single controller. This has not changed with Symfony2. You still are able to configure your (bundle) controller with single files. However, there is a new way which offers more flexibility and adds the configuration right to the place where it is used: to the specific action as meta-info with some sort of annotations.

First, your route.yml has to be edited and your bundle has to be added.

# app/config/route.yml
your_bundle:
    resource "@YourBundle/Controller/YourController.php"
    type: annotation

This is needed in every setup, but as you see, you can specify the route type as annotation. This means, Symfony2 will parse the doc block on any action of your controller file, and import this to route.yml. But don’t worry, Symfony2 does this just once and stores the information on the cached route.yml file.

Now you have to add the routing information on each action which should be imported as route, as shown below. You can also insert params to your route. Additionally to the route you can add various other settings direct to the action as also shown below.

class YourController
{
  /**
   * @extra:Route("/action/{id}", name"route_name", requirements = {"id" = "\d+"})
   * @extra:Template("YourBundle:Controller:action", vars={"your"})
   * @extra:Secure(roles="ROLE_MEMBER")
   * @extra:Cache(expires="+7 days")
   */
  public function yourAction($id)
  {
    $your = 'code ' . does('something with', $id);
  }
}

There is much more to come and everything is still under development. So expect changes and additions to these existing annotations.

Update 24.05.11
Yesterday, Fabien Potencier announced a change in the Annotation System of Symfony2. There is a official blog post explaining the changes.

My computers

So there are a couple of computers idling around here. I all of them gave names of planets and have come to the point where I have to use names of stars because I ran out of planets. Here I have a list of all the devices that I am using on a more or less regular basis. I left out smartphones, server in data centers or not anymore working computers at home.

Earth
My old, but still working home file server which runs Ubuntu. It has three internal HDDs and offers a total of approx. 1,5TB of storage space. I don’t like the really loud fan but I live with it.

Mars
An old Sony Vaio notebook which is not really in use anymore but still works. It runs Windows XP and is often used by others in the living room for just browsing the web. However, I don’t use it anymore.

Pluto
A 15″ MacBook Pro (first generation unibody) which is used by my dad on a daily basis. I just use a remote ssh connection occasionally to fix things or install new software. Yes Pluto is actually not a planet anymore (since 2006), however. I had a Netbook (Saturn) at this time and no other planet name was left.

Jupiter
My main notebook. This is a 15″ MacBook Pro (late 2009) with 8GB of RAM but still a really slow 320GB HDD. I am probably replacing the HDD with a SDD quite soon. I use this MBP every day at university or at home. I am doing my photo editing, programming and daily office work with this computer.

Venus
Not my computer, but my girlfriends. It is a Fujitsu Siemens Windows 7 notebook which I personally do not use at all.

Merkur
My HTPC just beside my TV. It is a Zotac Mag Mini system which runs with Ubuntu with MythTV. It records TV series and movies. I use it also as a small web server for developing small applications.

Uranus
A 23″ iMac actually used by my mum and not quite often by myself. I however often ssh in and install stuff.

Neptun
A 15″ ASUS notebook from 2006. It is running Windows XP, standing around somewhere and not used anymore. It was my main computer for quite a long time before I switched to my MBP (jupiter).

Genua
A 27″ iMac at work I already had to name after an astroid and not a planet, since there are no names left and this is actually not my personal computer.

Should my next project use Symfony2?

In a couple of hours, the Symfony Live event in Paris is going to start. You can expect Fabien Potencier to release Symfony 2.0 at the keynote he is holding on March 3rd at 17:30.

This is actually not a big deal since Symfony2 has been around for a couple of months. The big question is, should you already start developing your next project with Symfony2? There is no definite answer to that but what you can expect is a “not so much” changing API and already robust Framework right from the start. If you are planing a big project with longer time to develop, Symfony2 is a must. If you have already started and use Symfony1.4, stick with it.

Ein Monat Nexus S

Vor genau einem Monat habe ich mein Google Nexus S bekommen. Besorgt hat es mir ein Freund in London und es mir nach Österreich geschickt. Bin ich soweit zufrieden? Absolut! Es gibt dennoch ein paar kleine Dinge die mich stören.

Continue reading

Automatic Anti-Pattern Corrections for PHP

During my computer science studies at the Vorarlberg University of Applied Sciences I wrote my bachelor thesis about “Automatic Anti-Pattern Corrections for PHP”. As a fan of the open source philosophy, I want to share my work with others. I invite everyone to contribute to the great lex-pass project and this approach to better PHP software. Please share your thought and ideas on this with me and others by leaving a comment or sending me a message. Continue reading

Symfony 2.0 Preview

Here we go. Fabien Potencier last week released the preview website for symfony 2.0 (symfony reloaded). Me, as a long time PHP and symfony user this preview shows a lot of new interesting stuff comming to web development with symfony. A Quick-Tour of Fabiens newest baby is also available and points out major changes to the framework. First thing to notice is the completly changed directory structure. Another major step is the use of >= PHP 5.3.2 which adds support for namespaces and gives a great performance boost. As release date for symfony 2.0 “late 2010″ is scheduled.

Symfony Support in NetBeans 6.8 Announced

The NetBeans Team has announced to support not just PHP 5.3 which was released earlier last week but also Symfony in the next release (6.8)!

Because I am not very pleased with the PHP support within Eclipse PDT, I am currently using VIM for PHP, and specially, Symfony development.

Since Pierre told me recently that the PHP support for NetBeans is getting better and better, I am really looking forward to the next NetBeans release.

More information on Symfony integration in Netbeans

PHP 5.3 Released

Well not yet, but hopefully in a couple of hours and minutes. (Check php.net) Although there are some new cool features in it such as lambda functions, closures and PHAR support, there is this silly namespace thing. Namespaces are good in generally (remember, you had to prefix each class with your damn project-name to be on the save side) but separating the namespace parts with the *escape* character “\” (YES THE BACKSLASH!) – the worst ever to choose character – is a awful and total painful thing.

I was hoping until the latest second before the release that someone will fix this BUG and replace the namespace-separator with a better character (maybe “_”, “-”, “..” or “|” since “.” (concat), “::” (static) are already used for other issues).

Do not get me wrong, I appreciate the great work the PHP5.3 Team has done but this namespace thing takes some of the coolness away from that release. Sad but true story.

*UPDATE* PHP 5.3.0 has been release now.

Free to hire

Currently, I am free to hire from 1. Feb. 2010 – 30. Apr. 2010 (3 months work placement). More information.

Update:
Because I got asked: Yes, it is possible that I could work after the work placement as a reqular employee at your company (starting from 1.Aug.2010 at the earliest).