Fork me on GitHub
#clojure
<
2016-11-14
>
sophiago02:11:32

not sure what answer i'll get at this hour, but did something change in the 1.9 alpha that would break :refer-macros? i have [om.next :as om :refer-macros [defui ui]] and am getting a compile error: "Only :as, :refer and :rename options supported in :require"

sophiago03:11:35

you just use refer?

sophiago03:11:17

om.next is mostly all macros hence the question

sophiago03:11:25

but i'll give it a shot, thanks for the link

iku00088803:11:36

NP! That was what I inferred. Have not tested myself cuz am still with 1.8x at work.

sophiago03:11:46

(when you type term messages into slack because you're coding while traveling 🙃)

sophiago03:11:46

ah...now having trouble getting spec to compile for cljs 😛

pseud08:11:27

I’m having trouble finding the documentation for #? and while on the topic, is there no nicer way to require libraries where, depending on the arch, I may need :refer/:refer-macros ?

iku00088809:11:52

@pseud Have you checked this one? I did find it quite comprehensive

pseud09:11:33

@iku000888 much appreciated 🙂

chrisblom11:11:05

what is a good error tracking service for clojure?

chrisblom11:11:09

i've used Yeller in the past, which was fine, but they are shutting down soon

pesterhazy11:11:20

I like simply logging to papertrail

borkdude12:11:37

is there an easy way to get baz from a symbol ‘foo.bar.baz without converting to a string?

gfredericks12:11:55

I don't think so.

hans12:11:12

if you want 'baz (the symbol), then no. if you want "baz" (the string), then a substring of the name of 'foo.bar.baz might not be what you call a "conversion".

hans12:11:06

i.e. (subs (name 'foo.bar.baz) 8) => "baz"

gfredericks12:11:12

@borkdude depending on what you're worried about, it might not matter: the string "foo.bar.baz" already exists, calling name doesn't involve any work

gfredericks12:11:19

but substringing does of course

borkdude12:11:13

@gfredericks In this case I’m not worried, just lazy

borkdude12:11:38

thanks 🙂

borkdude12:11:24

How am I supposed to call java.nio.file.Paths/get with two Strings?

borkdude12:11:48

The signature is:

public static Path get(String first,
                       String... more)

mpenet12:11:58

(.get something "foo" (to-array ["bar" "baz]))

mpenet12:11:16

variadic => array

chrisblom12:11:16

get is static, so you'd need (Path/get ...)

chrisblom12:11:33

i'd use (Path/get "string-1" (into-array String ["string-2"]))

borkdude12:11:35

boot.user=> (Paths/get "foo" (to-array ["bar"]))

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;

borkdude13:11:01

@chrisblom that works, thanks

roelofw13:11:11

Someone a example of a parallel download with core.async

dpsutton13:11:44

there's a simulated async upload here http://www.braveclojure.com/core-async/ in the alts section. perhaps that's enough to get you going

Mikko Harju14:11:24

Hey all. Is anyone using the component system? I'm just wondering what's the current best practice to restart system in production setting. I'm having the ZooKeeper close the connection due to inactivity, and I'd need to do a reconnect. I'd also could do wrap the connection in an atom and swap! the new one in there.

roelofw14:11:32

@dpsutton thanks for the tutorial

roelofw14:11:48

I will read it and experiment with it

pesterhazy14:11:11

@mikko, can't you make the zookeeper driver reconnect automatically if the cx is lost?

pesterhazy14:11:21

that seems like something the driver should abstract away

pesterhazy14:11:25

like a connection pool

Mikko Harju14:11:37

@pesterhazy I'm using https://github.com/liebke/zookeeper-clj which does not support that as I know

Mikko Harju14:11:52

So I was thinking that it should be a decent idea if I could just restart the whole system when that happens 🙂

Mikko Harju14:11:14

But then again, adding a watcher and embedding the connection into an atom is also a viable solution in my book.

pesterhazy14:11:47

I wouldn't restart the entire system

Mikko Harju14:11:50

It seems like an overkill, yes, definitely. It's just that the system is built in a way that should not present any problems, I do it all the time on development.

pesterhazy14:11:04

the other suggestion seems better: (defn get-connection [cmp] (if (is-active? cmp) @(:connection cmp) (do (re-connect cmp) @(:connection cmp))

pesterhazy14:11:32

something like that to paper over the fact that connection may be lost on the way

Mikko Harju14:11:49

Sounds good. Maybe I'll go along those lines. Thanks @pesterhazy!

mpenet16:11:19

Netflix curator comes to mind for this stuff

mpenet16:11:34

(and more)

fabrao18:11:40

hello, anyone worked with clj-ssh?

jjfine18:11:02

@fabrao i've used it for sftp

hans18:11:30

we're using it for sftp as well

fabrao18:11:09

humm, I want to know one thing about ssh shell