Skip to content

Instantly share code, notes, and snippets.

#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
#!/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
###########
### MVC ###
###########
https://github.com/documentcloud/backbone
https://github.com/paulca/eyeballs.js
https://github.com/ahe/choco
https://github.com/maccman/superapp
http://www.sproutcore.com/
http://javascriptmvc.com/

How to write a reproducible example.

You are most likely to get good help with your R problem if you provide a reproducible example. A reproducible example allows someone else to recreate your problem by just copying and pasting R code.

There are four things you need to include to make your example reproducible: required packages, data, code, and a description of your R environment.

  • Packages should be loaded at the top of the script, so it's easy to see which ones the example needs.

  • The easiest way to include data in an email is to use dput() to generate

diff -Naur ../tmp/hadoop-0.20.1+169.68/src/contrib/cloud/src/py/hadoop/cloud/cli.py src/hadoop/src/contrib/cloud/src/py/hadoop/cloud/cli.py
--- ../tmp/hadoop-0.20.1+169.68/src/contrib/cloud/src/py/hadoop/cloud/cli.py 2010-03-18 17:29:55.000000000 -0700
+++ src/hadoop/src/contrib/cloud/src/py/hadoop/cloud/cli.py 2010-05-17 15:00:26.000000000 -0700
@@ -292,7 +292,7 @@
opt.get('public_key'), opt.get('user_data_file'),
opt.get('availability_zone'), opt.get('user_packages'),
opt.get('auto_shutdown'), opt.get('env'),
- opt.get('security_group'))
+ opt.get('security_group'), opt.get('spot_price'))
service.launch_master(template, config_dir, opt.get('client_cidr'))
#!/usr/bin/env python
# encoding: utf-8
"""
parse_delicious_xml.py
First download your bookmarks and restrict to specific tags if desired:
$ curl --user 'username':'password' -o delicious.xml 'https://api.del.icio.us/v1/posts/all'
Extract and count most common domains:
@atiw003
atiw003 / fastqc.sh
Created December 23, 2010 23:51 — forked from brentp/dnaa.sh
FASTQC_VERSION=0.4.3
SRCDIR=/usr/local/src/
cd $SRCDIR && mkdir -p fastqc && cd fastqc
wget http://www.bioinformatics.bbsrc.ac.uk/projects/fastqc/fastqc_v${FASTQC_VERSION}.zip
unzip fastqc_v${FASTQC_VERSION}.zip
cd FastQC && chmod a+x fastqc
0% jruby -rubygems trouble/twitter/twitter4j.rb
Rehearsal -----------------------------------------------
twitter gem 5.856000 0.000000 5.856000 ( 5.856000)
rubytter 5.844000 0.000000 5.844000 ( 5.845000)
twitter4j 1.730000 0.000000 1.730000 ( 1.730000)
------------------------------------- total: 13.430000sec
user system total real
twitter gem 4.850000 0.000000 4.850000 ( 4.850000)
rubytter 5.110000 0.000000 5.110000 ( 5.111000)
@atiw003
atiw003 / gist:731204
Created December 6, 2010 23:34 — forked from nahi/gist:730361
require 'java'
require 'twitter4j-core-2.1.8-SNAPSHOT.jar'
include_class 'twitter4j.TwitterFactory'
include_class 'twitter4j.http.AccessToken'
ck = "XXX"
cs = "XXX"
ak = "XXX"
as = "XXX"
estimatePi <- function(numDraws){
r <- .5 #radius... in case the unit circle is too boring
x <- runif(numDraws, min=-r, max=r)
y <- runif(numDraws, min=-r, max=r)
inCircle <- ifelse( (x^2 + y^2)^.5 < r , 1, 0)
return(sum(inCircle) / length(inCircle) * 4)
}