Skip to content

Instantly share code, notes, and snippets.

function simulate(element, eventName)
{
var options = extend(defaultOptions, arguments[2] || {});
var oEvent, eventType = null;
for (var name in eventMatchers)
{
if (eventMatchers[name].test(eventName)) { eventType = name; break; }
}
@zcaudate
zcaudate / worksheet.cljw
Created April 17, 2019 10:32
ames housing regression analysis
This file has been truncated, but you can view the full file.
;; gorilla-repl.fileformat = 1
;; **
;;; # Regression applied to the Ames dataset
;;;
;;; This is an attempt to use every trick in the books to unleash the full power of Linear Regression, including a lot of preprocessing and a look at several Regularization algorithms.
;;;
;;; The [original article](https://www.kaggle.com/juliencs/a-study-on-regression-applied-to-the-ames-dataset) was done as part of the [Ames Housing Dataset](https://www.kaggle.com/c/house-prices-advanced-regression-techniques) Kaggle Competition. This kernal has been ported to clojure and makes use of the [tech.ml](https://github.com/techascent/tech.ml) stack of libraries. The [original translation](https://nbviewer.jupyter.org/github/cnuernber/ames-house-prices/blob/acb961538e9b1cbbef8fb1733ecdd4b0012ffd89/ames-housing-prices-clojure.ipynb) was done by [Chris Nuernberger](https://github.com/cnuernber/ames-house-prices). Additionally, introductory dataset exploration has been taken from [another analysis](https://www.kaggle.com/pmarcel
@zcaudate
zcaudate / fx.clj
Last active April 10, 2019 19:31
cljplot with javafx
(ns cljplot.sketches.fx
(:require [cljplot.render :as r]
[cljplot.build :as b]
[cljplot.common :refer :all]
[fastmath.interpolation :as in]
[fastmath.stats :as stats]
[clojure2d.color :as c]
[cljplot.scale :as s]
[fastmath.core :as m]
[fastmath.random :as rnd]
@zcaudate
zcaudate / DYLD_LIBRARY_PATH
Created August 20, 2018 14:17 — forked from Brideau/DYLD_LIBRARY_PATH
Install GDAL with Java bindings on macOS High Sierra
export DYLD_LIBRARY_PATH=/usr/local/opt/gdal2/lib:$DYLD_LIBRARY_PATH
@zcaudate
zcaudate / SketchSystems.spec
Last active June 13, 2018 17:08
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
click -> First State
@zcaudate
zcaudate / create.sh
Last active May 22, 2018 12:26
create mint iso
#! /usr/bin/env bash
# Insert a USB key.
# if needed initialize it with MS/DOS FAT and MBR
# Download the Mint ISO image
# Convert the ISO -> IMG
hdiutil convert -format UDRW -o linuxmint-18.3-cinnamon-64bit linuxmint-18.3-cinnamon-64bit.iso
# Run a diskutil list to know the device for the USB key, e.g.: /dev/disk3

Keybase proof

I hereby claim:

  • I am zcaudate on github.
  • I am zcaudate (https://keybase.io/zcaudate) on keybase.
  • I have a public key ASCGkiFF1W_OVVZqtwQZXTIGgu8XZivaCKUZ3rL3jBrRXAo

To claim this, I am signing this object:

@zcaudate
zcaudate / speed_test.clj
Created February 20, 2017 21:23
record vs map
(defrecord Simple [value])
(deftype Basic [value])
(with-out-str
(time
(dotimes [i 100000000]
(set! (Basic. i) :value (* 2 i)))))
@zcaudate
zcaudate / count.clj
Created August 6, 2015 10:41
generative testing
(defn count-elements [coll1 coll2]
(+ (count coll1) (count coll2) 1))
(defn count-elements-tester [f]
(let [n (rand-int 6)
m (rand-int 6)
output (+ n m)
inputs [(range n) (range m)]
actual (apply f inputs)]
(if (= actual output)
@zcaudate
zcaudate / stats.py
Created February 14, 2015 02:50
usage statistics for clojars
(import [bs4 [BeautifulSoup]]
[operator [itemgetter]]
requests)
(defn project-links [username]
(let [[url (+ "https://clojars.org/users/" username)]
[res (requests.get url)]
[soup (BeautifulSoup res.text)]
[links (-> (soup.find "h1")
(.find-next "h1")