Fork me on GitHub
#clojure
<
2016-01-18
>
richiardiandrea01:01:22

how to people go about usergrid and clojure? Is there any wrapper?

kenrestivo01:01:58

what is a usergrid?

richiardiandrea01:01:07

it is a Baas, it helps building apps without thinking too much about infrastructure

kenrestivo01:01:38

i dunno, never used it, but if it uses oauth2 then that's pretty easy to do in clojure

mheld01:01:12

anybody successfully use bidi + liberator together?

mheld01:01:48

I’m trying to use those in a single page app context and I seem to be missing something with respect to how the handlers are being put together

mheld01:01:32

it seems like the /api/auth/loggedin-user path gets completely swallowed

mheld01:01:04

is there a way to see what routes are acceptable to compojure/ring (a la 'rake routes’ in rails land)?

mheld02:01:07

also does 'lein repl’ use some sort of standard :source-paths value?

mheld02:01:28

I have a common cljc folder that I can’t seem to see in the repl

clojuregeek02:01:10

@mheld: in this project https://github.com/electric-it/tosca-lens/blob/master/project.clj#L15 ... i have files in dev that i want to be able to use in the project (and repl) in :source-paths

mheld02:01:29

@clojuregeek: I have :source-paths ["src/clj" "src/cljc”] in my project.clj — shouldn’t that do the same thing?

mheld02:01:47

well, not the same thing, but open up the path for the repl to find stuff

clojuregeek02:01:10

yes i would think so...

mheld02:01:26

just makes it a billion times harder to debug 😉

clojuregeek02:01:06

where is the :source-paths at? is in a profile or first level?

mheld02:01:21

it’s first level

clojuregeek02:01:12

if it is just "src" does it work?

bbloom02:01:21

OK, I think https://github.com/brandonbloom/metaclj can now safely be called Alpha. As before, feedback welcome simple_smile

mheld02:01:29

@clojuregeek: I dunno if I wanna be putting clojurescript on my path but I’ll futz with it!

jarodzz03:01:18

guys. quick question.

jarodzz03:01:50

i tried (thread (while true (go))). it kinds of run out of heap size. and exited. what if i do (go-loop [] (go)).

jarodzz03:01:47

would go blocks manage themselves to stay out of running out of memory?

nowprovision03:01:08

(Thread. (fn [] (while true (go)))) memory stays constant, suggesting garabage collection is keeping pace

jarodzz03:01:52

so i should change my GC strategy in JVM?

nowprovision03:01:16

err... probably not, what are you trying to do? also I presume by thread you meant (Thread. (fn [] ..

jarodzz03:01:00

i am trying to dump some data from A to B. in the middle, i need to call an external web service to enrich something.

nowprovision03:01:34

The code you wrote is just creating endless coroutines

jarodzz03:01:29

so it is like i ready 1k records from A, (doseq [n records] (go (let [] (enrich)(write db)))). outside, it's a while true (read 1k from A)

jarodzz03:01:58

i left it there friday, today the results is like heap error. and exit in the middle

jarodzz03:01:32

so i am changing it to (go (while true (read 1k (doseq [r records] (go ... ))

nowprovision03:01:01

(go-loop [] (let [v < ch] // do work) (recur))

jarodzz03:01:13

y. something like that.

nowprovision03:01:00

put the output of a onto a channel

jarodzz03:01:03

got it. let me try it

jarodzz03:01:06

thanks, man

nowprovision03:01:19

also you don't need to launch a thread

jarodzz03:01:39

that i figured. a thread doesn't manage by go block thread pool

jarodzz03:01:57

therefore dangerous to heap size. 'oz it doesn't stop

jimmy07:01:07

has anyone use elastisch before ?

jarodzz07:01:12

i am using it. as a temp db though

jarodzz07:01:30

@nxqd. not much detail if you want to know cluster or sharding details though

jimmy07:01:45

i got an error because it cannot get the nodes info. I have setup ES_CLUSTER_NAME

jimmy07:01:49

but still no luck

jimmy07:01:15

curl gives error. I use the lastest version of that plugin 2.2.1 and latest elasticsearch as well

jarodzz07:01:42

i only have 1 machine running it. no clue on cluster issue. sorry

jimmy07:01:08

hmm, so I just use it as it is ?

jimmy07:01:49

@jarodzz: in the quickstart session, it does inform that we need to specify the ES_CLUSTER_NAME ? https://github.com/clojurewerkz/elastisch

jarodzz07:01:07

Elastisch needs ElasticSearch running locally (127.0.0.1). ES_CLUSTER_NAME need to be exported with the name of the local cluster. To find it out, use

jarodzz07:01:57

i don't think this is a good client with that kind of limitation. if i am getting it right

jarodzz07:01:17

i am writing http url call directly following elastic search curl GUIDE

jimmy07:01:37

do you get any error from that curl ? or it works ?

jarodzz07:01:56

it works for me on 1 machine

jimmy07:01:00

I got this error

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No feature for name [nodes]"}],"type":"illegal_argument_exception","reason":"No feature for name [nodes]"},"status":400} 

jarodzz07:01:15

from curl?

jimmy07:01:16

I only have one machine as well ( local dev )

jarodzz07:01:07

Elastisch 2.1 and 2.2 target ElasticSearch 1.x starting with 1.1 and through 1.7.x. Elastisch does not currently support ElasticSearch 2.x. It will be our focus after the (Elastisch) 2.2 release.

jarodzz07:01:13

could it be the version issue?

jarodzz07:01:21

which version of es you are using

jimmy07:01:30

ah ok I think it's the problem

jarodzz07:01:35

it looks like 2.x to me.

jimmy07:01:36

I use the latest elasticsearch which is 2.x

jimmy07:01:41

yeah, it's true

jimmy07:01:51

I think I need to revert it to older version then

jarodzz07:01:51

then you should skip this lib for now

jarodzz07:01:19

if it's simply use case, i suggest you use http-kit to similute curl. it's simple and straight forward

jarodzz07:01:01

you get async http at least

borkdude12:01:48

is this a feature of leiningen or just of command line tools in general? http://twitter.com/piyushpsycho/status/689017202289164288

borkdude12:01:03

reverse-i-search that is

jaen12:01:58

I think that's a shell feature.

borkdude12:01:16

I thought so too

borkdude12:01:21

but it never occurred to me I could use it in a repl simple_smile

jaen12:01:49

I think you'd have to rlwrap the REPL for it to work.

agile_geek13:01:23

@borkdude: I think u just need clojure.repl namespace

agile_geek13:01:39

Oh wait I see what u mean - forget that

tord13:01:30

It's a readline feature, I think

shanekilkelly14:01:04

@tord: yup. you only need to use rlwrap if the program doesn’t already support readline. I’m pretty sure lein repl does readline stuff correctly by default

juhoteperi14:01:27

Lein uses REPL-y (https://github.com/trptcolin/reply) which uses JLine (https://github.com/jline/jline2) to provide readline support

sveri15:01:25

I have been using tools.namespace successfully to reload changed code in the repl. Now I tried to execute refresh during "runtime" but it fails with an illegalstateexception. Is that even possible? How would I do that? Can I access the repl somehow programmatically maybe?

mheld22:01:15

so, uh, are .cljc files not allowed to have hyphens in their name?

mheld22:01:23

api-routes.cljc didn’t work, but routes.cljc did

mheld22:01:09

oh you know what, I bet it looks for api_routes.cljc

kenrestivo23:01:21

yep, in clojure (ns foo-bar) is foo_bar.clj file

kenrestivo23:01:53

for reasons that are totally obscure to me.

shaun-mahood23:01:58

I always assumed it was some Java thing, but haven't ever really looked it up

arohner23:01:46

yes, it’s a Java thing

mkunikow23:01:54

@kenrestivo: "When a Clojure namespace is AOT (ahead-of-time) compiled into a Java .class file, it has to have a name that is a valid Java identifier. Dashes aren't valid in Java class names, so Clojure converts them to underscores. It also converts characters like * into words like STAR."