The “bleeding edge” dilemma

The urge to run the latest trunk of KDE is too great ! but the fact that the trunk is not the most stable keeps a lot of us away from it. Our Friends over at project neon have done a great job trying to address the same issue.
But the problem is slightly bigger than this, imagine a scenario where you are working on two projects and for one piece of code to run you need to uninstall a few installed packages this breaks another piece of software that you need for another project.

Or another scenario would be , you are about to install an experimental piece of software. Do you leave your system in an inconsistent state if that experimental software doesn’t work ? Do you take a back-up ? or do you try to pull off a complex trick of lots of Alternate environments ?

The most embarrassing situation is when you go to your local Free Software User’s Group / LUG to give a talk about how great your OS and its applications are , and just when you are about to speak the app you were showcasing crashes , Damn !
How do you ensure that your apps don’t crash while giving the demo and also maintain your latest unstable hack to your favorite software without both getting into each others way ?

What is the solution to all of the above problems ?
I propose using Boot environments, on Open Indiana a.k.a Oi (Solaris) ( I have started to love this Distro , but my first love is always 🙂 )
Now supposing you have a clean install of you create a snapshot

$zfs create snapshot mydistro@firstInstall 

and now make this snapshot bootable

$beadm create -e mydistro@firstinstall FirstInstall 

Now go ahead and bork up your system 🙂
You may want to come back to the borked system again later, so you create a new snapshot and make it bootable.

$zfs create snapshot mydistro@borked
$beadm create -e mydistro@borked Borked 

now you want to boot into the borked Boot Environment next time.

$beadm activate Borked 

reboot, and in the OI grub you will find FirstInstall and Borked entries, select the one you want and continue working. FirstInstall lands you up
in the system before you borked it up. Enjoy hacking 🙂

more info about boot environments and beadm
That’s all for now! Give OI a try , you may switch over 😉
Until next time !

Script Console in GSoC branch of Digikam has Full Qt API available now !

Following my last post, the Script Console in Digikam’s GSoC branch has the FULL Qt API available by default.

Now you can access the full range of Qt Widgets from Modules like
QtCore, QtGUI, et al.
Use all the modules available in the Qt API as follows:
Open the script console in Digikam from tools->Script console
and type out :
var a = new QWebView();
var url = new QUrl(“your Url here”);
and then click on the Evaluate button.
The screen shot shows the result 🙂
Stay Tuned, More to Come !
Until….. Next time !

Yay !! i am on the planet !

It feels great to be on planet KDE.
This opportunity came as a pleasant surprise , Season of KDE.
Putting aside my project proposal for GSoC "Integration of Face Recognition in Digikam" as
one of my fellow (now a GSoC er on the same project). I have decided to focus my attention
on "QtScript integration in Digikam". More on this in a while.

Save Time and Money !

Many a times i read PDFs linked on websites, not knowing whether it is what i wanted (when i am trying to learn something new). In these cases Google comes to the rescue.

Instead of downloading the PDF ,i just google (verb) the link referring the pdf i.e.

Google would return a “Quick View” link clicking which it returns an HTML version of the pdf, saving a lot of time and bandwidth (money).


Windows Sins ….

“Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.”

Increasingly, computers are expected to be useful tools in our children’s education. But today, most children whose education involves computers are being taught to use one company’s product: Microsoft’s — Microsoft spends large sums of money on lobbyists and marketing to procure the support of educational departments.
continued ….

Urinal protocol vulnerability

When a guy goes into the bathroom, which urinal does he pick?  Most guys are familiar with the International Choice of Urinal Protocol.  It’s discussed at length elsewhere, but the basic premise is that the first guy picks an end urinal, and every subsequent guy chooses the urinal which puts him furthest from anyone else peeing.  At least one buffer urinal is required between any two guys or Awkwardness ensues.

Let’s take a look at the efficiency of this protocol at slotting everyone into acceptable urinals.  For some numbers of urinals, this protocol leads to efficient placement.  If there are five urinals, they fill up like this:

The first two guys take the end and the third guy takes the middle one.  At this point, the urinals are jammed — no further guys can pee without Awkwardness.  But it’s pretty efficient; over 50% of the urinals are used.

On the other hand, if there are seven urinals, they don’t fill up so efficiently:

There should be room for four guys to pee without Awkwardness, but because the third guy followed the protocol and chose the middle urinal, there are no options left for the fourth guy (he presumably pees in a stall or the sink).

For eight urinals, the protocol works better:

So a row of eight urinals has a better packing efficiency than a row of seven, and a row of five is better than either.

This leads us to a question: what is the general formula for the number of guys who will fill in N urinals if they all come in one at a time and follow the urinal protocol? One could write a simple recursive program to solve it, placing one guy at a time, but there’s also a closed-form expression.  If f(n) is the number of guys who can use n urinals, f(n) for n>2 is given by:

The protocol is vulnerable to producing inefficient results for some urinal counts.  Some numbers of urinals encourage efficient packing, and others encourage sparse packing.  If you graph the packing efficiency (f(n)/n), you get this:

This means that some large numbers of urinals will pack efficiently (50%) and some inefficiently (33%).  The ‘best’ number of urinals, corresponding to the peaks of the graph, are of the form:

The worst, on the other hand, are given by:

So, if you want people to pack efficiently into your urinals, there should be 3, 5, 9, 17, or 33 of them, and if you want to take advantage of the protocol to maximize awkwardness, there should be 4, 7, 13, or 25 of them.

These calculations suggest a few other hacks.  Guys: if you enter a bathroom with an awkward number of vacant urinals in a row, rather than taking one of the end ones, you can take one a third of the way down the line.  This will break the awkward row into two optimal rows, turning a worst-case scenario into a best-case one. On the other hand, say you want to create awkwardness.  If the bathroom has an unawkward number of urinals, you can pick one a third of the way in, transforming an optimal row into two awkward rows.

And, of course, if you want to make things really awkward, I suggest printing out this article and trying to explain it to the guy peeing next to you.

Discussion question: This is obviously a male-specific issue.  Can you think of any female-specific experiences that could benefit from some mathematical analysis, experiences which — being a dude — I might be unfamiliar with?  Alignments of periods with sequences of holidays? The patterns to those playground clapping rhymes? Whatever it is that goes on at slumber parties? Post your suggestions in the comments!

Edit: The protocol may not be international, but I’m calling it that anyway for acronym reasons.

ACK: This was originally published in XKCD

Nifty Tricks !

Trick 1:Running a simple HTTP / FILE server:

Supposing you have a folder where you have mirrored a repository and now want to use it instead of the on line (Over the Internet) repo.
So, since most Linux…et all OS es have PYTHON by default ,

cd to the mirror folder and execute
$python -m SimpleHTTPServer 9914
NOTE:here 9914 is an arbitrary port number, can be any unused port.

Trick 2:Resuming Torrent Downloads:
Recently because of some reason my ubuntu 8.10 which i was using for a long time, crashed. I had lots of unfinished torrent downloads there.
Not knowing what to do, i took a copy of the incomplete downloads and headed over to 9.04 and then copied them to Transmission Torrent client’s default download location and downloaded the same torrent files, to my amazement the
downloads resumed !