Re: Local variable

2014-07-08 Thread Lars Nilsson
is directly followed by @errors and as a result the lazy evaluation of (map ...) is not happening, and your println and errors updates does not get executed. Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Leiningen/javax.imageio

2014-05-12 Thread Lars Nilsson
x)) (defn -main [] (println (seq (foo $ lein run (image/jpeg image/png image/x-png image/vnd.wap.wbmp image/gif image/bmp) Worked without problem. Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: instaparse question

2013-10-31 Thread Lars Nilsson
e DRUG from the grammar and use the transform function on a parse-result to do something like (insta/transform {:WORD (fn [w] (if (...) [:DRUG w] [:WORD w]))} parse-result) so [:DRUG w] is emitted for whatever criteria you may have (lookup) when matched, otherwise [:WORD w] to retain the original conte

Re: futures - The Joy Of Clojure book question

2013-07-23 Thread Lars Nilsson
time: 5003.049 msecs" [2 4] Basically, [x x] doesn't do the evaluation, it happens in the let once for x. For [@x @x] the thread is kicked off once to do the computation, and the first @x waits for the result (if not already available) while the second @x uses the cached value. In my mod

Re: Most idiomatic way of splitting a string into sentences?

2013-07-06 Thread Lars Nilsson
On Sat, Jul 6, 2013 at 5:02 PM, Denis Papathanasiou wrote: > On Saturday, July 6, 2013 1:22:32 PM UTC-4, Lars Nilsson wrote: >> >> [snip] >> >> If that kind of splitting is really all you require, >> (clojure.string/split my-text #"[.!?;]") or (re-seq #&

Re: Most idiomatic way of splitting a string into sentences?

2013-07-06 Thread Lars Nilsson
ic way of doing this without using up > all the heap space? If that kind of splitting is really all you require, (clojure.string/split my-text #"[.!?;]") or (re-seq #"[^.!?;]+" my-text) For fancier stuff look into an opennlp wrapper or something like it. https://github.com/d

Re: with-open and for

2013-06-07 Thread Lars Nilsson
the day. Wrap flatten in a doall so the lazy sequence is realized before the with-open closes the stream. Lars Nilsson -- -- 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 t

Re: Wrong number of args (0) passed to: PersistentArrayMap

2013-03-30 Thread Lars Nilsson
(monger/remove-this-item m) > (. java.lang.Thread sleep 90) > (delete-those-items-in-the-model-that-are-scheduled-to-be-deleted)) > > Assume um/get-from-model is almost the same as get-in. Assume initial-data is > stored in the atom um/interactions. Where am

Re: genuine help needed to speed up minimax algorithm!

2012-08-17 Thread Lars Nilsson
mory allocation but uses fixed size arrays for the search/principal variation, etc. Lars Nilsson -- 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

Re: Lazily extract lines from large file

2012-08-16 Thread Lars Nilsson
ant to change your algorithm a bit, as your code will hold on the to the head of "lines" until all indices has been processed, consuming memory for all lines read regardless of whether you are interested in them. Also, nth with sequences is probably not what you want most of the time.

Re: How I can convert this python line to clojure?

2012-06-26 Thread Lars Nilsson
E (new vtkCompositeDataSet)) I'm guessing you'll want to get in touch with VTK people at this point to get better answers to how to use the Java API in general (I've just dug into the generated Java code for every answer I've given so far). Lars Nilsson -- You received this mess

Re: How I can convert this python line to clojure?

2012-06-26 Thread Lars Nilsson
figure out what they are. SCALARS would be 0 for instance) or define your own set of symbols for the values in vtkDataSetAttributes::AttributeTypes, and other enums like it, for more readable code in your own codebase.. Lars Nilsson -- You received this message because you are subscribed to the Goog

Re: How I can convert this python line to clojure?

2012-06-25 Thread Lars Nilsson
n vtk.jar, I see no reference to SCALARS anywhere, including vtkDataSetAttributes.java/class. Lars Nilsson On Mon, Jun 25, 2012 at 12:22 PM, Antonio Recio wrote: > @Lars Nilsson: I doesn't work. > > user=> (println vtkDataSetAttributes$AttributeTypes/SCALARS) > # vtkDataSetAttri

Re: How I can convert this python line to clojure?

2012-06-25 Thread Lars Nilsson
; 0 Not sure if you can get the equivalent of 0 as output, but perhaps referring to vtkDataSetAttributes$AttributeTypes/SCALARS will work? Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: fully type-hinted record still uses reflection!

2012-06-10 Thread Lars Nilsson
On Sun, Jun 10, 2012 at 1:08 PM, Lars Nilsson wrote: > On Sun, Jun 10, 2012 at 1:04 PM, Jim - FooBar(); wrote: >> Hi again (busy day eh?), >> >> well this doesn't make any sense either! Why is a record with  type-hinted >> arguments still using reflection? &

Re: fully type-hinted record still uses reflection!

2012-06-10 Thread Lars Nilsson
-- > and whenever i call update-position it complains that setLocation cannot be > resolved. setLocation is a method in java.awt.Point so i don't see why this > happens! Would (

Re: Function minimizer a la fminunc

2012-06-08 Thread Lars Nilsson
if nothing else, you get a lot of building blocks to build upon. Lars Nilsson -- 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 -

Re: Doseq, map-style

2012-06-08 Thread Lars Nilsson
me an intermediate result is built and then thrown away. Or perhaps it's insignificant compared to what the unspecified function does that is passed to map for performing the side-effect work.. Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Cloju

Re: Issues with installing clojure-mode on Mac in Emacs

2012-05-27 Thread Lars Nilsson
list 'load-path (expand-file-name ".emacs.d" "~")) (add-to-list 'load-path (expand-file-name ".emacs.d/packages" "~")) Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Cheap defrecord transformation

2012-04-25 Thread Lars Nilsson
ecs" nil and user=> (time (dotimes [_ 1000] (let [x {:a 10 :b 20}] (assoc x :c 30 "Elapsed time: 2496.002425 msecs" nil Timing for a single assigment without looping is bound to have some variance that does not reflect real performance. Regards, Lars Nilsson

Re: [ANN] Clojure Namespace Browser (clj-ns-browser "1.0.0")

2012-04-06 Thread Lars Nilsson
Well, as it turns out, I installed Inconsolata just yesterday, along with a couple of others, exploring alternatives to Courier New. Uninstalling Inconsolata results in sdoc displaying the text correctly. Thanks for a very nifty tool. :) Lars Nilsson On Fri, Apr 6, 2012 at 12:29 PM, Frank

Re: [ANN] Clojure Namespace Browser (clj-ns-browser "1.0.0")

2012-04-06 Thread Lars Nilsson
library of the Clojure language [Actual display] clnjtqe.cnqe - Na'eroace Ftmda'emsal libqaqx nf she Clnjtqe lamgtage Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Looking for parser generator library

2012-01-28 Thread Lars Nilsson
g Parsec-style parsing (to some extent anyway) to Clojure are https://github.com/youngnh/parsatron https://github.com/mmikulicic/clarsec I couldn't say whether they're close enough to what you're looking for or anything though. Lars Nilsson -- You received this message because you

Re: Setting up Emacs to edit Clojure for Windows folks

2012-01-25 Thread Lars Nilsson
ect 99% of the time and send expressions over from my editing frame using the above keybindings, and test functions, etc, in the repl frame. Maybe one day I'll look at slime/swank stuff, but I haven't found myself needing much more than this so far. Lars Nilsson -- You r

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Lars Nilsson
On Fri, Jan 20, 2012 at 3:57 PM, Steve Miner wrote: > > On Jan 20, 2012, at 2:41 PM, Lars Nilsson wrote: > >>  => (map #(vector %1 %2) [1 2 3] ['a 'b 'c]) >>  ([1 a] [2 b] [3 c]) > > Sorry if I'm drifting a bit off topic, but I just wanted to

Re: How to loop over several sequences in parallel for side-effects?

2012-01-20 Thread Lars Nilsson
b 'c]) ([1 a] [2 b] [3 c]) Seem like the result you would expect or not, when you talk about "run over several sequences in parallel"? Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Java interop: inner class

2012-01-09 Thread Lars Nilsson
(import 'foo) (import 'foo$bar) (foo$bar. (foo.)) Lars Nilsson -- 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 - p

Re: Faster JSON library

2011-10-10 Thread Lars Nilsson
On Mon, Oct 10, 2011 at 11:19 AM, Lars Nilsson wrote: > On Fri, Oct 7, 2011 at 4:20 PM, Stuart Halloway > wrote: >>> Trying to be a little bit constructive here, in case I come across as >>> complaining, I took the source for c.d.json and put it into a >>> l

Re: Faster JSON library

2011-10-10 Thread Lars Nilsson
(let [c >> (Character/valueOf (char i)] ...) and the time for my 217KB JSON file >> dropped from 107 seconds to 2 seconds, or only a little more than >> twice as slow as clj-json (which clocked in a little under one second >> for my file). >> >> Lars Nilsson > >

Re: Faster JSON library

2011-10-07 Thread Lars Nilsson
I get the following, trying to follow that link. Login Required You are not logged in. You cannot view this URL as a guest. You must log in or sign up for an account . If you think this message is wrong, please consult your administrators about getting the necessary permissions. Lars Nilsson On

Re: Faster JSON library

2011-10-07 Thread Lars Nilsson
r only a little more than twice as slow as clj-json (which clocked in a little under one second for my file). Lars Nilsson -- 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 p

Re: Faster JSON library

2011-10-06 Thread Lars Nilsson
have any say in the matter (unless I dig into its code and make changes, rather than work on my own..) I cloned clutch in github with the intent of playing around with swapping in clj-json to see what difference it makes in practice, but it's not what I'd like to work on at the moment, ideal

Faster JSON library

2011-10-06 Thread Lars Nilsson
price in performance that I cannot easily overcome without hacking around inside it in order to swap JSON implementation, rather than tweaking my own code (although, in this case it may be limited to just the JSON string creation). Perhaps there are benefits (of which I'm not aware) to c.d.js

Re: standalone indentation tool

2011-08-08 Thread Lars Nilsson
the command line for emacs would be useful? emacs --batch --eval ... Lars Nilsson -- 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 -

Re: clooj, a lightweight IDE for clojure

2011-07-19 Thread Lars Nilsson
/file reindent functionality in Emacs. In other words, I usually use TAB for lines that were written earlier, to align it better with new code, not to affect indentation of the line I'm currently typing. Lars Nilsson -- You received this message because you are subscribed to the Google Groups

Re: [meta] Google Groups/gmail support?

2011-07-18 Thread Lars Nilsson
e?hl=en&utm_source=HC&utm_medium=leftnav&utm_campaign=chrome Lars Nilsson -- 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 m

Re: [meta] Google Groups/gmail support?

2011-07-18 Thread Lars Nilsson
On Mon, Jul 18, 2011 at 10:21 PM, Ken Wesson wrote: > If you know of such a place, I am all ears. Maybe http://groups.google.com/support/bin/request.py?contact_type=contact_policy ? Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure&qu

Re: clooj, a lightweight IDE for clojure

2011-07-18 Thread Lars Nilsson
On Mon, Jul 18, 2011 at 2:06 PM, Arthur Edelstein wrote: > Tallied. :) What's your favorite keyboard shortcut for invoking smart > indent? Is it TAB? I imagine it's still important to be able to indent > and de-indent manually, but maybe I'm wrong. I use TAB. Just about the only file type I edit

Re: clooj, a lightweight IDE for clojure

2011-07-18 Thread Lars Nilsson
On Mon, Jul 18, 2011 at 1:42 PM, Arthur Edelstein wrote: >> Not sure if I'm not misunderstanding the initial creating of a >> project, but it seems to me that I am using a file dialog box for a >> directory selection. As it wasn't entirely clear what it expected me >> to do at that point, I just t

Re: clooj, a lightweight IDE for clojure

2011-07-18 Thread Lars Nilsson
directory. It will probably take quite a bit for me to give up Emacs, but I find it a very interesting project, and like several others have said, it worked right out of the box, which is a huge plus. Regards, Lars Nilsson -- You received this message because you are subscribed to the Google Gro

Re: Lazy Programming

2010-12-15 Thread Lars Nilsson
On Wed, Dec 15, 2010 at 8:20 AM, Ralph wrote: > I'm not sure what all the hype is about lazy programming. > > I've been a lazy programmer for more than 30 years. :-) So this demotivator should fit the bill? http://despair.com/proc24x30pri.html Lars Nilsson -- You received t

Re: Make a loop in a loop

2010-07-07 Thread Lars Nilsson
but for this test i just > like to write them... Maybe (doseq [year (range 1999 2010 1)] (doseq [month (range 1 53 1)] (print-data year range))) Regards, Lars Nilsson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Batch file wrappers on Windows

2010-06-22 Thread Lars Nilsson
On Tue, Jun 22, 2010 at 10:15 AM, Lars Nilsson wrote: > On Tue, Jun 22, 2010 at 5:08 AM, Paul Moore wrote: >> On 22 June 2010 00:11, Rick Moynihan wrote: >>> On 21 June 2010 18:42, Paul Moore wrote: >>>> 3. Using a bat file to start a GUI application from Explo

Re: Batch file wrappers on Windows

2010-06-22 Thread Lars Nilsson
e. > > Clearly others don't get so up tight about these inconveniences as me, > which is fine. At least that means I haven't missed a solution that > already exists. > > Thanks for the feedback, > Paul. Maybe Windows Script Host is an option, if you haven't looked a

Re: How do I call Foo.class?

2010-04-11 Thread Lars Nilsson
egalArgumentException: No matching method found: > getEnrty for class com.google.gdata.client.finance.FinanceService > > Is seems like "(class PortfolioEntry)" doesn't resolve to the same > type as "PortfolioEntry.class". > > Any ideas? Is getEnrty copy'n'pas