My Recent Pastes (20 and counting)
Pastes by Ana Nelson (20 and counting)
Below are the 5 most recent pasties by Ana Nelson.
July 28, 2007
5:10AM EDT
by Ana Nelson
View all 75 lines
## date_time.rb # Calculates the previous business day. # When region is null, returns the weekday or previous Friday if a weekend day. # When a region is passed, checks for holidays in this region.
July 27, 2007
2:47PM EDT
by Ana Nelson
View all 10 lines
def dbg(&block)
sym = yield
puts "#{sym.to_s}: #{eval(sym.to_s, block)}"
end
July 22, 2007
2:48PM EDT
by Ana Nelson
View all 17 lines
module Reportable
def complete?
data_errors.empty?
end
July 22, 2007
1:58PM EDT
by Ana Nelson
View all 14 lines
rails $1 cd $1 ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails ruby script/generate rspec
July 20, 2007
6:50PM EDT
by Ana Nelson
View all 37 lines
lt <- function(field, operator, value, data_frame) {
switch(operator,
"<" = is.na(data_frame[field]) | data_frame[field] < as.numeric(value),
">" = is.na(data_frame[field]) | data_frame[field] > as.numeric(value),
TRUE # Return TRUE if there is no comparison operator - this means we just want the field name included but don't want to perform any operation on it.
