This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-19
Channels
- # beginners (69)
- # boot (10)
- # cider (18)
- # cljsrn (6)
- # clojure (225)
- # clojure-austin (1)
- # clojure-dusseldorf (7)
- # clojure-france (2)
- # clojure-greece (3)
- # clojure-italy (9)
- # clojure-madison (6)
- # clojure-miami (1)
- # clojure-mke (2)
- # clojure-russia (58)
- # clojure-sg (36)
- # clojure-spec (25)
- # clojure-uk (54)
- # clojurescript (20)
- # core-async (15)
- # cursive (16)
- # datomic (71)
- # emacs (7)
- # hoplon (3)
- # jobs (5)
- # jobs-discuss (4)
- # klipse (3)
- # leiningen (2)
- # lumo (60)
- # mount (1)
- # off-topic (16)
- # om (6)
- # om-next (7)
- # onyx (21)
- # pedestal (15)
- # planck (1)
- # re-frame (3)
- # ring-swagger (4)
- # specter (33)
- # uncomplicate (31)
- # untangled (8)
- # vim (35)
morning!
rcfotd:
-------------------------
clojure.core/empty
([coll])
Returns an empty collection of the same category as coll, or nil
@seancorfield I'd love to come, but as @yogidevbear has pointed out.. I have #brexit'ed already... and I am allergic to cats. But have fun anyway and enjoy blighty! :flag-gb:
@dominicm well, I don't have a logic answer, but the implementation says so: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/A MapEntry.java#L48
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AMapEntry.java#L48
Ah, Heathrow....
Hello everyone... 🙂 Anyone got a quick answer to this: "What data type should I use to store lattitude and longitude in Datomic?"
@stathissideris has trodden this path @maleghast - ping him
@jonpither - Thanks, will do 🙂
I am feeling stupid... I have a lazy-seq of vectors. I want to get all the vectors that are unique based on the first value. Any ideas?
@maleghast I think you're looking for http://weavejester.github.io/medley/medley.core.html#var-distinct-by
@dominicm Thx! @minimal I will look at that too and figure out which one fits best 🙂 Thanks
I think I may have a simpler / pure core solution in my particular use-case, actually... If I get the first 5 items in each vector and then turn the resulting seq into a set I will have my de-dupe, but I am going to hang onto medley for the future...
@maleghast Oh, you only wanted to dedupe the values inside the vector.
No I want to de-dupe the vectors, but the vectors are duplicated across the first five values and once I am down to de-dupe I only want the first 5 values
As ever, talking about the problem with other people makes the solution come to the fore - thanks both!
In my ColdFusion slack group we have a Friday puzzle channel where someone will occasionally post a coding puzzle. Someone posted this about an hour ago: https://gist.github.com/ryanguill/06ec5681ecff5ea2497f8ebcbcab3e33 I'd be really interested to see what a Clojure solution might look like if anyone here is interested in trying to solve it when they have some spare time.
I was wondering if anyone has a better / more clojuric approach to "fixing" CSV data that is actually needed to be (let's say) Doubles than things like this:
(->> station-data-raw
(map #(assoc % :station/elevation (Double/parseDouble (get % :station/elevation))))
(map #(assoc % :station/latitude (Double/parseDouble (get % :station/latitude))))
(map #(assoc % :station/longitude (Double/parseDouble (get % :station/longitude)))))
ColdFusion, now there's a blast from the past, bringing up some memories (both good and bad)
@gjnoonan, indeed. You might appreciate this I mentioned it on that slack group this morning:
>After learning a little bit of Clojure (which uses immutable data structures), seeing mutable CF code like this makes me feel really dirty:
>`arguments.user = get( arguments.user.getUserID() );`
And a friend fairly pointed out that: >Sure, but isn't one of the major points of CF that it's loosely typed and mutable?
You get what you get from the tools you "choose" to use
I say "choose" as, with work situations, you don't always actually get a choice (at least not when you're setting out on a career). Sometimes the choices are made for you
¯\(ツ)/¯
not a lot of spare time @yogidevbear but look for powersets and then filter them when the sum is the number you want 🙂
Thanks @reborg. I'll look into that. I also don't have much spare time at the moment 🙂 When I'm not doing my day job, I'm doing some moonlighting and trying to get an online system going for my wife's business which is opening in about a month 😂