This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int) [service (java.util.concurrent.Executors/newFixedThreadPool 24)] that is something that should, in theory, be a queue with 24 worker threads right? "ps aux | grep java" is only showing a single thread, "top" is only showing < 100% utilization, iknstead of 2400% utilization
Are you sending it 'jobs' that take significantly longer to execute than the overhead of starting and finishing the jobs? Sending it really tiny jobs might not get you any actual parallelism
Turns out, I was mis-reading the output of TOP. On per process, it' sshowing full usage (i..e 2400%), but on the top overall usage, it's showing 99% (i.e. 2400 / 2400).
is it possible to:
1. pass an anonymous function to a macro and
2. evaluate the function at MACRO EXPANSION time
in particular, I want to do:
(defmacro foo [ .... ] ....)
(foo (fn [x] (println (+ 1))) ...)
yeah, I have this weird situation where
foo behave as follows:
(foo f1 f2 data)
data is interpreted as data
however, I want to parameterize
foo by passing it functions
f2, that modify the behaviour of
foo -- is this possible ?
maybe i lack imagination, but i can't imagine a case where some client code would use a macro, parameterizing it with a function... So I guess you're writing a macro that itself calls a macro. In that case you would want the outer macro calling into functions that build the code rather than callinbg into macros, so you're out of the macro system as soon as you enter the outer level
in 10 (?) years since i started playing with clojure, i wrote maybe 5-10 macros and most were of the def-thing kind...thinly wrapping a function call.
that's to say, are you really sure you want a macro? and if so, can you simplify it so that it's only a wrapper around your data orienbted or function oriented underlying system
There are alot of functions to bind. I want to pass it two functions,
j-name, which decides how the functions are named, for example, I want
to bind cu-foo to java.jcuda.JCublas2/cublasFoo cu-bar to java.jcuda.JCublas2/cublasBar ...
(make-bind c-name j-name foo bar cat dog)
so I have c-name be a function (s -> (symbol (str "cu-" s))) and j-name something to append the java.jcuda.JCublas2/cublas and capitalize the symbol
but now, I want the cname and j-name to be functions rather than hard coded, because I also will be binding jcudafft, jcuda/cudnn / ...
Looks like a fine occasion for macros indeed. I would take it in reverse order, by first gathering/processing a list of symbol names then feeding that into a def-bindings macro
During cider debugging, is there a way for it to keep refreshing local variables every step ( the l key) ?
Why I can't
(> #inst"2017" #inst"2018") in clojure?
It works on cljs. And on clojure, I can compare
> with Dates and cljs's
I don't remember if
#inst in Cljs emits
UtcDateTime, if latter, it shouldn't be comparable by default, but if
cljs-time.extend ns is loaded, that will extend
http://www.jcuda.org/jcuda/jcublas/doc/jcuda/jcublas/JCublas2.html#cublasSgemm(jcuda.jcublas.cublasHandle, int, int, int, int, int, jcuda.Pointer, jcuda.Pointer, int, jcuda.Pointer, int, jcuda.Pointer, jcuda.Pointer, int) is there a way to call 'resolve' or some other function, and get taht function as a result ?
i.e. I want something that will take "jcuda.jcublas.JCublas2/cublasSgemm", and return that function
Hm, could somebody explain me the difference between
into? does the latter have side effects?
you could do that via reflection if you wanted to but it doesn't sound like a particularly good idea
@bronsa: so the only three ways to get a java method are: 1. type it out literally in clojure code 2. have a macro generate it at macro expansion time 3. get it via reflection ?