88Pro Thinking

cat /senthoor/mind | grep thought > blog

Thursday, September 29, 2005

Thukku Kavadi

One of my friends took part in a Hindu Ritual that takes place every year at Nalur Temple(and other big Hindu temples). It’s called “Thukku Kavadi” and normally about 8 hooks are used (4 at the back of the body and 4 on the legs) but my friend has done it with 2 hooks. I am really amazed what our skin is capable of, to carry the entire body weight in just two hooks. Moreover when the person is hanging they rock the Palmyra beam. Here are some pictures for you, my friend brought back from Jaffna.

posted by 88Pro / Thursday, September 29, 2005

Sunday, September 25, 2005

Undo Undo

Looks like the InteliJ guys have come up with a new way of saying "Redo"

posted by 88Pro / Sunday, September 25, 2005

Saturday, September 24, 2005

iPod nano: Some interesting writeups I enjoyed on the web

The iPod nano is a sham. They haven't made the iPod smaller; they've made Steve Jobs much, much larger.[Source]

This “stress-test” consisted of sitting on it, dropping it from normal heights several times, throwing it from a moving car at various speeds, throwing it extremely high in the air and letting it land on the pavement, and ultimately running over it with the car. The important thing to consider, here, is that each of these tests were done on the same Nano. [Source]

Apple Computer says its iPod music player and iTunes Music Store have 74 percent and 85 percent of their worldwide markets, respectively. But according to Gene Munster, a Piper Jaffray analyst, the end is near.
"Nobody can sustain an 80 percent market share in a consumer electronics business for more than two or three years," Munster told CNN. "It's pretty much impossible." Well, he's right about one thing: Apple's market share won't stay at 80 percent. It's about to go up. [Source]

I thought that Microsoft should issue all of its employees a Nano and then have them report back a week later on why they can't make a product like that. Microsoft has the funds, the smarts, but the creativity is burdened by the weight of their monopoly. That's never been more evident than with the Nano. You go MS with another bloated Word feature, while the world embraces the modernism, the simplicity, form and function of the Nano. Even a post a day from Scoble can't get the sales figures up on Tablet PCs. And tell me again that design doesn't matter. 75% market share based on best-in-class design proves that claim wrong.[Source]

posted by 88Pro / Saturday, September 24, 2005

Wednesday, September 14, 2005

Taz Blogging

One of my student and now a friend, started bloging. Check it out.


posted by 88Pro / Wednesday, September 14, 2005

Sunday, September 11, 2005

Palindrome - Ruby way

1. Open File
2. Sort the file
3. Read each entry
4. Strip each entry
5. Check entry equals to reverse of it (Palindrome)
6. Check length is greater than 5
7. Print it
File.open("dic-0294.txt").each{|line| puts line if (line.strip! == line.reverse and line.length>=5 )}

Couple of observations, what’s the difference between strip! and strip method. Ruby’s convention says that if a method ends with an exclamation mark (!) it has side effect (Dangerous?). strip! changes the string itself where strip returns the results but doesn’t change the string (like Java). In my case I don’t want to issue a strip command every time I use line so first time use it with !.

Also in the code there are no loop constructs and this is achieved by usage of blocks in Ruby. If you want to get a better understanding of Blocks, let me point here, here and here.

How many lines it would take to write this in Java?

posted by 88Pro / Sunday, September 11, 2005

Office Guns

I found this site Office Guns, through a blog. This is a site that describes how to create Guns(toy) with day to day office supplies. Check out this advance gun in action with a laser pointer for accurate aim :-) neat ha.

posted by 88Pro / Sunday, September 11, 2005

My First Ruby Attempt

I was on Skype with Hasith after the Ruby session. One question he shot was what and when do you think Rails will fit in our company. I was not very clear with the answer then but I guess Dave from Pragmatic Programmer Inc has some what addressed the question in his latest blog.

My first Ruby script was for some simple SQL code generation. I was given a file containing phone numbers (10k of them) and I have to produce an output file which contains 15 delete SQL statements for each of the phone number in the file.

