I've tried carica as squeegee suggested and it worked as I expected. I'm
going with that so I can allow both dynamic binding and static config via
file.
Thanks!
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cl
I just noticed I replied with a private message earlier
> If you end up using a separate config file rather than project.clj, you
> might find Carica https://github.com/sonian/carica useful. It allows
> merging config files on the classpath into one effective config hierarchy
> with predictab
I don't think I'll go with primitive arrays. A big part of the reason I'm
using Clojure is for the immutable persistence. I just want to use them in
the most efficient way possible. I know I'm not going to get hyper-blazing
C-level performance.
On Wednesday, 20 April 2016 15:38:11 UTC-7, Stu
Ooops - my apologies (attempted correction below)
Here is a horribly contrived example (sorry, that's all I can come up
withht now rig) using recur across different arities of the same function,
together with trampoline.
(defn is-odd?
([n]
(cond (< n 0) true
(even? n) #(is-odd? (d
The first answer: test & measure. Benchmark your code, use a JVM profiler
to find hotspots, etc. Test every change you make to see if it has a
measurable improvement. Any assumptions about what “should” be
faster/slower are likely to be wrong.
The long answer:
The JVM does not give you much co
You can only tell by benchmarking. And even then it can change when
you move to different hardware. You can debate about big O and
constant factors and numa and all that jazz till you are blue in the
face.
There are 3 kinds of people in the world:
1) those who think we should stick with arrays bec
That was actually the example I used to implement this. As it turns out,
assoc-in, update-in, etc. work on anything that supports assoc.
On Wednesday, 20 April 2016 13:39:40 UTC-7, Andy Fingerhut wrote:
>
> I don't know if assoc-in etc. work on the clojure.data.priority-map data
> structures, b
Do you think that maps vs vectors would make a difference in the transient
case?
On Wednesday, 20 April 2016 13:42:12 UTC-7, Andy Fingerhut wrote:
>
> Transients are a performance optimization that can give quite significant
> performance increases when you know you will be doing many updates to
Transients are a performance optimization that can give quite significant
performance increases when you know you will be doing many updates to a
Clojure vector or map. A long sequence of updates on a transient tends to
allocate much less memory than the corresponding sequence of updates on a
non-
I don't know if assoc-in etc. work on the clojure.data.priority-map data
structures, but your questions at least reminded me of the implementation
of that data structure, which uses two maps internally to maintain the
priority map, and keeps their contents consistent with each other [1]. It
also i
I don't think you're missing anything James. It does not look like this
example uses trampoline with the intended effect.
On Wednesday, April 20, 2016 at 2:45:05 PM UTC-4, James Elliott wrote:
>
> Does trampoline really help in this case? I don’t see where we are ever
> returning a new function
Does trampoline really help in this case? I don’t see where we are ever
returning a new function for trampoline to call, avoiding a new stack
frame. It seems to me no different than simply calling the other arities
directly in this example. What am I missing?
On Wednesday, April 20, 2016 at 12:
I'm writing some code that I would like to perform as quickly as possible.
Currently, I am iterating over large hash maps and performing assocs and
dissocs.
I don't know much about performance optimization, but I am told that memory
locality is a big factor. I would like to know how Persisten
I had a bit of trouble fully understanding the EAV concept or the pldb
code. There's not a good overview of EAV architecture that doesn't focus
on databases. I'm not much of a DB guy. So, I'm not sure if I got the
essence of the EAV pattern with my new implementation, but here it is
anyway:
You can prevent stack consumption by using trampoline for tail-recursive
calls to a different arity, and recur for same arity, something like:
(defn find-comment-in-line
([s] (when (pos? (count s))
(if-let [cs (seq (comment-s? s))]
;; yes, a comment symbol found,
;; j
You can prevent stack consumption by using trampoline for tail-recursive
calls to a different arity, and recur for same arity, something like:
(defn find-comment-in-line
([s] (when (pos? (count s))
(if-let [cs (seq (comment-s? s))]
;; yes, a comment symbol found,
;; j
Myriam,
Would you check with the latest commit on the develop branch please?
We're trying to get a new SNAPSHOT release out that might sort a
number of issues.
If yours isn't sorted then I might look at it as we use PCA a fair bit too.
Do you have a small example of some code that is failing?
c
Hi,
cljs-ajax transforms vector parameter into map during transfer like this:
[40.328 -68.348] -> { 0 40.328, 1 -68.348}.
What does it mean and how avoid this? Thanks.
Sincerely,
Ru
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this
I am getting the following error with Incanter 1.9 running the PCA example
from the documentation:
CompilerException java.lang.ClassCastException: java.lang.Boolean cannot be
cast to java.lang.Number, compiling:(pca.clj:17:10)
That works fine with Clojure 1.6. (and yes, I know that the latest is
It's very simple: Leave configuration file management and stuff out of the
lib. Instead, pass the translations dictionary to your library as an
argument.
On your app level, you could still load the desired dictionary from a
config file but the lib should stay independent of this.
On Wednesday
20 matches
Mail list logo