Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
class Integer | |
N_BYTES = [42].pack('i').size | |
N_BITS = N_BYTES * 16 | |
MAX = 2 ** (N_BITS - 2) - 1 | |
MIN = -MAX - 1 | |
end | |
p Integer::MAX #=> 4611686018427387903 | |
p Integer::MAX.class #=> Fixnum | |
p (Integer::MAX + 1).class #=> Bignum |
<?php | |
/* | |
Template Name: Landing | |
*/ | |
// Add custom body class to the head | |
add_filter( 'body_class', 'add_body_class' ); | |
function add_body_class( $classes ) { | |
$classes[] = 'landing-page'; |
gem 'pg' | |
group :development do | |
gem 'ruby-debug' | |
end | |
gem 'rake', '~> 0.8.7' | |
gem 'devise' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
gem 'omniauth' | |
gem 'haml' | |
gem 'dynamic_form' |
DROP TABLE IF EXISTS survey_sessions; | |
-- Imagine a table with survey sessions | |
-- token: some id or token to access a survey | |
-- answers: a key value store for answers | |
CREATE TABLE survey_sessions ( | |
token text, | |
answers hstore); | |
-- We need some data to play with | |
INSERT INTO survey_sessions (token, answers) VALUES ('9IaxxP', 'a=>1, b=>2'); |
belongs_to
association does not automatically save the object. It does not save the associated object either.has_one
association, that object is automatically saved (in order to update its foreign key).has_one
association) is unsaved (that is, new_record?
returns true) then the child objects are not saved. They will automatically when the parent object is saved.Yahoo! provides its GeoPlanet data as three separate TSV files, available for download here.
That's a database with some 17 million records:
The course will have six weeks of lectures and assignments, followed by a final exam.
###Quick links to get started:
http://nithinbekal.com/posts/rails-presenters/
http://eewang.github.io/blog/2013/09/26/presenting-the-rails-presenter-pattern/
This is a collection of links, examples and rants about Presenters/Decorators in Rails.