Henry Cipolla

I hate blog taglines.

RSS Feed for ProgrammingProgramming

Creating an Array of Hashes in Ruby

I just made a simple mistake which I figure would be good share with anybody new-ish to Ruby. I wrote the following code to create an array of hashes and fill in some values. Can you guess what the output is?

#!/usr/bin/env ruby
testArray = Array.new(5, Hash.new)
0.upto(4) do |i|
testArray[i][:value] = i
end
0.upto(4) do |i|
[…]

Read More

How to create infinite sessions with the Facebook Platform API

Like all things with Facebook Platform API, creating infinite sessions is really easy. However, there seems to be a lot of confusion and misinformation on the web about how this works. Part of this could be the fault of Facebook’s documentation. They provide a pretty good explanation of the authentication process but […]

Read More

Close
E-mail It