Monday, December 29, 2008

Impossible is Nothing

A friend of mine who is currently a runner and an aspiring tri-athlete posted a series of inspiring Youtube videos on his Facebook profile.

A couple of them were from Adidas' "Impossible is Nothing" campaign which reminded me of one of my favorite quotes of all time which also came from that ad campaign.

Impossible is just a big word thrown around by small men who find it easier to live the world they've been given than to explore the power they have to change it.

Impossible is not a fact. It's an opinion.

Impossible is not a declaration. It's a dare.

Impossible is potential.

Impossible is temporary.

Impossible is nothing.

Getting started with Ruby and Watir

As a web developer, I'm always on the look out for ways to improve the quality of the web applications I develop.

One of the tools that I am trying out recently is Watir (pronounced Water). It's too early for me to say whether it's as good as or better than Selenium but I have to admit, learning ruby in the process is a nice bonus. Compared to my experience learning TCL, I found Ruby to be easier to learn.

Here's a quick run down of the steps to get started with installing Ruby and using Watir. Before anything else, I would recommend absolute newbies to try this on Windows first because it will be much easier and quicker.
  1. Download the Ruby one click installer
  2. Double click on the file you download and follow the instructions to install ruby
  3. Open a command prompt and type the following to update ruby and install watir
  4. gem update --system
    gem install watir

  5. We would also want to run tests on firefox, so let's install additional ruby packages that will allow us to do that
  6. gem install firewatir

  7. To allow firefox to work with Watir, you'll need to install the jssh plugin for firefox.
I wrote a script to check if IE and Firefox works with Watir. Copy the script below into a file mytest.rb and save it to your computer.
# set the variables
validator_site = "http://validator.w3.org"
url_to_check = "http://www.google.com"
browser = "ff"

if browser == "ie"
require "watir"
ctrl = Watir::IE.new
else
require "firewatir"
include FireWatir
ctrl = Firefox.new
end

puts "1. Open validator site"
ctrl.goto validator_site

puts "2. Type url to validate"
ctrl.text_field(:name,"uri").set url_to_check

puts "3. Submit the URL"
ctrl.link(:class,"submit").click

puts "4. Results ... "
if ctrl.text.include? "Errors found"
puts " Test FAILED."
else
puts " Test PASSED!"
end

ctrl.close

To execute the script, open a command prompt and type

ruby mysite.rb

To try it with Internet Explorer, change the browser variable from 'ff' to 'ie'.

The script simply loads up the w3c validator site and submit "http://www.google.com" for validation. The command prompt will output messages as the script progresses. In the end, it checks whether the words "Errors found" is on the page and outputs a Success or Fail depending on whether those words are found or not.

Monday, December 22, 2008

I Dare You To Move

Once in a while, something stupid happens to everyone but what if that something stupid is so big, so life changing that it totally breaks you, saps you of all your confidence and renders you incapacitated.

If something like that were ever to happen to you, wouldn't you like someone to "Dare You To Move" ?

It's never easy isn't it ? You know you have to get up and continue but there's this huge weight on your shoulders that always reminds you of what happened. All we know is that we have to move forward "like today never happened" but nobody really knows how. I think it's because everybody is different. People find themselves in the most unexpected places.

So I really liked this song by Switchfoot. My favorite lines ....
Maybe redemption has stories to tell
Maybe forgiveness is right where you fell
Where can you run to escape from yourself?
Where you gonna go?
Where you gonna go?
Salvation is here

Yes, salvation is here !

Lots of videos from Youtube to choose from but not all of them have the line "salvation is here". There's just something oddly comforting about that line in the song so I chose a video with that line in it. Enjoy.

http://www.youtube.com/watch?v=3mN6mfI3hTE


Speaking of "lifting yourself up off the floor", I better start posting more blog entries soon or I'll fall off again :-)

Monday, December 15, 2008

Revenge of the Geeks

"Yes, But it's like the Greeks used to talk about the philosopher kings.
Geeks have no interest in power. The only power we're interested in is low power consumption
and longer battery life and low prices so we can stay up later at night. Geeks have no desire - geeks may inherit the earth, but they have no desire to rule it."

Robert Stephens on 60 Minutes December 30,2007

Sunday, December 07, 2008

And Into the Light ....

I can't remember when I first heard it. Some say that before you can step into the light you must know what darkness is.

It's been a while since I posted anything on this blog and I think it's about time for a make over.

Please bear with me as I tweak the heck out of this new template and get this blog going again.

Thanks,

Ham