Service integration using YubNub

I have never been so excited by 'simple' ideas since the time I saw RSS way back in Aug, 2004.

When I had first seen YubNub, I knew that this idea was here to stay. But then it was quite in its early days and so was not quite usable other than like the Yahoo open shortcuts that I blogged about here.

Today, I happened to revisit that site again. Whew! What a wonder! It has pipes, multiple parameters, string utilities, conditional constructs etc. So a mere combination of commands and you can be working wonders!

To give you an example, suppose you have a server, you can host a set of JSP's (or any other dynamic page) that takes parameterized input and process it and pipe it between sites. This is how you can create personal agents that extract info from one place, automatically blog about it, add sites to bookmarks… the possibilities are unlimited.

An other advantage of this is you just have to remember commands to get your things done. No need of URL's or even short URL's for that matter.

An example is:

garfield -year {rand -min 1979 -max 2005} -month {rand -min 1 -max 12}

will show you the garfield comic for a month randomly. (This is a command I created to check the site out).

Try running it here.
(In order to be convinced by the power of the command, try running this command 3-4 times and see the results).

And if you have a Googlenym, then you can use YubNub to publish your site/page.

Ex: This is mine:

gfl threepointsomething

Try running it here.

An interesting observation is the movement from the GUI back to the command line way of working. The sheer expression power of the command line is unmatched compared to the GUI and that is what is making this click.

And if you are interested there are a host of utilities like Konfabulator widgets, FF integration, FF extension etc that you can use… and enjoy!

And if you are not impressed, it is nothing to do with YubNub; perhaps my explanation was not good and you should go and check it out yourself. 🙂

And these are the YubNub commands that I wrote:

garfield
diggspy

Want to experiment more with this.

Sudoku – Take 1

While the Bulls and Cows experiment is still incomplete, this weekend I found myself trying out another interesting thing. This time it was Sudoku.

I started off writing a simple problem solver, which, given a problem gives the solution. But my intentions were different. I wanted to write a problem generator that is able to generate problems.

This is not easy as it sounds. The problem solver that I wrote was using the simple backtracking algorithm (I just want to get things working – computers today are good enough to solve these problems in negligible time).

The problem generator is more interesting because of the following constraints:

* The problem generated should have a unique solution.
* The set of givens (i.e. the digits that are present in the problem) should be a minimal set – this means that there should not be a smaller set of givens that can also generate the same unique solution.

The algorithm that I used is this:
* Fill up the first row of the matrix using random numbers.
* Generate a complete solution using this row.
* Now start off a loop analyzing which of these numbers are required and which ones are not. A number is considered as required if removing that number will result in the solution seizing from being a unique solution.

I don't know if this algorithm is right, but I expect it to guarantee that the problem generated satisfies the constraints given above.

The experiment went well and this is what I found:
“The number of givens is between 22 and 26 with a matrix of size 9×9”. Of course, as mentioned in the Wikipedia article on Sudoku, the number of givens has little or no bearing on the difficulty level. That is something that I need to analyze.

Here's the source code in C(Requires Linux/Unix because of use of system function).

Firefox extensions – my picks

Recently I have developed a craze for Firefox extensions. Although I knew about the extensibility of Firefox, I was not aware of the different extensions that helped me use the browser JUST the way I wanted to.

I use Firefox 1.5 and although some extensions don't have extensions compatible with this version, some hacks can be done to make 1.0 extension work in 1.5.

Here is the list of extensions that I recommend (alphabetical order):

* Fasterfox 1.0.1: http://fasterfox.mozdev.org/
This extension speeds up the loading of pages.

* FoxyTunes 1.1.5.4: http://www.foxytunes.org/firefox/
Use this extension to control virtually any player from within Firefox.

* Gmail Delete Button 3.3: http://www.arantius.com/article/arantius/gmail+delete+button/
This extension adds a (much expected) Delete button in the Gmail interface.

* IE Tab 1.0.7: http://ietab.mozdev.org/
Open pages that REQUIRE IE from within Firefox at the click of a button.

* Image Zoom 0.2.2: http://imagezoom.yellowgorilla.net/
Helps you zoom in/out images (this feature is otherwise not available in Firefox).

