The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Two-Hundred and Fifty-Two Ohs is Weak, Come On Now

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Two-Hundred and Fifty-Two Ohs is Weak, Come On Now Posted: Dec 15, 2005 11:20 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Two-Hundred and Fifty-Two Ohs is Weak, Come On Now
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Ano… Scleepts from Japan! Second Life has a fun one that uses Yahoo’s API to hunt down gradual vowel endurance. Who can hold out the “oo” in “Google” for the longest? Here you go:

 require 'open-uri'

 appid = 'g(sustained)gle'
 uri = "http://api.search.yahoo.co.jp/WebSearchService/V1/webSearch?appid=#{appid}&query=" 
 regexp = /totalResultsAvailable="(\d+)"/
 i = 1
 while true
   query = "g#{'o' * i}gle" 
   if match = open(uri + query).read.match(regexp)
     puts "#{$1}\t#{query}" 
     if $1.to_i.zero?
       puts i
       break
     end
   end
   i += 1
 end

Mine stopped at 251. 252 looks like this:

Goooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogle.

But now, by clearly marking the above as mine, I’ve become the new champion! I have lasting vowel power! Once I am indexed. (Seen on ~sasada.)

Read: Two-Hundred and Fifty-Two Ohs is Weak, Come On Now

Topic: Two tips for working with databases in Rails Previous Topic   Next Topic Topic: My first Haskell program

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use