New Theme 4

Posted by Hisham Thu, 03 Jul 2008 19:59:00 GMT

I'm working on a new theme for this site. To force myself to finish it, I'm going to apply it directly, the result being, messed colors, fonts, etc until its done. Wee! (=

Thunderbird sucks, Claws owns! 7

Posted by Hisham Wed, 02 Jul 2008 01:46:00 GMT

I was setting up my signature file (~/.sig) in Thunderbird today, and I thought to myself, "hmm, let me create a fifo instead, and pipe some output from fortune into it". So I mkfifo'ed ~/.sig and wrote a little perl script to write out my signature into the fifo when Thunderbird asked for it. The script is pretty simple:

#!/usr/bin/perl -w

chdir;
$FIFO = '.sig';

while (1) 
{
    unless (-p $FIFO) 
    {
        unlink $FIFO;
        system('mknod', $FIFO, 'p') 
            && die "can't mknod $FIFO: $!";
    }

    # next line blocks until 
    # there's a reader
    open (FIFO, "> $FIFO") 
    || die "can't write $FIFO: $!";
    print FIFO <<EOF
--
HMB.
(hisham.mardambey\@gmail.com)
Codito Ergo Sum.

EOF
;
    print FIFO `fortune`, "\n";
    close FIFO;
    sleep 5;    # to avoid dup signals
}

The result of which will be:

--
HMB.
(hisham.mardambey@gmail.com)
Codito Ergo Sum.

Guy in chicken costume:  The world is gonna end at midnight tonight. Y2K. 
Peter Griffin:  Y2K? What are you selling, chicken or sex jelly?

And to my amazement, as soon as I fired up Thunderbird and tried to compose a new email, the entire user interface blocked, and my CPU usage went through the roof. A quick check showed that Thunderbird was infinitely reading from the fifo. Son of a ... After some google'ing around, I found this to be a common bug in the 2.x.x series, so I upgraded to 3.x.x, and, they had introduced a "fix". What sort of fix might you ask? Well, I could compose a message alright, except the ~/.sig file wouldn't get read at all. What a fix! If the file is a fifo don't read it? Thats hilarious. At this point, I was fed up, Thunderbird was going away. I remembered another mail client I used to use, Claws. A quick call to emerge installed it, and 2 minutes later, I had it all set up and it was reading my ~/.sig file properly. Claws 1, Thunderbird 0.

Finder -> Frisk (0.0.1) 5

Posted by Hisham Wed, 25 Jun 2008 05:23:00 GMT

Yes, I've called it Frisk! Version 0.0.1 is ready, no public release yet, but I'm started to feel fairly happy with the solid foundations Frisk is being built on top. As it stands, there are 3 libraries (aside the other libraries from the EFL) that are being built: fkinetic, fthumbnailer, and fmultiscale. The first being a generic kinetic movement area, the second being a distributed thumbnailer and caching engine, and the third being the code display widget that lays out images and decides how to move them around and manipulate them.

I'm coming up with TODO lists for each of the sub-projects, so far, I have one for fmultiscale. I'm going to add more info to a page dedicated to this project.

Finder! 3

Posted by Hisham Mon, 16 Jun 2008 16:31:00 GMT

I've been working on a new concept for an image viewing / searching application. For lack of a better name, it's called Finder for now. The idea is the following. Say you want to find an image on your system; you know its mainly blue (of some sky), but you don't remember its name, size, location, or when you got it. How can you go about looking for it? You fire up Finder, let it loose on your system, and ask it to cluster images by color. The end result is a big map of all your images, zoomed out, such that every corner of the image represents a color, and the closer you move from one corner to another, you see the colors converging into a gradient. So, naturally, you'd go to the blue area, use your mouse wheel to start zooming in and out, and "throw" the images around (using a kinetic energy panning approach) until you start finding something that resembles the image you're looking for. You can then zoom in and out, and pan around, until you find your target image, at which point you can pick it up and use it. Right now, I've implemented the kinetic panning area, an LRU multi-layered cache system for the images, and the (*huge*) image grid widget that will hold those thousands and thousands of images. Some of the major challenges at this point are being able to handle the vast amount of data thrown at the application, scrolling it around, loading / unloading images, etc. The next major hurdle to jump over is going to be zooming in and out pretty fast (a problem that might be solved using mipmaps, but might require OpenGL, something I'm trying to avoid).
UPDATE: Video here.

Quick and dirty(?) Rails 2.0.1 Todo List 4

Posted by Hisham Thu, 07 Feb 2008 16:39:00 GMT

So I really needed to get a todo list up and running VERY quickly with minimal hassle. Rails to the rescue! With 2.0.1, you can do the following:
rails todos
cd todo
rake db:create:all
script/generate scaffold Todo title:string body:text done:boolean due:datetime percentage:integer 
rake db:migrate

And then, if you want, add a bit of CSS like I did (screenshot!) to create that progress bar, and voila! Insta-TODO. I plan to make the CSS and any other modifications I add to this little Rails-one-liner public very soon (as an update to this post).