Skip to content

Instantly share code, notes, and snippets.

View prakashmurthy's full-sized avatar

Prakash Murthy prakashmurthy

View GitHub Profile
@prakashmurthy
prakashmurthy / gist:642266
Created October 23, 2010 14:22
Why are these two different? The numbers are the same; just re-arranged.
ruby-1.9.2-rc1 > 707106783028.0 * 1 / 1000000002604.0 * 707106783027.0 / 1000000002603.0
=> 0.49999999999999994
ruby-1.9.2-rc1 > 1 / 1000000002604.0 * 707106783027.0 / 1000000002603.0 * 707106783028.0
=> 0.5
token : <token_string>
secret : <secret_string>
atoken : <access_token_string>
asecret : <access_secret_string>
<p>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 'auto',
height: 300,
#!/usr/bin/env ruby
# Solution for a Quick Ruby Kata by Noel Rappin -
# http://railsrx.com/2010/09/27/a-quick-ruby-kata/
# Modification of the Solution for Problem number 76 on Project Euler
# http://projecteuler.net/index.php?section=problems&id=76
class Array
def meets_criteria?
meets_criteria = false
count_hash = Hash.new(0)