Thursday, June 5, 2008

Thousand words and more

I thought looking at the results of Google Image search for a few 'abstract' words would be interesting. So I wrote a screen scraping script in Ruby (this language is just great - the force is definitely deep with this one) that reads in search terms from a file and collects the searched images and their links from the first page of the image search results. The images were subsequently resized using ImageMagick. My list was:

Always, Bliss, Blossom, Blue, Bubble, Death, Delirium, Destiny, Dreams, Eternity, Fantastic, Happiness, Hilarious, Hope, If, Liberty, Life, Love, Nothingness, Rainbow, Smile, Sunflower, Sunshine, Time

And below are some of the results. The images are clickable - they lead you to the www links Google obtained them from. Note that Google returns 21 search results(images) on its first page in its default setting. In some cases I could'nt retrieve the images due to various technical snags that I was too lazy to spare any attention for. I am just putting up 5 or less per search word, in no particular order - ones that appeal to me or stand out in some way (and post censoring :) ) - you could ask me if I were a tyrant and I would say 42. So lets just get going:



Always:






Bliss:






Blossom:






Blue:






Bubble:







Death:






Delirium:







Destiny:






Dreams:






Eternity:






Fantastic:






Happiness:






Hilarious:






Hope:






If:






Liberty:






Life:






Love:






Nothingness:






Rainbow:






Smile:






Sunflower:






Sunshine:






Time:






And, finally, on a lighter note, can you believe Google turned up this while searching for 'bubble'?:

Saturday, April 19, 2008

Alphabot

A friend of mine had put a this link up in Google Talk status message:

http://playfreeonlinegames.eu/playonline/typethealphabet.html

and his record of 2.84 seconds. In an exhausted state, after having spent a day running after some compatibility issue in some code, my first shot earned me 6.89 seconds.

Huh?!


Deciding to take matters a wee bit more seriously I decided to ... umm... cheat. I wrote this Java code:

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;

public class alphabot {

public static void main(String[] args) {

try {

Robot robot = new Robot();

robot.delay(5000);

robot.keyPress(KeyEvent.VK_A);
robot.keyPress(KeyEvent.VK_B);
robot.keyPress(KeyEvent.VK_C);
robot.keyPress(KeyEvent.VK_D);
robot.keyPress(KeyEvent.VK_E);
robot.keyPress(KeyEvent.VK_F);
robot.keyPress(KeyEvent.VK_G);
robot.keyPress(KeyEvent.VK_H);
robot.keyPress(KeyEvent.VK_I);
robot.keyPress(KeyEvent.VK_J);
robot.keyPress(KeyEvent.VK_K);
robot.keyPress(KeyEvent.VK_L);
robot.keyPress(KeyEvent.VK_M);
robot.keyPress(KeyEvent.VK_N);
robot.keyPress(KeyEvent.VK_O);
robot.keyPress(KeyEvent.VK_P);
robot.keyPress(KeyEvent.VK_Q);
robot.keyPress(KeyEvent.VK_R);
robot.keyPress(KeyEvent.VK_S);
robot.keyPress(KeyEvent.VK_T);
robot.keyPress(KeyEvent.VK_U);
robot.keyPress(KeyEvent.VK_V);
robot.keyPress(KeyEvent.VK_W);
robot.keyPress(KeyEvent.VK_X);
robot.keyPress(KeyEvent.VK_Y);
robot.keyPress(KeyEvent.VK_Z);




} catch (AWTException e) {
e.printStackTrace();
}
}
}



This is an awt robot which can be given the control of your mouse and keyboard. This particular one waits for 5 seconds to let you click or focus your mouse someplace, and then "types" in the letters of the English alphabet.

I compiled it and ran it (as such things go), and before my 5 seconds were up, went to the Webpage to click on 'a' and wait. And , lo! 0.03 secs. Not bad at all ...


This is where I should have ideally finished my post and not written this statement and the few that follow it had I not remembered a puzzle I recently read:

Place 50 balls in 9 boxes so that each box contains an odd number of balls.

At first glance this seems impossible since the sum of an odd number of odd integers cannot be even. Its, however, achievable if you place a box inside another. Talk about a puzzle that forces you to think outside the box to only lead you back to inside one.

Yawn!

Tuesday, March 11, 2008

Binary Sudoku


After a busy day, while I was way into a hectic night , I came across this. I really was in no mood to be humored, but then I looked away and chuckled. Hilarious!


(The above pic is from http://xkcd.com/74/)