This file contains hidden or 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
| toSeconds <- function(x){ | |
| if (!is.character(x)) stop("x must be a character string of the form H:M:S") | |
| if (length(x)<=0)return(x) | |
| unlist( | |
| lapply(x, | |
| function(i){ | |
| i <- as.numeric(strsplit(i,':',fixed=TRUE)[[1]]) | |
| if (length(i) == 3) | |
| i[1]*3600 + i[2]*60 + i[3] |
This file contains hidden or 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 'yaml' | |
| require 'logger' | |
| require 'active_record' | |
| namespace :db do | |
| def create_database config | |
| options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'} | |
| create_db = lambda do |config| | |
| ActiveRecord::Base.establish_connection config.merge('database' => nil) |
This file contains hidden or 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
| .libPaths("~/Rpackages") | |
| library(lattice) | |
| library(XML) | |
| library(RCurl) | |
| library(RLastFM) | |
| library(cimis) | |
| options(error = recover, repos = "http://cran.cnr.Berkeley.edu") |
This file contains hidden or 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
| #!/bin/bash | |
| #debian R upgrade | |
| echo "deb http://streaming.stat.iastate.edu/CRAN/bin/linux/debian lenny-cran/" | sudo tee -a /etc/apt/sources.list | |
| sudo apt-get update | |
| sudo apt-get -t lenny-cran install --yes --force-yes r-base r-base-dev | |
This file contains hidden or 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
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
NewerOlder