IdeaMonk

thoughts, ideas, code and other things...

Tuesday, January 11, 2011

Shifting time...

I’m discontinuing my old blogs. The wordpress one on blog.ideamonk.com just didn’t appeal much to me. The blogger one on ideamonk.blogspot.com has been an old mess. Most of the posts were half-baked, outdated, and of less meaning.

So from now on, I'd be posting on http://blog.ideamonk.com

KTHXBAI

Wednesday, January 05, 2011

Scraping in Python for fun and profit

Missed out on this one lately.

Labels: , ,

Thursday, December 30, 2010

AudioHover 0.1 - Create audible hover effects in html5 quickly

AudioHover 0.1 walkthrough from Abhishek Mishra on Vimeo.



Just recorded a screencast of this weekend's hack. AudioHover is a jQuery plugin that makes it pretty easy to add audible hover effects to any element in html5.

Grab the source here.

Its sort of a gift to my friend Ankkit, who is a very creative artist from Shrishti Arts School.

Labels: , ,

Saturday, December 25, 2010

Alarming Expenses

Too bad, so far, excluding my $182 Amazon AWS misfortune/loot/getting fucked for running a 1.5gig instance with 20gb ebs for some 48+ hrs doing nothing. Excluding anything before Dec 4, so far 11550 has drained out till 24th of Dec. Thats like Rs. 577 out of my pockets per day.


>>> for stuff in zip(too,goo):
... print "%2d :" % stuff[0],
... for x in xrange(1, -1*int(stuff[1])):
... print "#",
... print
...
24 : # # # # # # # # #
23 : # # # # # # # # # # # # # # # # #
22 : # # # # # # # # # # #
21 : # # # # # # # # # # # # # # # # # # # # #
20 : # # # # # # # # # #
19 : # # # # # # # # # # # # # # # # # # # # #
19 : # # # # # # # # # # # # # #
18 : # # # # # # # # # # # # # #
18 : # # # # # # # # # #
16 : # # # # # # # # # #
15 :
14 :
13 :
12 :
11 :
10 : # # # # # # # # # #
9 : # # # # # # # # # # # # #
8 : # # # # # # # # # # # # # # # #
7 :
6 : # # # # # # # # # #
5 : # # # # # # # # # # #
5 : # # #
5 : # # # # # # # # # # # # #
^ date expense
Luckily from 11 to 15 I didn't have to withdraw much. Sadly the Rs. 1000 I got on 22nd got over very soon by 24th. Around 9k out from my gsoc card around this period, while about 2k from the other account. Paying for my broadband bill I'd be -700 pretty soon. Worst part is this figure is an estimate from withdrawals from my cards, while occasionally I've been taking ~250 / day from home too, mostly for transport. Sucks!!!

Crazy winter this has been, looking back at it I'm like WTF! Why is it turning into a zero-sum game. Damn, I'm hungry too now, and don't really wish to waste this weekend with any half-minded work.

Labels: ,

Thursday, December 23, 2010

Books on HTC Desire HD



Just finished reading a Perry Mason after long long time.

Reading books on HTC Desire HD has not at all been a bad experience.

Thanks to Aldiko, the perfect ebook reader for Android.

Eagerly waiting to catch on some Agatha Christies soon.









Some quick 'n dirty review point & scrapy snaps of Aldiko -


The Wooden finish looks professional!


I <3 the night mode, pretty comfortable to eyes in day or night. Common settings are just a tap away.


Moreover commonly done tasks are pretty quick to reach


The awesome shelf view, the in book dictionary is okay-ish, search is quite good.


And a wide array of settings

So, suit yourself :)

Labels: , , , ,

Sunday, December 12, 2010

Getting back to 2001?!

Feeling great, staying 24x7 at office, spending more time deep-reading alone at night when rest of the folks go away, rather than just roaming across 100s of headlines of HN. Now that the load of college has dropped by about 1/5th, I'm feeling like back in 2001 again :)

Labels:

Sunday, October 24, 2010

Q1 of BORQ - Mad Libs

My solution for Mad Libs, I need to practice some more regular expression. Rubular is a great help for people like me. RegExp is in a more free-form in Ruby compared to python, which is quite good for quick experiments on irb.

I wish I could even get rid of the "if"s and make it sexier. Can't think more on this one right now.

Labels:

Q2. of BORQ - LCD display

This is an old one, pretty famously seen on uva, etc. I found Choice to be better than OptParse, as said in Choice docs - it like writing poems for command-line parsing :D

Initially I was doing a string[j].chr.to_i which seemed like a required bullshit, I wish it could've been string[j].to_i but string[i] gives back a decimal. Now one could talk about the C style '5'-'0' conversion to number, but then, that machine dependent (think ascii, ebcdic, etc). The slightly more ruby-ish way - string[j..j].to_i :)

Here's my number -
abhishekmishra@mbp [~/code/BORQ]> ruby q2_lcd_numbers.rb -s 3 9535009187
--- --- --- --- --- --- --- --- ---
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
| | | | | | | | | | | | | | |
--- --- --- --- --- ---
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
--- --- --- --- --- ---

Surprisingly the PyMos core code is 180 lines while this reaches upto 108. Python => more results per line? The absence of 'end' in python is one big reason for this. Besides I dont find my ruby code so ruby-ish at this stage.

Labels: