Syndicate content

Netbeans and Ubuntu 64bits

 - Tagged as

I've been having some very annoying problems with Netbeans IDE running under Ubuntu Jaunty and Karmic. The Java virtual machine process would start to consume memory, probably due to a bug in Netbeans, at a very fast rate, after just 20 minutes of moderate use it would have consumed about 1Gb of RAM. This means that, on my 2GB laptop, the system starts to paginate the memory on disk, severely affecting the overall performance of the system.

Optimizing Javascript and CSS downloads with Zend Framework

 - Tagged as

Modern web sites and applications require the use of many javascript and css files. If not done with care this can affect the user's experience. One of the easiest methods to improve the performance is by concatenating and minimizing the individual files into bundles, reducing this way the number of downloads and the total size to be downloaded.

One problem with this approach though is that during development phases it's important to work with the original source files, so it's easier to debug or perform changes in them. From the developer's point of view it's ideal to work with small files.

Zend Framework offers an interesting way to include external javascript and css files in your pages. The headLink and headScript view helpers allow to include files in the page at any point in the execution which will be finally added to the head section of your layout just before sending the page to the browser. Since all the files are actually added to page at the end of the request we can override those helpers and filter their contents to replace the individual files with our bundles.

Runtime, annotations based, lexer generator

 - Tagged as

Just a quick post to publish this class. It allows to easily create lexers (or lexical scanners or tokenizers) by either extending the class or pointing it to a class or object.

Takes advantage of PHP's Reflection API to explore the document blocks of your class looking for special annotations describing patterns (regular expressions) and rules.

Some features:

- "First to match" and "longest match" lexing modes.
- States based lexer with support for a states stack
- Rules can consume, ignore, repeat in a different state or repeat skipping the rule just matched
- Implements the iterator interface so it can be used in foreach() loops for example
- Reports lexing failures indicating the position in the text plus the line and column
- Caches the internal lexer information so the annotations are only parsed once
- Allows to save and restore the internal lexer information so it can persisted and cached between requests Read more

Finally HTML5 goodness for the real world

 - Tagged as

Firefox 3.1b3 has arrived and it's stuffed with a ton of new web technologies. Most of the stuff comes from the WhatWG working drafts, which should mean that major browser vendors (Mozilla, Microsoft, Opera, Apple and Google) are aware of the specifications and will incorporate them at some point. Read more

My new programming font: Inconsolata

 - Tagged as

Just a short post to announce a jewel I've just found.