On Sep 16, 7:20 am, loonster tbur...@acm.org wrote:
Sound or image files will show up in the resulting uberjar if they
reside in a /resources subdirectory of a Leiningen home project
directory. I can't find any documentation for how to refer to and
load such resource files within a
Am Donnerstag, 15. September 2011 schrieb Ken Wesson :
On Thu, Sep 15, 2011 at 8:56 AM, Herwig Hochleitner
hhochleit...@gmail.com javascript:; wrote:
Consider
(defn find-in-tree
([tree pred?]
(concat
(filter pred? tree)
(mapcat find-in-tree (filter sequential? tree)
Hi
I'm new to Clojure so forgive me if this is a dumb question. I want
to incorporate some Clojure into a Java application.
String rule=(str key val label);
String str = (ns test) + (defn foo [key val label] +
rule +
I use the following helper function:
(defn getResource
Load resource. This is guaranteed to work with JNLP'd jars.
[resource-string]
(.getResource (.getContextClassLoader (Thread/currentThread))
resource-string))
Note the comment. I had a lot of trouble loading resources when my
uberjars
Given a list of vectors, I want to return a list of vector whose
elements are grouped by index.
For example: Given [:a :b] [:c :d] = [:a :c] [:b :d]
For this, I wrote the expression
(map (partial conj []) [:a :b] [:c :d])
= [:a :c] [:b :d]
It returned the right answer. Now I want wrap the above
Note that this implementation is the same as (clojure.java.io/resource) [1].
Dave
[1]
https://github.com/clojure/clojure/blob/3a3374f714e5a755b7de2a761f37696f07a74e80/src/clj/clojure/java/io.clj#L422
On Fri, Sep 16, 2011 at 8:58 AM, willyh wheine...@gmail.com wrote:
I use the following
Hi,
the use of a apply should work. Also note the (partial conj []) is not
necessary. vector works as well.
user= (defn columns [ xs] (apply map vector xs))
#'user/columns
user= (columns [:a :b] [:c :d])
([:a :c] [:b :d])
Sincerely
Meikel
--
You received this message because you are
Not the right answer. I tried to use the apply function with no
success.
How can I wrap the expression inside a function.
Why not use partition and interleave?
user (partition 2 (interleave [:a :b] [:c :d]))
((:a :c) (:b :d))
U
--
You received this message because you are subscribed to the
The problem could be that #{} in clojure is a set literal, try using
clojure.lang.PersistentHashSet/create
Hi
I'm new to Clojure so forgive me if this is a dumb question. I want
to incorporate some Clojure into a Java application.
String rule=(str key val label);
Hi,
Am Donnerstag, 15. September 2011 23:39:10 UTC+2 schrieb Eamonn:
The code works BUT if I try to pass in a map for example like so
Object result = foo.invoke( hello,world,#{:a 1 :b 2});
This does not pass a map to the function, but the string #{:a 1 :b 2}. And
from your example I
I would like to see a listing of a swing type CRD database program to
see how the items go together.
Thanks,
still trying to relate to Clojre type programming
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
http://search.maven.org/#artifactdetails%7Corg.clojure%7Cjava.classpath%7C0.2.0%7Cjar
Fixes http://dev.clojure.org/jira/browse/CLASSPATH-2
-Stuart Sierra
clojure.com
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
I've sectioned off most of this evening to try out these tricks and treats.
So far, it's all working well with
'evil'http://gitorious.org/evil/pages/Home,
and swank debugging http://www.youtube.com/watch?v=galfpq969Hg.
Tim
On Thu, Sep 15, 2011 at 11:32 AM, gaz jones
I can't look at http://dev.clojure.org/jira/browse/CLASSPATH-2
Is it set to non-public?
Am Freitag, 16. September 2011 schrieb Stuart Sierra :
http://search.maven.org/#artifactdetails%7Corg.clojure%7Cjava.classpath%7C0.2.0%7Cjar
Fixes http://dev.clojure.org/jira/browse/CLASSPATH-2
-Stuart
When I convert the following code to use transients it returns
different result. Am I doing anything wrong or is it a bug in
transients?
(defn tt []
(loop [i 0 tset #{}]
(if (= i (int 5e5))
(count tset)
(recur (inc i)
(let [nn (rem (* i (int 1e3)) 131071)
hi,
i dream of having a remote repl onto e.g. android so that i can try to
reduce the write-push-run-test-debug-repeat cycle time. pretty please,
does anybody have insights / experience / git hub forks / ideas about
this? getting to a point where i can do code updates more easily, in
fragments,
On Fri, Sep 16, 2011 at 1:24 PM, Raoul Duke rao...@gmail.com wrote:
hi,
i dream of having a remote repl onto e.g. android so that i can try to
reduce the write-push-run-test-debug-repeat cycle time. pretty please,
does anybody have insights / experience / git hub forks / ideas about
this?
hi,
On Fri, Sep 16, 2011 at 10:36 AM, David Nolen dnolen.li...@gmail.com wrote:
Have you considered using ClojureScript instead?
i had not.
my context probably won't allow it, frankly. things need to be as
close to native as possible to stand a snowball's chance in hell of
being allowed :-)
On Fri, Sep 16, 2011 at 1:38 PM, Raoul Duke rao...@gmail.com wrote:
hi,
On Fri, Sep 16, 2011 at 10:36 AM, David Nolen dnolen.li...@gmail.com
wrote:
Have you considered using ClojureScript instead?
i had not.
my context probably won't allow it, frankly. things need to be as
close to
Certainly looks like a valid use of transients. Might be related to
http://dev.clojure.org/jira/browse/CLJ-829 but I dunno.
On Sep 16, 9:55 am, Sergey Didenko sergey.dide...@gmail.com wrote:
When I convert the following code to use transients it returns
different result. Am I doing anything
Here's what I speculate the problem is:
Last time I checked, contains? doesn't work on transient sets.
Try rewriting (contains? tset %) as (tset %).
Let me know if that change fixes your program. This is a bug I reported
something like 1-2 years ago. If this turns out to be the source of your
I have the android build cycle down to a single command
that creates an installable apk file. If I do this on a
machine with a web server I can put the apk file into a
directory with a web page link. So all that would be needed
is a form that has a build button on it and downloads
the updated
On Fri, Sep 16, 2011 at 2:07 PM, Mark Engelberg mark.engelb...@gmail.comwrote:
Here's what I speculate the problem is:
Last time I checked, contains? doesn't work on transient sets.
Try rewriting (contains? tset %) as (tset %).
Let me know if that change fixes your program. This is a bug I
Then it is contrary to the docs:
http://clojure.org/transients
Transients support the read-only interface of the source, i.e. you
can call nth, get, count and fn-call a transient vector, just like a
persistent vector.
Examining the Java sources it looks like the transient collections do not
Yes, now it works. Thanks.
Try rewriting (contains? tset %) as (tset %).
Let me know if that change fixes your program.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts
On Fri, Sep 16, 2011 at 2:20 PM, David Nolen dnolen.li...@gmail.com wrote:
On Fri, Sep 16, 2011 at 2:07 PM, Mark Engelberg
mark.engelb...@gmail.comwrote:
Here's what I speculate the problem is:
Last time I checked, contains? doesn't work on transient sets.
Try rewriting (contains? tset %)
On Fri, Sep 16, 2011 at 11:20 AM, David Nolen dnolen.li...@gmail.comwrote:
Examining the Java sources it looks like the transient collections do not
support contains? by design.
David
Unfortunately, another design decision in Clojure is that contains? returns
spurious results, rather than
On Fri, Sep 16, 2011 at 2:37 PM, Aaron Cohen aa...@assonance.org wrote:
Am I misunderstanding
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ATransientSet.java#L32
?
Transient collections don't implement Associative (which extends
IPersistentCollection and ILookup)
On Fri, Sep 16, 2011 at 2:44 PM, Mark Engelberg mark.engelb...@gmail.comwrote:
On Fri, Sep 16, 2011 at 11:20 AM, David Nolen dnolen.li...@gmail.comwrote:
Examining the Java sources it looks like the transient collections do not
support contains? by design.
David
Unfortunately, another
On Thu, Sep 15, 2011 at 6:42 AM, Chris Perkins chrisperkin...@gmail.comwrote:
On Wednesday, September 14, 2011 11:19:13 AM UTC-4, Brian Hurt wrote:
Say I have two name spaces, A and B, with A depending on B. I want to
test namespace A, replacing module B with a mock B for testing purposes-
Here is the (a?) ticket for this issue:
http://dev.clojure.org/jira/browse/CLJ-700
I too have thought, it was fixed by now.
Am Freitag, 16. September 2011 schrieb David Nolen :
On Fri, Sep 16, 2011 at 2:37 PM, Aaron Cohen
aa...@assonance.orgjavascript:_e({}, 'cvml', 'aa...@assonance.org');
On Fri Sep 16 10:24 2011, Raoul Duke wrote:
hi,
i dream of having a remote repl onto e.g. android so that i can try to
reduce the write-push-run-test-debug-repeat cycle time. pretty please,
does anybody have insights / experience / git hub forks / ideas about
this? getting to a point where
On Fri, Sep 16, 2011 at 12:34 PM, Daniel Solano Gomez
cloj...@sattvik.com wrote:
source available, yet). Due to how dynamic compilation occurs, it's
slow (a few seconds), but it sure beats having to do an entire
compile/deploy cycle.
keen!
--
You received this message because you are
Sorry, I don't know where to configure this in JIRA. Help?
-Stuart Sierra
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
On Fri, Sep 16, 2011 at 3:26 PM, Herwig Hochleitner
hhochleit...@gmail.comwrote:
Here is the (a?) ticket for this issue:
http://dev.clojure.org/jira/browse/CLJ-700
I too have thought, it was fixed by now.
The other thing to consider is that - is this a contract that is desirable
to support?
Fixed. It needed Default Permission Scheme = Clojure Permission Scheme.
- Chas
On Sep 16, 2011, at 3:42 PM, Stuart Sierra wrote:
Sorry, I don't know where to configure this in JIRA. Help?
-Stuart Sierra
--
You received this message because you are subscribed to the Google
Groups
On Friday, September 16, 2011 3:12:49 PM UTC-4, Brian Hurt wrote:
How *should* I structure this code for testing? I was assuming the natural
way to do this is to make A, B, and C separate name spaces but maybe this is
wrong.
The best way to make these namespaces testable, in my opinion,
On Friday, September 16, 2011 3:12:49 PM UTC-4, Brian Hurt wrote:
On Thu, Sep 15, 2011 at 6:42 AM, Chris Perkins chrispe...@gmail.comwrote:
On Wednesday, September 14, 2011 11:19:13 AM UTC-4, Brian Hurt wrote:
Say I have two name spaces, A and B, with A depending on B. I want to
test
Support of membership testing is pretty much the defining characteristic of
sets, transient or not.
Transient sets already support membership testing in the form of (my-set
item). If they support the IFn interface for membership testing, it's hard
for me to imagine that it would be much more
Am Freitag, 16. September 2011 schrieb David Nolen :
The other thing to consider is that - is this a contract that is desirable
to support? Transients are only about performance - lowering the time it
takes to construct a collection. Perhaps there are faster implementations
which cannot
On Fri, Sep 16, 2011 at 4:33 PM, Mark Engelberg mark.engelb...@gmail.comwrote:
Support of membership testing is pretty much the defining characteristic of
sets, transient or not.
Transient sets already support membership testing in the form of (my-set
item). If they support the IFn
On Fri, Sep 16, 2011 at 4:28 PM, Chris Perkins chrisperkin...@gmail.comwrote:
On Friday, September 16, 2011 3:12:49 PM UTC-4, Brian Hurt wrote:
On Thu, Sep 15, 2011 at 6:42 AM, Chris Perkins chrispe...@gmail.comwrote:
On Wednesday, September 14, 2011 11:19:13 AM UTC-4, Brian Hurt wrote:
Sorry! Disregard my former post. In fact, get doesn't work on transients
either. Fingers too fast :/
Still, looking keys up in a map while building it, is a valid use case for
transients, because you do that with persistent collections too. Same with
sets.
At the very least, get and contains?
Using PriorityQueue should give a good, fast result. Here's my
implementation:
(defn smallest-n [n xs]
(let [q (java.util.PriorityQueue. xs)]
(for [i (range n)] (.poll q
(smallest-n 5 (shuffle (range 100)))
;; (0 1 2 3 4)
Jim
--
You received this message because you are subscribed
Great. I can eliminate another function from my general purpose
utilities file. Thanks. I need to comb the docs more.
On Sep 16, 9:21 am, Dave Ray dave...@gmail.com wrote:
Note that this implementation is the same as (clojure.java.io/resource) [1].
Dave
That's really no different from just sorting the list and taking the first
5. O(n log(n)).
And for really large data sets, this is going to consume a lot of memory.
The method I outlined would be O(n) and doesn't force the sequence to all be
resident in memory at the same time.
On Fri, Sep 16,
On Fri, Sep 16, 2011 at 4:01 PM, Stuart Sierra
the.stuart.sie...@gmail.comwrote:
On Friday, September 16, 2011 3:12:49 PM UTC-4, Brian Hurt wrote:
How *should* I structure this code for testing? I was assuming the
natural way to do this is to make A, B, and C separate name spaces but maybe
Am Freitag, 16. September 2011 schrieb David Nolen :
I suspect that part of the reason there is little movement on this is that
transients are as of 1.3 *still* marked alpha. And from what I understand
they will most likely become an implementation detail. That is direct use
will be
On Fri, Sep 16, 2011 at 5:12 PM, Herwig Hochleitner
hhochleit...@gmail.comwrote:
Am Freitag, 16. September 2011 schrieb David Nolen :
I suspect that part of the reason there is little movement on this is that
transients are as of 1.3 *still* marked alpha. And from what I understand
they will
Hi all,
I'd like to extend some protocol to objects of classes that were
compiled in memory, and thus I don't have the class handy as literal but
have to resolve it.
To simplify the issue, my code is basically like this:
--8---cut here---start-8---
Hello all,
I'll be changing core.logic so that logic variables are introduced w/
fresh and NOT exist. I'm loathe to make this change now but Daniel
Friedman has a forthcoming paper on constraint logic programming with
miniKanren (now clpKanren) and Friedman, Byrd, and Kiselyov have all agreed
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
hi community,
i feel compelled to do something more complex in clojure. not too big,
but bigger than what fits in 100 lines and offers some chances to use
macros.
it should also be fun, maybe something like robocode.
- --
-BEGIN PGP
Am Freitag, 16. September 2011 schrieb David Nolen :
I will note:
It will probably not become an error because of the reasons I mentioned
above and there is no reason to single out transients over all the other
types that also return false.
Thanks, I just was about to start a thread on dev
Brian Marick wrote Midje to support Clojure testing with a lot of mocking.
May be worth a try: https://github.com/marick/Midje
-S
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that
Pepijn de Vos had a blogpost about lazy sorts. One of them seems to be a
particularly good fit for this problem:
http://pepijndevos.nl/lazy-sorting/index.html (the heap-sort example seems
the fastest of those for this use-case...).
Em sexta-feira, 16 de setembro de 2011, Mark Engelberg escreveu:
That heap-sort example is not really lazy. The
java.util.concurrent.PriorityBlockingQueue essentially sorts the whole
thing, and then the heap-sort is just making a lazy seq over that.
Also, note that the speed test at that link is only working with lists of
1000, and the original poster
IMO, get and contains? should work on transients. If the fn-call
variant of get works, the others can for transients be defined in
terms of that. Add containsKey to ITransientAssociative and implement
containsKey on transient sets and maps to do what calling them as
functions does, and the problem
Notice something you do often, and try to automate it. Or find an open-
source project you use, and you wish were better in some way, and
improve it. Learning a language by means of I need to learn
something, what should I do is not as effective, or as fun, as
learning it by doing something you
On Sep 16, 1:24 am, Joost jo...@zeekat.nl wrote:
On Sep 16, 7:20 am, loonster tbur...@acm.org wrote:
Sound or image files will show up in the resulting uberjar if they
reside in a /resources subdirectory of a Leiningen home project
directory. I can't find any documentation for how to
59 matches
Mail list logo