Skip to content

Instantly share code, notes, and snippets.

View otfrom's full-sized avatar
I may be slow to respond.

Bruce Durling otfrom

I may be slow to respond.
View GitHub Profile
@Eleonore9
Eleonore9 / rbow_parens.el
Last active August 29, 2015 14:15
My colour settings for rainbow blocks (extract from my .emacs)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(rainbow-blocks-depth-1-face ((t (:foreground "SpringGreen4"))))
'(rainbow-blocks-depth-2-face ((t (:foreground "dark cyan"))))
'(rainbow-blocks-depth-3-face ((t (:foreground "deep sky blue"))))
'(rainbow-blocks-depth-4-face ((t (:foreground "slate blue"))))
'(rainbow-blocks-depth-5-face ((t (:foreground "medium orchid"))))
@jarohen
jarohen / transducers.clj
Last active August 29, 2015 14:10
November 2014 Thoughtworks dojo - Transducers
;; We can write map and filter in terms of reduce
(defn my-map [f coll]
(reduce (fn [acc el]
(conj acc (f el)))
[]
coll))
(defn my-filter [pred coll]
(reduce (fn [acc el]
@cgrand
cgrand / foami.clj
Last active October 25, 2015 18:32
(ns foami.core
"FOreign Asynchronous Mechanism Interop"
(:require [clojure.core.async :as async]))
(def ^:private abandon (doto (async/chan) async/close!))
(def ^:private pending-writes (async/chan))
(defn put!
"Tries to put a val into chan, returns either: true if put succeeded, false if chan is
@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
@hugoduncan
hugoduncan / gist:4060702
Created November 12, 2012 17:31
logback config for per host log files in pallet 0.8
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator>
<key>target</key>
<defaultValue>unspecified</defaultValue>
</discriminator>
<sift>
<appender name="FILE-${target}" class="ch.qos.logback.core.FileAppender">
<file>logs/target-${target}.log</file>
<append>false</append>
<encoder>
@mattb
mattb / gist:3888345
Created October 14, 2012 11:53
Some pointers for Natural Language Processing / Machine Learning

Here are the areas I've been researching, some things I've read and some open source packages...

Nearly all text processing starts by transforming text into vectors: http://en.wikipedia.org/wiki/Vector_space_model

Often it uses transforms such as TFIDF to normalise the data and control for outliers (words that are too frequent or too rare confuse the algorithms): http://en.wikipedia.org/wiki/Tf%E2%80%93idf

Collocations is a technique to detect when two or more words occur more commonly together than separately (e.g. "wishy-washy" in English) - I use this to group words into n-gram tokens because many NLP techniques consider each word as if it's independent of all the others in a document, ignoring order: http://matpalm.com/blog/2011/10/22/collocations_1/

@kelsey-sorrels
kelsey-sorrels / markov.clj
Created September 6, 2012 04:46
Overtone Internal Sequencer with Markov chains
(ns overtone.examples.internal-sequencer
(:use [overtone.live]))
;; A fully server-side sample sequencer.
;; =====================================
;; This example demonstrates some of the benefits of moving all synth
;; triggers inside the server itself. For example, it allows you to
;; modify the synthesis with *immediate* effect (rather than waiting for
;; the next bar/chunk to be scheduled) and you can use a global pulse to
@sritchie
sritchie / WholeFile.java
Created February 2, 2011 17:32
Hadoop input format for swallowing entire files.
package forma;
import forma.WholeFileInputFormat;
import cascading.scheme.Scheme;
import cascading.tap.Tap;
import cascading.tuple.Fields;
import cascading.tuple.Tuple;
import cascading.tuple.TupleEntry;
import java.io.IOException;
import org.apache.hadoop.mapred.JobConf;
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>