This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-05
Channels
- # admin-announcements (183)
- # aws (30)
- # beginners (22)
- # boot (301)
- # cider (19)
- # cljs-dev (3)
- # cljsrn (23)
- # clojars (15)
- # clojure (136)
- # clojure-italy (8)
- # clojure-nl (4)
- # clojure-russia (19)
- # clojured (10)
- # clojurescript (134)
- # component (48)
- # cursive (7)
- # datavis (4)
- # datomic (50)
- # devcards (6)
- # events (9)
- # jobs (1)
- # ldnclj (10)
- # lein-figwheel (19)
- # leiningen (1)
- # luminus (16)
- # off-topic (5)
- # om (151)
- # proton (60)
- # re-frame (10)
- # reagent (25)
- # remote-jobs (1)
- # slack-help (3)
- # spacemacs (1)
- # vim (1)
Anyone know why Clojure doesn't have ex-message
and ex-cause
? ClojureScript has them. Is it an oversight?
Is there a way to determine what template was used to build a leiningen app?
@surreal.analysis: not really. lein templates are just a mechanism to produce an initial project directory tree populated with files, themselves produced through a standard templating mechanism. Saves a little work, using code generation in place of manual copy/paste, to set up a project. Maybe a unique snippet left unchanged after the project's author publishes their project could be used to identify a particular origin template. Curious- what problem would be solved by knowing if a particular project was originally seeded by a template?
Not really a huge problem - there was an error in the project.clj of a leiningen template I used recently, but couldn't quite pin down a date
I saw that aspect of the template had been edited within the past month
So I wanted to know whether or not my version was before or after
Just making a new project with the template confirmed that the issue was still there, and I could have browsed the source, but it would have been nice to know right away if it was the right version
I could also see people using it as a sort of "best practices diff" tool
e.g.
lein new my-template@commit123 old-scaffolding
lein new my-template new-scaffolding
diff —brief -r old-scaffolding/ new-scaffolding/
thanks, makes sense. now that I think of it I have asked similar questions- which template version did I use for X project, and did template Y get subsequent downstream enhancements back from project Z.
hi guys, I really love the idea of data driven system from this video https://www.youtube.com/watch?v=BNkYYYyfF48. Do we have any good example of how to do this ? thanks
@nxqd: i heartily recommend reaching out to Paul on twitter @ohpauleez and asking him
awesome, I would do that, I'm still very new to clojure, but I can magine with this kind of system we would build CRUD backend pretty fast. 😄
very fast
How can I set the dev key with environ?
@danielgrosse: Have you tried this section of the documentation? https://github.com/weavejester/environ#example-usage. It mentions how to set keys.
If that doesn’t help, can you give an example of what you’d like to achieve?
I set a {:profile {:dev {:env {:debug true}
in the project.clj, but it is ignored. The map in the profiles.clj is recognized.
should the :profile
key not be :profiles
, with an ’s' ?
Here’s a project.clj from one of my apps, it uses environ for settings, may be useful as an example: https://github.com/ShaneKilkelly/jetcan-server/blob/master/project.clj#L40
also, if you have a profiles.clj file, is there a reason for not making the change in that file? It might be a good idea to not spread the configuration out amongst multiple files.
The key is :profiles, I just mistyped it here. I uses the luminus template as a reference, where it is working. I use the profiles.clj only for the database url
I'm yet to see a popular library that uses reader conditionals instead of cljx
, is there any reason for that besides lack of time?
mount uses reader conditionals, I think. Aside from lack of time, some library authors may not be willing to insist on 1.7 as the minimum version of clojure that they’ll support just yet.
updating a project to use reader conditionals would mean deprecating 1.6 and below, on top of the time investment.
@spacepluk: after having used reader conditionals I would never use again cljx
but as @shanekilkelly said, you may not want to deprecate 1.6.0
ands below
@shanekilkelly: I didn't know about mount it looks very interesting
@spacepluk: you can find a tutorial on reader conditional here https://github.com/magomimmo/modern-cljs/blob/2ed53774fe22075ae9c74a3394c617ae9994c64e/doc/second-edition/tutorial-12.md take also in consideration that both :crossover
feature of cljsbuild
and cljx
are now deprecated. One more thing: I’m in the process of publishing a new tutorial of the series where I explain in depth the accommodation of reader conditionals to make a library portable on CLJ and CLJS… I think I should finished it in a couple of days...
@magomimmo: that's great, thanks
@spacepluk: you’re welcome
@solicode: I love test.check
, as anyone that does not want to write too many tests. It allows you to discover very difficult bugs to be killed.
Is anyone able to help me out with a Pedestal SSE issue? I’ve posted the details here, https://groups.google.com/forum/#!topic/pedestal-users/J8oj33cg_e0
I set a key to the env in the uberjar profile, when I run the jar locally, the key is set. When I copy the jar to my server and run it there, its not. What could be the cause of this?
Oh its read from the .lein-env. Is this the normal behaviour?
Shouldn't this been compiled to the package?
btw, cider 0.10.1 is out - https://github.com/clojure-emacs/cider/releases/tag/v0.10.1
We're happy to announce that Clojure/west 2016 will be held in Seattle, Apr 15-16th - please see http://clojurewest.org for more info.
See http://clojurewest.org/cfp for more info on the call for presentations and http://clojurewest.org/sponsorship for more info on sponsoring!
hey, so I’m trying to use/extend @pyr’s riemann-acknowledgement library.. and can’t quite seem to get the events get tagged properly
trying to use it this way: https://gist.github.com/prasincs/224c171c7a5c2178ab74
based on the print messages, the events do get tagged when there’s an ack for the host/service combo
Hey guys!… I am creating some tests for my REST API to validate/check simple things such as the response status code and the shape of the returned data. However, the response body comes comes as a java.io.BufferedInputStream I don’t why and how to deal with it. In short, I am getting something like this: '#object[java.io.BufferedInputStream 0x6a5dd0ef "java.io.BufferedInputStream@6a5dd0ef"] (class java.io.BufferedInputStream)’
Is this the reason behind using something like the wrap-json-response middleware, right?
wrap-json-response is returning the input stream. you can slurp
the input stream to create a string
Suppose I had a collection:
{:id 1 :name "Jane Doe" :images []}
and I wanted to add
[{:count 3 :monitor 12}]
to :images
is that allowed in clojure or do I have to create a completely new collection
jcomplex: yes, this does (efficiently) create a completely new collection, so use the return value
is there a way to jack into the clojure compilation process? for example, to do some extra analysis, constant folding, etc. I imagine it would take the form of a lein/boot plugin, but I’m not sure where to start. Are there any projects that already do a similar thing?
it seems that if there’s no value available on the event-chan
that’s setup when the request for the event source is received, something closes the connection
this is why the code in the guide, https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-sse.md, works
@srdjan: i see some code was previously posted: https://gist.github.com/batasrki/61894e9d83d0535fe56b
@jonahbenton: yeah, I posted that in the morning
is the code still the same?
presumably the minimal stream-ready implementation from https://github.com/pedestal/pedestal/blob/master/guides/documentation/service-sse.md is confirmed to work?
so a fully static dummy version of link-update like: (defn link-update "Sends the updated link record when the value is put on the channel" [channel] (dotimes [_ 20] (let [;; record (<! update-chan) output "your data here"] ;; (view-models/single-item record)] (log/debug channel) (log/debug output) (>!! channel {:name "link-update" :data output}))))
in the published link-update, where does update-chan come from?
so when a map is put onto update-chan and the rendered event is pushed onto the sse channel, pedestal is throwing an exception and the client doesn't see the event?
what data does (view-models/single-item ...) produce?
it takes a db-sources hashmap, converts the date, fills in the title if the column value is nil
hmm. i am curious about what happens if you remove the go block from link-update and use dotimes instead
i suspect what's happening is this:
actually, scratch that
change link-update, and its callers, to return the sse channel
might be faster to remove the go block
i think what's happening is pedestal is getting confused about the response to this request
your call train is returning null
in response to the /stream request
so pedestal will close the response channel
the response socket
i have not used sse but in other situations pedestal needs interceptors to return either a context or a channel
yeah, I figured it’s the null return that’s closing it, but I didn’t know how to return a non-null value while waiting for the “real” value to show up on the channel
will be curious to hear if it works. sse channel would make sense, and would be a more natural example in the documentation
thanks, @jonahbenton
cool, thank you
@jr yeah, I’m planning on using tools.analyzer, but you do you plug that into lein run
?
the normal Clojure compiler is not open for manipulation like that
Question with Monger could you set up a watcher to the collections that would allow you to know if was updated?
@jcomplex: MongoDB supports tailable cursors on capped collections https://docs.mongodb.org/manual/tutorial/create-tailable-cursor/
It's not a general solution, but it may be useful. Otherwise, there's no way to be notified of changes to a collection (at least none that I'm aware of)
Hi guys, when defn a method, what is the difference of using a dash and not using a dash?
like in defn -doThis
and defn doThis
both can be called with and without the dash.
There is no difference between the two, only defining it with defn- will make it private.
Sorry for stepping up, but why can we invoke the function with and without the leading dash?
I read somewhere that it has something to do with :gen-class
, but it is not clear enough. 😞
the leading dash is the default prefix for genclass
So you see it with -main most commonly to generate a class with a static main
@alexmiller: Makes sense! Thank you!