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
(let [f (future (do (Thread/sleep 1200) 2))] | |
(or (deref f 1000 nil) (.cancel f true))) |
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
if(someObject instanceOf someClass){ | |
// specific behaviour for someClass | |
} else if (someObject instanceOf someOtherClass) { | |
// specific behaviour for someOtherClass | |
} // ... ad nauseam |
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 some-fn [some-param] | |
some-param) |
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
(map seq [(.getBytes (String. "12") "UTF-8") (.getBytes (String. "12") "ISO-8859-1") (.getBytes (String. "12") "US-ASCII")]) | |
-> ((49 50) (49 50) (49 50)) |
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 my.behavior) | |
;; | |
;; implementing SupportMyBehavior (3 args) is sufficient to also have | |
;; support for the behavior given some config record MyConfig. | |
;; | |
;; Protocols | |
;; |
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
(for [v value-list] | |
(map #(apply % v) fn-list)) |
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
>> dt = DateTime.parse('Tue, 03 Jul 2012 14:13:16 CEST +02:00') | |
=> Tue, 03 Jul 2012 14:13:16 +0200 | |
>> tz = Time.zone.parse('Tue, 03 Jul 2012 14:13:16 CEST +02:00') | |
=> Tue, 03 Jul 2012 16:13:16 CEST +02:00 | |
>> tz2 = Time.zone.parse('Tue, 03 Jul 2012 14:13:16 CEST +02:00') | |
=> Tue, 03 Jul 2012 16:13:16 CEST +02:00 | |
>> dt <=> tz | |
=> -1 | |
>> tz <=> tz2 | |
=> 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
2012-06-06 21:10:09 | |
Full thread dump OpenJDK 64-Bit Server VM (19.0-b09 mixed mode): | |
"Attach Listener" daemon prio=10 tid=0x000000000282b800 nid=0x238d waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"Swank REPL Thread" prio=10 tid=0x00007faa18013000 nid=0x2080 waiting on condition [0x00007faa1ed56000] | |
java.lang.Thread.State: WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <0x0000000784710bf8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) |
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.lang.RuntimeException: who is using this???? | |
at org.jruby.RubyGlobal$NonEffectiveGlobalVariable.get(RubyGlobal.java:421) | |
at org.jruby.Ruby$3.getValue(Ruby.java:2287) | |
at org.jruby.internal.runtime.GlobalVariables.get(GlobalVariables.java:111) | |
at org.jruby.embed.variable.LocalGlobalVariable.retrieve(LocalGlobalVariable.java:94) | |
at org.jruby.embed.variable.VariableInterceptor.retrieve(VariableInterceptor.java:157) | |
at org.jruby.embed.internal.BiVariableMap.retrieve(BiVariableMap.java:373) | |
at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:122) | |
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:90) | |
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:153) |
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
;given the following data: | |
(def users | |
; [id, name] | |
[[1, "amy"] | |
[2, "doug"] | |
[3, "ben"]]) | |
(def messages | |
; [row-id, user-id, medium] |
NewerOlder