Posts

Showing posts from December, 2006

Want to annotate all the images on web? Want to enrich image search?

Tasks like image recognition are trivial for humans, but continue to challenge even the most sophisticated computer programs. This talk introduces a paradigm for utilizing human processing power to solve problems that computers cannot yet solve. Traditional approaches to solving such problems focus on improving software. I advocate a novel approach: constructively channel human brainpower using computer games. For example, the ESP Game, described in this talk, is an enjoyable online game -- many people play over 40 hours a week -- and when people play, they help label images on the Web with descriptive keywords. These keywords can be used to significantly improve the accuracy of image search. People play the game not because they want to help, but because they enjoy it. Here Luis describes other examples of "games with a purpose": Peekaboom, which helps determine the location of objects in images, and Verbosity, which collects common-sense knowledge. I also explain a general

Andre Lewis on Ruby And Google Maps

Google Tech Talks December 7, 2006 ABSTRACT Andre will be covering topics such as the following: - ImageMagick and geographic data: creating custom Google Map overlays with RMagick - Google Maps custom controls: creating a better (or at least different) zoom control - Demystifying the geocoder: you, too, can create a geocoder from scratch
How to add google maps to googlepages? 1) Create your html containing google maps. (You can use this if you want to start with ). Don't use GooglePages page creator. Instead create html and upload it using the upload file toool available on the right hand side of the Page Creator 2) Now add following iframe tag in your homepage (or whatever page on googlepages.com you want to put your map on) <iframe src="http://jjhaveri.googlepages.com/maps.html" width="540" scrolling="no" height="330"></iframe>
Star rating System in Ruby on Rails (AJAX based) After looking at couple of websites, I realized that AJAX based rating system are a must for any socieal networking website :). So here is how I implemented it (I used mostly instructions from Dave Naffi's website to implement this. Steps 1)Download Acts as rateable plugin from Juxie.com Command> cd Command> ruby script\install http://juixe.com/svn/acts_as_rateable 2) Creating ratings table where you will be storing your ratings: mysql> desc ratings; +---------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | rating | int(11) | YES | | 0 | | | created_at | datetime | NO | | | | | rateable_type | varchar(15) | NO | |
Are you intelligent ;)? Intelligent Test My answers
How to ask for confirmation when submitting a delete request in Rails with submit_tag? After some minor research, I found that this works for me! I tried ":confirm" attribute in the tag, but it didn't work <%= submit_tag( "Destroy",:onclick => "return confirm('Are you sure?')" ) %>
Things I like about Ruby ? - Easy to use - Perl like feeling (I have been developing systems in perl for 6 years now) - Domain Specific Language - Code Generation - Extensibility - Everything just works :) - Abstraction Things I don't like about Ruby? - Abstraction (a necessary evil?) - Slow
Finally I managed to combine all my blog into one!!! The only reason I didn't do that before was unavailibility of "tags".
choose one millon random lines from a file containing one billion lines This is an interesting problem and I can imagine lots of data intensive companies must be facing these types of challeges where they need to analyse the weblogs. So let me write down the problem statement and look at various available solutions "Given an apache webserver logfile containing appx 1 billion entries, write an algorithm to select 1 million entries randomly from this file" Solution: Here are a few assumptions 1) Because the problem states that the file has appx 1 billion lines, I will assume that we don't know the exact number of lines in the files 2) I will assume that I don't have enough memory in my computer to hold all 1 billion lines. But I do have memory to hold 1 million lines and also I do have a data-structure that can count untill 1 million (longint ?) Here is an algorithm I propose $N=1000000 for (1..$N) { push @lines, scalar <>; }
Apache VirtualHost , Mongrel Cluster for rimu's hosting services Here is the file that worked for me (for Apache 2.0) NameVirtualHost *:80 ServerName myapp.com ServerAlias www.myapp.com DocumentRoot /var/www/yycctw/public Options FollowSymLinks AllowOverride None Order allow,deny Allow from all ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000 ProxyPreserveHost on ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /excerpt ! ProxyPass /javascripts ! ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined I found the one for apache 2.2 at lots of places but nothing for Apache 2.0 so I decided to write one on my own. Note that the last few lines with ! at the end are for allowing apache instead of mongrel to server images/stylesheets/excerpt/javascript because of it efficiency. Also here are my mongr