Saturday, September 30, 2006

Eclipse & Php: Php Ide

Eclipse is a wonderful IDE for programmers (extensible with plugins and for new programming languages) and I really enjoy using it! A sort of the Emacs of the new millennium (I'll keep on using Emacs too, though :-)

The Zend plugin for programming in Php with Eclipse, Php Ide also looks very promising! I started using it few weeks ago and found really helpful and powerful. It features syntax completion and an easy to use debugger (although I still haven't succeeded in debugging php programs as web servers).

Here's a screenshot during debugging:

I found it very productive and it is always kept upgraded (the version I'm trying is 0.2.4).

One of the problems I had was due to the use of MySql: when I run a php application I used to get this error:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in...
This was due to the fact that the configuration of php used by php ide expects the socket for connecting to MySql server in /tmp/mysql.sock, but the Debian system I'm using is configured so that the mysql socket is actually in /var/run/mysqld/mysqld.sock.

Since I didn't find a way to configure this option in the php used by php ide, I simply create a symbolic link before starting php ide:

ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

With this "hack" I have no problem at all :-)

Friday, September 29, 2006

GNU Gengetopt 2.18

I released few days ago the new version of GNU Gengetopt,, a GNU program I'm the maintainer of.

Gengetopt is a generator of parsers of command line options.

It generates a C function that uses getopt_long function to parse the command line options, to validate them and fills a struct. Thus your program can handle options such as:

myprog --input foo.c -o foo.o --no-tabs -i 100 *.class
And both long options (those that start with --) and short options (start with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU Coding Standards.

Command line options are an important feature of every non trivial programs. The getopt functions already do a good job in parsing them, but a lot of programming is still require... Gengetopt will do this additional programming for you, and you simply have to provide a file with the specification of the options your program accepts.

I refer the interested programmers to gengetopt's documentation.


Hi! I finally took a moment and published my first Blog!
Here I'll post stuff, ideas, news, tips about Computer Programming and Computers in general!

If you see the URL, tronprog, and wonder whether this has something to do with the movie Tron, well... YES! :-)
It's one of my favorite movies ever, and it will always be a cult movie!
I saw it when I was a child at a local cinema. I was already fond of computers, but that movie enhanced my passion even more.

I chose this name, even because TRON was a debugging command in the BASIC programming language; it stands for TRace ON, and it was basically used to start the tracing of a program. Since programming is one of my main passions, and debugging is unavoidable in programming... well... I thought that using tron in the URL was a good idea!

Happy Hacking! :-D