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 "Thread-4" java.lang.ExceptionInInitializerError | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:340) | |
at clojure.lang.RT.classForName(RT.java:2154) | |
at clojure.lang.RT.classForName(RT.java:2163) | |
at clojure.lang.RT.loadClassForName(RT.java:2182) | |
at clojure.lang.RT.load(RT.java:436) | |
at clojure.lang.RT.load(RT.java:412) | |
at clojure.core$load$fn__5445.invoke(core.clj:5862) | |
at clojure.core$load.doInvoke(core.clj:5861) |
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
classloader: #object[sun.misc.Launcher$ExtClassLoader 0x654d12c2 sun.misc.Launcher$ExtClassLoader@654d12c2] | |
url: #object[java.net.URL 0x1fb03ff9 file:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar] | |
Exception in thread "Thread-4" java.lang.ExceptionInInitializerError | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:340) | |
at clojure.lang.RT.classForName(RT.java:2154) | |
at clojure.lang.RT.classForName(RT.java:2163) | |
at clojure.lang.RT.loadClassForName(RT.java:2182) | |
at clojure.lang.RT.load(RT.java:436) | |
at clojure.lang.RT.load(RT.java:412) |
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
sample [master●] % tree -a | |
. | |
├── .gitignore | |
├── project.clj | |
└── src | |
└── sample | |
└── core.clj | |
2 directories, 3 files | |
sample [master●] % cat project.clj |
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
------ | |
STATUS | |
------ | |
pluginId org.eclipse.ui | |
pluginVersion 3.107.0.v20150423-1329 | |
code 0 | |
severity 4 | |
message Unhandled event loop exception | |
fingerprint 7dd19923 |
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
;;;;;;;;;;;;;;;;;;;;; | |
;; nrepl request when :pprint "true" | |
{:op "eval", :code "(defn somefn [] (prn \"something\"))", :ns "user", :pprint "true", :right-margin 20} | |
;; nrepl responses: | |
{:id a625ffc0-06f2-4fd5-a037-91b265e917b9, :pprint-out #<Var@758d0fe8: | |
#object[user$somefn 0x1929eceb "user$somefn@1929eceb"]> | |
, :session fe8e50cf-a399-47c4-8548-860cf540ae80} | |
{:id a625ffc0-06f2-4fd5-a037-91b265e917b9, :pprint-sentinel {}, :session fe8e50cf-a399-47c4-8548-860cf540ae80} |
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
=> (use 'clojure.pprint) | |
nil | |
=> (print #'pprint) | |
#'clojure.pprint/pprint | |
nil | |
=> (pprint #'pprint) | |
#<Var@309f74bd: #<pprint$pprint clojure.pprint$pprint@56b9af2a>> | |
nil |
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
;; Which solution would be preferred as an API over SWT Display.syncExec Display.asyncExec ? | |
;; In java you do this: | |
;; Display.syncExec( -> ...) | |
;; Display.asyncExec( -> ...) | |
(require '[ccw.swt :as swt]) | |
;; O | |
(swt/sync-exec |
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
(use 'ccw.api.content-assist) | |
(register-completion-proposal-provider! | |
{:label "Available namespaces" | |
:provider (constantly ["clojure.core" "clojure.set" "clojure.repl" "clojure.java.io"])}) |
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
================ | |
clojure/core.clj - | |
================ | |
version originale (avec map): | |
1:4 paredit.parser=> (dotimes [_ 10] (time (do (-> "/home/lpetit/projects/clojure/src/clj/clojure/core.clj" slurp sexp) nil))) | |
"Elapsed time: 5391.817183 msecs" | |
"Elapsed time: 4978.254708 msecs" | |
"Elapsed time: 4365.472075 msecs" | |
"Elapsed time: 4478.291098 msecs" | |
"Elapsed time: 4496.73974 msecs" |
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
;;; Dining philosophers. Solution using Clojure STM. | |
;;; This is sort of an implementation of the "Use monitor" solution: | |
;;; http://en.wikipedia.org/wiki/Dining_philosophers_problem#Monitor_solution | |
;;; What are our identities? | |
;;; The problem talks about forks, and philosophers. | |
;;; Conceptually, forks have a "taken-by" property which can have one | |
;;; of three values: :left-philosopher, :righ-philosopher, :nobody. | |
;;; Conceptually, philosophers have a "state" property which can be | |
;;; :eating or :thinking. | |
;;; Note that with an approach using STM for getting both forks at once |