Thursday, March 11, 2010

Source-Highlight-Ide 1.0

I've just released a new version of Source-Highlight-IDE, an IDE for GNU Source-highlight (given a source file, produces a document with syntax highlighting).

Sourcehighlightide home page is

This new version is a complete rewriting using Qt4 (instead of KDE3) and it is based on Source-Highlight-Qt (which I've already blogged about) additional library,, which provides highlighting in Qt relying on GNU Source-Highlight.

Sourcehighlightide is useful when you have to develop a new language definition file for source-highlight. A language definition file makes use of regular expressions, and if they become complex it might be hard to understand how they are matched. Source-highlight already provides some mechanisms for debugging a language definition file; Sourcehighlightide provides a graphical interface to debug a language definition file: it will show which regular expression is matched during the formatting of the input file, and you can process the input file step by step (i.e., an expression at time), and you can also see the output while it is produced.

As you can see from the following screenshot, Sourcehighlightide is a MDI (Multi Document Interface) application, so you can have many files open at one time. Moreover, it provides the basic commands that are common to every GUI application, so we will assume their knowledge throughout this manual.

The online manual is available here.

The main window

Debugging a language definition file

Wednesday, March 03, 2010

CakePhp and SSL connections (https)

I've been playing with CakePhp for some time now (and really enjoyed and enjoying it), since I'm turning my bibliography system, PhpBibliography, to use it (I've rewritten it basically from scratch using cakephp, and hopefully the new version will be out soon).

What I've been struggling with was the https ssl connections which didn't seem to work: I was getting page not found errors, and even after the ssl site was working, only the home page seemed to respond, but no css style was applied.

The problem was due to the rewriting engine on which cakephp is based on, and I had not configured it correctly in the apache site (so cakephp was not to blame). I document my experience here hoping it can help others.

I'm using Ubuntu 9.10, so what follows was done on such system.

First of all, you need to enable ssl in apache; To enable SSL, type (as user root, e.g., with sudo):

a2ensite default-ssl
a2enmod ssl

Note that I'm not interested here in creating a specific certificate, so I'm using the default one.

Then, you need to make the mod_rewrite work also for the ssl site: you need to edit /etc/apache2/sites-enabled/default-ssl and make sure that AllowOverride is set (in my case I only need that in /var/www):

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

Then, restart apache and your cakephp will work with https as well.