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
import numpy as np | |
import pandas as pd | |
from datetime import datetime | |
from fastparquet import write | |
def compute_vwap(df): | |
q = df['foreignNotional'] | |
p = df['price'] |
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
import numpy as np | |
from numba import jit | |
from numba import float64 | |
from numba import int64 | |
@jit((float64[:], int64), nopython=True, nogil=True) | |
def _ewma(arr_in, window): | |
r"""Exponentialy weighted moving average specified by a decay ``window`` | |
to provide better adjustments for small windows via: |
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
[supervisord] | |
nodaemon=true | |
loglevel=debug | |
[program:amon] | |
command=gunicorn -c gunicorn.conf.py wsgi | |
directory=/amon | |
autostart=true | |
autorestart=true | |
redirect_stderr=true |
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
#!/bin/bash | |
############################################################################### | |
## ## | |
## Build and package OpenSSL static libraries for OSX/iOS ## | |
## ## | |
## This script is in the public domain. ## | |
## Creator : Laurent Etiemble ## | |
## ## | |
############################################################################### |
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 implementation of Norvig's Spellchecker in Clojure, | |
;; using core.async | |
;; | |
;; There are probably some bugs in this. | |
;; | |
;; Original problem: https://github.com/ericnormand/spelling-jam | |
;; from Lambda Jam, Chicago, 2013: http://lambdajam.com/ | |
;; | |
;; Clojure core.async introduction: | |
;; http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html |
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
;; based on core.logic 0.8-alpha2 or core.logic master branch | |
(ns sudoku | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;As shown in the presentation: http://blip.tv/clojure/clojure-concurrency-819147 |
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
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
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 com.snowtide.clojure.memoize) | |
(defn- mutable-memoize | |
[f #^java.util.Map map] | |
(fn [& args] | |
(if-let [e (find map args)] | |
(val e) | |
(let [ret (apply f args)] | |
(.put map args ret) | |
ret)))) |