This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install postgres | |
==> Downloading http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.bz2 | |
Already downloaded: /Users/rainyglade/Library/Caches/Homebrew/postgresql-9.2.2.tar.bz2 | |
/usr/bin/tar xf /Users/rainyglade/Library/Caches/Homebrew/postgresql-9.2.2.tar.bz2 | |
==> Patching | |
/usr/bin/patch -f -p1 -i 000-homebrew.diff | |
patching file src/pl/plpython/Makefile | |
patching file contrib/uuid-ossp/uuid-ossp.c | |
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.2.2 --datadir=/usr/local/Cellar/postgresql/9.2.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.2.2/share/doc/postgresql --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-ossp-uuid --with-python --with-perl ARCHFLAGS='-arch x86_64' | |
./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.2.2 --datadir=/usr/local/Cellar/postgresql/9.2.2/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.2.2/share/doc/postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Seed | |
class CourseRequirement < OpenStruct | |
include Gardener | |
def self.destroyable? | |
true | |
end | |
def attributes | |
{ coming_soon: coming_soon } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ostruct' | |
class Instrument < OpenStruct | |
def self.instruments_array | |
InstrumentsCSVReader.get_from_file | |
end | |
def self.all | |
@all ||= instruments_array.map { |n| new(n) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CitizenshipStatus | |
include Processor | |
def process_field(value) | |
AlienStatus.find_code( value ) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Euler | |
class Prob1 | |
def self.sum(upper_limit, num1, num2) | |
::Prob1.new(upper_limit, num1, num2).sum | |
end | |
def initialize(upper_limit, num1, num2) | |
puts "#{upper_limit} | #{num1} #{num2}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper.rb' | |
require 'lib/sf_to_coll/convert.rb' | |
require 'rake' | |
describe SfToColl::Convert do | |
context "main file for single record should be 2186 chars long" do | |
Rake::Task["import_field_data"].invoke | |
let(:converter){ SfToColl::Convert.new("tmp/ctbrown.csv").process } | |
let(:out_file_name){ converter.out_file_name } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph | |
attr_accessor :points, :edges | |
def initialize(array_of_points) | |
points = Marshal.load(Marshal.dump(array_of_points)) | |
puts "in initialize where graph.points is #{points}" | |
edges=[] | |
construct_edges | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point | |
attr_accessor :x, :y | |
end | |
class QuadtreeNode | |
attr_accessor :point, :name | |
def northwest(other) | |
self.point.x > other.point.x && self.point.y < other.point.y | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'kdtree' | |
true | |
>> point_array = [ [3,5],[14,0],[0,3],[-5,6],[-2,-3],[-4,-7],[2,-5],[0,0] ] | |
[ | |
[0] [ | |
[0] 3, | |
[1] 5 | |
], | |
[1] [ | |
[0] 14, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Function parameters: cart_item_id (ec_items) | |
product_name (ec_products) | |
--returns the title of the course at that point in time. | |
create or replace function public.get_historical_name ( integer, varchar ) | |
returns varchar as ' | |
declare | |
v_cart_item_id alias for $1; | |
v_product_name alias for $2; |
OlderNewer