records alias with local vars

2019-08-28 Thread Brian Craft
In this example (defrecord x [y]) (defn b [x] (.getBytes ^String x)) The compiler fails to resolve .getBytes. It emits reflection code, saying x is a class. It is resolved by deleting the defrecord, or renaming the parameter. Is this expected, or documented? Are there other cases like this?

Re: avoiding casts with aget & friends

2019-01-31 Thread Brian Craft
Is there any way to inspect what the jit does to it? On Wednesday, January 30, 2019 at 10:07:38 PM UTC-8, Alex Miller wrote: > > > > On Wed, Jan 30, 2019 at 11:07 PM Brian Craft > wrote: > >> With much experimentation, I ended up with this: >> >> (let [a 1

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
n Wednesday, January 30, 2019 at 8:41:49 PM UTC-8, Brian Craft wrote: > > The full context is large. But, for example, in this code: > > (let [a 1 > b (:foo {:foo 3}) > c (if (< a b) a b)]) > > b and c are Object (if the disassembly is to be believed) which l

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
context. From that I > could probably talk a little more about what I would expect the compiler to > understand and how you might be able to influence it. > > On Wed, Jan 30, 2019 at 8:50 PM Brian Craft > wrote: > >> If there is unnecessary casting or boxing, how do you av

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
where there is unnecessary casting or > boxing. > > > > On Wed, Jan 30, 2019 at 6:55 PM Brian Craft > wrote: > >> I haven't tried much. I'm getting the java via clj-java-decompiler.core >> 'decompile' macro. >> >> A long cast does dro

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
unning this hot enough for the JIT to kick in? Usually this is > the kind of thing it's good at, but it might take 10k invocations before it > does. > > > On Wednesday, January 30, 2019 at 4:03:43 PM UTC-6, Brian Craft wrote: >> >> Profiling is showing a lot of time s

avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
Profiling is showing a lot of time spent in RT.longCast, in places like this: (aget flat-dict (bit-and 0xff (aget arr j))) arr is hinted as ^bytes, and flat-dict as ^objects. which compiles to this: Object code2 = RT.aget((Object[])flat_dict, RT.intCast(0xFFL & RT.longCast((Object)RT.aget((by

partition & fold

2019-01-26 Thread Brian Craft
Still trying to understand reducers & transducers. Is the difference between r/folder and r/reducer the parallelization? Anyone know what this error is about? (r/foldcat (r/map #(apply + %) (r/folder (into [] (range 1000)) (partition-all 5 ArrayIndexOutOfBoundsException 47427 java.uti

Re: r/fold combinef and reducef init values

2019-01-26 Thread Brian Craft
> An Architect's View -- http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > > *From: *Brian Craft > *Sent: *Friday, January 25, 2019 3:36 PM > *Subject: *r/fold combinef and reducef

Re: r/fold combinef and reducef init values

2019-01-25 Thread Brian Craft
Looks like it's something that's changed over different clojure releases. On Friday, January 25, 2019 at 3:35:58 PM UTC-8, Brian Craft wrote: > > From the docs: > > r/fold takes a reducible collection and partitions it into groups of > approximately n (default 512

r/fold combinef and reducef init values

2019-01-25 Thread Brian Craft
>From the docs: r/fold takes a reducible collection and partitions it into groups of approximately n (default 512) elements. Each group is reduced using the reducef function. The reducef function will be called with no arguments to produce an identity value in each partition. The results of tho

transducer parallelism

2019-01-25 Thread Brian Craft
Are there any docs on transducer parallelism? I had the impression, from various sources, that they could operate in parallel, but in doing some benchmarks over a largish collection (counting character frequencies in 1.3M strings), transduce never uses more than one thread. Is this expected? If

undocumented one-argument call of reducer

2019-01-25 Thread Brian Craft
The transducers doc suggests transduce works with standard reducing functions, but then transduce makes a one-argument call to the function. The code docs for transduce say the reducing function must support a one-argument call, but don't give any information about what that call should do. It

removing trailing zeros in floating point formatting

2018-07-26 Thread Brian Craft
Probably more of a java question, but I'm finding that floating point formats with (format) are inflating data sizes enormously with meaningless trailing zeros, because the underlying java conversion methods don't work as they do on other platforms. E.g., in C printf("%.6g %.6g %.6g %.6g\n", 0.

Re: with-open pattern

2017-05-05 Thread Brian Craft
This looks like a partial solution: https://github.com/pjstadig/scopes perhaps inspired by this discussion: https://dev.clojure.org/display/design/Resource+Scopes On Friday, May 5, 2017 at 5:10:27 AM UTC-7, Herwig Hochleitner wrote: > > 2017-05-04 19:35 GMT+02:00 Brian Craft >:

Re: with-open pattern

2017-05-04 Thread Brian Craft
t not cover all of the scenarios you’re thinking of, though. > > On Thursday, May 4, 2017 at 1:35:48 PM UTC-4, Brian Craft wrote: >> >> The with-open style is used a lot in the jdbc lib, and elsewhere. It's >> pretty simple when data is very small, as you can just eval

with-open pattern

2017-05-04 Thread Brian Craft
The with-open style is used a lot in the jdbc lib, and elsewhere. It's pretty simple when data is very small, as you can just evaluate the entire result with doall, etc. How do you deal with larger data, where you need to evaluate iteratively? If there's only one with-open it can be reasonably

Re: escape characters to make a string literal

2017-03-30 Thread Brian Craft
March 30, 2017 at 2:13:23 AM UTC-7, Christophe Grand wrote: > > A funny thing is that octal or hexadecimal escapes are not part of EDN > (even if most readers recognize them). > > On Wed, Mar 29, 2017 at 8:49 PM, Brian Craft > wrote: > >> A funny hole in the meta-prog

Re: escape characters to make a string literal

2017-03-29 Thread Brian Craft
A funny hole in the meta-programming story. I don't think the String or Character classes have methods that do this. Also interesting, clojure's print methods will handle some escapes, but not others: cavm.core=> (println (pr-str "foo\tbar")) "foo\tbar" nil cavm.core=> (println (pr-str "foo\

escape characters to make a string literal

2017-03-29 Thread Brian Craft
Is there an easy way to display a string as a string literal that can be read by clojure? E.g. > (let [x "\001"] (what-goes-here x)) "\001" -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Re: instrument code only in dev, with lein

2017-03-23 Thread Brian Craft
So, this seems to work pretty easily, though I'm relying on 'require' resolving references in the same order as the directories in :source-paths. For :source-paths ["src-dev", "src"], it will find src-dev/foo/instrument.clj,instead of src/foo/instrument.clj, when both exist. I can't find anyth

instrument code only in dev, with lein

2017-03-17 Thread Brian Craft
How do you instrument code, e.g. apply ring wrap-reload, wrap-stacktrace-web, etc., only in dev, not in uberjar? -- 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 me

Re: structuring parallel code

2017-01-30 Thread Brian Craft
I think java locks may be the only good answer. I can't usefully divide the vector, because the distribution of updates is uniform along the length of it. Perhaps there's a solution with queues, with multiple threads generating potential placements, and a single thread updating the vector and

Re: structuring parallel code

2017-01-30 Thread Brian Craft
find Clojure’s reducers library > <https://clojure.org/reference/reducers> to be helpful. > > On Monday, January 30, 2017 at 9:38:01 PM UTC-5, Brian Craft wrote: >> >> ans: this scales badly. >> >> There must be a way in clojure to operate on large data struct

Re: structuring parallel code

2017-01-30 Thread Brian Craft
ans: this scales badly. There must be a way in clojure to operate on large data structures in parallel, no? On Monday, January 30, 2017 at 6:03:39 PM UTC-8, Brian Craft wrote: > > Would this not scale badly? When the vector is hundreds of thousands, or > millions? > > On Mon

Re: structuring parallel code

2017-01-30 Thread Brian Craft
dified at once > without stepping on other unrelated refs. > > On Mon, Jan 30, 2017 at 5:26 PM, Brian Craft > wrote: > >> I'm experimenting with ref, dosync, and alter to run some code in >> parallel, but so far haven't been able to figure out how to structu

structuring parallel code

2017-01-30 Thread Brian Craft
I'm experimenting with ref, dosync, and alter to run some code in parallel, but so far haven't been able to figure out how to structure it such that it runs faster, instead of slower. The problem looks something like this. The current state is a long vector. Input is a long sequence of values.

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
noying somebody, you're not really alive." > -- Margaret Atwood > > > > On 12/9/16, 3:00 PM, "Brian Craft" > on behalf of craft...@gmail.com > wrote: > > > > Trying to profile some code, and the stack traces look like > > > > c

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
t; *OmitStackTraceInFastThrow* > > On Friday, December 9, 2016 at 6:25:24 PM UTC-5, Brian Craft wrote: >> >> Yes, but not very practical: since I don't know which one to change, this >> would be a huge rewrite of code to eliminate #() and (fn []). >> >> >> On

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
PM UTC-8, Brian Craft wrote: > > Yes, but not very practical: since I don't know which one to change, this > would be a huge rewrite of code to eliminate #() and (fn []). > > > On Friday, December 9, 2016 at 3:16:06 PM UTC-8, Alex Engelberg wrote: >> >> If yo

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
fn-with-a-name [] (/ 1 0)) > > ArithmeticException Divide by zero clojure.lang.Numbers.divide > (Numbers.java:158) > user=> (pst) > ArithmeticException Divide by zero > clojure.lang.Numbers.divide (Numbers.java:158) > clojure.lang.Numbers.divide (Numbers.java:3808) > user/eval20857/m

finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
Trying to profile some code, and the stack traces look like clojure.something0 clojure.something1 clojure.something2 clojure.something100 foo$fn_1000$fn_1002$fn_10003.invoke() How can I figure out what that last function is? I can access the symbol from the repl, b

'lein trampoline test' fails on first run with 'No implementation of method'

2016-08-14 Thread Brian Craft
With an empty target directory 'lein trampoline test' fails with a protocol exception, 'No implementation of method'. Running 'lein test' works fine. After running 'lein test', 'lein trampoline test' also works. Anyone know what's going on? Seems like something isn't being compiled, or loaded,

Re: separation of concerns w/o encapsulation

2015-05-13 Thread Brian Craft
va.net > classes. So, I wonder myself which are the limits of reusability in > component pattern. > > > > > > > > > El viernes, 8 de mayo de 2015, 18:29:50 (UTC+2), Brian Craft escribió: >> >> Talk on the list about encapsulation usually comes back to

Re: separation of concerns w/o encapsulation

2015-05-12 Thread Brian Craft
On Tuesday, May 12, 2015 at 4:29:22 AM UTC-7, Georgi Danov wrote: > > coding and designing defensively because you are concerned about your > teammates is big waste of time. if this is the reality (in the enterprise > it's the norm) > Yes, it is the norm in the enterprise. In a decade of ente

Re: separation of concerns w/o encapsulation

2015-05-11 Thread Brian Craft
use public/private Vars to > enforce which aspects of a data structure are meant to be “public” to other > modules. > > –S > > [1]: https://github.com/stuartsierra/component > > On Friday, May 8, 2015 at 5:29:50 PM UTC+1, Brian Craft wrote: >> >> Talk

separation of concerns w/o encapsulation

2015-05-08 Thread Brian Craft
Talk on the list about encapsulation usually comes back to some variation of "you don't need it when you have immutable data structures". But in the long term I'm finding the problem of working w/o encapsulation is not the danger of data being mutated under you. Rather, it's the danger of all th

guides for porting clojure to clojurescript

2015-04-23 Thread Brian Craft
Has anyone written a guide, or best-practices doc for converting clojure libs to clojurescript? I'm thinking of things like "what to do with java methods calls?" Write shim objects? Convert all the method calls to protocols? I expect this has been done many times, especially for common needs, l

case-insensitive data structures, contrib fnmap

2015-03-18 Thread Brian Craft
I found an earlier thread about case-insensitive maps, which pointed to a contrib lib, fnmap. It doesn't appear to have survived. Is there another lib that does this, or a better way of doing case-insensitive data structs? -- You received this message because you are subscribed to the Google G

Re: vectorz, "Unable to find implementation", uberjar, excluding source

2015-01-21 Thread Brian Craft
Fixed it by adding :aot [mikera.vectorz.core] to the uberjar profile. On Wednesday, January 21, 2015 at 11:26:47 AM UTC-8, Brian Craft wrote: > > I'm excluding source when building uberjar, due to jar size and class > loader problems at run time. However I now get &

vectorz, "Unable to find implementation", uberjar, excluding source

2015-01-21 Thread Brian Craft
I'm excluding source when building uberjar, due to jar size and class loader problems at run time. However I now get "Unable to find implementation :vectorz" errors at run time. Is there some way to work around this? -- You received this message because you are subscribed to the Google Groups

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-10 Thread Brian Craft
e namespace in memory from the .clj file. > Does the above make sense ? > > Laurent > > Le mercredi 10 décembre 2014, Brian Craft > a écrit : > >> This exception is related to the pack200 -m option, which alters class >> file timestamps. >> >>

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-09 Thread Brian Craft
This exception is related to the pack200 -m option, which alters class file timestamps. Do clojure class loaders depend on class file timestamps? On Monday, December 8, 2014 9:15:57 AM UTC-8, Brian Craft wrote: > > Assuming this is something to do with class loaders going wrong, how woul

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-08 Thread Brian Craft
on a function argument that is a record. On Sunday, December 7, 2014 11:46:01 AM UTC-8, Brian Craft wrote: > > Not sure if I followed the non-interactive case. Is it just > 1) deftype or defrecord in one file > 2) import the class in a different file > 3) AOT compile (e.g. u

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-07 Thread Brian Craft
> http://dev.clojure.org/jira/browse/CLJ-979 > > Thanks, > Ambrose > > On Sat, Dec 6, 2014 at 5:22 PM, Brian Craft > wrote: > >> Yes, I know. ;) In this case it's happening with an uberjar, not with the >> repl. I do "java -jar myapp.jar", and later

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Brian Craft
: > https://groups.google.com/forum/#!msg/clojure/N2ivUM8bvB8/xgiFVtsXKnkJ > > Cheers, > > Juan > > On Saturday, December 6, 2014 5:55:23 PM UTC-3, Brian Craft wrote: >> >> I'm experimenting with jwrapper, and am getting runtime exceptions like >> this

Re: perform action after events stop for some period

2014-12-06 Thread Brian Craft
rgs) (f args))) > (recur :wait nil)) > > c)) > > Signalling the go block to terminate when the event source is no longer > available is missing, but that simple enough to implement. Maybe this is > something you can use as a starter point. > > Ho

debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Brian Craft
I'm experimenting with jwrapper, and am getting runtime exceptions like this, due to some jar manipulation that it's doing. I know one of the steps is pack200, however running pack200 manually doesn't create these issues. Anyone have suggestions for debugging this? I've seen this type of error

pack200 unknown attributes

2014-12-03 Thread Brian Craft
Experimenting with pack200, I get very many warnings like so: Dec 04, 2014 5:11:31 AM com.sun.java.util.jar.pack.Utils$Pack200Logger warning WARNING: Passing class file uncompressed due to unrecognized attribute: clojure/core$long.class Without having any real understanding of what it's doing,

Re: perform action after events stop for some period

2014-12-02 Thread Brian Craft
Cool. I haven't used core.async before, and am a bit reluctant to pull in another dependency just for this. But maybe it's the right solution. On Tuesday, December 2, 2014 10:03:54 AM UTC-8, Erik Price wrote: > > > > On Tue, Dec 2, 2014 at 12:22 PM, Brian Craft > wr

Re: perform action after events stop for some period

2014-12-02 Thread Brian Craft
ts counting down again): >> >> (defn invoke-after-uninterrupted-delay >> ([period events-ch f] >> (invoke-after-uninterrupted-delay period events-ch f [])) >> ([period events-ch f & args] >> (async/go-loop [] >> (let [[_ p] (async/

Re: perform action after events stop for some period

2014-12-01 Thread Brian Craft
2000) (println "ending" Oddly, if calling (event) between "running" and "ending" messages, the repl will stack-overflow on the return value. No idea what that's about. But, running like this is fine: (do (event) nil) On Monday, December 1, 2014 1:37:

perform action after events stop for some period

2014-12-01 Thread Brian Craft
I have need to perform an action when a series of events is quiet for some period. That is, if one event arrives an action is queued to execute after some timeout. If a second event arrives the timeout is reset, and so-forth. The following code seems to work, however I'm wondering if calling 'fu

ring jetty adaptor: any way to abort on unrecoverable error?

2014-11-26 Thread Brian Craft
If jetty fails to bind a port because it's in use an exception is thrown, but the app keeps running. A bunch of jetty threads are created in spite of having no port to listen on, and they burn cpu. How can I have it exit on unrecoverable errors? -- You received this message because you are su

Re: map function generator

2014-11-18 Thread Brian Craft
juxt? user=> (map (juxt zero? even?) (range 5)) ([true true] [false false] [false true] [false false] [false true]) user=> (map (apply juxt [zero? even?]) (range 5)) ([true true] [false false] [false true] [false false] [false true]) On Monday, November 17, 2014 8:25:07 PM UTC-8, Andy L wrote:

seque examples

2014-11-18 Thread Brian Craft
Anyone have examples of when & how to use seque? -- 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 with your first post. To

Re: test.check slow shrinking

2014-11-12 Thread Brian Craft
ple gen/s-pos-int gen/s-pos-int)) (def gen-mostly-ints (gen/frequency [[9 gen/int] [1 (gen/return Double/NaN)]])) (defn gen-matrix2 [x y] (gen/vector (gen/vector gen-mostly-ints x) y)) (defn gen-names [n] (gen/vector (gen/such-that not-empty gen/string-alpha-numeric) n)) (def gen

Re: test.check slow shrinking

2014-11-12 Thread Brian Craft
ever, this is all guess work and conjecture, as I don't understand the > shrinking algorithm well enough, and I haven't tried my suggestion. Also, > modifying your generators in this way may make your model less general if > you wish to use it in other ways later. > > Chee

test.check slow shrinking

2014-11-11 Thread Brian Craft
Using test.check, I'm finding the shrinking to be very, very slow. Running a hundred cases takes a few seconds, unless it hits an error, in which case it takes 40-60 minutes to shrink, and the shrinking is not very effective (resulting test case is much larger than necessary). Sometimes the shr

Re: io/writer + map/recur

2014-10-31 Thread Brian Craft
Your first implementation probably failed because map is lazy, so none of the '.write' calls happened during the with-open block. Try doseq. On Friday, October 31, 2014 1:08:01 PM UTC-7, Sam Raker wrote: > > I'm writing some stuff to interact with the Twitter API. I want to be able > to write

Re: extending custom data types to clojure core abstractions

2014-10-31 Thread Brian Craft
Nice, thanks! On Friday, October 31, 2014 9:59:26 AM UTC-7, Daniel wrote: > > Brian, this may help: https://github.com/ztellman/collection-check > > On Tuesday, October 28, 2014 2:24:48 PM UTC-5, Brian Craft wrote: >> >> Following up on the thread about the massive ove

memory leak, vector vs list vs chunking

2014-10-30 Thread Brian Craft
I have a vector of values which compute large result sets, similar to a vector of lazy seqs. It's a vector because it has to be sorted before the values are evaluated, in order. When evaluating each value in order of the vector, it's important that they are garbage collected, because two won't

Re: extending custom data types to clojure core abstractions

2014-10-28 Thread Brian Craft
his code itself may have some answers to your questions about how to > make new data structures satisfy some Clojure abstractions. > > Andy > > On Tue, Oct 28, 2014 at 3:57 PM, Brian Craft > wrote: > >> Hm, I just tested it with a 160M file, split into 2 million st

Re: extending custom data types to clojure core abstractions

2014-10-28 Thread Brian Craft
to 1 byte of > memory per character, only using 2, 3, or 4 bytes for other Unicode > characters, depending on the code point. > > https://github.com/pjstadig/utf8 > > Andy > > On Tue, Oct 28, 2014 at 12:24 PM, Brian Craft > wrote: > >> Following up on the thread

extending custom data types to clojure core abstractions

2014-10-28 Thread Brian Craft
Following up on the thread about the massive overhead of String, I tried writing a string collection type that stores strings as bytes, converting to String on-demand. It seems to work. Memory footprint and performance are good for the application. The hard part was trying to track down the cor

Re: processing large text files

2014-10-26 Thread Brian Craft
On Sunday, October 26, 2014 6:51:18 PM UTC-7, TheBusby wrote: > > On Mon, Oct 27, 2014 at 7:10 AM, Brian Craft > wrote: > >> I found iota, which looks like a good solution for the read portion of >> the problem. However I also need to process the data in the file. If

processing large text files

2014-10-26 Thread Brian Craft
The java overhead for Strings is incredible. Even moderate-sized input files will consume all memory. Are there good existing solutions? I found iota, which looks like a good solution for the read portion of the problem. However I also need to process the data in the file. If I start with an io

Re: Interop nightmare

2014-09-08 Thread Brian Craft
On Monday, September 8, 2014 11:09:50 AM UTC-7, Sean Corfield wrote: > > > I find that it is quite difficult to use clojure unless one knows Java, > which I believe to be a barrier to new comers. > > I'm surprised every time I hear this. You can write a lot of Clojure > without having to do an

om tutorial, java.lang.UnsupportedClassVersionError

2014-08-27 Thread Brian Craft
The basic tutorial fails on cljsbuild, with Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CompilerOptions : Unsupported major.minor version 51.0, compiling:(cljs/closure.clj:1:1) I gather this is some java version issue. Is there a workaround?

Re: running a jar-based cli tool

2014-08-14 Thread Brian Craft
On Wednesday, August 13, 2014 11:30:59 PM UTC-7, Shantanu Kumar wrote: > > > > On Thursday, 14 August 2014 03:25:48 UTC+5:30, Brian Craft wrote: >> >> Thanks! This works perfectly. >> >> It took a few tries to find the right incantation, but this se

Re: running a jar-based cli tool

2014-08-13 Thread Brian Craft
ool. On Wednesday, August 13, 2014 2:04:04 PM UTC-7, Shantanu Kumar wrote: > > > > On Thursday, 14 August 2014 02:23:50 UTC+5:30, Brian Craft wrote: >> >> I need to run a tool while building docs which is distributed as a jar >> file, and is run with "java -

running a jar-based cli tool

2014-08-13 Thread Brian Craft
I need to run a tool while building docs which is distributed as a jar file, and is run with "java -jar". Not sure the best way to do this. lein can fetch the jar if I add it to dev dependencies, but then it's in some directory in ~/.m2. Is there some simple way to get the path so I can pass it

vim & java

2014-08-13 Thread Brian Craft
fireplace is working pretty well for me when working with clojure files, but I often find I need to delve into the java to see what's going on. Is there any way to set this up so it's more seamless? I'd like to be able to jump to java source the same way I can jump to clojure source. -- You re

Re: handling agent errors

2014-08-12 Thread Brian Craft
On Tuesday, August 12, 2014 9:59:54 AM UTC-7, Brian Craft wrote: > > > > On Monday, August 11, 2014 10:08:09 PM UTC-7, Jeremy Heiler wrote: >> >> On Mon, Aug 11, 2014 at 3:07 PM, Brian Craft wrote: >> >>> Two questions, really. I'm running large batc

Re: handling agent errors

2014-08-12 Thread Brian Craft
On Monday, August 11, 2014 10:08:09 PM UTC-7, Jeremy Heiler wrote: > > On Mon, Aug 11, 2014 at 3:07 PM, Brian Craft > wrote: > >> Two questions, really. I'm running large batch jobs with an agent. The >> jobs may fail in any number of unanticipated ways (due to u

workflow with aot compiling

2014-08-11 Thread Brian Craft
A number of clojure tools, like tools.namespaces, and codox, don't work with aot compiling, and their docs say to turn it off. However aot compiling isn't really optional: we're embracing the platform, and java libs like their named classes. How do you work around this? I can move aot compiling

handling agent errors

2014-08-11 Thread Brian Craft
Two questions, really. I'm running large batch jobs with an agent. The jobs may fail in any number of unanticipated ways (due to user input), so I do a try/catch in the agent, log any errors, and continue with the next job. First question: how to deal with OOM (the Xmx limit, not the OS out of

Re: setting c3p0 logging

2014-08-09 Thread Brian Craft
14 10:11:17 PM UTC-7, Brian Craft wrote: > > I'm trying to get c3p0 to log to slf4j. Anyone have this working? I'm > dropping a c3p0.properties file in the "resources" directory, but it's not > having any effect. I can't tell if the file is being found. I

setting c3p0 logging

2014-08-08 Thread Brian Craft
I'm trying to get c3p0 to log to slf4j. Anyone have this working? I'm dropping a c3p0.properties file in the "resources" directory, but it's not having any effect. I can't tell if the file is being found. Is there a good way to debug this? -- You received this message because you are subscribe

docs with sphinx rst

2014-08-03 Thread Brian Craft
I need to integrate with a project which uses sphinx to generate documentation. Are there any solutions for documenting clojure apps with sphinx? I found lein-sphinx, which allows running a sphinx build from lein, but doesn't include a clojure domain for sphinx. Any sphinx users here? Maybe ada

honeysql tagged literal problem

2014-08-01 Thread Brian Craft
Trying to do a #sql/call with honeysql, like [#sql/call [:unpackValue probe-field :row]] where probe-field is a local variable, it builds a SqlCall object with symbol probe-field, instead of using the value in the probe-field variable. I guess, then, that tagged literal handlers are passed symb

Re: timbre logging, java libs

2014-07-30 Thread Brian Craft
Very useful, thanks! I was considering just dropping timbre, or extracting the profiling macros. The main things I use from timbre are the profiling macros. I found Stuart's post about the original contrib profiling macros being a half-baked idea, but I'm unaware of a usable alternative. GUIs l

timbre logging, java libs

2014-07-22 Thread Brian Craft
Is there any good way to use timbre in a project with java libs, e.g. c3p0, that use java logging APIs? Java logging is such a hopeless muddle I don't pretend to understand it, but my impression is that libs like c3p0 use assorted backends (log4j, etc.), which in turn use assorted "appenders" to

Re: unexpected behavior of clojure.core/empty

2014-07-18 Thread Brian Craft
hm, looks even more broken in the context of these examples. On Friday, July 18, 2014 5:04:34 AM UTC-7, Mike Fikes wrote: > > My guess: Perhaps this is a bug, or alternatively, a known issue that > won't be addressed because to do so would be a breaking change. > > There is an old demo of Clojure

unexpected behavior of clojure.core/empty

2014-07-18 Thread Brian Craft
=> (empty [:foo 5]) [] => (first (mapv identity {:foo 5})) [:foo 5] => (empty (first (mapv identity {:foo 5}))) nil What just happened there? Is this expected? In the second and third cases the type of the vector is clojure.lang.MapEntry, which I expect is the root of the behavior, but this seem

Re: casting error

2014-07-16 Thread Brian Craft
PM UTC-7, Brian Craft wrote: > > That does, in fact, fix the compile issue. Thanks! > > The cast error, however, persists. It's something to do with reloading the > namespace with the defrecord. Once it happens, it takes a "lein clean" to > clear. After that it wo

Re: casting error

2014-07-16 Thread Brian Craft
browse/CLJ-1232 > > Andy > > > On Wed, Jul 16, 2014 at 7:18 PM, Brian Craft > wrote: > >> Apparently this is due to a class loader problem. >> >> I moved it into a different file to try to avoid the problem. However I'm >> now

Re: casting error

2014-07-16 Thread Brian Craft
ement No idea what to do with this. Is it not possible to type hint methods returning records? On Wednesday, July 16, 2014 4:21:22 PM UTC-7, Brian Craft wrote: > > Trying to eliminate a reflection warning, I put a type hint on a function, > like > > (defn foo ^PStatement [] ...

casting error

2014-07-16 Thread Brian Craft
Trying to eliminate a reflection warning, I put a type hint on a function, like (defn foo ^PStatement [] ...) which compiles without the reflection warnings, but at run time I get ClassCastException java.lang.ClassCastException: cavm.h2.PStatement cannot be cast to cavm.h2.PStatement What doe

Re: working intellij plugin?

2014-07-14 Thread Brian Craft
ing able to load them is just a > bug, I'll try to fix that for the next build. > > > On 14 July 2014 17:15, Brian Craft > > wrote: > >> Cool, got it working. >> >> Is there a way to edit and evaluate a buffer loaded from a jar? Currently >> it has

Re: working intellij plugin?

2014-07-14 Thread Brian Craft
ningen plugin are effectively > discontinued in favour of Cursive. There's full instructions on how to get > started here: https://cursiveclojure.com/userguide. Let me know if you > have any more questions. > > Cheers, > Colin > > > On 14 July 2014 03:35, Brian Craf

working intellij plugin?

2014-07-13 Thread Brian Craft
In need of a way to breakpoint in java code, I decided to look at intellij. I tried the directions here: http://wiki.jetbrains.net/intellij/Getting_started_with_La_Clojure which don't work. When trying to open a project, it throws: java.lang.NoSuchMethodError: com.intellij.openapi.module.Modif

syntax tree manipulation

2014-07-03 Thread Brian Craft
What clojure tools should I be considering for doing syntax tree manipulations? In general, I'm recursively matching patterns in subtrees and rewriting them. The patterns are usually more complex than, say, core.match patterns (e.g. match subtree having vector that contains term, and split the

Re: stderr with repl development

2014-05-21 Thread Brian Craft
uture invokes the binding conveyor, which sets *err* to the vim channel. Where does Thread get its *err*? > > > On Wed, May 21, 2014 at 4:41 PM, Brian Craft > > wrote: > >> A small clue, gleaned from a cider issue: >> >> This outputs to the repl terminal. >&

Re: stderr with repl development

2014-05-21 Thread Brian Craft
A small clue, gleaned from a cider issue: This outputs to the repl terminal. (future (.start (Thread. #(println "blah2" This output is captured by vim. (future (println "blah3")) Still no idea what's going on. On Wednesday, May 21, 2014 1:09:31 PM UTC-7, Brian C

stderr with repl development

2014-05-21 Thread Brian Craft
Still not able to track down stderr. Anyone know how this stuff works? Dumping *err* from a ring handler, running from jetty, I get this: java.io.PrintWriter@1d9e436a. This will write to the repl terminal, so long as I flush (wtf... stderr is buffered?). If I dump *err* from a future, I get th

debug output with ring and fireplace

2014-05-20 Thread Brian Craft
Running a ring server from vim-fireplace, any errors that occur during request processing will dump to the repl terminal, which is fine. I'd like to add debug output and have it also dump to the repl. However printing to stdout or stderr from a ring handler doesn't work. How can I output to the

passing commands to a running server

2014-05-19 Thread Brian Craft
I'm sure I've seen a thread on this, but can't find it now. Is there a common pattern for sending management commands to a running server via cli? E.g. if "foo" starts my ring server, I need something like "foo -x twiddle" to send "twiddle" to the running process. -- You received this message

Re: doall example

2014-05-16 Thread Brian Craft
ll items in the seq, effectively removing any lazy > evaluation. In this case it's necessary because the filter is checking the > modification date of the file, which is obviously mutable. > > - James > > > > On 17 May 2014 00:39, Brian Craft >wrote: > >>

doall example

2014-05-16 Thread Brian Craft
I came across this today in a library: results (seq (doall (filter modified? files)))] I believe the seq is to coerce the empty list to nil. What is the doall for? Context here: https://github.com/ibdknox/watchtower/blob/master/src/watchtower/core.clj -- You received this message because you

  1   2   3   4   >