News
- Welcome to the personal website of Lieven Dekeyser
Use the cscope code indexer from TextWrangler
From the wikipedia entry:
cscope is a console mode or text-based graphical interface that allows software engineers or developers to search source code. It is often used on very large projects to find source code, functions, declarations, definitions and regular expressions given a text string.
cscope is installed with the Xcode Developer Tools and it was originally intended to index C-based languages, but it can be used for PHP or Java code too. It's not perfect, but it can be useful when working in large code bases.
I've written some scripts to use cscope from within TextWrangler:
Update Index.scpt
Find Definition.scpt
Same drill: put them in your TextWrangler Scripts folder and edit for configuration.
Use ZendCodeAnalyzer from TextWrangler
I've got mixed feelings about PHP development. On one hand, it's ubiquitus and thus a very handy platform to create web apps for. On the other hand, it's an ugly language. PHP 5 fixes a lot of shortcomings of earlier versions, so I kind of tolerate it, but I can never escape the feeling of not being absolutely certain about the code I write. In compiled languages, I've come to trust the compiler to warn me when I'm about to do something stupid. I miss that when doing PHP development.
Luckily, the php command has an option ( php -l file ) to at least check for syntax errors, and Jon Gruber has written a script to use it directly from my favourite free text editor. I've been using this for a while, but I couldn't get rid of that unconfortable feeling.
At work, our web devs use Zend Studio Neon though, which is an extended version of Eclipse with support for PHP development. One part of Zend Studio is the code analyzer, which goes a bit further than just a simple syntax check. It also shows warnings about common mistakes like using a variable that has not been initialized. The problem with using Eclipse is that it's a slow, buggy, completely non-native memory hog on Mac OS X, so for me it wasn't worth it to switch...
Luckily, the Zend code analyzer has a CLI interface, which allows one to use it from other applications and after a bit of struggling with AppleScript, I can now use it from TextWrangler!
If anyone is interested, here's the script:
Check for PHP errors.scpt (30KB AppleScript file)
Just put it in TextWrangler's Scripts folder and edit it to point to the correct location of your ZendCodeAnalyzer.
Written by lieven at 04/06/08 @ 12:39:54 | Last changed 03/11/09 @ 06:56:19 | Link
Cocotron Test
Same code, same Interface Builder file, both built from Xcode.
How? Cocotron!
Building and deploying was fairly easy. Unfortunately, there are still a lot of unimplemented features (even NSAlert is unimplemented right now). I also noticed some ClearType glitches in the textfield while typing, but I'm pretty impressed as it is. If only this project was backed by some large organisation, us poor Mac developers with cross-platform daytime jobs would have a decent tool to use...
I wonder how it compares to GNUStep...
Written by lieven at 02/19/08 @ 16:45:26 | Last changed 02/19/08 @ 16:46:48 | Link
Custom views in NSStatusItem's menu items
Starting with Leopard, you can now add custom views to menu items. So in theory, it should be possible to put anything in a menu you would normally put in a window.
Great! Let's try this out in a real-world scenario!
Read more...
Written by lieven at 02/16/08 @ 09:59:48 | Last changed 02/16/08 @ 10:03:23 | Link
Quoted for the truth
Something found on Wil Shipley's blog: (it's actually an old post, but still very relevant)
Don't gloss over anything. Write every line to be bulletproof. Write every method as if every other method was out to get your code and try to make it crash, and your job was to make sure it wasn't going to happen in YOUR code. Assume the user is going to hit keys randomly. Assume the network is going to get disconnected. Assume the hardware will fail.
I wish more developers would have this attitude towards coding..
Written by lieven at 02/14/08 @ 17:43:45 | Last changed 02/14/08 @ 17:44:06 | Link
Sjanell recordings
My first band was called Sjanell. We played mostly covers but we did have a few songs of our own.
While cleaning up my closet yesterday, I found a CD with some recordings. As CD-Rs fade over time, I couldn't copy the voice track from one song, but the others are still complete. I thought it would be a good idea to put them online before more of it gets lost. Not that it's all that spectacular, but just for nostalgia's sake, you can download the songs from:
http://lievendekeyser.net/sjanell/
Written by lieven at 01/13/08 @ 03:08:01 | Last changed 01/13/08 @ 03:11:11 | Link
Globetrotter Photos
I just finished uploading the photos from my trips to the USA and Poland. Enjoy!
New York (1)
Philadelphia
Washington DC
Baltimore
New York (2)
Poznan (Poland)
Written by lieven at 11/18/07 @ 15:23:59 | Last changed 02/04/08 @ 18:16:42 | Link
Washington DC
Washington DC is the cleanest city we've visited in the USA until now. The hostel is located in a very business-oriented neighbourhood, but then again, the entire city seems to be packed with people in suits, so that's not something out of the ordinary. We went on 2 sightseeing tours, one at night with Mike and Nick (the monuments and governement buildings are all lit up very nicely), and one during the day with a group of people from the hostel.
It was very cool to meet up with Mike, someone I've known over the internet for about 8 years now, but we had never met in real life. I'd like to thank him and his family for their hospitality! A pity we couldn't stay longer!
Written by lieven at 11/02/07 @ 19:21:20 | Last changed 02/04/08 @ 18:17:34 | Link
Philadelphia
The hostel we're staying in is located in Fairmount Park, just outside the city center. The weather is getting better, so yesterday evening I was able to sit outside on the porch and today we've borrowed bikes here at the hostel to tour around the park and city.
Some of the roads in the park are closed for cars between april and october, which made the trip really enjoyable. Also, on a lot of roads in the city's center there are separate lanes for busses and bikes, so you don't have to be as crazy to ride a bike as in New York.
Written by lieven at 10/28/07 @ 16:37:56 | Last changed 02/04/08 @ 18:18:17 | Link
Random thoughts and pictures
It's kind of hard to find a computer that allows me to copy photos from my camera, but since I had promised some photos, here are some from my mobile phone..
The view from the Empire State Building was excellent, we were quite lucky with the weather the first few days. Later on it slowly started getting cloudy and now we're in Philadelphia, it's raining cats and dogs. Let's hope the weather reports for sunday (a little colder but sunny) are correct!
The hostel in Philadelphia is quite different from the one in New York, at first sight reflecting the atmosphere of both cities. Whereas in New York everyone seemed to be excited and always in a rush (is ignoring red lights as a pedestrian even considered against the law anymore?), Philadelphia seems to be more relax. But we have just arrived, so I might be wrong..
In New York, I could practically be considered a native, except for my crappy English and the subway map hidden in my pocket to peek every now and then :-D
But do notice the the impatience in my look and of course the giant cup of tea (should be coffee, I know, but my stomach still can't handle it)
And yeah, I should go see a barber...
Written by lieven at 10/26/07 @ 22:43:20 | Last changed 02/04/08 @ 18:19:45 | Link