I've discovered a crazy bug that's really confusing me. I'm curious to hear if anyone can explain it.
Here's some code in foo.rb
:
class Superclass
unless ENV['NORMAL_METHOD_DEF']
define_method :regex do
/^(\d)$/
end
cmake_minimum_required(VERSION 2.8.4) | |
cmake_policy(SET CMP0042 NEW) | |
project(emptyExample) | |
set(APP_NAME emptyExample) | |
set(BUNDLE_NAME "emptyExample") | |
# ===================== oF Directory ===================== | |
set(OF_DIRECTORY "!!!!!!!!!!! ENTER YOUT OPENFRAMEWORKS DIRECTORY !!!!!!!!!!!") | |
# ======================================================== |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1"> | |
<title>Drifting Things</title> | |
<style> | |
body { | |
text-align: center; |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1"> | |
<title>Sound Player</title> | |
<style> | |
body { | |
text-align: center; | |
} |
I've discovered a crazy bug that's really confusing me. I'm curious to hear if anyone can explain it.
Here's some code in foo.rb
:
class Superclass
unless ENV['NORMAL_METHOD_DEF']
define_method :regex do
/^(\d)$/
end
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
# you need to run https://gist.github.com/1816161 first | |
comm = subset(contr, form_tp=="SA18") | |
plot(comm$date, comm$contb_receipt_amt, log='y', col=comm$color, axes=F, xlab="", ylab="", main="Contributions by Authorized Committees (log scale)", cex=.65) | |
axis.POSIXct(1, las=2, at=seq(min(comm$date), as.POSIXct("2012/01/02"), by="month"), cex=0.65, cex.axis=0.65, format="%b") | |
options(scipen=10) |
# load csv | |
contr <- read.csv("fec-contr.csv") | |
# convert date column to R date type | |
contr$date <- strptime(as.character(contr$contb_receipt_dt), "%Y-%m-%dT%H:%M:%SZ") | |
plot(date,contb_receipt_amt,axes=F,col=color,cex=.7,ylab="",xlab="",main="Contributions in 2011") | |
# add time axis | |
axis(2, las=2, cex.axis=0.65) | |
axis.POSIXct(1, las=2, at=seq(as.Date("2011/1/1"), as.Date("2012/01/01"), by="month"), cex=0.65, cex.axis=0.65, format="%b") |
# read csv file | |
ds <- read.csv('2012-Presidential-Campaign-Finance-Contributors.tsv', sep='\t') | |
# aggregate by candidate | |
res <- aggregate(ds$contb_receipt_amt, by=list(ds$cand_nm), FUN=sum, na.rm=TRUE) | |
X = data.frame(name=res$Group.1, amount=res$x) | |
# make data columns callable without typing X$ everytime | |
attach(X) |
/*! | |
* quantize.js Copyright 2008 Nick Rabinowitz. | |
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
// fill out a couple protovis dependencies | |
/*! | |
* Block below copied from Protovis: http://mbostock.github.com/protovis/ | |
* Copyright 2010 Stanford Visualization Group | |
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php |
class SessionsController < ApplicationController | |
include ApiInfusionsoft | |
def new | |
end | |
def numeric?(object) | |
true if Float(object) rescue false | |
end | |