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)
What's the shortest way to add N values to a set using only core functions?
petrus: not sure if this is the shortest, but it works: (reduce conj #{1 2 3} (range 55 60))
looks like merge works! (merge #{1 2 3} 5 7) => #{7 1 3 2 5}
I'd like to rotate a 2D vector by a rotation matrix without requiring huge matrix libraries. Is there a clever way to multiply a position vector like [-1 0] by a 90 deg rotation matrix like [[0 1] [-1 0]] in a terse way?
So I guess this is pretty short:
(let [pos [0 -1]] ; position vector
[(apply + (map * [0 -1] pos)) ; colums of 90 deg rotation matrix
(apply + (map * [1 0] pos))])
=> [1 0] ; rotated 90 deg clockwise
Is there a way to add state to cycle
in Clojure?
I guess a circular list.
Why would you need state? Couldn’t you use take
and take-last
to emulate it since it’s infinite?
Hello all!
What does keyword :-
mean in the functions definition like this:
(defn func [schema coercion-matcher :- CoercionMatcher] … )
?
@dapi it's probably from https://github.com/Prismatic/schema
Yes, it's from Prismatic/schema, but I can't understand what this keyword :-
does mean. Is it clojure-specific argument type or something user defined?
from the example in the Readme:
(s/defn stamped-names :- StampedNames
[names :- [s/Str]]
(StampedNames. (str (System/currentTimeMillis)) names))
it says, that the function stamped-names
should return a value of type
(or schema
) StampedNames
Hello guys, could you help me. I have this code https://gist.github.com/anonymous/e9b1dbc20d382cfbacc7 When I try to write into file manually created vector everything looks good. But when I try to write vector that I received from file, I have a exception. But this vectors are equal.
@dwht: Can you post /Users/dwht/Documents/artec-png/input/minus.png.h
here?