Skip to content

Instantly share code, notes, and snippets.

Edmund Jackson ejackson

Block or report user

Report or block ejackson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ejackson
ejackson / gist:5203517
Last active Dec 15, 2015
Non-fiction, Non-textbook stories on How the West was Won, and where it got us
View gist:5203517
-----------= Tales of Yore =-----------
* Hackers: Heroes of the Computer Revolution
(http://www.amazon.co.uk/Hackers-Heroes-Computer-Revolution-Anniversary/dp/1449388396)
* The soul of a new machine
(http://www.amazon.co.uk/Soul-New-Machine-Tracy-Kidder/dp/0140062491/ref=sr_1_2?s=books&ie=UTF8&qid=1363772696&sr=1-2)
* The brainmakers
(http://www.amazon.co.uk/Brainmakers-Scientists-Moving-Beyond-Computers/dp/067151055X/ref=sr_1_1?s=books&ie=UTF8&qid=1363772724&sr=1-1)
View gist:3989381
(def v (into [] (repeatedly 1e5 #(rand 100))))
(defn rnd [x]
(Math/round x))
(defn prnd ^long [^double x]
(Math/round x))
(time (r/fold + (r/map rnd v)))
(time (r/fold + (r/map prnd v)))
@ejackson
ejackson / *scratch*.el
Created Jun 8, 2012
Nothing to see here, yet.
View *scratch*.el
;; MM""""""""`M
;; MM mmmmmmmM
;; M` MMMM 88d8b.d8b. .d8888b. .d8888b. .d8888b.
;; MM MMMMMMMM 88''88'`88 88' `88 88' `"" Y8ooooo.
;; MM MMMMMMMM 88 88 88 88. .88 88. ... 88
;; MM .M dP dP dP `88888P8 '88888P' '88888P'
;; MMMMMMMMMMMM
;;
;; M""MMMMMMMM M""M M""MMMMM""M MM""""""""`M
;; M MMMMMMMM M M M MMMMM M MM mmmmmmmM
@ejackson
ejackson / *gists*.txt
Created Jun 8, 2012
Nothing to see here, still.
View *gists*.txt
2723920 2012-05-18 08:13:02 public unify_datums.clj
f262c68... 2012-04-19 12:45:56 private
1762346 2012-02-07 21:57:11 public Zoo Proposal
1726444 2012-02-02 23:31:59 public Attempt at the problem
+ 1674762 2012-01-25 04:39:48 public Unusual behaviour of symbol-macrolet
1431199 2011-12-04 20:33:49 public
1423801 2011-12-02 16:16:59 public A quick moving average
1380546 2011-11-20 17:37:54 public
1319377 2011-10-27 12:05:36 public
1293529 2011-10-17 19:29:20 public
@ejackson
ejackson / gist:2723920
Created May 18, 2012 — forked from swannodette/gist:2719676
unify_datums.clj
View gist:2723920
(ns datomic-play.core
(:use [datomic.api :only [db q] :as d])
(:require [clojure.core.logic :as l]
[clojure.pprint :as pp]))
(def uri "datomic:dev://localhost:4334/hello")
(defprotocol IUnifyWithDatum
(unify-with-datum [u v s]))
View gist:1762346
;;; zoo.clj -- Statistics library for Clojure built on the CERN Colt Library
;; by David Edgar Liebke http://incanter.org
;; March 11, 2009
;; Copyright (c) David Edgar Liebke, 2009. All rights reserved. The use
;; and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file epl-v10.htincanter.at the root of this
;; distribution. By using this software in any fashion, you are
@ejackson
ejackson / core.clj
Created Feb 2, 2012
Attempt at the problem
View core.clj
(ns timetable.core2
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]
[clojure.tools.macro]))
;; --------------------------------------------------------
;; Useful goals
(defne rembero
"Succeeds if out is the list l with the first instance of element x removed"
[x l out]
@ejackson
ejackson / core.clj
Created Jan 25, 2012
Unusual behaviour of symbol-macrolet
View core.clj
(ns timetable.core
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]
[clojure.tools.macro]))
;; Basic form. Works
(run 10 [q]
(== [(lvar) (lvar) (lvar)] q)
(membero :history q)
(membero :math q)
View gist:1431199
$("#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;
@ejackson
ejackson / gist:1423801
Created Dec 2, 2011
A quick moving average
View gist:1423801
(defn sma [n s]
{:pre [(pos? n)]}
(concat
(repeat (dec n) nil)
(map #(/ (reduce + %) n) (partition n 1 s))))
You can’t perform that action at this time.