Fork me on GitHub
#clojure
<
2016-11-05
>
markx00:11:05

Can anyone teach me how to create a wrapped buffer with int32_type, and a frame-type, using clojurewerkz/buffy?

rmoehn00:11:55

@tmarble You might have a little more luck in #slack-help. At least there are admins who can invite people.

Pablo Fernandez01:11:11

Argh… buddy-core and clj-crypto depend on different apparently incompatible versions of bouncy castle.

Pablo Fernandez01:11:46

Any ideas how to deal with this?

richiardiandrea01:11:01

@pupeno you can (I think) explicitely set the desired bouncy castle dependency in either lein or boot, the problem is, which one is going to work? This is the hardest problem to solve I guess. ^ cool that you PR-ed 😉

Pablo Fernandez01:11:34

1.55 seems to work with clj-crypto.

Pablo Fernandez01:11:49

Ah… requesting it in my project.clj actually helps. Thanks.

richiardiandrea01:11:46

yes it is actually resolved by the maven machinery behind lein or boot, everything at top level takes precedence over transitive deps 😉

seantempesta10:11:05

Does anyone have a good defn macro for debugging? I keep finding myself writing debug statements at the beginning of the function printing out the variables that are passed in and the results of the first let block. Or is this something that clojure.spec can fix? Oh yeah, and it needs to be clojurescript compatible (hence why I’m not just using a debugger).

lmergen10:11:32

@seantempesta: i think Timbre might do what you want

seantempesta10:11:38

@lmergen: How so? I’m actually using Timbre for logging, but I’m having to manually put debug statements in every function.

lmergen10:11:34

hmm you are correct, i was confused by the 'spy' macro -- thats pretty much the opposite of what you want

lmergen10:11:01

it seems to me that this defn debug macro should exist, though

amacdougall14:11:49

Given a sequence [a b c d e], say I want to get everything up to and including d. take-while excludes the element which matches the predicate, which is fine, but is there a simple way to do the inclusive version? Everything that comes to mind seems needlessly complex.

amacdougall14:11:18

I mean, I guess I could (conj (take-while (partial not= d) coll) d). But that feels like I'm repairing a collection I should have been able to create in one pass.

tianshu14:11:47

Hi, I want to write a tons of items to file for later usage, each item is a map. is it possible to use EDN format. I mean, I think an edn can only contains one data struct, for example, a map. but I want something like:

{:a 1 :b 2}
{:a 2 :b 3}
{:a 3 :b 4}
...

amacdougall15:11:21

@doglooksgood You can always just put your items in a vector! [{:a 1 :b 2} ...].

tianshu15:11:31

@amacdougall I vector may be huge and i want async write. I've copy the function from cookbook. Thanks for your help anyway.

amacdougall15:11:39

Oh, that makes sense then. If you're working with very large files, you don't want to put the whole data structure in memory.

amacdougall15:11:18

As for my take-while problem, above, I settled on a local helper for my exact situation:

(defn rewind-to [pred coll]
  (if (or (empty? coll) (pred (peek coll)))
    coll
    (rewind-to pred (pop coll))))

amacdougall15:11:48

(rewind-to #{5} (vec (range 10))) returns [0 1 2 3 4 5], which is enough for my purposes.

tianshu16:11:02

This function is used for processing large lazy seq?

ericnormand16:11:45

what are people converging on for time manipulation now?

ericnormand16:11:58

since java 8 has it's own time, that is

gfredericks16:11:56

@ericnormand I once asked sean corfield about making clj-time support the new java classes and he said "yeah maybe sure" and so neither of us did anything about it afaik

dominicm17:11:40

There's a library to wrap java time.

markx19:11:23

Can anyone tell me how to combine primitive types and dynamic frames, when using https://github.com/clojurewerkz/buffy