Hacker News new | past | comments | ask | show | jobs | submit | Kafka's comments login

I'm not sure but I came to think of the HATEOAS constraint of REST.


Here's a Ruby one-liner

    n=1234567;(1..n).reduce{|t,n|s=i=0;loop{i+=1;s+=rand;break if s>=1};t+i}.to_f/n


I might be the last one on earth that still runs a Rails 1.1.x app. This time the ancient one dodged a bullet.

"ah, actually 1.1.x isn't vulnerable. The issue first arrived in 2.0" - https://twitter.com/tenderlove/status/288777229276704768


we had some rails 1.x apps at work and we were happy.


Tried it on a Mac mini of age but still a Core 2 Duo. It was very slow in Google Chrome. If it's moving smoothly on more modern computer I guess It's time to upgrade.

On another note, I believe that this is why native still is around.


Works smoothly on Chrome 21 on Windows XP. Note that if you change tentacles to max, thickness to about 9, gravity to max, and friction to 0.3, it is a good simulation of long flowing hair - maybe could be used in a RPG with a girl as protagonist?


Could you please explain why it would output that?


Typo, updated. Should have been n * n


In Ruby:

  # Ethiopian Multiplication
  # usage: ruby em.rb 673 7
  m, n = ARGV.map(&:to_i)
  product = 0
  while m >= 1
    puts "%4d : %4d %s" % [m, n, m.even? ? "Ignore" : ""]
    product += n unless m.even?
    m = m / 2
    n = n * 2
  end
  puts "Product: #{product}"
https://gist.github.com/3660240


I played with the same kind of hack back in the nineties and then in JavaScript+HTML table in 2001. http://plea.se/me/galen_man.htm (it was hideously slow to scroll down back then)

http://plea.se/me/mandelnikala.html


1.upto(100){|n|puts [["Fizz"][n%3],["Buzz"][n%5]].inject{|m,e|m=m.nil? ? e:m+=e||""}||n}


NoMethodError: undefined method `first' for "":String in Ruby 1.9.3


"Even in 1969 the AI lab had a direct news feed from the New York Times. And on-line text chatting between users, with video support was possible"


From the comment by David Luckham.


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: