Thursday, December 3, 2009

Ruby on Rails Techniques

Group Operations in a Transaction

ActiveRecord is the handy persistence engine that allows you to do many cool things with data and logic. One of the really handy things that ActiveRecord allows you to do is to group multiple inserts in a single transaction.

Instead of

my_collection.each do |q|

Quote.create({:phrase => q})

end

Use:

Quote.transaction do

my_collection.each do |q|

Quote.create({:phrase => q})

end

end

or for rolling back the whole transaction if any insert fails, use:

Quote.transaction do

my_collection.each do |q|

quote = Quote.new({:phrase => q})

quote.save!

end

end

Tuesday, August 11, 2009

Ultra-Wideband: 200x personal-area networking

A technology for rapidly transmitting data over radio in the 3.1- to 10.6-GHz range, UWB is capable of generating data transfer rates approaching 500Mbit/sec. with relatively low power consumption. By way of contrast, Bluetooth's top speed is only 2.1Mbit/sec. One of the underlying strengths of Ultra-Wideband is that it uses data-rich repeated pulses of energy in the radio spectrum to transmit data. These pulses have a fairly short range of 30 feet. In contrast to most wireless systems, which typically transmit data over a narrow band of frequencies, UWB transmissions occur over a much wider spectrum of radio frequencies.

Wednesday, August 5, 2009

Ruby on Rails for Java Technology Developers

Ruby on Rails is a framework for quickly building web applications. Rails takes advantage of many of the lessons learned over the past decade of web development. Rails uses Model/View/Controller (MVC), view templates, sessions, cookies, and many other abstractions that developers in any web framework will find familiar.But Rails improves on the past as well. With convention over configuration, you use configuration only where necessary, so simple applications do not require hundreds of lines of boilerplate XML.In this session you will learn why Rails is so powerful, and why other frameworks are racing to emulate Rails best features. Best of all, Ruby and Java technology are growing together. With JRuby, you can run your Rails apps on a Java technology-based VM, and continue to access the enormous base of useful Java libraries. You will see how easy it is to get an application started with JRuby on Rails.