Fork me on GitHub
#clojure
<
2017-08-02
>
sjol01:08:10

@cjsauer Many thanks for you help! I just got home and tried your ideas, turned out I needed to do both the :aot [clojure.tools.logging.impl] and :main app.core overrides in my :uberjar section as my global main was set to :main ^:skip-aot app.core

cjsauer14:08:11

I'm glad you got it working. Happy coding :)

tdantas08:08:35

do you guys knows any “blog app” repository ? need to see a “real” application with authentication

ClashTheBunny12:08:15

Have you tried cryogen? It's a static blog generator.

misha11:08:26

I'd like to hear any opinions on the following: There is a transition :T from state :A to state :B. :T has a behavior fn :t :A has a teardown fn :exit :B has a setup fn :enter all of the fns above accept entire state machine as an argument (basically can depend on "current state"). There are several ways to implement transition in terms of fns call sequence: 1) :exit :t :enter – visually intuitive, but "destroys" source state before :t has a chance to use it (if :t depends on it) 2) :t :exit :enter – visually unintuitive, but :t can rely on :A not being destroyed upon :t call. Which one is superior and why? Any input is appreciated.

chrisjd11:08:00

If :t can fail then the latter seems fine; I would read it as "`:t` implies the transition :exit -> :enter". If :t cannot fail then the former is more readable and conveys that fact.

misha11:08:21

failure is interesting :t aspect, I have not thought through yet. I'd say :t should be pure in an i/o sense, but can issue an event, which would trigger another transition in the system. e.g. I'd choose to put any api calls into :enter rather than into :t

misha11:08:31

an example of :t would be (dec retries-left); but I can't come up with a side-effecty, issuing an event one right now.

henrik12:08:07

I’m using clj-http to do SOAP requests. Whenever I get a response, the REPL floods with stuff like this:

17-08-02 12:13:45 Mimir.local DEBUG [org.apache.http.wire:73] - http-outgoing-3 >> "<sus:Begin>[\n]"
17-08-02 12:13:45 Mimir.local DEBUG [org.apache.http.wire:73] - http-outgoing-3 >> "2000-01-01[\n]"
One line for every line of XML received by my machine. How do I get it to tone it down a bit?

henrik04:08:26

@cjsauer Excellent, thank you very much.

zilti12:08:06

I released a new ClojureFX version. It features automatic Controller generation for FXML files: https://bitbucket.org/zilti/clojurefx

triwave17:08:10

o/ everyone, new clojurian here

donyorm17:08:47

Welcome, @triwave, we're glad to have you! If you have any questions feel free to ask (the #beginners channel may be useful)

triwave17:08:13

oh great! I didnt notice the beginner channel in the list..Ill head there now, thanks!

johnj21:08:25

honeysql is pretty slick 😉

schmee22:08:53

anyone use jvisualvm to profile clojure code?

qqq22:08:06

is there any java library which provides a browser dom model via a java api? I want to program against the dom as the UI, but I want to use clojure instead of cljs, is this possible at all?

mobileink20:08:44

what does that mean? how would you program "against the dom" from java? other than https://github.com/miraj-project/html, haha.

qqq21:08:21

using java, you would open up a browser

qqq21:08:33

then there would be bindings which allowed you to register callbaskc on browser events and functions for manipulating the dom

mobileink21:08:57

so that the response to a browser event comes from the server? i mean the event calls something on the srver? i don't get it.

mobileink21:08:33

i.e. duplicate the dom on the server?

mobileink21:08:26

i believe there is a haskell thingee that does this, can't remember the name.

schmee22:08:25

I’m seeing that clojure.lang.RT.nthFrom() is taking 60% of the time in my code, but unfortunately that doesn’t tell me what part of my code that does all those calls

noisesmith22:08:05

@schmee forgive me if this is obvious, but it means you are calling nth on collections that are not associative

noisesmith22:08:32

if you can find the main calls to nth that are taking time, you can ensure the input is a vector

noisesmith22:08:57

which takes nth from linear time (nthFrom) to O(1) (nth)

schmee22:08:59

I’m iterating over sets a lot, I guess that would be the main suspect?

noisesmith22:08:11

iterating on a set should not use nth

schmee22:08:54

hmm, ok, thanks for the tip, I’ll dig around and see if I can find any weird iteration going on

noisesmith22:08:01

the only thing in clojure.core that uses nthFrom is nth, and you can probably find calls to that in your code, or the code of your libs - you know it's a bottleneck but don't know its callers somehow?

noisesmith22:08:08

it wouldn't be iteration!

noisesmith22:08:31

iteration isn't going to use nthFrom, if someone sane wrote it

noisesmith22:08:57

it would be code that's looking for the nth item of a collection that is a list or lazy seq or seq

schmee22:08:31

huh, well, I don’t have a single nth in my code, it’s either iterate everything or first

schmee22:08:46

I’m gonna time some stuff and see how far that gets me

schmee22:08:04

no doubt I’m doing something stupid somewhere

noisesmith22:08:16

what is it that told you nthFrom was taking so much time?

noisesmith23:08:52

interesting, yourkit's hotspot view shows the most active call chains leading to the call

schmee23:08:34

that sounds great, if I can’t figure it out I’ll get yourkit on trial

schmee23:08:36

@noisesmith found it: (let [[[s1 s2] & r] w)

schmee23:08:00

apparently, rest destructuring calls nthFrom

noisesmith23:08:24

interesting... so you could try some explicit lookups instead of destructuring (I've heard of destructuring being a bottleneck before)

schmee23:08:03

yeah, peek and pop it is! 🙂

schmee23:08:40

next up, reducing the crazy number of clojure.lang.Util.hash() calls…

schmee23:08:53

at least I know where that comes from, I’m creating sets like there is no tomorrow

noisesmith23:08:01

with peek and pop, be sure you know the type of the input of course