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
//automatically converts lines from char[] to strings, presents | |
//a range of strings, immutable. | |
auto stringLines(string filename){ | |
auto f = File(filename); | |
return f.byLine().map!(a => a.idup); | |
}; | |
//readSet does a bit much, I'd like to pull out what the foreach is doing, | |
//obviously a reduction. for now, its string->AssocativeMap String String | |
auto readSet(string path){ |
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 sometest | |
(:require [iota :as iota] | |
[clojure.core.reducers :as r])) | |
;;==Synthetic data== | |
(def fillrecord {:Unit :text | |
:category :text | |
:DemandGroup :text | |
:SRC :text | |
:FillType :text |
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 '[java.awt GraphicsEnvironment GraphicsDevice GraphicsConfiguration Transparency]) | |
(import '[java.awt.image BufferedImage]) | |
(defn ^BufferedImage make-imgbuffer | |
([w h ^Transparency t] | |
(let [^GraphicsEnvironment ge | |
(GraphicsEnvironment/getLocalGraphicsEnvironment) | |
^GraphicsDevice gd (.getDefaultScreenDevice ge) | |
^GraphicsConfiguration gc (.getDefaultConfiguration gd)] | |
(.createCompatibleImage gc w h t))) |
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 broken | |
"We should be able to collect the args via destructuring, | |
implicitly merge them with defaults, and return the resulting | |
map aliased by m, right? This idiom works in clojure..." | |
[& {:keys [x y min max] :or | |
{x 0 y 0 min 0 max 0} :as m}] | |
m) | |
;;=>(broken) |
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
;;Say I don't want to ever touch the internet. Say I've written all my | |
;;awesome clojure stuff, and I have built up a bunch of libraries in | |
;;my local .m2 repo. Important caveat: say none of these libraries | |
;;got there via 'lein install', if they did....we got problems and | |
;;likely will get wierd errors. Let's say, for now, every lib | |
;;is downloaded from either clojars or maven central. | |
;;If we were to copy our .m2 folder to another place....say | |
;;a network file folder, or just a local file folder like | |
;;c:/Users/tom/repos/, we can force lein to look there |
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 spork.data.lazymap) | |
(defn mapEquals [^clojure.lang.IPersistentMap m1 obj] | |
(clojure.lang.APersistentMap/mapEquals m1 obj)) | |
(defmacro with-lazy-map [thunk lm symb & body] | |
(let [the-map (with-meta symb {:tag 'clojure.lang.IPersistentMap})] | |
`(do (when (not (realized? ~thunk)) | |
(set! ~lm (force ~thunk))) | |
(let [~the-map ~lm] |
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
;;Compatibility layer to extend spork.util.table usage | |
;;into incanter datasets (as of 1.9.1). | |
;;Since datasets are now based on an API in clojure.core.matrix, | |
;;we can extend the API to use our table functions. This should | |
;;eliminate the trouble we've have processing incanter | |
;;datasets effeciently, since we can parse spork tables | |
;;using schemas. | |
(ns proc.dataset | |
(:require [spork.util [table :as tbl]] | |
[clojure.core.matrix.protocols :as mp] |
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
Running with REPL... | |
Compiling crashtest.core | |
nREPL server started on port 53636 on host 127.0.0.1 - nrepl://127.0.0.1:53636 | |
REPL-y 0.3.7, nREPL 0.2.12 | |
Clojure 1.8.0 | |
Java HotSpot(TM) 64-Bit Server VM 1.8.0_111-b14 | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") |
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
Exception in thread "JavaFX Application Thread" netscape.javascript.JSException: TypeError: undefined is not a function (evaluating 'd.endsWith("\n")') | |
at com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:137) | |
at com.sun.webkit.dom.JSObject.callImpl(Native Method) | |
at com.sun.webkit.dom.JSObject.call(JSObject.java:106) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) | |
at java.lang.reflect.Method.invoke(Unknown Source) | |
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) | |
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28) |
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
$ java -jar project.jar | |
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes | |
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source) | |
at sun.security.util.SignatureFileVerifier.process(Unknown Source) | |
at java.util.jar.JarVerifier.processEntry(Unknown Source) | |
at java.util.jar.JarVerifier.update(Unknown Source) | |
at java.util.jar.JarFile.initializeVerifier(Unknown Source) | |
at java.util.jar.JarFile.getInputStream(Unknown Source) | |
at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source) | |
at sun.misc.Resource.cachedInputStream(Unknown Source) |
OlderNewer