Hash Puppy – A Qt Checksum Calculator

I’ve decided to give Qt a try after long time of wxWidgets programming. When I learn to a new language or how to use a new library I always like to build some small projects to get my hands dirty with. This time I’ve built small checksum calculator – Hash Puppy (in fact, first I had the name then I’ve decided I must use it for some new project).

hashpuppy
Continue reading Hash Puppy – A Qt Checksum Calculator

Re-distilling PDFs to Reduce Size

I decided to finally learn QT and started to read the “C++ GUI Programming with Qt 4” (first edition) which is available online. The book comes in a zip file that unzips to a huge, 51MB, pdf file. Even when considering the book is quite long (556 pages), the file size is very large compared to what one is used to except. The huge file size made reading the PDF less convinient, as one notices a considerable delay when opening it (especially if the PDF resides on some portable storage), so I’ve decided to play a little and see what I can do about it.
Continue reading Re-distilling PDFs to Reduce Size

Book Review: Lighttpd by Andre Bogus

As an avid user of Lighttpd, I was glad to receive a copy of the “Lighttpd” book by Andre Bogus (Packt publishing) for reviewing. I’ve been using Lighttpd extensively for production over a year now and I’m very satisfied. However, I remember that as a new user I had my share of frustration. In his book, Andre Bogus, tries ease the process for those that decided to move to Lighttpd.
Continue reading Book Review: Lighttpd by Andre Bogus

Displaying Non-Builtin Math Macros in LyX

I believe LyX is a great tool for writing LaTeX document. It makes writing formulas very easy and it allows you to see the formula as you are writing, as opposed to seeing only LaTeX code. However LyX doesn’t support every LaTeX package and the macros it defines. Sure it doesn’t stop you from using these macros in your formulas, but it doesn’t display nicely, you see the name of the macro instead of a schematic preview.

While LyX doesn’t support many of the great packages out there like mathtools (which I really hope it will someday), you can add some support to your documents. At the beginning of the document insert a comment, via Insert->Note->Comment. Inside the newly created comment insert a math-macro via Insert->Math->Macro. In the name part, put the name of the command you want to add support for. In the second box (caption LyX), use existing LyX commands to mimic how the macro will look like. For example, this is what it looks like for the \coloneqq macro (from the great mathtools package):
math-macro

After adding the math macro in the comment, when you will use the macro inside formulas it will display nicely:
math-macro2

A little explanation how things work. When you define a math macro in LyX, LyX does two things:

  1. Inserts LaTeX code to create the macro.
  2. Displays the macro nicely when editing the document.

While the latter is desirable, the former is problematic. If LyX inserts LaTeX code to define the existing macro, it will cause errors. So when you put the LyX macro in the comment environment, the code LyX generates gets ignored and only the second, desirable, outcome is achieved.

Convert int to string (As Well As Almost Anything)

This is a little code snippet from Open Yahtzee‘s code base that converts all the built-in types and many custom classes (ones that override the << operator) to string.

template <class T> inline std::string stringify(T x)
{
	std::ostringstream o;
	o << x;
	return o.str();
}

I first wrote it to convert ints to string, but later I templatized it so it would work with other types as well. It’s a clean elegant snippet that I thought other might find useful too.

tarsum-0.2 – A read only version of tarsum

When I first scratched the itch of calculating checksums for every file in a tar archive, this was my original intention. When I decided I want the script in bash for simplicity, I forfeited the idea and settled for extracting the files and then going over all the files to calculate their checksum value.

So when Jon Flowers asked in the comments of the original tarsum post about the possibility of getting the checksums of files in the tar file without extracting all the archive, I’ve decided to re-tackle the problem.

Continue reading tarsum-0.2 – A read only version of tarsum

XWRDS Gets a Browser Search Extension

I’ve added today an OpenSearch description for XWRDS. In simple words it means that you can now search XWRDS directly from your browser search box. Supported browsers include Firefox 2.0+, Internet Explorer 7+ and Google Chrome, so if you use one of this browser you can now solve your crosswords faster then ever by using the XWRDS search.

To add the XWRDS search to your browser’s search box either click this link, or got to the XWRDS website and select the XWRDS search engine from the pull down menu of your browsers search box (usually at the top right corner of the window).

XWRDS Gets a YubNub Command

YubNub is a site that provides users with a social command line to the internet. It lets you do all kinds of stuff, mostly search related, by typing special commands.

Today, I’ve added a command to YubNub that allows you to search XWRDS. The command name is xwrds and it expects the clue to search as an argument.

For example:

xwrds Either of two of the VIII's six

I hope people will find it a convinient way to easily search XWRDS.

Update 20/11/2009: Fixed link to YubNub.

RTL Tiddlers in TiddlyWiki

Update – For TiddlyWiki 5 see RTL Tiddlers in TiddlyWiki 5.

I’ve been using TiddlyWiki for a while now, and it became a very useful tool for me. Today, I’ve decided to organize my various recipes (somehow cooking and especially making deserts has turned into an hobby of mine), and as you can expect I’ve decided to use TiddlyWiki for the tasks.

There was a slight problem as some of the recipes are in Hebrew, and it seems TiddlyWiki doesn’t have built-in support for RTL (right-to-left) tiddlers. However, such support can be added via custom stylesheets and the tiddlers’ tags. The idea for this method is taken from this TiddlyWiki.

Create a new tiddler called “StyleSheet” (without the quotes). This is a special tiddler (a shadow tiddler) that lets you add additional CSS code for your wiki. Insert the following code into the newly created tiddler:

/*{{{*/
div[tags~="RTL"].tiddler {
    direction: rtl;
}
div[tags~="RTL"].tiddler .subtitle {
    direction: ltr;
}
div[tags~="RTL"].tiddler .tagged {
    direction: ltr;
    float: left;
}
/*}}}*/

Now for every tiddler you want to be in RTL direction just add RTL to its list of tags. After you do it, the tiddler will appear correctly. Here is an example of what in RTL looks like after the fix:

A screenshot of an RTL tiddler
A screenshot of an RTL tiddler

Italian Radio Stations List for Radio.py

Fabio, an Italian user of radio.py, wrote to me the other day with couple of suggestions and a huge radio.py configuration file with 150 Italian radio stations.

According to Fabio, the list contains 40 of the most popular Italian radio stations, along with radio station from where he used to live in north Italy.

In his post, Fabio also describes a useful tip he uses. He used the radio.py configuration file to number his favorite stations, thus allowing him even easier way to listen to them. E.g.

radio.py 1
radio.py 3

Previously, Henrikan compiled a .radiopy file containing some 58 Swedish radio stations.

If your a radio.py reader and you’ve compiles a .radiopy file you would like to share, send a link along with short description and I’ll gladly publish it.