A Gray code generator in PHP

Submitted by Frederic Marand on Sun, 2009-02-22 18:09

For a recent case, I had to define the behaviour of a system with a lot of independent conditions to check, which could trigger any number of a set of messages and actions on data, and all of this based on a plain english (i.e. non algorithmic) description of the data, which only covered the most commons scenarios for these conditions, leaving lots of undefined combinations of inputs. What's one to do in such cases ?

Demo/tutorial Directory module from FOSDEM 2009

Submitted by Frederic Marand on Mon, 2009-02-09 23:53

A simple "directory" module, which I did at FOSDEM for Kineta Systems as a tutoring demo, is available in my Sandbox on Drupal.org.

This is a smallish demo module to explain the basics of building such code, and possibly work on it. For deployment purposes, though, you should rather use the existing Directory module by Augustin (aka "beginner").

Switching to private downloads to speed up Drupal

Submitted by Frederic Marand on Sat, 2008-12-20 21:18

It is usually considered a given that "private" downloads, going through Drupal, are slower than "public" downloads, which can be served directly by Apache, or whatever web server the site is running on. This is indeed true in the general case; however, for low-cost hosting, this apparent axiom needs to be revisited.


I recently had to install Drupal 6.x for a french government agency on a low-cost hosting plan. Although the site performed reasonably well considering the limitations of the chosen hosting plan, I soon noticed it was missing mod_deflate and mod_expires, which caused pages to be served uncompressed and every static file to be served without an expiration date.

And, of course, the site had quite a few images: photos on most pages, and several logos at the bottom of each page.

Now, when mod_deflate is missing, using the "Page compression" option on http://example.com/admin/settings/performance is a good workaround for the download page size, but what about the static files ?

Checking a few cheap hosting plans, it appeared these limitations are actually quite common. And without mod_expires, there is no way to tell Apache to serve static content with specific headers. Luckily for us, with Drupal we have a trick up our sleeves, the so-called "private" file downloads.

When hovering over a link no longer displays the target in Opera

Submitted by Frederic Marand on Sun, 2008-11-23 20:50

Spending most of my web time in Opera, I had noticed that on one of my PCs, hovering over a hypertext link (i.e. <a href="..." ...>) had ceased displaying the target of the link in the UI, and there didn't seem to be a setting to make it appear again. Even when upgrading, that annoying behaviour kept stuck.

As one can expect, it turned out to be simple to fix, just not obvious in the Opera UI. Here is the procedure:

Speeding up Drupal on Vista with Wampserver

Submitted by Frederic Marand on Sat, 2008-11-22 18:28

The problem : Drupal awfully slow on Vista (and Seven) with Wampserver

For some time now, I'd been severiously annoyed by the (utter lack of) performance of Drupal 6 and 7 on my home PC, which happens to be running Microsoft Vista: considering I was used to getting page times around 200ms on a fractional Celeron with Apache 2.2 on a Linux server hosted comparatively far across the net from that same machine, I felt the 5 to 15 seconds response time per page on this local machine with a quad core and 3 GB RAM were really making me lose my time.

The solution

After some time spend googling around, I stumbled upon an incredibly simple tip, which made the 5 to 15 seconds per page drop down to around 1 second when logged in, and well below 500 ms when not logged in. It's incredible what ONE single character in a plain text file gets you under Vista :-)

UPDATE 2010-01-23: David Hogg tells us (see below) that this works for Windows Seven too

GroupWise 8 is here at last

Submitted by Frederic Marand on Fri, 2008-11-21 19:35

So at long last, GW8 is becoming reality :

See the GW8 announcement on Novell communities.

As a long time developer on GroupWise (hey, I did this even before I started on Drupal !), I'm glad to see the product evolve. And already a planned upgrade for a customer :-)

Now, if I could find a project merging both... to this day, I've only used Delphi, both with OLE and SOAP, to communicate with GW.

When Trac "Available projects" starts as an empty page

Submitted by Frederic Marand on Wed, 2008-10-29 22:33

Having to use Trac instead of our usual Drupal Project* setup for a new Drupal project, I just found out a problem which perplexed me for a moment: after following the instructions from the Trac site for a very basic setup, without SVN integration, all seems to work well, up to the point where I started the server.

# tracd --port 8000 /var/www/trac/proj1

The problem

... and went to my browser to http://www.example.com:8000/ only to receive an almost empty page, just saying "Available Projects" and nothing else. No error during trac-admin initenv. And the page was well-formed, showing it was likely not an actual bug.

Googling around the problem showed the issue to be already known, but offered no hint about the solution. What could be wrong ?

If the SELECT in your Drupal modules are suddenly all 4 lines high or more...

Submitted by Frederic Marand on Sat, 2008-09-20 20:16

If all of a sudden you notice that the SELECT elements in your Drupal forms increases to 4 and any smaller size is ignored...

... maybe you've already forgotten you were using Chrome, and it is not a Drupal bug : this is a "usability" feature of WebKit. See http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderListBox.cpp#L67.

Safari users are probably used to it, but for users of other browsers, this is a bit disconcerting.