Re: Help with Liberator POST route

2015-02-18 Thread Andy-
Without having tested it: I think you're "curl -d" format is wrong. It's not semicolon separated: http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request HTH On Wednesday, February 18, 2015 at 7:09:19 AM UTC-5, g vim wrote: > > I have a Liberator app which

Re: partition-when

2015-03-05 Thread Andy-
Tried myself and my first transducer for fun: (defn partition-when [f] (fn [rf] (let [a (java.util.ArrayList.) fval (volatile! false)] (fn ([] (rf)) ([result] (let [result (if (.isEmpty a) result

Re: how do you re-load a clojure library?

2015-03-29 Thread Andy-
Off topic for this list but I'm sure helpful to some: On Windows: You can see open file handles with MS's Process Explorer. On Linux: There is `lsof`, or if you like interactive: The popular `htop` utility allows you to press `l` to see all open ports, files and cwd of a process. This quickly

Re: [ANN] Clojure 1.7.0-beta1 released

2015-04-13 Thread Andy-
Why not just change the `?' to `_'? ? So: #?(:cljs (def unrelated-1 nil)) then #_(:cljs (def unrelated-1 nil)) Even saved a character :) On Monday, April 13, 2015 at 3:38:01 PM UTC-4, whodidthis wrote: > > > > On Monday, April 13, 2015 at 4:48:28 PM UTC+3, Alex Miller wrote: >> >> I think what y

Re: Performance of defmulti in both ClojureScript and Clojure

2015-04-27 Thread Andy-
Looks like they're pretty slow compared to a simple case: http://jsperf.com/cljs-multimethods https://github.com/rauhs/cljs-perf On Saturday, April 25, 2015 at 10:33:18 AM UTC-4, Timur wrote: > > Hi everyone, > > There are situations where I want to dispatch functions using based on > their ce

Re: Performance of defmulti in both ClojureScript and Clojure

2015-04-27 Thread Andy-
ance expectations of > multimethods in ClojureScript still stands :) > > David > > On Mon, Apr 27, 2015 at 9:44 AM, Andy- > > wrote: > >> Looks like they're pretty slow compared to a simple case: >> >> http://jsperf.com/cljs-multimethods >>

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
In addition to James comment: IMO clojure.org/metadata should be clearer about this. It's mentioned more clearly on the reader page: http://clojure.org/reader#The%20Reader--Macro%20characters "The metadata reader macro first reads the metadata and attaches it to the next form read (see with-meta

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread Andy-
uses example attaching metadata using the reader to the symbol, but > seems it not works as expected) > > Is a little bit confusing. The metadata documentation says clearly that > are equivalent, but are not equivalent. > > > Thank you very much again. > > Regards

Opinion on take-while for stateful transducers

2015-05-09 Thread Andy-
([r i] i)))] (take-while #(= % (td nil %) Is this a good idea and rock solid implementation? I'm a little worried this breaks down for corner cases (and this would be no fun to debug). Or am abusing transducers here? What would be a good way to implement this? Possibly even f

Re: Opinion on take-while for stateful transducers

2015-05-12 Thread Andy-
3 4] > > ;; monotonically increasing > (into [] (take-while-accumulating max 0 <=) '(1 2 3 4 4 1 5 6)) > [1 2 3 4 4] > > > Steve Miner > steve...@gmail.com > > > > > On May 9, 2015, at 6:28 PM, Andy- > > wrote: > > > (defn tak

Re: Question regarding java array

2015-06-11 Thread Andy-
On Thursday, June 11, 2015 at 5:32:02 AM UTC-4, Ritchie Cai wrote: > > Just wondering though, is there a faster way to load an array than this > way? > https://github.com/malloc82/imaging/blob/45475b99f564b1ac77e668e04b91cb9c01a096d7/src/imaging/dicom.clj#L138 > the data file I'm trying to read f

Re: Is this expected behavior with meta data?

2015-06-25 Thread Andy-
There was just this question the other day: http://stackoverflow.com/questions/30922413/why-does-metadata-symbol-not-work There is also a few threads a few weeks ago here on google groups about it: https://groups.google.com/d/msg/clojure/_e7vBom2acw/0AAKTiGuzv4J HTH On Thursday, June 25, 2015

Re: materials

2015-06-25 Thread Andy-
The sidebar on reddit is actually pretty decent: http://www.reddit.com/r/clojure My #1 resource for looking up docs is nowadays clojuredocs.org since it gives examples/comments for most of the functions. HTH On Thursday, June 25, 2015 at 4:59:12 AM UTC-4, Baskar Kalyanasamy wrote: > > hi every

Re: Avoiding repetition while still using 'recur'

2016-06-26 Thread Andy-
To add a little variant of James Reeve's code: You can avoid the loop/recur by using reduce: (defn valid-parens? [s] (let [opening-brackets {\( \), \[ \], \{ \}} closing-brackets (clojure.set/map-invert opening-brackets)] (empty? (reduce (fn [stack c] (if (o

Re: Index of an element in a vector of vectors

2016-12-07 Thread Andy-
One option is to use keep-indexed: (first (keep-indexed (fn [i xs] (first (keep-indexed (fn [j x] (when (= x "5") [i j])) xs))) players)) On Wednesday, December 7, 2016 at 5:32:10 PM UTC+1, Rickesh Bedia wrote: > > If I have

Re: Index of an element in a vector of vectors

2016-12-08 Thread Andy-
etter way. On Thursday, December 8, 2016 at 11:13:42 AM UTC+1, Rickesh Bedia wrote: > > Is there a way to generalise? > > I.e a function that allows you to swap any of the 1-9? > > On Wednesday, 7 December 2016 18:06:19 UTC, Andy- wrote: >> >> One option is to use keep-in

beginning to learn Clojure after imperative programming my whole life

2017-08-09 Thread Andy
resources/ particular tips/any advice for improving Clojure skills. Does anybody have any websites used for solving Clojure problems? other than the most popular ones. Wishing you the best of luck in life and coding. best wishes fellow Clojurians, Andy -- You received this message because you

Re: Anyone mourns the loss of: tryclj.com ?

2017-12-16 Thread Andy-
You can also get a REPL with https://coderpad.io/ . It even runs Clojure 1.9 and the editor has great VIM bindings. If it asks you to register you can just start a new session in an incognito window. HTH On Saturday, December 16, 2017 at 4:29:23 AM UTC+1, Didier wrote: > > Just realized that:

Re: Durable atom

2015-08-16 Thread Andy-
You might like some of immutant's stuff: http://immutant.org/documentation/2.0.2/apidoc/guide-transactions.html Even though it's called caching, it can be used as a kv-store. They do offer persistence and transaction. HTH On Sunday, August 16, 2015 at 10:59:09 AM UTC-4, Jeremy Vuillermet wrote

Re: How can find something inside heavily nested data structure ?

2015-08-19 Thread Andy-
I have yet to evaluate it myself but this might do help you: https://github.com/nathanmarz/specter On Wednesday, August 19, 2015 at 10:18:06 AM UTC-4, Hussein B. wrote: > > Hi, > > I have transformed JSON response into the equivalent data structure using > Cheshire library. > > The result is a

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-03 Thread Andy-
Only to answer the "retry on error" part of you question: You might like hara/event: http://docs.caudate.me/hara/hara-event.html HTH On Wednesday, September 2, 2015 at 8:44:07 PM UTC-4, jo...@signafire.com wrote: > > TLDR: how do you use Component when the application logic involves > retrying

Re: newbie Q: how to tweak file-seq (original: how to selectively iterate through a tree of directories) ?

2015-10-05 Thread Andy-
Try to adapt my code: https://gist.github.com/rauhs/63054a06631c0be598d3 where you change your accept function to incorporate: http://stackoverflow.com/questions/813710/java-1-6-determine-symbolic-links HTH On Saturday, October 3, 2015 at 5:14:51 PM UTC-4, hpw...@gmail.com wrote: > > The direc

Re: Pattern matching on lists

2016-04-08 Thread Andy-
That's described here: https://github.com/clojure/core.match/wiki/Basic-usage#sequential-types Use: [([1] :seq)] On Friday, April 8, 2016 at 2:37:37 PM UTC+2, Russell Wallace wrote: > > How do you do pattern matching on lists in Clojure? I've tried using > core.match but the examples all deal

Re: Removing duplicates from a series

2016-05-17 Thread Andy-
Hi, dedupe is almost what you need, but you can just copy the source and modify it slightly: (defn dedupe-by "Similar to dedupe but allows applying a function to the element by which to dedupe." ([f] (fn [rf] (let [pv (volatile! ::none)] (fn ([] (rf)) ([resu

Re: why my java code (call clojure from java ) run spend so much loooooog time .

2014-02-13 Thread Andy-
FYI: http://stackoverflow.com/questions/21759848/ On Thursday, February 13, 2014 11:02:07 AM UTC-5, Xiaojun Weng wrote: > > I am a new clojure player,but i have wrote java code by few years. > > when i use emacs run my clojure code (read a big file 50M ) , nrepl run > over use 30 second. > but

Re: [ANN] Clojure 1.6.0-beta1

2014-02-15 Thread Andy-
inline On Saturday, February 15, 2014 12:41:52 AM UTC-5, Mars0i wrote: > > Could someone clarify for me why "some?" as a name for not nil makes sense > at all in the first place? Not criticizing. I just don't understand what > existence or there being some of something has to do with nil. > >

Re: Looking for advice to fine tune a simple function

2014-02-16 Thread Andy-
I'm also very new to clojure but this is how I'd do it: (def hr-zones { [0 100] :low [101 120] :fat-burn [121 140] :aerobic [141 160] :anaerobic [161 333] :max}) (defn hr->zone [hr] (some (fn [x] (and (<= (first (key x)) hr (second (key x))) (val x))) hr-zones))

Re: Looking for advice to fine tune a simple function

2014-02-16 Thread Andy-
(let [[[l lv] [h hv]] i] (and (< l x) (<= x h) hv))) (partition 2 1 m)) Cheers On Sunday, February 16, 2014 6:47:51 PM UTC-5, Andy- wrote: > > I'm also very new to clojure but this is how I'd do it: > > (def hr-zones { >[0 1

Re: Latex style file for formatting/coloring clojure code?

2014-02-16 Thread Andy-
On Sunday, February 16, 2014 6:05:24 PM UTC-5, puzzler wrote: > > I am unable to find a style file that supports clojure code in LaTeX. Can > anyone point me in the right direction? > Pygments can output LaTeX. (There is also minted) HTH -- You received this message because you are subscribed

Re: Looking for advice to fine tune a simple function

2014-02-17 Thread Andy-
On Sunday, February 16, 2014 11:19:58 PM UTC-5, Bruno Kim Medeiros Cesar wrote: > > (BTW, Andy, how do you format your code so prettily?) > I usually just paste it into pygments.org and then paste it back into google groups (which accepts the generated HTML). Cheers -- You rece

Re: Looking for advice to fine tune a simple function

2014-02-17 Thread Andy-
On Monday, February 17, 2014 6:43:18 PM UTC-5, Laurent Droin wrote: > > > (def inf Long/MAX_VALUE) > (defn quantize > [x markers values] > (let > [f (partial (fn([%1 %2 %3] (cond (<= %1 %2) %3))) x)] > (first (filter #(not (nil? %))(map f (conj markers inf) values) > > The reason I

Re: The Application Context Pattern

2009-02-27 Thread Andy Chambers
2009/2/27 Marko Kocić : > > Interesting approach, nice explained. > > Does anyone have similar example using one of the cells > implementations? > What would be pros/cons between this and cells approach? The cells implementations I've seen posted to this list (in fact pretty much all cells reimpl

Re: Clojure performance tests and clojure a little slower than Java

2009-07-29 Thread Andy Fingerhut
d BSD for everything, some copyright by me, the rest by the owner of the benchmark web site). You can get it here: git://github.com/jafingerhut/clojure-benchmarks.git Again, submissions for new benchmark programs, or improvements to existing ones, are welcome. Thanks, Andy On Jul 28, 8:52 am,

Good memory profilers (program or human)?

2009-07-30 Thread Andy Fingerhut
ry are being exhausted. It would be possible to improve things by not creating all of the separate strings, one for each line, and then concatenating them together. But first I'd like to explain why it is using so much, because I must be missing something. Thank, Andy --~--~-~--~--

Re: Good memory profilers (program or human)?

2009-07-31 Thread Andy Fingerhut
alls. I'm happy to be proved wrong on that, if someone finds better Clojure versions than I've got. Thanks, Andy On Jul 30, 11:00 am, Andy Fingerhut wrote: > I'm gradually adding a few more Clojure benchmark programs to my > repository here: > > git://github.com/jafinge

Re: Transient Data Structures

2009-08-03 Thread Andy Fingerhut
eone forgets to call "persistent!" on a data structure before using it in another thread. Thanks, Andy On Aug 3, 2:25 pm, Rich Hickey wrote: > I've been doing some work on Transient Data Structures. You can read > about them here: > > http://clojure.org/transients > >

pmap uses more parallelism than intended due to use of "eager" map?

2009-08-04 Thread Andy Fingerhut
availableProcessors)) rets (map #(future (f %)) coll) but I don't know yet where the implementation of map that is "active" at that point in the source code is. Perhaps it is implemented in Java? Andy --~--~-~--~~~---~--~~ You receive

Re: Question about pmap

2009-08-04 Thread Andy Fingerhut
t know the answer off the top of their head. Andy On Aug 4, 1:59 am, Johann Kraus wrote: > > My guess would be you're seeing the overhead for pmap since the > > (inc 0.1) computation is so cheap.  From the docs for pmap: > >   "Only useful for computationally intensi

Re: pmap uses more parallelism than intended due to use of "eager" map?

2009-08-04 Thread Andy Fingerhut
n for chunked collections. That's pretty quick and easy. or (2) modify the pmap implementation so that even if map optimized for chunked collections, pmap doesn't use more parallelism than intended. That would require a more significant code change in pmap. Thanks, Andy On Aug 4

Re: Question about pmap

2009-08-06 Thread Andy Fingerhut
you are curious. I don't see any reason why that method should have any kind of contention or worse performance when running on 2 cores vs. 1 core, but I don't know the guts of how it is implemented. At least in OpenJDK all it does is "return new Double(d)", where d is the doub

Re: Question about pmap

2009-08-06 Thread Andy Fingerhut
On Aug 6, 10:00 am, Bradbev wrote: > On Aug 6, 3:07 am, Andy Fingerhut > wrote: > > > > > On Aug 5, 6:09 am, Rich Hickey wrote: > > > > On Wed, Aug 5, 2009 at 8:29 AM, Johann Kraus > > > wrote: > > > > >> Could it be that your CPU

Re: Transient Data Structures

2009-08-06 Thread Andy Fingerhut
x27;re curious: http://github.com/jafingerhut/clojure-benchmarks/blob/38e1f592ca3befe94a0674a5f5a43d952cd369b3/knuc/knucleotide.clj-7.clj It went from about 19 minutes down to about 12 minutes. Excellent improvement for a small change to the code. That brings it down to about 7.7 times the run time of th

Re: Clojure performance tests and clojure a little slower than Java

2009-08-06 Thread Andy Fingerhut
On Aug 6, 3:28 pm, André Thieme wrote: > On 27 Jul., 23:26, AndyF wrote: > > Hello Andy, could you please update the following table? > > > > >         |  sbcl  |  perl  |   ghc  |  java |   clj > > - > &g

Re: Question about pmap

2009-08-06 Thread Andy Fingerhut
nt types like long and float, and report back when I've got them. Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

combining methods

2009-08-07 Thread Andy Chambers
Hey All, Does clojure have an equivalent of either CLOS's `call-next-method' or java's super? For example, given the multi-method, and the interfaces ICDISCElement and IODMDef, where IODMDef extends ICDISCElement (defmulti validate class) (defmethod validate ICDISCElement [elem] ;;generi

Re: Clojure performance tests and clojure a little slower than Java

2009-08-07 Thread Andy Fingerhut
On Aug 6, 6:49 pm, John Harrop wrote: > On Thu, Aug 6, 2009 at 6:57 PM, Andy Fingerhut < > > andy_finger...@alum.wustl.edu> wrote: > > You are correct.  I've updated that file: > > >http://github.com/jafingerhut/clojure-benchmarks/blob/bb9755bdeeccae8... >

Re: Test a random function

2009-08-07 Thread Andy Fingerhut
] (loop [s s t (transient {})] (if-let [s (seq s)] (let [item (first s)] (recur (next s) (assoc! t item (inc (get t item 0) (persistent! t Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: Clojure performance tests and clojure a little slower than Java

2009-08-07 Thread Andy Fingerhut
LTS I also tried it with 4 parallel threads on my 2-core machine, and this problem parallelizes significantly better than the simpler problem in the "questions about pmap" discussion thread -- nearly half the elapsed time, and only 6% more total CPU time for the 4-thread version vs. the

Re: Question about pmap

2009-08-08 Thread Andy Fingerhut
s from Nicolas Oury -- perhaps we are measuring the bandwidth from cache to main memory, not raw computational ability of the processor cores. Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Clojure performance tests and clojure a little slower than Java

2009-08-09 Thread Andy Fingerhut
On Aug 8, 2:16 pm, John Harrop wrote: > On Sat, Aug 8, 2009 at 5:23 AM, Mark Engelberg > wrote: > > > > > On Fri, Aug 7, 2009 at 5:14 PM, John Harrop wrote: > > >     (if (and (not (= 0 i)) (< (+ zr2 zi2 limit-square))) > > > I believe that (zero? i) is faster than (= 0 i). > > On primitive ints

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread Andy Fingerhut
fort to optimize the heck out of their programs in ways that most Haskell programmers would probably find excessive. Even some of the C and C++ implementations seem to pull out __builtin_memmove calls and explicitly using SSE macros in order to tweak out a few more milliseconds of lower run time. And

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread Andy Fingerhut
tors instead of the maps that I use, would probably speed things up some more. I also still have a fair number of uses of map that would probably be faster with loop/recur. Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread Andy Fingerhut
gerhut/clojure-benchmarks/blob/14c5df3ee28d418a938de584f6675860043dd0f5/RESULTS And, as usual, improvements to the performance of these Clojure programs are welcome. Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread Andy Fingerhut
On Aug 10, 5:57 pm, Mark Engelberg wrote: > Andy, > > My understanding is that any double that gets stored in a vector or > map is boxed, and therefore, the vast majority of your double > conversions aren't really doing anything, because when you pull them > out of the

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread Andy Fingerhut
On Aug 10, 11:33 pm, Mark Engelberg wrote: > On Mon, Aug 10, 2009 at 11:15 PM, Andy > > Fingerhut wrote: > > I suspect I'm doing something wrong in my mutable Java array > > implementation, but I don't see what it could be. > > There still seems to be a lot

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread Andy Fingerhut
On Aug 10, 11:50 pm, Christophe Grand wrote: > Hi Andy, > > On Tue, Aug 11, 2009 at 8:15 AM, Andy Fingerhut < > > andy_finger...@alum.wustl.edu> wrote: > > I've tried an approach like you suggest, using mutable Java arrays of > > doubles, macros using aget

Re: Transient Data Structures

2009-08-11 Thread Andy Fingerhut
On Aug 10, 11:15 am, Christophe Grand wrote: > Hi Andy, > > On Thu, Aug 6, 2009 at 7:40 PM, Andy Fingerhut < > > > > andy_finger...@alum.wustl.edu> wrote: > > Thank you, Christophe!  I've been wanting to try those out. > > > I made changes to 3 l

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread Andy Fingerhut
p://github.com/jafingerhut/clojure-benchmarks/blob/0f7fdd358086cb95c898d7c2656215408a8d0689/RESULTS As always, suggestions or improved versions are welcome. Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloju

Re: Can Clojure be as fast as Java?

2009-08-11 Thread Andy Fingerhut
On Aug 11, 4:27 pm, Stuart Halloway wrote: > If I am reading the README correctly, clj-8 is 10.8 times slower than   > Java, but clj-9 does better: 3.2 times slower. > > Stu You are reading that correctly. My clj-9 wasn't created until after fft1976's message start

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread Andy Fingerhut
.Object's, each of which happens to be a Java array of primitive doubles, as before. Now about 3.0 x Java run time. http://github.com/jafingerhut/clojure-benchmarks/blob/43ed2f42e6c1485541532e51eacc66488949c658/RESULTS Thanks, Andy --~--~-~--~~~---~--~~ You received

Clojure, Java JIT, and inlining

2009-08-12 Thread Andy Fingerhut
o change permits? Is it because of some kind of function call/return overhead that the JIT cannot eliminate? Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Newbie with problems building clojure-contrib

2009-08-12 Thread Andy Fingerhut
t;beside" my clojure directory, instead of within it, and I gave a full absolute path name (e.g. / Users/andy/clojure/clojure-1.0.0.jar) instead of a relative path name when I built clojure-contrib. I'd recommend trying that and see if it makes

Re: Newbie with problems building clojure-contrib

2009-08-12 Thread Andy Fingerhut
Oh, one more thing. If you have latest git clojure-contrib, I'd recommend trying it with latest git clojure, too. Latest clojure- contrib might not work with clojure 1.0.0. Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Can dosync transaction result computation be parallelized over multiple threads?

2009-08-13 Thread Andy Fingerhut
accessing. Do all of those get bundled together with the original transaction, too? If so, did it require anything special in the implementation to make that work? Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Transcript of Rich's "Clojure for Lispers" talk uploaded

2009-08-13 Thread Andy Fingerhut
sible place, if you know how and have the access to it. For example, if a link to it could be put on clojure.blip.tv, that might be cool. Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Memory leak in vec (and maybe persistent!)?

2009-08-14 Thread Andy Fingerhut
oolean before that. Would it be correct to nullify the reference to the persistent object returned by a call to persistent! on a transient object? Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloj

Re: Memory leak in vec (and maybe persistent!)?

2009-08-15 Thread Andy Fingerhut
On Aug 15, 5:44 am, Christophe Grand wrote: > I wouldn't call this a memory leak: vectors have a bigger memory overhead > than before (additional PersistentVector$Node and AtomicReference). > > On Sat, Aug 15, 2009 at 2:13 AM, Andy Fingerhut < > > andy_finger...@alum.wu

Re: How to have a fast access to a java array of non-primitives?

2009-08-15 Thread Andy Fingerhut
e know how to speed that up? > >         Is it written somewhere in the java interop documentation? > > >         Best, > > >         Nicolas. I don't know if this works for all classes, but you can try this: user> (class (make-array java.lang.Object 5)) [Ljava.lang.Object; An

Re: Memory leak in vec (and maybe persistent!)?

2009-08-18 Thread Andy Fingerhut
On Aug 17, 3:51 am, Christophe Grand wrote: > On Sat, Aug 15, 2009 at 4:23 PM, Andy Fingerhut < > > andy_finger...@alum.wustl.edu> wrote: > > Not to say this ought to be done, but would it be possible to have no > > 'edit' field *at all* for persis

Re: Memory leak in vec (and maybe persistent!)?

2009-08-19 Thread Andy Fingerhut
was transient), by walking the data structure from the root node and stopping whenever we hit a persistent node that hasn't been mutated, but in general that could be all of the nodes. Thanks! Andy --~--~-~--~~~---~--~~ You received this message because you a

Dynamic enforcement of no side effects in transactions?

2009-08-19 Thread Andy Fingerhut
don't know what the performance impact of creating such a sandbox might be. Thanks, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Tight loop performance

2009-09-06 Thread Andy Fingerhut
I think there is definitely value in having _one_ flag you can turn on that gives you as many kinds of performance warnings as we know how to give. Andy On Sep 6, 7:49 am, Nicolas Oury wrote: > Hello, > > >         (aset-byte dst dst-offset (byte sample)) > > Most of the time, a

Re: clojure-mode survey

2009-09-11 Thread Andy Kish
There isn't a debian package and depending on your setup, you'll probably have to edit the Makefile to install from source. Andy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Ann Arbor Clojure Meetup?

2009-09-11 Thread Andy Kish
at the AAJUG on the 22nd in an old beat up Astros ballcap. Introduce yourself if you see me. :-) Andy. [1] http://www.google.com/calendar/htmlembed?src=v2433p4md2226qtd3ja1annifc%40group.calendar.google.com&mode=AGENDA On Sep 8, 1:07 am, Lance Carlson wrote: > Hi Clint, > > I att

Re: clojure-mode survey

2009-09-11 Thread Andy Kish
. They make setting up an environment more stupid-proof, and I need that sort of thing! Until there's a standardized way to launch clojure, clojure-project is nice as well. Thanks again! Andy. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Modeling Data Associations in Clojure?

2009-09-14 Thread Andy Kish
h clojure right now, so report back to the mailing list if something works well for ya! I'm not at the point where I need a db, but if I do I think I'll end up trying to use datalog. Andy Kish. [1] http://clojure.org/api#toc654 [2] h

Re: type checking/inference?

2009-09-16 Thread Andy Kish
Cool! Thanks for the heads up. Most of experience with functional languages has been with Haskell up 'til now, so I've been itching for a type system too. Qi always looked interesting but the goofy website and license drove me away. Maybe I'll have to take another look... Andy K

doc-tests for clojure--please give my library a try!

2009-09-16 Thread Andy Kish
the idea of doc-testing and my code are very welcome! The introduction I wrote to doc-test is below. Thanks! Andy Kish. - doc-test is a Clojure namespace that provides Python-like doctests [1]. WHY DOC-TEST? - Examples are very useful in document

Re: Second Lisp to Learn

2009-12-20 Thread Andy Fingerhut
t Scheme implementations. PLT Scheme might be a good one to start with, in terms of the amount of example code and documentation that comes with it. I believe it implements many of the SRFIs, as well as extensions of its own. Andy On Dec 20, 12:31 pm, Sean Devlin wrote: > Hi everyone, &g

Re: performance improvments for the following code

2010-01-27 Thread Andy Fingerhut
c (rest c)] (if (seq c) (let [e (first c) e-fitness (fit-fn e)] (if (> e-fitness winner-fitness) (recur e e-fitness (rest c)) (recur winner winner-fitness (rest c winner) Andy -- You received this messa

Re: ClassNotfound Exception while loading JAR files in Clojure 1.2

2013-05-22 Thread Andy Fingerhut
are still using Clojure 1.4, and relatively few are using 1.3). Andy On Wed, May 22, 2013 at 8:20 AM, wrote: > Hi Sean, > >Thanks for your reply. I use Clojure.Jar version 1.2.0 and the > contrib.jar is also the same version. > >Copied below is the stack trace

Re: why is this behaving badly?

2013-05-24 Thread Andy Fingerhut
Try adding (flush) after the print call. On Fri, May 24, 2013 at 12:35 PM, Jim - FooBar(); wrote: > Hi everyone, > > I am trying to do something very simple like asking the user whether he > wants to continue or not (a-la bash). However, sometimes the print > statement is printed sometimes it is

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Andy Fingerhut
} {:a2p-id "2", :dh-uuid "def-ghi-klm-opq"} {:a2p-id "3", :dh-uuid nil})) then especially note the double parentheses. That is a list (or sequence), whose first element is a list (or sequence) of maps. You can use (first (map find-records query-parts)) to get the inner li

Re: filter on sets ... [reward: me face palming]

2013-05-25 Thread Andy Fingerhut
Woops, and here I wasn't being careful enough... You have a list (or sequence) of two elements, both of which are lists (or sequences) of maps. You can use (apply concat (map find-records query-parts)) to return a single list containing nothing but maps. Andy On Sat, May 25, 2013 at 10:

Re: java.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys

2013-05-27 Thread Andy Fingerhut
that you have some code compiled with Clojure 1.5 or later that you are attempting to run with an earlier version of Clojure. Andy On Mon, May 27, 2013 at 9:15 AM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > 2013/5/27 ru > >> Exception in thread

Re: sorted-map-by issue?

2013-06-06 Thread Andy Fingerhut
fingerhut/thalia/blob/master/doc/other-topics/comparators.md Andy On Thu, Jun 6, 2013 at 4:19 AM, dennis zhuang wrote: > Sorry, it's my mistake. > Because treep map use the comparator to compare keys, and if the > comparator returns 1 constantly,it can not find the item that

Re: sorted-map-by issue?

2013-06-06 Thread Andy Fingerhut
) that is the relative order that it was added in. https://github.com/flatland/ordered Andy On Thu, Jun 6, 2013 at 7:56 AM, dennis zhuang wrote: > Thanks,you are right.I want to creat a map which keeps elements in > insertion order, but clojure doesn‘t have. > 在 2013-6-6 下午10

Re: Why aim for repeatability of specification / generative testing?

2013-06-06 Thread Andy Fingerhut
lower and require a lot more temporary disk space to record the logs. So you end up using a large variety of different seed values to increase test coverage, and if any of them fails, you can turn on the extra logging and re-run it, knowing that you will hit the same problem as before. Andy On Thu

Re: [ANN] Instaparse 1.1.0

2013-06-11 Thread Andy Fingerhut
7;d in O(log n) worst case time, and yet substrings would only hold onto references of the parts that they explicitly refer to, and perhaps a little bit more (but not the entire original string). Andy On Tue, Jun 11, 2013 at 3:09 PM, Mark Engelberg wrote: > Honestly I hadn't yet g

Re: [ANN] Instaparse 1.1.0

2013-06-11 Thread Andy Fingerhut
And to answer my own question about a reference for this change in behavior, which appears to have been made in Java 7: http://stackoverflow.com/questions/16123446/java-7-string-substring-complexity Andy On Tue, Jun 11, 2013 at 3:33 PM, Andy Fingerhut wrote: > Mark, > > I had not he

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread Andy Fingerhut
own command line, so Leiningen has no way to affect the JVM command line options in that case. Andy On Fri, Jun 21, 2013 at 6:59 AM, Jim - FooBar(); wrote: > Did you read the entire thread? > both Jason and Leon (who originally posted) admit that this was the > problem...Stuart ev

Re: clojure 1.5 cheatsheet?

2013-06-24 Thread Andy Fingerhut
or categorizing them, other than simply putting them all together into one category together, I am open to suggestions. Andy On Mon, Jun 24, 2013 at 3:18 AM, terjesb wrote: > http://jafingerhut.github.io > > kl. 11:38:41 UTC+2 mandag 24. juni 2013 skrev Las følgende: > >>

Re: Unnecessary boxing with 1.5?

2013-06-24 Thread Andy Fingerhut
You have what is likely an undesired right paren at the end of the let line, ending the scope of the let. Andy On Mon, Jun 24, 2013 at 4:32 PM, Cedric Greevey wrote: > (defn foo [x y z] > (let [x (long x) y (long y) z (long z)]) > (loop [a false b (long 0)] > (if a b

Re: Build fails with any IBM JDK above 6.0.x

2013-07-01 Thread Andy Fingerhut
tests for clojure.java.io/copy that work on other JDKs but fail with IBM JDK 1.6, related to how it handles UTF-16 encoding a bit differently. Let me know if that works for you. Andy On Sun, Jun 30, 2013 at 10:22 AM, Sherif Ali wrote: > Hello all, > > I am having a problem building an

Re: Overflowing (count ...)

2013-07-08 Thread Andy Fingerhut
at causes count to throw an ArithmeticException if the sequence contains more than Integer/MAX_VALUE elements. I don't know if such a patch is acceptable to the Clojure/core team or not, but we may find out. http://dev.clojure.org/jira/browse/CLJ-1229 Andy On Sun, Jul 7, 2013 at 5:

Re: Group words by their first letter and sum their frequencies

2013-07-11 Thread Andy Fingerhut
version at clojure.org/cheatsheet gets updated less frequently, simply because I have to ask someone else to do it who has the necessary permissions. I'll ask again now. Andy On Thu, Jul 11, 2013 at 6:50 AM, James Trunk wrote: > Hello Laurent, > > Thank you so much for your detailed and

Re: S-s-s-serious performance bug with `map` laziness

2013-07-13 Thread Andy Fingerhut
sequence can sometimes help, e.g. see the issue description and my proposed pach here: http://dev.clojure.org/jira/browse/MCOMB-2 Andy On Sat, Jul 13, 2013 at 6:52 PM, Daniel Dinnyes wrote: > Seems these guys below have the same problem, and everyone thinks it is > `apply` or `concat` to blam

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Andy Fingerhut
interested in discussing the topic at length will find an appropriate forum to do so, which I hope the Clojure Google group is not. Andy On Jul 26, 2013, at 12:07 PM, Cedric Greevey wrote: > On Fri, Jul 26, 2013 at 10:29 AM, Charlie Griefer > wrote: >> On Jul 25, 2013, at 8:15 PM, Ce

Re: BigDecimal and ==, with a proposed fix

2013-08-01 Thread Andy Fingerhut
, but also another one to how hash is calculated for BigDecimal values, so that hash is still consistent with =. Take a look at it and see if you think it is correct. Andy On Thu, Aug 1, 2013 at 9:28 PM, CGAT wrote: > My understanding of == is that it is intended to establish numeri

Re: BigDecimal and ==, with a proposed fix

2013-08-01 Thread Andy Fingerhut
:16 PM, Andy Fingerhut wrote: > I agree, which is why I wrote a patch for the ticket > http://dev.clojure.org/jira/browse/CLJ-1118 > > (Depending on when you read this, dev.clojure.org may not be accessible > due to a recent DNS update made by the Clojure folks. Wait a while and try &

  1   2   3   4   5   6   7   8   9   10   >