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
(defun sublime-text-2 () | |
(interactive) | |
(color-theme-install | |
'(sublime-text-2 | |
((background-color . "#171717") | |
(background-mode . light) | |
(border-color . "#1a1a1a") | |
(cursor-color . "#fce94f") | |
(foreground-color . "#cfbfad") | |
(mouse-color . "black")) |
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 merge_sort.core | |
(:use [clojure.java.io :only (reader)]) | |
(:gen-class :main true)) | |
(defn merj [left right] | |
(loop [[lhead & ltail :as left] left | |
[rhead & rtail :as right] right | |
result []] | |
(cond (nil? left) (concat result right) | |
(nil? right) (concat result left) |
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/sh | |
# Change `ELISP_DIR` variable as you needed | |
ELISP_DIR="$HOME/.emacs.d/site-lisp" | |
MIRROR="https://lowstz.org/jdee" | |
echo -n "This script require wget and unzip, please ensure that your system has been installed them?[yes/no]:" | |
read choice | |
case $choice in | |
YES|yes|Y|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
(ns sudoku | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn get-square [grid x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in grid [x y]))) | |
(defn init [grid [pos value]] |
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 tst [] | |
(fn [aseq] | |
(let [mapfn (fn [v] | |
(let [v (identity v) | |
_ (println :x) | |
_ (println :y)] | |
v))] | |
(map mapfn aseq)))) | |
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
(def plot(-> (charts/xy-plot (range 180) (incanter/sel alldata :cols 0)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 1)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 2)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 3)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 4)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 5)) | |
(charts/add-lines (range 180) (incanter/sel alldata :cols 6)) | |
(charts/clear-background))) | |
(incanter/view plot) |
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
curl "http://www.oanda.com/currency/historical-rates/download?quote_currency=USD&end_date=2012-9-3&start_date=2012-3-8&period=daily&display=absolute&rate=0&data_range=d180&price=bid&view=graph&base_currency_0=INR&base_currency_1=&base_currency_2=&base_currency_3=&base_currency_4=&download=csv"|tail -n +6 |head -n -4|cut -d, -f2|sed 's/"//g' > USD.csv | |
curl "http://www.oanda.com/currency/historical-rates/download?quote_currency=EUR&end_date=2012-9-3&start_date=2012-3-8&period=daily&display=absolute&rate=0&data_range=d180&price=bid&view=graph&base_currency_0=INR&base_currency_1=&base_currency_2=&base_currency_3=&base_currency_4=&download=csv"|tail -n +6 |head -n -4|cut -d, -f2|sed 's/"//g' > EUR.csv | |
curl "http://www.oanda.com/currency/historical-rates/download?quote_currency=GBP&end_date=2012-9-3&start_date=2012-3-8&period=daily&display=absolute&rate=0&data_range=d180&price=bid&view=graph&base_currency_0=INR&base_currency_1=&base_currency_2=&base_currency_3=&base_currency_4=&download=csv"|tail -n +6 |head -n - |
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
(def alldata (io/read-dataset | |
"/home/tutysra/src/myprojects/data/data2/resources/alldata.csv")) |
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 normalize | |
"Normalizes data" | |
[dataseq] | |
(let [mean (stats/mean dataseq) | |
normalfn (fn [x] (/ (- x mean) mean))] | |
(map normalfn dataseq))) |
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
(def normalized-plot | |
(-> (charts/xy-plot (range 180) (normalize (incanter/sel alldata :cols 0))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 1))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 2))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 3))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 4))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 5))) | |
(charts/add-lines (range 180) (normalize (incanter/sel alldata :cols 6))) | |
(charts/clear-background))) |
OlderNewer