Clojurians
#clojure
<
2016-01-11
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

datajohnny00:01:20

I am trying to make an endpoint work with clara but I am not getting the the right hand side to work: https://gist.github.com/datajohnny/a927c54a56f00035676e any help be appreciated

esnunes00:01:12

@donmullen: mount looks promising, when I had my first contact with component I felt something bad about using OO however as I'm clojure noob I decided not to think about it and just accept it. I might be missing something but mount looks simpler

datajohnny00:01:24

anyone around that has used clara I have some questions that I cant find answers for

drusellers01:01:45

@esnunes: @donmullen fantastic conversation on the two (component / mount) on reddit - https://www.reddit.com/r/Clojure/comments/3zppdn/the_beauty_of_clojure/

danielsz02:01:19

Everything that has been said about mount vs component vs system is true. However, I would like to point out that beyond providing ready-made community-backed components, system also provides a development workflow that only Boot allows. The other noteworthy property of system is that the latest snapshot supports abstractions derived from Duct: endpoints and handlers.

danielsz02:01:12

The development workflow is demonstrated at https://github.com/danielsz/holygrail

danielsz02:01:09

As for the Duct abstractions, it's basically this: https://github.com/weavejester/duct/wiki/Components

danielsz02:01:37

Personally, I think it's very cool that mount has emerged, and I will take a closer look at it. Maybe system will end up supporting that too.

danielstockton08:01:11

Im having trouble with some NoClassDefFoundErrors, including the drill-jdbc-all lib (apache drill bundled with all dependencies) which seems to conflict with hadoop and other libs. Can anyone give me any tips on dealing with this? It seems that the classloader is at some point looking for apache commons libs used by both libraries which drill is shadowing.

mpenet09:01:22

looked at mount and fled when I see global defs as a base for it

mpenet09:01:57

I personally don't see the OOness in component, I guess it's low level and can lead you into dark places if you use it the wrong way

mpenet09:01:07

but I am happy with it

mpenet09:01:47

we have systems with >50 components that would be hell to manage without (or full of redundant stuff to manage lifecycles)

seancorfield09:01:18

You really have >50 things with global state?

mpenet09:01:49

yes, a few base components, tons of subs that are themselves components, but yes, we have some complex systems

seancorfield09:01:03

That much state sounds bad...

mpenet09:01:04

if you deal with just a web app it would be bad, but it's not our case

seancorfield09:01:48

"just a web app" — that’s a bit dismissive...

mpenet09:01:52

the "state" is quite limited, it's just get propagated in many different "sub-systems"

mpenet09:01:05

I didn't mean it in that way

mpenet09:01:17

more as in "simple 3 tier web app"

dm309:01:02

I really fail to see how mount is any worse than component

dm309:01:45

it just doesn't force you into passing the state as an argument

dm309:01:52

but you could still do that

mpenet09:01:02

lots of internal state

mpenet09:01:08

(atoms, defonces etc)

dm309:01:19

and how is that bad?

mpenet09:01:22

but I just looked at the surface

mpenet09:01:37

I guess it's a matter of taste, I personnaly see it as a smell

dm309:01:39

if the state is hidden in the namespace

dm309:01:47

and the namespace provides the API

mpenet09:01:49

I'd rather have it as an argument to something

mpenet09:01:14

and if I want to inject it in a ns I can, but not making it the default

mpenet09:01:40

as I said, matter of taste probably.

dm309:01:40

yeah, it seems so

agile_geek11:01:28

My view on Component and Mount is that they can both be abused and both, used properly, are very useful. I think the issues arise with inexperience when the patterns both use get applied universally without understanding the tradeoffs?

agile_geek11:01:02

BTW I am completely inexperienced in both and would worry about misapplication.

danielgrosse14:01:44

How can I filter a XML to only return nodes without children?

danielgrosse14:01:06

<data>
<node>
    <children>
        Foo
    </children>
</node>
<node>
    bar
</node>
</data>

denik14:01:25

@seancorfield: @martinklepsch: both slack integrations removed

jonahbenton14:01:30

@danielgrosse: clojure.xml/parse will return a data structure of nested maps. (-> parsed-xml first :content) will give you a collection of the node maps. :content on the node maps will give you a vec with the contents of the node tag. items in that vec will either be a string- "bar"- or a map in the case of nested elements like <children>. take what you wish and turn it back into xml if desired. an example: http://blog.korny.info/2014/03/08/xml-for-fun-and-profit.html#parsing-xml-as-structured-data

alexmiller14:01:30

