26 Mar '13, 2pm

Redis sets - The intersection of space and time

Redis sets - The intersection of space and time

# flight_finder.rb class FlightFinder def initialize(attrs) @arrival_city = attrs.fetch(:arrival_city).parameterize @departure_city = attrs.fetch(:departure_city).parameterize @window = attrs.fetch(:window) end def flights redis.mget(*flight_keys) end private attr_reader :arrival_city, :departure_city, :window def flight_keys flight_ids.map { |id| "flights:#{id}" } end def flight_ids redis.multi do redis.sunionstore('temp_set', *departure_time_keys) redis.sinter('temp_set', departure_cities_key, arrival_cities_key) end.last end def departure_cities_key "cities:#{departure_city}:departures" end def arrival_cities_key "cities:#{arrival_city}:arrivals" end def departure_time_keys window.range_keys { |epoch_time| "departure_time:#{epoch_time}:flights" } end def redis Redis.current end end

Full article: http://robots.thoughtbot.com/post/46335890055/redis-sets-...

Tweets

Power to alter a space dramatically

forums.condosingapore.com 26 Mar '13, 10am

http://www.businesstimes.com.sg/arch...cally-20130322 Published March 22, 2013 Power to alter a space dramatically Popular...

Would You Buy a Telenoid from Outer Space?

Would You Buy a Telenoid from Outer Space?

spectrum.ieee.org 25 Mar '13, 2pm

This is the year 2250. At the space railway station on planet Telvikos, the small robot Telenoid R1 is waiting for his dep...

The Space Between

The Space Between

yankodesign.com 29 Mar '13, 4pm

Balance is a contemporary flower vase designed with the traditional know-how of Veneto blown glass. The decorative piece i...

This celeb brought out the Air Jordan XI "Space Jam" yet again

This celeb brought out the Air Jordan XI "Space...

sneakernews.com 25 Mar '13, 11pm

is winning. The man has Olivia Wilde on his arm, floor seats for the Knicks, and a crispy looking pair of the Air Jordan X...

Moon landing jump starts general's own space legacy. #AirForce #WomensHistory

Moon landing jump starts general's own space le...

af.mil 26 Mar '13, 12pm

-- When Neil Armstrong made history with man's first footsteps on the moon, Susan Helms needed a little nudging from her m...

Ghica Popa – The Space Sneaker Project #Assorted

Ghica Popa – The Space Sneaker Project #Assorted

kicksonfire.com 25 Mar '13, 12pm

work for awhile, but nothing compares to this new Space Sneaker Project. Like all great artists, Popa pulled inspiration f...

The sound of Earth from Space:

ecorazzi.com 24 Mar '13, 10am

“, which consists of radio signals caused by plasma waves found in our planet’s Van Allen radiation belts. In short, these...