"

Archive for the ‘Uncategorized’ Category

The revolution has just begun!!

Thursday, May 13, 2010 @ 01:05 PM
posted by Geppy

Post to Twitter Post to Facebook

Format Your Code With Crustify

Thursday, May 6, 2010 @ 07:05 PM
posted by josealobato

The problem

Don’t you love your code? I mean, it is our product as developers. In the same way that a baker knows how to do and create delicious bread, we create source code…. beautiful source code. The code has to do its duty right and efficiently but it also has to be beautiful. There is nothing better that see your code after some time and feel that this is your code with the correct style.

There is another think to take into account. When we review a piece of code, if the code is not formatted in the way we expected we are adding lot of brain stress due to a non expecting format, avoiding we to focus properly on the most important, what the code does.

As you go coding you will make your way to the right format, because you will see tones of code on books, Apple examples, articles and more. But, there are tools that can help upfront.

Crustify

Yes, yes, I know you can format using XCode itself, but it is somehow limited. You can control some indexing and others, but if you want more, you can have a look to Crustify.

With a bit of initial effort, Crustify will give you full control on the code format with more than 400 settings to adjust. Here I will guide you throw the steps to set it up so you can tell by yourself.

Download and install it

So, lets focus. Go and download the source code from the Crustify site. There you will find our friend GIT, do not panic, use:

1
git clone git://github.com/bengardner/uncrustify.git

This will create a folder with all the code inside. The next step is to build it. Like the old days use:

1
2
./configure
make

On the “src” folder you will have the “crustify” executable. Move it to your “/usr/local/bin”, and you are done. You can test on the terminal somewhere with the command “crustify -h”.

Include in XCode

I can show how to run it on the command line, but I’m sure you want to go to the point and include it in XCode. Here we deal with Objective-C so first lets take the basic configuration that comes with the source code. Take the file “etc/objc.cfg” and save it where ever you think is right (your configurations folder maybe!). It contains a default configuration good enough to start with.

This configuration file though is loosely documented so it is mandatory you to read the 70 lines file “documentation/htdocs/configuration.txt” to understand some of its simple enough syntax.

If you want to explore further the effect of every setting in your code you can download the UniversalIndentGUI. There, select Crustify and you will be able to, graphically, play with the setting so you get the best of the tool.

Better if you go adjusting your configuration as you go, so let’s set up and easy way to run Crustify from XCode. I borrow the small script from Scott from HackerToys

1
2
3
4
#!/bin/sh
echo -n "%%%{PBXSelection}%%%"
/path/to/uncrustify -q -c /path/to/defaults.cfg
echo -n "%%%{PBXSelection}%%%"

The only thing we need to do is add a new user script in XCode as shown on the picture (use you own path).

Edit User Scripts.png

You may assign a shortcut if you use it very often. Now you are done. Just open any file and run the script using the script menu of XCode.

Enjoy your coding!

I need to say this again, the code is your product so… make it shine!!

Post to Twitter Post to Facebook

Captured by the cellphones

Monday, March 29, 2010 @ 01:03 AM
posted by Geppy

Today, the national Spanish newspaper El Pais published an article on the event we took part during the last three days.

During March the 25th, 26th and 27th, the lab with title “The camera in your cellphone” directed by Alberto Tognazzi and the lab with title “What can you do with an iPhone?” directed by Geppy Parziale put together more than 30 people composed by musicians, developers, graphical designers, movie makers and artists.

During the three days, Alberto recorded videos of musicians (Manos de Topo, Blanca Lamar, San León, Los Seis Días and more) within the Raval, one of the most suggestive zones of Barcelona. Those videos were recorded using smart phones and uploaded on YouTube. Each musician selected a place and played a song representing an inspired emotion.

In the meantime, Geppy directed a group of developers and graphic designers to build an iPhone app that will be sent to the AppStore. The app will provide a virtual trip through the Raval and provide the recorded videos on a map of Barcelona.

This is the link to the event.

Post to Twitter Post to Facebook