Clojure 1.8.0-RC5 is now available https://groups.google.com/forum/#!msg/clojure/5UjWgwTI6fY/Q06vv6cVDQAJ - we expect this to be the last RC. Any testing would be appreciated - feedback on the google group (including "looks good") is preferable.

meow14:01:29

@denik: thank you for freeing those up

denik14:01:18

@meow: of course. they were used for clojure nyc’s meetup group. Kinda useful but ok not to have them

meow15:01:31

yeah, as you know we're just extremely constrained by slack's imposed limitations and are trying to enable some folks to test various integrations that might help with Slackpocalypse

jaen15:01:04

@alexmiller: first time I tried 1.8 and it seems it doesn't like Immutant - https://gist.github.com/jaen/8d1ff8a1605d74034086

tcrawley15:01:00

@jaen: what version of immutant? and can you tell me what version of potemkin is shown by lein deps :tree or boot show -d?

tcrawley15:01:53

we test Immutant against 1.8 on CI, so things should work. there were issues with an older potemkin at one point

denik15:01:20

@meow: understood

meow15:01:49

#C0J5T38VB

jaen15:01:48

@tcrawley: [potemkin "0.3.4"]

tcrawley15:01:55

@jaen: you'll need to update that to "0.4.1" - immutant depends on "0.4.1", so something else must be dragging in an older version

bronsa15:01:35

@jaen: if bumping potemkin doesn't fix it, try using a custom 1.8 with the following patch applied: http://sprunge.us/HTAW

bronsa15:01:48

(if bumping potemkin fixes it, just ignore me :simple_smile: )

jaen15:01:52

@alexmiller, @tcrawley, @bronsa: it seems it was potemkin after all. Adding [potemkin "0.4.3"] to my dependencies seems to have fixed it. Thanks!

tcrawley15:01:01

my pleasure!

stathissideris19:01:02

what's the trick for getting leiningen to run in a mode that will allow me to show Swing JFrames etc

stathissideris19:01:17

I'm trying to use seesaw

stathissideris19:01:31

and I suspect that leiningen is running in headless mode or something

dobladez20:01:52

@stathissideris: have you tried passing java.awt.headless=true as a JVM param ?

dobladez20:01:32

oh wait, may be I read your problem backwards

stathissideris20:01:27

@dobladez: on you are correct, that's the problem I was having... the parameter that you mention seems to have fixed it, but then I tried again without it and it seems to work ok as well now

stathissideris20:01:50

so I'm confused, maybe the window was opening underneath other windows (I'm on OSX)

lvh21:01:59

I’m writing something that takes a map on the Clojure side, but needs to turn that into a Java object (for interop). Is it preferred to use (doto (ThatObject.) (.withX x) (.withY y)), or proxy? It seems like what proxy is built for

jasonjckn21:01:55

what is the slackapocaplyse exactly?

jasonjckn21:01:01

are they changing pricing model?

niwinz21:01:33

Consists in fact that slack company may just close the clojurians slack has it happens previously with other community

jasonjckn21:01:50

we're using a free model I assume?

lvh21:01:17

jonahbenton: thanks

lvh21:01:28

jonahbenton: that doesn’t seem to cover the doto case though

lvh21:01:34

jonahbenton: although it does suggest proxy is what I want

jonahbenton21:01:49

yeah, doto is useful when the java side has expectations for a specific concrete type, and the source of truth for the data resides in that type. if you want to bridge some clojure data or functionality into java via specific java interfaces, use proxy or reify

meow21:01:31

@jasonjckn: #C0J5T38VB

lvh21:01:47

jonahbenton: yeah, that’s what I thought. Thanks! I’ll write a bunch of tests with doto, then check if the proxy works

jonahbenton21:01:19

@lvh sure thing, good luck

lvh22:01:52

When using varquotes to subvert ^:private, is it preferred to deref the var, or call the var directly? (@#’my-ns/my-fn x y z) and (#’my-ns/my-fn x y z) both work. This is for a namespace testing that, hence why I want to subvert ^:private)

jonahbenton22:01:28

@lvh my imperfect understanding is that @ in that case is a no-op

lvh22:01:48

jonahbenton: I believe that that’s accurate as long as you’re not rebinding anything

lvh22:01:04

jonahbenton: i.e .`@` controls when you resolve the var

arohner22:01:06

I’m using timbre and component. When I start the app inside nRepl, timber’s console println appender logs into my nrepl, rather than into the console repl where I started lein, which is really irritating. Is there a way to grab the console’s stdout, from nrepl, so I can log there instead?

lvh22:01:30

deraen: thanks

arohner22:01:09

answering my own question, it looks like if I (.getRawRoot out), I get the console stdout, then I can println to that