* Live HTTP Headers 0.11: http://livehttpheaders.mozdev.org/
Very useful for HTTP users to find out the exact HTTP headers of all incoming/outgoing requests.

* MR Tech Local Install 4.0: http://www.mrtech.com/extensions/
This has a lot of features, one of them worth mentioning is the Firefox restart option, that can be used to restart Firefox when you install themes/plugins.

* RSS Panel 1.18: http://www.xs4all.nl/~jlpoutre/BoT/Javascript/RSSpanel/
If there is an RSS embedded in a page, this extension displays a panel containing the titles of the RSS feeds and also allows you to open the RSS link.

* ScrapBook 0.18.4: http://amb.vis.ne.jp/mozilla/scrapbook/
Another beauty. This extension makes your Firefox like a grabber.

Other than its use as a grabber, there is another interesting way of using it:
Consider that you want to grab all IEEE papers related to topic XYZ. Usually these papers (the freely available ones) are published in the PDF format. So Google for:

filetype:pdf IEEE XYZ

and then use Scrapbook to grab all PDF's. Voila, all PDF's are now downloaded in a jiffy.

* Scrollbar Anywhere 0.8: http://perso.wanadoo.fr/marc.boullet/ext/extensions-en.html
If you are using a 2 button mouse, then use this extension to scroll the window, by right-clicking in the browsing window and then dragging the mouse.

* SessionSaver .2 0.2.1.030.4: http://adblock.ethereal.net/alchemy.cgi/SessionSaver
My favorite. 🙂 This extension, combined with the MR Tech Restart magically transforms your browsing experience. You can use this extension to restore your session the way you left it. You can also re-open an accidentally closed tab.

* Tab Mix Plus 0.2.5.2: http://tmp.garyr.net
Adds several options to the tabs. PS: Instead of installing different extensions for single tab related features, use this ONE extension for all your TAB needs.

* Viamatic foXpose 0.2: http://viamatic.com/firefox
This extension helps you to see all the open tabs in neat little tiles. You then click on a tile and move to that tab.

* Web Developer 1.0: http://chrispederick.com/work/webdeveloper/
A breeze for web developers. This allows you to work with your Firefox browser to perform various checks – like image properties, form properties and you also get to use it like a dynamic CSS editor (my favorite option).

Some others that are good – this list has those extensions that are really good, but I use them less frequently:

* Answers 1.24: http://www.answers.com
* DownThemAll! 0.9.8.4: http://downthemall.mozdev.org
* FlashGot 0.5.9.99: http://flashgot.net
* Gmail Manager 0.4.1: http://www.longfocus.com/firefox/gmanager
* Super DragAndGo 0.2.4: http://morphis.eu.org/
* Tab Mix Plus 0.2.5.2: http://tmp.garyr.net

And yeah, before I conclude, let me tell you this:

There is an application called MozBackup (http://mozbackup.jasnapaka.com/) that helps you in saving your configuration so that you can restore it in case of crashes, or transfer it to a different system.

What's your ego?

This is mine:



Results (as on Jan 10th):

engine ranking ego points
google.com 1st, 2nd, 5th, 6th, 7th, 13th, 22th, 23th, 25th, 33th, 36th, and 37th 13337
yahoo.com 1st, 2nd, 3rd, 4th, 6th, 7th, 8th, and 13th 7386
msn.com 1st, 2nd, 3rd, 4th, and 7th 5948

I figured in the top 50 list!!! 🙂

How far is heaven from earth?

I don't know why I am writing this. But I felt this is interesting. (This is not a ground-breaking observation and may be baseless)

So the question is how far is heaven from earth.

Let us make some analysis:

It is known that a day in heaven is equal to 1 year on earth.
This means that 365 days on heaven is equivalent to 365 years on earth.

Now Pluto is at a distance of about 5,913,520,000 KM and it takes 248.54 years to revolve round the sun.

This means that for a body that takes 365 years to revolve round the sun (a vague assumption), it should be roughly at a distance of 9,000,000,000 KM from the sun. And considering the distance of earth from sun, we can safely neglect it and say that this is the distance of heaven from earth.

And if my calculations are not wrong, it will take you about 8 hours to reach there if you travel at the speed of light.