Animator.js: A javascript library by Bernie Sumption

While surfing on net I came across a javascript library(animator.js) based on prototype library written by Bernie Sumption.

I found this library a bit interesting. One that appeals me is the ability to define start state and end state through CSS

See in action here.

Customized Google search engine for ruby on rails(ROR)

Today Ritu Kamthan created a search engine for RubyOnRails (powered by Google Co-op)

Presently it searches over following sites:

weblog.rubyonrails.org
wiki.rubyonrails.com
rituonrails.wordpress.com
webonrails.wordpress.com
fromdelhi.com
vinsol.com
rubyonrails.org
ajaxonrails.wordpress.com
del.icio.us/
www.rubycentral.org
www.rubycentral.com
www.ruby-lang.org
www.rubyonrails.com
nubyonrails.com
rubyforge.org
sitekreator.com/satishtalim/index.html
dec.orat.in/
den1jay.blogs.assembla.com/

If you are a regular rails blogger and wanna add your site to this list, please let me or Ritu know, so that we can include your site.

My new HP Pavillion DV2117 Notebook

lap31.JPGMy new Notebook

Configuration:

Intel Core Duo Processor 1.66 GHz, Intel 945GM Chipset, 2 MB L2 Cache / 533 MHz lap11.jpgFSB, 1 GB PC2-4200 (533 MHz) DDR2, 100 GB Serial ATA, 150 MB/ Sec @5400 RPM, 8X SuperMulti Double Layer (8.5 GB) DVD +RW/ +R Writer, Intel Graphics Media Accelerator (GMA) 950; DVMT 3.0 – Up to 128 MB, 14.1″ WideScreen (WXGA) with BrightView Technology, Windows XP Media Center Edition, 1 year limited global warranty, Integrated Bluetooth HP Module, IEEE 802.15 Standard, Integrated 802.11a/b/g, Intel Pro/Wireless 3945ABG, Altec Lansing Stereo Speakers, 5-In-1 Digital Media Reader (Secure Digital, Multi-media card, Memory stick, Memory stick pro and xD picture card), Integrated 56K Modem, HP Imprint Finish – Wave Pattern, Capacitive Buttons – Backlit with touch technology, 2 Headphone Jacks, Wired Headset, HP QuickPlay Direct, HP Mobile ExpressCard Remote Control, Integrated 1.3 Megapixel webcam, Microphones, Next Gen Express Card/54 Slot, Norton Antivirus and Norton Internet Security 2006 (Includes 60 days live updates)

Ruby On Rails India

As far as I know there are very few people working on RubyOnRails in India. Vinayak solutions Pvt. Ltd. is doing great in this field. Recently Manik Juneja (Director) attended the Rails conf. Landon and last week traveled Colombo to train a team of web programmers on Ruby on Rails.

Tab completion in irb

irb has tab completion support, you need to activate this by requiring ‘irb/completion’. You can load it when you invoke irb from the command line:


% irb -r irb/completion

Or you can load the completion library when irb is running:


% irb(main):005:0> require 'irb/completion'

If you often use tab completion then:

Linux users: Can create an alias in .bashrc by following these steps:

  • % vi ~/.bashrc
  • add alias irbtc="irb -r 'irb/completion'"
  • % source ~/.bashrc

Windows Users: Can create a file named irbtc.bat in your windows\system32 folder as irb -r "irb/completion" the file content.

<
Now you can run irb with tab completion support by:
% irbtc

Example:

% irbtc
irb(main):001:0> st="this is a string"
=> "this is a string"
irb(main):002:0> st.len
tab
irb(main):002:0> st.length
=> 16
irb(main):003:0> st.up
tabtab
st.upcase st.upcase! st.upto
irb(main):003:0> st.up

What do you see a face or an Eskimo?

eskimo.jpg

Lib file state_select.rb

If you are not interested in installing a plugin just for one method(state_select) then You can put state_select.rb file in you rails lib directory. And include state_select.rb file in your controller where ever you want to use state_select method.

The url for state_select.rb is http://github.com/bansalakhil/stateselect/tree/master/lib/state_select.rb
Feedback please….

Plugin: state_select, generate drop down selection box for states

I have wrote my first plugin(state_select). This plugin allows to create drop down list for states, same as country_select method in rails. I know this is not a big deal…

UPDATE: Curently it can generate state list for India, US, Canada, Australia, Spain and Uganda(default is US).

Usage:

state_select(object, method, country=’US’, options = {}, html_options = {})

Return select and option tags for the given object and method, using state_options_for_select to generate the list of option tags.

state_options_for_select(selected = nil, country = ‘US’)

Returns a string of option tags for states in a country. Supply a state name as selected to have it marked as the selected option tag.

NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.

github URL: http://github.com/bansalakhil/stateselect/tree/master

Install plugin by

script/plugin install git://github.com/bansalakhil/stateselect.git

12 Balls Problem

You have 12 balls (of any kind), one ball either lighter or heavier than the other 11. A scale is provided to you but only three weighs are allowed. How can you possibly figure out which is the odd ball?

Deprecated Finders in Rails 1.1.5

These Finders are deprecated

  • find_first [use find(:first)]
  • find_all [use find(:all)]
  • find_on_conditions [use find(:conditions)]