Skip to content

Instantly share code, notes, and snippets.

View michaelbarton's full-sized avatar

Michael Barton michaelbarton

View GitHub Profile
-module(friendfeed).
-export([start/0]).
-import(mochijson2).
start() ->
inets:start(),
build(1000),
inets:stop().
build(0) -> ok;
fs = SFS['directory']
fs.directories # Returns a list of all the file system directories under here
# e.g. ['directory', 'directory/sub1', 'directory/sub1/sub2']
# Directories are order from root to sub directories
fs.files # Returns array of files in this directory
# e.g ['directory', 'directory/file1', 'directory/sub1/sub2/file2']
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }
Three points about building scientific software
I think scientific software projects should fail more. Even good software projects should die off. I say this because the spectrum of scientific software ranges from poor to excellent, and they all hang around being poor to excellent. If everything less than excellent died off we'd all be using excellent tools for our research. If you think I'm being elitist let me ask when was the last time you used Yahoo! to do a web search? Yet how often is outmoded software still used in science?
There should be more commercial software. Because how else does software die off unless people start having to pay for it? x Making people pay for your scientific software will ensure that you make sure it is excellent, and that it stays excellent. Otherwise people to won't paying for it and it will die off. Why should scientists have to, or want to pay for software when there will be free alternatives? Because your time is valuable and £50 spent on a tool that is excellent and k
print.pdf <- function(figure,name,extra.width=0){
# Create file name
pdf <- paste("/Users/mike/Desktop/post/",name,".pdf",sep="")
# Convert to pdf
trellis.device("pdf", color=TRUE)
pdf(pdf,onefile=FALSE, paper = "special")
print(figure)
dev.off()
data(iris)
distance <- dist(1 - cor(iris[-5]))
clustering <- hclust(distance)
plot(clustering)
s/\[c\]//g
s/-L//g
s/EX_//g
s/(e)//g
s/ /,/g
s/,$//g
#! /usr/local/bin/ruby
#
# Short script for converting yaml file time to csv
#
require 'yaml'
require 'rubygems'
require 'fastercsv'
\documentclass[12pt,PhD]{muthesis}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{url} % typeset URL's reasonably
\usepackage{listings}
\usepackage{phdthesis}
\usepackage{rotating}
\usepackage{subfig}
\usepackage{psfrag}
#! /usr/local/bin/ruby
require 'rubygems'
require 'fastercsv'
layout = Hash.new
FasterCSV.open(ARGV.first, :headers => true).each do |row|
row.headers.each do |header|
layout[header] ||= Hash.new