Clever Foo

Rafael Ferreira's life log

Douchebag move of the week

without comments

Always ingenious, John Stewart delivers one of the best reviews of what went on this week with McCain’s campaign reaching for new lows with their attack adds aimed at painting a picture of an “elitist Obama”



Update: Priceless comment from reddit:

[url]http://www.reddit.com/comments/6uis9/jon_stewart_mccains_celebrity_attack_add_is_the/c04wkkx[/url]

Written by raf

August 2nd, 2008 at 2:21 am

Posted in Politics

Mono OSCON BOF?

with one comment

Does anyone know of such strange, yet delightful, gathering? I would like to see how things are going in mono land…

Written by raf

July 23rd, 2008 at 4:12 pm

Posted in Mono

Awesome reddit quote of the day

with one comment

======”Flip-flops are only worn by girls and gay guys. On John McCain it’s just beach wear.”======

Original here: [url]http://reddit.com/info/6kas2/comments/[/url]

Written by raf

May 22nd, 2008 at 2:23 am

Posted in Politics

Vista as an instrument of meditation…

with 6 comments

I’m typing this as I wait for my dad’s brand new Sony VAIO to run Vista’s “checking your hardware” utility; it has been doing this for about 8 minutes now. Before this lovely state, I had to wait while it ran “windows gets ready to run for the first time” for about 20 minutes.

wait.. it just rebooted, looks like it is done.

So in total, it took me 5 minutes to unpackage the VAIO plug it in and turn it on, and about 28 minutes to run Vista for the first time.

Two things I don’t understand:

1) This is a brand new US$2,000 laptop with a fancy hybrid hard drive, why does it need to “check my hardware”?
2) Why OEM’s put up with this? I mean Sony should have enough leverage to force Microsoft to provide them with a “quick firstboot” version of Vista.

Don’t get me wrong, I’m not a Windows hater, I’m fine with it for the most part, but this just pushes my patience to a whole new level… has no one at Microsoft used a Mac and seen their elegant “firstboot” system? Or used pretty much any recent Linux distro for that matter?

btw.. windows is still booting…

Written by raf

May 2nd, 2008 at 11:20 pm

Posted in General

Sitting at opposite ends of the spectrum

with 2 comments

For some odd reason I came across this video today, it brings together Mr. Dawkins and Pastor Ted. I’m not quite sure why professor Dawkins would even consider something like this but it is hella funny.




Even if you are a big Pastor Ted fan, this video should still serve to show you the crumbling grounds that one must take to argue about logic and reason against an evolutionary biologist.

Written by raf

March 10th, 2008 at 2:55 am

Posted in General

Async delegates in… bash!

with 2 comments

This may not surprise some of you but, believe it or not, you can write very simple asynchronous delegates in plain old bash. Yeah that’s right, BASH.

Here’s the scenario, let’s say you have to perform a task that might take a long time (let’s pretend you need to check the health of an nfs server prior to attempting to mount exports from it) but you do not want to block the main “process” waiting for it, here’s how something like that can be implemented:

###################################################
# ASYNC NFS CHECK
# Rafael Ferreira <raf@ophion.org>
###################################################

# CONFIG FLAG - whether NFS has been checked or not
NFS_OK=1

# Runs a command asynchronously
# $1 is the command to run
# $2 is the callback function
async_run() {
        {
                $1 &>/dev/null

                # calling the callback passing the result
                $2 $?
        }&
}

nfs_callback() {
        if [ $1 == "0" ]
        then
                touch /tmp/$$
        fi
}

for i in $(mount -l  -t nfs | grep nfs2 | awk -F ":" '{print $1}')
do
        if [ $NFS_OK == "1" ]
        then
             async_run "/usr/sbin/rpcinfo -p $i" nfs_callback
             disown

        fi
done

sleep 1s

if [ -f /tmp/$$ ]
then
        echo "NFS OK"

else
        echo "NFS NOT OK"
fi

In a nutshell, async_run() is where all the action happens. It takes a string parameter of a command to be run and a callback function to be dispatched once the command is done. On the example above, I decided to block the main process and wait for the async call to return for at most 1 sec, this allows me to have constant execution O(1), no matter how long the async task takes.

Yeah, I know this is pretty silly, but hey, I like it.

Written by raf

March 6th, 2008 at 11:00 am

Posted in General

And for the Arse of the Year Award…

with 5 comments

This guy Mark Fink should get the Arse of the Year Award for the most obtuse gnome mailing list post:

http://mail.gnome.org/archives/desktop-devel-list/2008-February/msg00131.html

My fav quote from that whole thread:

””I’ve never written a program before so I also need some help. Also I need a place to put it on the web””

We are indeed doomed….

Written by raf

February 23rd, 2008 at 1:03 am

Posted in General

Mike Huckabee pulls a “Howard Dean”

without comments

This might turn out to have the same effect to Mike Huckabee’s bid for the White House as Howard Dean’s now infamous “rahhh!”.

http://firstread.msnbc.msn.com/archive/2008/01/15/579265.aspx

Now, to be clear, I’m not putting Howard Dean’s deranged scream in equal footing with Mr. Huckabee’s comments but I do see a parallel that could lead to the same kind of political turmoil.

Fundamentally, I see two things wrong with Huckabee’s stance:

a) He manages to display complete lack of respect towards the US Constitution and the principles in which it was based
b) He shows a lack of insight into the complexity of Christianity and how one must quantify what “God’s standards” mean in light of the different interpretations of the Bible (I must say this one is extra troublesome coming from a “minister”)

Well, enough said. Let’s all seat back and watch.

Written by raf

January 16th, 2008 at 3:01 am

Posted in Politics

Quote of the day

without comments

“Given enough eyeballs, all bugs are shallow.” – Eric S. Raymond

Written by raf

January 5th, 2008 at 1:39 pm

Posted in Uncategorized

No, I’m not dead.. Uva Software is unveiled

without comments

For the last year or so, along with my dual Master’s degree, I’ve been working with a partner on what I think is a long overdue addition to the educational marketplace in the US, an open source educational software company providing software that aims at shaking up things and really increase the value of what you get today when you think educational software.

[url]http://www.uvasoftware.com[/url]
Open Educational Middleware

We have just released version 0.1 of our flagship product: Uva Core an open source SIF agent library.

That’s it… now it’s official…. carry on…

Written by raf

October 1st, 2007 at 10:58 pm

Posted in Uncategorized