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
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]] |
;;Three ways to count the number of occurrences in a collection | |
;; ("orange" "bottle" "coke" "bottle") => [("bottle" "coke" "orange") (2 1 1)] | |
(let [c '("orange" "bottle" "coke" "bottle")] | |
(let [counts (reduce #(conj %1 (hash-map %2 (inc (get %1 %2 0)))) | |
{} c)] | |
[(keys counts) | |
(vals counts)]) | |
# print to console for debugging | |
p = (x) -> | |
console.log x | |
x | |
# generate HSL object from normalized arguments | |
hsl = (hue, saturation, lightness) -> | |
h: hue | |
s: saturation | |
l: lightness |
$("#marketList tbody.yui-dt-data") | |
.find('tr') | |
.map(function(_,row){ | |
var $r = $(row); | |
var data = { | |
"name": $r.find(".yui-dt-col-market").text() | |
, "sell": parseFloat($r.find(".yui-dt-col-sell").text()) | |
, "buy": parseFloat($r.find(".yui-dt-col-buy").text()) | |
}; | |
return data; |
class Cl.errors.Error | |
description: -> "An error has occurred in Cassowary Coffee" | |
toString: -> @description() | |
class Cl.errors.ConstraintNotFound extends Cl.errors.Error | |
description: -> "Tried to remove a constraint never added to the tableau" | |
class Cl.errors.NonlinearExpression extends Cl.errors.Error | |
description: -> "The resulting expression would be nonlinear" |
;;ClojureScript compiler 329708 (2011.12.14) | |
;;Based on RangeNum protocol by Tassilo Horn: | |
;; http://groups.google.com/group/clojure/browse_thread/thread/f3192b351b0ab2b4/ec6c106dfdcf0cf9?lnk=gst&q=ranged#msg_ed6de8b7a5cabf41 | |
(ns c2.main | |
(:refer-clojure :exclude [+]) | |
(:use-macros [c2.util :only [typeof]])) | |
(defprotocol RangeNumProtocol |