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
<?php | |
$dict = array ( | |
"ftp" => function($input){ | |
if (preg_match("/^([A-Za-z0-9_\-\.])+$/", $input)){ | |
return TRUE; | |
}else{ | |
return FALSE; | |
} | |
} |
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
<?php | |
$dict = array ( | |
"ftp" => function($input){ | |
if (preg_match("/^([A-Za-z0-9_\-\.])+$/", $input)){ | |
return TRUE; | |
}else{ | |
return FALSE; | |
} | |
}, |
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 skiplist.core) | |
(defn probability [& {:keys [p] :or {p 1/2}}] | |
(> p (rand))) | |
(defn remove-duplicate [s] | |
(distinct s)) | |
(def c (atom 0)) |
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 parallel-colt-matrix.core | |
(:require [core.matrix.protocols :as mp]) | |
(:import [cern.colt.matrix.tobject.impl DenseObjectMatrix1D DenseObjectMatrix2D DenseObjectMatrix3D])) | |
(defn find-right-dimension [[vector]] ;;Need a better way to do this | |
(cond | |
(vector? (first (first vector))) (throw (Exception. "To be Done")) ;[(Class/forName "[[[Ljava.lang.Object;")] | |
(vector? (first vector)) [(Class/forName "[[Ljava.lang.Object;")] | |
:else [clojure.lang.PersistentVector])) |
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 parallel-colt-matrix.impl | |
(:use [core.matrix.protocols]) | |
(:require [core.matrix.implementations :as imp]) | |
(:import [cern.colt.matrix.tdouble.impl DenseDoubleMatrix2D])) | |
(extend-type DenseDoubleMatrix2D | |
PImplementation | |
(implementation-key [m] | |
"Returns a keyword representing this implementation. |
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 parallel-colt-matrix.impl | |
(:use [core.matrix.protocols]) | |
(:require [core.matrix.implementations :as imp]) | |
(:import [cern.colt.matrix.tdouble.impl DenseDoubleMatrix2D]) | |
(:import [cern.colt.matrix.tdouble.algo DenseDoubleAlgebra])) | |
(extend-type DenseDoubleMatrix2D | |
PImplementation | |
(implementation-key [m] |
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
In my life I want to be founder, an entrepreneur. | |
Make bussiness, make money, offer value, hire people, change the world and stuff like that. | |
November 2011 zhitomirskiy (http://en.wikipedia.org/wiki/Ilya_Zhitomirskiy) took his life, Aaron Swartz (http://en.wikipedia.org/wiki/Aaron_Swartz) did the same 20 days ago, and Jody Sherman (http://blog.launch.co/blog/should-we-talk-about-the-fact-that-jody-sherman-didnt-just-d.html) did too yesterday. | |
Now, I am not even close to those mind, but we can say that those guys up there are the prototype of person I want to be... | |
Like it turns out it is not a very healty sport... But it is what I wanna be. | |
However I also want to finish my life in a healty way, and I don't even yet know how, what and where it is gonna be. |
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 map-over-nested | |
([f ar] | |
(if (> (vector-dimensionality ar) 1) | |
(mapv (fn [a] (map-over-nested f a)) ar) | |
(mapv f ar))) | |
([f ar br] | |
(if (> (vector-dimensionality ar) 1) | |
(mapv (fn [a b] (map-over-nested f a b)) ar br) | |
(mapv f ar br))) |