Friday, October 31, 2008

Variable byte coding in C#

In the last years I have developed a relatively large amount of code for my projects, mostly related to Information Retrieval. Now I think is time to share it, starting from the basic classes.

My plan is to a produce (non-periodic) series, with roughly a class per post, and maybe to end up with a sourceforge project collecting all the classes.

This the first post of the series, which presents a class implementing variable byte coding.
[Read More…]

Sunday, October 26, 2008

Genova aquarium

A pleasing Sunday at the Genova aquarium.

Thursday, October 23, 2008

2spaghi.it - Eating in Italy Web 2.0 style

“Andiamo a farci 2 spaghi?” literally means “let’s going to eat some spaghetti”.
It is a typical Italian expression to offer a friend to have a lunch together.
If the answer to the question is “si”, then you have to find a place to go. 2spaghi.it may help you in choosing the right place.

2spaghi.it is a very nice social site that is focused on sharing info, comments and evaluation on any restaurant on the Italian territory.

2spaghi.it is not restricted to spaghetti but includes any kind restaurant performing any kind of cuisine.
You can search for an enoteca to do some wine tasting, or a trattoria to taste local cuisine, but also look for a cheap Chinese restaurant or a Sushi bar.

Wherever you’re in Italy you can have a quick look to this site to find a nice place where to enjoy a good meal (a SpagoLicious restaurant), or be warned about places to avoid (scarso).

The makes a sensible use of many Web 2.0 tools: tags, votes, comments, maps, friends, feeds etc. etc.
This is the Web 2.0 I like!

Here’s my profile on 2spaghi

Monday, October 13, 2008

HxD - Freeware Hex Editor and Disk Editor

HxD is the best hex editor for windows I’ve ever used.

The key feature, which puts it a step higher all the other hex editors, is the the fact that files are not loaded into memory for editing.
This simple fact allows to work on really big files, e.g., I’ve worked with 17 gigabytes file, for viewing or even overwrite editing quickly and smoothly. Operations that results in file length modification are also possible, with the obvious overload caused by file resizing.

HxD has many visualization options and also implements a versatile search functionality. It also features the possibility of performing raw disk and RAM editing. But these are just a few of all the provided features, check the list here.

The fact that it is freeware is the icing on the cake.

Saturday, October 11, 2008

Modifying the BBCode plugin in FlatPress

I like FlatPress!
I’ve found that the standard BBCode plugin does not allow to specify the “alt” tag for images.
To enable this feature I’ve modified the do_bbcode_img function, in the plugin.bbcode.php file, by expading the line:

	$alt = $title = basename($actualpath);

into:

if (isset($attributes['alt'])) {
	$alt = $title = htmlspecialchars($attributes['alt']);
}
else {
	$alt = $title = basename($actualpath);
}

This simple modification allows me to write, for example:

[img=images/ae.png popup=true alt='My custom made image title']

obtaing the following output (hover the mouse on the image) and the good side-effect, almost for free, is that the new title is also used by lightbox (click on the image):

My custom made image title

PS: the htmlspecialchars() function is invoked to prevent the use of malicious html/javascript code by bad guys.