This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-12
Channels
- # beginners (102)
- # boot (5)
- # cider (1)
- # cljs-dev (15)
- # cljsjs (1)
- # cljsrn (20)
- # clojure (104)
- # clojure-austin (1)
- # clojure-europe (8)
- # clojure-italy (39)
- # clojure-nl (17)
- # clojure-spec (38)
- # clojure-uk (23)
- # clojurescript (34)
- # cursive (31)
- # data-science (5)
- # datomic (3)
- # emacs (28)
- # joker (1)
- # kaocha (5)
- # klipse (1)
- # leiningen (1)
- # off-topic (66)
- # quil (4)
- # reagent (35)
- # ring-swagger (1)
- # rum (1)
- # shadow-cljs (121)
- # test-check (1)
- # tools-deps (33)
- # uncomplicate (2)
- # vim (15)
- # yada (1)
What's a good alternative to luminus (ideally that has a lein template) that is perhaps more light weight? I'm noticing on a brand new luminus project, just a lein test
takes 30 seconds to execute the stub test
@m131 shadow-cljs
@m131 Depends what you mean by "alternative to luminus"... If you want something lightweight, you could start with lein new compojure lightapp
(I tend to recommend folks start with bare bones Ring, Compojure, and gradually add the libraries they need as they understand each piece... Luminus has a lot of moving parts to understand)
what is the difference between s/map-of
and s/every-kv
, both have similar usages ?
The doc string for map-of
says - Unlike 'every-kv', map-of will exhaustively conform every value.
What does this mean, will not every spec apply exhaustively anyways ?
@murtaza52 What is s/reduce-kv
? Did you paste the wrong function there.
@seancorfield thanks, have edited the question
Ah, you mean s/every-kv
? OK, that's like s/every
which says "Note that 'every' does not do exhaustive checking, rather it samples
coll-check-limit elements. Nor (as a result) does it do any
conforming of elements."
So every
and every-kv
check a sample of elements (useful for large collections where you want a sanity check, but don't need all the values conformed), whereas map-of
and coll-of
will both check the entire collection and conform all the values. That might not work for very large (or even infinite) collections.
@murtaza52 If you're working with very large/infinite collections, the overhead of validating and conforming every single element is going to be really large.
@seancorfield thanks, that explains it.
@seancorfield would you recommend to start a new project with next.jdbc or go with the standard version?
next.jdbc is the standard thing now. Less baggage, more performance.
next.jdbc
is the "next" version of clojure.java.jdbc
so I'd recommend using it instead of c.j.j at this point.
Ok! Thanks :)
c.j.j will continue to get bug fix updates but that's about it. next.jdbc
is where all my effort is focused now.
And feel free to ask in #sql if you have any Qs.
Thanks a lot for your help.
I'm traveling a bit over the next week so be patient if I'm slow to answer. Hmm, 07:36 where you are? Europe?
If so, I'll actually be on your timezone next week 🙂
7:36 is UTC+2 (amsterdam, berlin, paris, … CEST)
Ah, I'll be in the UK so... close...
In spacemacs, does anyone know the correct way to cancel a leader/space-bar command? Esc is kinda working but it also displays a message SPC ESC is undefined
there's also standard C-g
but it has the same effect. However, I would just ignore that message 🙂
Is there any consensus on how .edn
should be formatted? Does any style-guide exists perhaps?
If a person is not going to be examining it, then one big long line is reasonable.
If a person is going to be reading it, there are various pretty-printers that can be used, although they might not produce exactly the format you want, e.g. clojure.pprint/pprint, fipp, and a few others.
You must be cautious with the pretty printers to avoid using options that many of them have to eliminate part of the data, e.g. when a vector or list is very long, or the nesting of data goes more than N levels deep.
any examples of usng google drive with clojue? found the google-apps-clj
library but seems to be unmaintained
On running the following code - (r/foldcat (r/mapcat prepare-event events))
1) When (count events) ->100
, the above code returns a data of type of java.util.ArrayList
2) When (count events) ->1000
, the above code returns a data of type of
and the above behavior is breaking my code, why would it return different types depending on if the data was parallelized or not using the r/cat
combine fn ? Shouldn’t it always return realized data ?
@murtaza52 How it is breaking your code?
Hi, i have a problem that im struggling to solve. Any help will be much appreciated.
I want to navigate inside a map. The map has :content
key that its value might be a collection of string (that i want to extract), or a collection, this collection may contain maps with :content
key as well that i want to iterate on each one of these maps (probably recursively) and extract the :content
value (when its a collection of strings and not a map).
i tried to use specter
but its API is kinda hard to understood
clojure.walk
might be handy as well but my attempts were unsuccessful
I can't seem to catch exceptions within a map. Is this expected behavior?
user=> (try (map #(/ % 0) [1]) (catch Exception e "what"))
Error printing return value (ArithmeticException) at clojure.lang.Numbers/divide (Numbers.java:188).
Divide by zero
Without the map it works "normally"
user=> (try (/ 1 0) (catch Exception e "foo"))
"foo"
@jahson Initially when I wrote the code I tested it with a small dataset, and the code worked. However when I tested it with a larger dataset, it started throwing an error, bcoz the above snippet was returning an object while the expectation was a seq.
@bennyk you can map
your fn
over the hash-map
, and then recursively call the fn
based on the value of the :content
key.
@murtaza52 Yeah, I'm trying to understand what is causing that error because according to https://clojure.org/reference/reducers
> To produce an output collection, use clojure.core/into
to choose the collection type or the provided r/foldcat
to produce a collection that is reducible, foldable, seqable, and counted.
In a clojure.core.spec
is there a way to define relationship between two keys ? I have a hash-map which contains 2 dates, and I want to specify the relationship between them.
It is needed for generating test data, as my logic fails when the relation ship between doesnt hold true.
@murtaza52 You can "attach" any predicate on a s/keys
with a s/and
but you will have to write your own generators to ensure the property.
@seancorfield I am from Zurich :) I wish I will be able attend a Clojure conference soon to meet everyone. I have never been happier working while working with a language, it’s tools and community:)
@alpox it is a big honor :) but I think many use it, the issue are companies here are not extremely risk seeking for IT
I think 3/4 companies in the list who advertise using Clojure are in Switzerland
I must have missed that! I guess I should lay my eyes on them when looking for a job 🙂 I'm from Andelfingen btw. (Kanton Zürich)
I sneaked Clojure in mine: they wanted me to build a web app with R Shiny/Python Dash, and I said NO WAY (been burned before by R Shiny)
So I got a white card to use CLJS
I am in Zürich :) if you work there we can definitely meet :)
The companies using Clojure are
Hahah good luck :) I wished we could become a hub like London
Clojure needs a push to make it first class language for data analysis as well
Thanks 🙂 It would be dream-like to find a job with clojure. Its so much nicer to work with than say JavaScript which I did for the last year. (Any more) I would also welcome if more used Clojure for things like ML, DataScience and similar to compete a bit with python 🙂
are you guys volunteering to make data science libraries for clojure?
I think we will have to reuse python
I think I might invest some time with the libpython-clj
@christian.gonzalez I maybe would, if I had more experience in that field (And with clojure) 😄
This is a wrapper around pandas
there have been discussions on here about whether clojure actually needs a dataframe library like pandas
I want to do some benchmarks to see the performance and if the price is not to high let’s check for other wrapper like scikit
given how easy it is to filter/transform/etc. hashmaps as rows
I like pandas for its time series functionality
And also it is slow to perform operations on sequences of maps
Like x+y on data frame
yeah i guess it doesn’t have to be maps
but that’s a good point
I heard about Neanderthal and wondered if this or some other library in Clojure can compete/replace Numpy in Clojure?
I tried to reimplement time series with ordered maps, but the issue is you can almost never get to add matriciels
neanderthal is supposed good for matrix operations like that, was going to mention that too
Replace Numpy yes, for sur (especially with the ClojureCuda)
you can even use cuda with neanderthal
But matrix operations is only a really small part of the problem
I wondered if you could port this into Clojure)
Neanderthal relies on JCuda for porting the cuda libraries
So you have access to the standard package but not these ones.
Moreover, dragan (the author of Neanderthal) mentioned he could port cuDNN (cuda for Neural nets) into Clojure.
It would be great, but then do you also get all the supporting tools like tensorboard, or what not from MXNet/Pytorch/TF
I see the landscape in the datascience field is growing in clojure 😄 I'm happy to hear that!
I think there would be a utility of cuDNN bindings in Clojure but more realistically we would might start as a symbiotic language
Maybe with less interop than with JVM and JS
But at least a way to reuse python libraries.
For the data science field, we would need a community effort to have monopolistic framework (yes framework) that would centralize all the effort, this is what the data science channel is trying to achieve
But this is only my honest opinion :)