This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-13
Channels
- # admin-announcements (8)
- # beginners (28)
- # boot (2)
- # bristol-clojurians (4)
- # cider (12)
- # clojure (177)
- # clojure-android (23)
- # clojure-canada (1)
- # clojure-dev (21)
- # clojure-italy (27)
- # clojure-korea (1)
- # clojure-russia (20)
- # clojure-spain (1)
- # clojurebridge (11)
- # clojurescript (156)
- # core-matrix (1)
- # cursive (2)
- # datomic (39)
- # events (1)
- # hoplon (13)
- # immutant (4)
- # javascript (2)
- # jobs (1)
- # ldnclj (13)
- # luminus (2)
- # melbourne (25)
- # off-topic (9)
- # onyx (13)
- # re-frame (110)
- # reagent (5)
@andre.richards: I've already left chat last time when you answered my question about "how to start in clojure", but I got your message and just want to thank you for advise.
@shamatov np š
Has anyone seen a qr code generator (for clj or java) with the ability to embed a logo into the qr code?
I guess, what I can do is create a QR code and on top of it draw the logo image of the company
zxing looks like the way to go. https://skrymerdev.wordpress.com/2012/09/22/qr-code-generation-with-zxing/
ahh, someone was even nice enough to make this: https://github.com/killme2008/clj.qrgen
@escherize: oh nice
i trying to optimize my workflow, can any one suggest how i can map stack trace to sources in vim ?
https://gist.github.com/mpenet/5231071c9f8217d13fd3 oddness or something I misunderstood?
what's up?
I have a leiningen puzzle if anyone can help
I know lein deps
can install the dependencies locally
but it does not seem to install the plugin dependencies
is there a way to do that?
@ericnormand: I believe it should
or even install a jar from clojars with all its dependencies?
@swizzard: I mean the jars required by the plugins
we're running the lein-immutant
plugin
so, specifically, lein immutant war
builds the jar, then downloads this stuff
Retrieving org/immutant/wildfly/2.0.0/wildfly-2.0.0.pom from clojars
Retrieving org/clojure/tools.nrepl/0.2.7/tools.nrepl-0.2.7.pom from central
Retrieving org/projectodd/wunderboss/wunderboss-wildfly/0.6.1/wunderboss-wildfly-0.6.1.pom from central
Retrieving org/projectodd/wunderboss/wunderboss-wildfly/0.6.1/wunderboss-wildfly-0.6.1.jar from central
Retrieving org/clojure/tools.nrepl/0.2.7/tools.nrepl-0.2.7.jar from central
Retrieving org/immutant/wildfly/2.0.0/wildfly-2.0.0.jar from clojars
then creates a warand I want that stuff to already be loaded when I do lein deps
or some other command that I can do before
because we're building docker images
and this downloads each time it builds
whereas the lein deps
line is up above
and all of the jars are in the cache
so they don't need to be refetched
well, I didn't expect there to be an easy answer
thanks everyone!
ericnormand: the war step resolves those directly, and they aren't visible at lein deps
time
I'm testing whether I can run lein immutant war
right after lein deps
@tcrawley: and thanks! you rock
but you could add a profile that adds [org.immutant/wildfly "2.0.0"]
to :dependencies
, and you can then do lein with-profile +war-deps deps
ok, thanks!
I'll give that a try
Is there a better way than this (keyword (str (name (:name the-keyword)) "-panelā)) to add -panel to a keyword, so that :home turns into :home-panel.
@pupeno (keyword (str (name :foobar) "-panel"))
right? I can't think of anything shorter
(-> :foobar name (str "-panel")) looks a little better
(-> :foobar name (str "-panel"))
is more readable, but it's missing a keyword call, and I like to not thread the first call: (-> (name :foobar) (str "-panel") keyword)
not sure, but I guess it's because the idea of the threading macro is to unwrap nested calls so they can be read as "transformation steps"... unwrapping the first call gives an additional step for my brain to interpret
this is especially true with short calls like (name :foobar)
... if it's a map/reduce/etc with a long (or not so long) fn as first param, I will probably do:
(->> coll
(map #(some big fn on %))
(filter some-pred)
first)
@swizzard: it's sometimes fewer lines too (but not in this case)... it's aesthetics, so it depends
hello all, just a quick note that the Clojure/conj CFP has been pushed back a week and will now close Aug 21st https://cognitect.wufoo.com/forms/clojureconj-2015-call-for-presentations/ - would love to have submissions re Clojure or ClojureScript use, libraries, experience reports, etc
Clojure/conj is Nov 16-18 in Philly! http://clojure-conj.org
Does anyone use Ember with Ember Data? Is there something similar to jsonapi-resources for clojure?
@mattly: like this? (fn [& args] (count args))
that will be especially difficult since functions can be overloaded
Looks like you need reflection: http://stackoverflow.com/questions/1696693/clojure-how-to-find-out-the-arity-of-function-at-runtime
tel: perhaps you want conj
(reduce conj m0 m)
will work on a vector or a hash-map (and is the simple part of the definition of into)
Iām working with some things that are very similar to transducersā¦ maybe I should just figure out how to represent them as transducers exactly and steal all that machinery
I mean you seem to be describing (fn [f] (map (fn [e] (if (map-entry? e) [(first e) (f (second e))] (f e))))
(defn map-entry?
[e]
(or (instance? clojure.lang.MapEntry e)
(and (vector? e) (= 2 (count e)))))
(defn updating [f]
(fn [col]
(->> (map (fn [e]
(if (map-entry? e)
[(first e) (f (second e))]
(f e)))
col)
(into (empty col)))))
if we generalize the first type to [a i -> o]
then these have types [[a i -> x] [a x -> o] -> [a i -> o]]
and [[a i1 -> o1] [a i2 -> o2] -> [a [i1 i2] -> [o1 o2]]]
(defn par
"Produce an action over maps from a map of actions. If an action returns nil
then it is excluded from the output map. Map keys which have no corresponding
action are passed through untouched."
[as]
(fn [ev m0]
(persistent!
(reduce (fn [m e]
(let [v0 (get m0 k)
v1 (f ev v0)]
(if v1 (assoc! m k v1) (dissoc! m k))))
(transient m0) as))))
arrdem: testing for two element vectors (or even map entry instance) leads to weird corner cases. Why not just be a functor and switch behavior by collection type not element type?
noisesmith: yeah you could do that too... in my mind this is a mapping that's variant on the type of the elements of the seq being mapped over (the special case being whatever the type of a map pair is, otherwise just the elements). You're right that would behave a lot better.
tel: not literally in the haskell sense, just sharing that aspect of dispatching what it does in a way that is appropriate for the collection type - I'm using the term quite loosely
with a protocol
or maybe a multimethod
multimethods can express arbitrary open dispatch, but protocols are much more efficient for open single dispatch
(In this case you were inspecting that it was a vector and the size of the vector too, in the case that the vector is a mapentry)
but you canāt really do typeclasses without a type system and prolog to pipe around your vtables, ha
I don't really want to dig too far into re-frame, but what does "define state transitions in time via reducers" mean?
there are a few ways of looking at itā¦ the easiest is just to note that all of the āevent emittersā and ādispatchersā and things are doing a lot of inversion of control