01: #Delete Array Contains the Delete Statements in the order of Execution
03: delete_array=Array.new
04: delete_array[0]="delete from senthoorvideo where userid='MSISDN';"
05: delete_array[1]="delete from senthoorphoto where userid='MSISDN';"
06: delete_array[2]="delete from senthoorphoto_bak where userid='MSISDN';"
07: delete_array[3]="delete from senthoorfolder where userid='MSISDN';"
08: delete_array[4]="delete from senthoor_sim_contacts where userid='MSISDN';"
09: delete_array[5]="delete from senthoordatalogger where userid='MSISDN';"
10: delete_array[6]="delete from senthoor_sync_mapping where userid='MSISDN';"
11: delete_array[7]="delete from senthoorphonebook where userid='MSISDN';"
12: delete_array[8]="delete from senthoorphonebookchanges where userid='MSISDN';"
13: delete_array[9]="delete from senthoorphonebookindex where userid='MSISDN';"
14: delete_array[10]="delete from senthoorphonebookmapping where userid='MSISDN';"
15: delete_array[11]="delete from senthoorphonebooksim where userid='MSISDN';"
16: delete_array[12]="delete from senthoorphonebooksynchresult where userid='MSISDN';"
17: delete_array[13]="delete from senthoor_search_history where userid='MSISDN';"
18: delete_array[14]="delete from senthooruser where userid='MSISDN';"
21: delete_input_file = File.open("MWFailedList-BothJulyAndAugust.txt")
22: output_SQL_File = File.open("delete_script.sql","w+")
24: delete_input_file.each do |line|
25: delete_array.each{|delete_sql| output_SQL_File.write(delete_sql.sub("MSISDN",line.strip)+"\n")}
26: end
28: delete_input_file.close
29: output_SQL_File.close

Did you know that
1) reading a file
2) taking each element
3) run throuh an array
4) replace a token with an element
5) write back to a file

can be done in just two lines of code? (check line 24,25)

posted by 88Pro / Sunday, September 11, 2005

Saturday, September 10, 2005

Ruby with Sam

I attended Ruby on Rails tutorial session conducted by Sam Ruby . I have long ago heard about Ruby and in year 2003 I was evaluating between Ruby and Python but at that time I made the choice to go ahead with Python(Check this forum post on the discussions I had with Matt).

I really wanted to go for this tutorial since

1. Wanted to see Sam Ruby in action :-)
2. Wanted to hear his perspective on Ruby and Rails.

He is pretty much impressed with Ruby and its capabilities. As a novice after writing a small data crunching script in Ruby I am very much impressed, especially with blocks. He is a dynamic language expert and he has been using Perl and python for many years, where Perl was his choice when he wanted a quick hack and python was when he wanted a hack which he will have to go and read and may be update in two weeks time :-)(Since Perl being a language after two weeks even yourself can’t understand your own programs sometimes) Now what’s interesting to me is, he think Ruby is both suitable for quick hack since it has the power of Perl and also its suitable for writing larger scripts which needs to be maintained over time.

At the end of the session few of us had a small chat with him and one asked whether he thought ruby is here to stay or it’s just hype. He believes that ruby is here to stay (Tim Bray from Sun motioned that in his blog too). Also Sam Ruby, said his job responsibility at IBM to look and see where things are heading in next 5 years time. One example he mentioned was that he started working PHP, plug in for Apache as back as 1999 and only now IBM has got around recognizing PHP is going mainstream. Now he thinks Ruby or Ruby related frameworks might be the next big thing in 5 years time down the lane.

My advice, if you are looking around to find out what’s the next thing you need to invest your time in learning, probably it doesn’t hurt to dive into Ruby and frameworks like Rails. As an added bonus when you learn a language you tend to looks at problem differently in different angles.

He is rewriting his blog tool in Ruby now (initially it was written in Python) and as he writes and improves his application he is blogging his progress.

Sam Ruby mentioned that some guys who converted their Java web applications to Ruby on Rails realized, not only the Rails application was smaller than Java application, it was even smaller than Java’s XML configuration files (web.xml, struts_config.xml)


Ruby On Rails
Sam Ruby: Rails Confidence Builder – First post on his effort to building a blog tool to evaluate the power of Ruby.
Key note slides at FOSSL
Tim Bray’s first impression on Ruby
10 things every Java Programmer should know about Ruby
Is Rails Ready for Prime Time?
Ruby success stories

Disclaimer: All what I have said here is my interpretation of his tutorial session and the small discussion we had.

posted by 88Pro / Saturday, September 10, 2005

Tuesday, September 06, 2005

Eclipse Screen Shot Published

Screen shot from Eclipse has been published at www.thedailywtf.com. Only one correction, the error didn’t appear while I was working on Eclipse. One of my colleague Uchitha caught it in action.

posted by 88Pro / Tuesday, September 06, 2005

This page is powered by Blogger. Isn't yours?

doteasy.com - free web hosting. Free hosting with no banners.