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
:javascript | |
function processData(data) { | |
if(data.error) { | |
alert(data.error); | |
return; | |
} | |
alert('Accession: ' + data.results[0].experimentInfo.accession + '\nDescription: ' + | |
data.results[0].experimentInfo.description); | |
} |
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
library(ggplot2) | |
# read data file tasks.csv - it looks like this: | |
# task,date,start,end | |
# task1,2010-03-05,09:00:00,13:00:00 | |
# task2,2010-03-06,10:00:00,15:00:00 | |
# task3,2010-03-06,11:00:00,18:00:00 | |
# task4,2010-03-07,08:00:00,11:00:00 | |
# task5,2010-03-08,14:00:00,17:00:00 | |
# task6,2010-03-09,12:00:00,16:00:00 |
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
#!/usr/bin/ruby | |
def collatz(n) | |
raise "#{n} does not compute" if n < 1 | |
return n if n == 1 | |
if n.odd? | |
n = 3 * n + 1 | |
elsif n.even? | |
n = n/2 | |
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
sau103@gymea-nh:~$ ruby -v | |
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] | |
sau103@gymea-nh:~$ boson -hv | |
boson [GLOBAL OPTIONS] [COMMAND] [ARGS] [COMMAND OPTIONS] | |
GLOBAL OPTIONS | |
+-------------------+-------+---------+-------------------------------------------------------------------+------------------+ | |
| Name | Alias | Type | Desc | Values | | |
+-------------------+-------+---------+-------------------------------------------------------------------+------------------+ |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'daemons' | |
dir = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
daemon_options = { | |
:multiple => false, | |
:dir_mode => :normal, | |
:dir => File.join(dir, 'tmp', 'pids'), | |
:backtrace => true |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
# install GEOmetadb | |
source("http://bioconductor.org/biocLite.R") | |
biocLite("GEOmetadb") | |
library(GEOmetadb) | |
# connect to database | |
getSQLiteFile() | |
con <- dbConnect(SQLite(), "GEOmetadb.sqlite") | |
# count samples per GDS |
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
namespace :db do | |
require "mongo" | |
require "json/pure" | |
require "open-uri" | |
feed = ENV['feed'] | |
db = Mongo::Connection.new.db('friendfeed') | |
col = db.collection('entries') | |
desc "Seed database with feed entries" |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
doc = Hpricot(open("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi?db=gds")) | |
(doc/'//fieldlist/field').each do |f| | |
puts "#{(f/'/name').inner_html},#{(f/'/fullname').inner_html},#{(f/'description').inner_html}" |
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
# mongodb.rake for Rails | |
# assumes that mongodb installed in Rails.root/lib/mongodb | |
namespace :db do | |
namespace :mongo do | |
# start db server | |
task :start do | |
pr = get_pids | |
if pr.length == 0 |