Re: CLJS: How can you find the version of clojurescript that you're running?

2012-10-21 Thread AtKaaZ
**clojure-version* * {:major 1, :minor 4, :incremental 0, :qualifier nil} On Sun, Oct 21, 2012 at 2:16 AM, Frank Siebenlist frank.siebenl...@gmail.com wrote: When you have different versions of clojurescript in the dependencies of your main project, how do you ask the repl what version it is

Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread Dave
Clojurists - I'm fairly new to Clojure and didn't realize how broken I've become using imperative languages all my life. I'm stumped as to how to parse a Varnish (www.varnish-cache.org) log file using Clojure. The main problem is that for a single request a varnish log file generates multiple

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread Dave Sann
Look at: http://clojuredocs.org/clojure_core/clojure.core/line-seq to get a lazy sequence of lines of the file. I don't think that there is any need to sort here. (I think sorting wont help anyway because some lines are seem to be only identifiable based on the thread id in the current

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread Dave Sann
btw, start simple and just see if you can scan the lines without doing anything in particular. Then take some sub sequence: (take 100 my-line-seq) Play in the repl to start building up the data you want. See what you get and work from there. D On Sunday, 21 October 2012 19:05:42 UTC+11, Dave

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread Ray Miller
As Dave says, you can do this using line-seq, but you'll have to accumulate some state as you read the lines so you can return all the lines for a given thread's ReqStart to ReqEnd. Once you've returned that block, you can delete the state for that thread-id, so your accumulated state will only

Re: Write stream to two outputs

2012-10-21 Thread Petar Radosevic
Hi Herwig, Thanks for your help. Herwig Hochleitner writes: (defn copy-multi ([input outputs] (copy-multi input outputs (make-array Byte/TYPE 1024))) ([^java.io.InputStream input outputs buffer] (let [size (.read input buffer)] (when (pos? size) (doseq

Re: CLJS: How can you find the version of clojurescript that you're running?

2012-10-21 Thread David Nolen
There is not. That would be useful. On Saturday, October 20, 2012, Frank Siebenlist wrote: When you have different versions of clojurescript in the dependencies of your main project, how do you ask the repl what version it is running with… is there any easy function/var that I overlooked?

Re: Write stream to two outputs

2012-10-21 Thread Herwig Hochleitner
Streaming simultaneously can result in all kinds of problems due differences in speed and reliablility between a disk and network connection. So if you can, buffer the data for the write to S3. Maybe you could just stream to S3 from the file after you've written it? If you must stream

Re: finding intervals quickly

2012-10-21 Thread Brian Craft
Answering my own question, my issues were 1) overlooking a couple seqs that were thousands of times slower than vectors, and 2) using / instead of quot. Just found this video: http://www.infoq.com/presentations/Crunching-Numbers-Clojure I'm finding that seqs are pretty much always too slow,

Re: ANN: ClojureScript release 0.0-1513

2012-10-21 Thread Shantanu Kumar
On Oct 20, 12:52 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: ClojureScript release 0.0-1513 is on its way to the Maven Central Repository. Changes:http://build.clojure.org/job/clojurescript-release/18/ This release (via lein-cljsbuild 0.2.9) broke one of my projects, which worked

Re: ANN: ClojureScript release 0.0-1513

2012-10-21 Thread Shantanu Kumar
1. $ git clone g...@github.com:kumarshantanu/basil.git Or whichever URL is convenient for this project: https://github.com/kumarshantanu/basil Shantanu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: ANN: ClojureScript release 0.0-1513

2012-10-21 Thread David Nolen
Please isolate the commit by using the lein checkouts feature - you can use the ClojureScript repo directly then and use git bisect to determine the exact commit that broke your build. Thanks. On Sunday, October 21, 2012, Shantanu Kumar wrote: On Oct 20, 12:52 am, Stuart Sierra

CLJS-402: Re: CLJS: How can you find the version of clojurescript that you're running?

2012-10-21 Thread Frank Siebenlist
I've created an JIRA issue for this: http://dev.clojure.org/jira/browse/CLJS-402 and added a patch for the build script: --- Auto-generation from the build script of version_autogen.clj and version_autogen.cljs files that both define the cljs.version-autogen/clojurescript-version with the

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread AtKaaZ
I assumed he needs the results sorted by transaction id, if he doesn't then it should be quite simple On Sun, Oct 21, 2012 at 10:05 AM, Dave Sann daves...@gmail.com wrote: Look at: http://clojuredocs.org/clojure_core/clojure.core/line-seq to get a lazy sequence of lines of the file. I

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread AtKaaZ
Looks like something I would do in datomic. Parse the log one time, and concurrently put the data into a datomic database and then ... wait I just realized, I don't think we can get the results sorted from the database, because the return from a query is a set of results and your transaction ids

Re: finding intervals quickly

2012-10-21 Thread AtKaaZ
This comes to mind: (set! *warn-on-reflection* true) But you probably already considered it... On Sun, Oct 21, 2012 at 4:27 AM, Brian Craft craft.br...@gmail.com wrote: I have a vector of maps representing intervals with (start, end) coords in one dimension, that are non-overlapping, and

Re: finding intervals quickly

2012-10-21 Thread Chas Emerick
If you are happy with sorting the data already, then put the pairs into a sorted set, and use `subseq` and `rsubseq` to query. Depending on the size of the data (i.e. how many coordinate pairs you have) and the specifics of your usage (i.e. mostly, how dynamic the dataset is), using a

How to Aliasing Java Class Names?

2012-10-21 Thread JvJ
I'm trying to import some classes from a library (jpl), which have names already taken by java.lang classes. When I try to import jpl.Float and jpl.Integer, I get exceptions due to name clashes. Is there a way to alias the class names so that I can use them? -- You received this message

Re: How to Aliasing Java Class Names?

2012-10-21 Thread Andy Fingerhut
As mentioned in a recent thread class name clashes on importing classes of same name from different Java package, you can use the classes with fully qualified names without importing them at all. I am not aware of any way to alias them. Andy On Oct 21, 2012, at 6:57 PM, JvJ wrote: I'm

Re: Parsing Log Files with Interspersed Multi-line Log Statements

2012-10-21 Thread Dave
raym - Thanks so much for the code snippet. That was just what I needed to get unstuck and start playing around with the parser. I really appreciate the help. - Dave On Sunday, October 21, 2012 6:10:51 AM UTC-5, raym wrote: As Dave says, you can do this using line-seq, but you'll have to