This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Nelle Varoquaux, Andrew Tulloch | |
# Uses the pool adjacent violators algorithm (PAVA), with the | |
# enhancement of searching for the longest decreasing subsequence to | |
# pool at each step. | |
import numpy as np | |
cimport numpy as np | |
cimport cython |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns avi.compose) | |
(declare ^:private splice-form) | |
(defn- splice-normal-form | |
[value form] | |
(apply list (first form) value (rest form))) | |
(defn- splice-if-form | |
[value form] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sm/defn coupon-lookup | |
"If the code supplied is empty, sends a failed discount on | |
immediately. (This won't affect the rendering, since nothing's | |
shown if the code is blank.) If the code is NOT blank, fires off an | |
Ajax request to the server to look up the discount. | |
TODO: Ideally we'd have a channel that could signal a dissoc, | |
instead of only adding items to the state." | |
[title :- regatta/Title | |
code :- coupon/Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example selfspy.conf. Put this in your ~/.config/ to use it | |
# with the systemd .service file. | |
# Note: You cannot indent lines in here! | |
# Defaults, used by both selfspy and selfstats. | |
[Defaults] | |
# Don't use quotes around the password, they'd be part of it! | |
# Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns schema-client.schema-extensions | |
"Schemas representing abstract classes and subclasses" | |
(:use plumbing.core) | |
(:require | |
[clojure.string :as str] | |
[plumbing.map :as map] | |
[schema.core :as s] | |
[schema.utils :as utils] | |
[schema.macros :as sm])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'company) | |
(global-company-mode t) | |
(global-set-key (kbd "s-;") 'company-dabbrev) | |
(global-set-key (kbd "s-:") 'company-complete) | |
(global-auto-complete-mode 0) ;; disable this!!! they fight eachother and it is annoying. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clj-serializer.core :as serializer]) | |
(require '[clj-json.core :as m-json]) | |
(require '[org.danlarkin.json :as dl-json]) | |
(require '[clojure.contrib.json.read :as cc-json-read]) | |
(require '[clojure.contrib.json.write :as cc-json-write]) | |
(defn nano-time [] | |
(System/nanoTime)) | |
(defn timed [task] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def find_deps(cookbook_dir) | |
nel = Hash.new { |h, k| h[k] = [] } | |
Dir.glob("#{cookbook_dir}/*/").each do |r| | |
deps_for(r, nel) | |
end | |
nel | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns org.dipert.reconfig | |
"Reads a file of Clojure data into *config* | |
when a SIGHUP is recieved. | |
Useful for daemons that support the reloading of | |
configuration data while running." | |
(:use [clojure.contrib.io :only (reader)] | |
[clojure.contrib.logging :only (info warn)]) | |
(:import (sun.misc Signal SignalHandler) | |
(java.io File PushbackReader))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn mapmap | |
"Return a new map, mapping keys to (keyfn key) and mapping values to | |
(valfn val)" | |
([valfn map] | |
(mapmap identity valfn map)) | |
([keyfn valfn map] | |
(persistent! (reduce | |
(fn [c [k v]] (assoc! c (keyfn k) (valfn v))) | |
(transient {}) | |
map)))) |
OlderNewer