apt-get install mysql-server php5-cgi php5-mysql php5-curl php5-cli
cp default-php-fastcgi /etc/default/php-fastcgi cp php-fastcgi /etc/init.d/
update-rc.d php-fastcgi defaults
#I'm using two non-standard packages; one for nearest neighbors (FNN) and one for doing split-combine-apply (think map reduce) type operations. | |
#you'll have to run this: install.packages(c('FNN', 'plyr')) | |
#you can also checkout documentation in R using the question mark; run this: ?knn | |
library(FNN) | |
library(plyr) | |
#Here are some random points on the plane to show you the interface | |
neartop = ldply(1:50, function(i){ | |
c( x = rnorm(1) | |
, y = 1 + rnorm(1, sd=0.5)) |
Things I don't particularly like about Devin Chalmers: | |
1. He doesn't write any tests before implementing John Conway's Game of Life. | |
2. He asks for whiskey with lots of different, non-whiskey things mixed in. | |
3. He put a second top tube on his bicycle and then stopped riding it. | |
4. Looks better in a pair of brass goggles than I do. |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;/login.html (a static resource) does not work in [compojure "0.6.0-RC4"] | |
;;however, the simple GET works fine | |
;; 2011-02-12 08:03:25.840:WARN::/login.html | |
;; java.lang.NullPointerException | |
;; at ring.middleware.session$wrap_session$fn__3069.invoke(session.clj:47) | |
;; at ring.middleware.cookies$wrap_cookies$fn__3009.invoke(cookies.clj:132) | |
;; at clojure.lang.Var.invoke(Var.java:365) | |
;; at ring.adapter.jetty$proxy_handler$fn__2063.invoke(jetty.clj:16) | |
;; |
\documentclass[a4paper,11pt,leqno,article,oneside]{memoir} | |
\usepackage[leqno]{amsmath} | |
\usepackage{amsfonts} | |
\begin{document} | |
\title{Test Document} | |
\chapter{Clustering} |
<!DOCTYPE html> | |
<head> | |
<meta charset='utf-8'> | |
</head> | |
<body> | |
<h1>Original Page content</h1> | |
<p>blah blah blah</p> | |
<div id='my_pubtex'></div> | |
</body> | |
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js'></script> |
package "com.pgtest" | |
class Rubyisms | |
macro def attr_reader(name) | |
quote do | |
def `name` | |
@`name` | |
end | |
end | |
end |
#!/usr/bin/env ruby | |
# | |
# Copyright Keming Labs 2011 | |
# But you can use it under the MIT license. Yay! | |
# See our visualization of these data here: | |
# | |
# http://keminglabs.com/ukuni/ | |
# | |
# This script imports data from UCAS | |
# |
# Run this first: | |
# | |
# install.packages(c('RSQLite.extfuns', 'ggplot2', 'maps')) | |
# | |
library(RSQLite) | |
library(ggplot2) | |
library(RSQLite.extfuns) | |
db = dbConnect( | |
dbDriver("SQLite") |
(defn jsArr | |
"Recursively converts a sequential object into a JavaScript array" | |
[seq] | |
(.array (vec (map #(if (sequential? %) (jsArr %) %) | |
seq)))) | |
(defn jsObj | |
"Convert a clojure map into a JavaScript object" | |
[obj] | |
(.strobj (into {} (map (fn [[k v]] |