This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-16
Channels
- # aws-lambda (10)
- # beginners (52)
- # boot (42)
- # cider (2)
- # cljs-dev (8)
- # cljsjs (4)
- # cljsrn (10)
- # clojars (3)
- # clojure (48)
- # clojure-conj (4)
- # clojure-dev (19)
- # clojure-italy (7)
- # clojure-norway (4)
- # clojure-russia (44)
- # clojure-spec (70)
- # clojure-uk (34)
- # clojurescript (39)
- # cursive (35)
- # data-science (11)
- # datomic (7)
- # emacs (6)
- # fulcro (2)
- # hoplon (12)
- # jobs (1)
- # juxt (18)
- # lein-figwheel (2)
- # leiningen (4)
- # luminus (9)
- # off-topic (29)
- # om (46)
- # onyx (131)
- # other-languages (24)
- # parinfer (84)
- # pedestal (10)
- # portkey (45)
- # protorepl (1)
- # re-frame (15)
- # reagent (43)
- # ring-swagger (41)
- # schema (6)
- # shadow-cljs (293)
- # slack-help (2)
- # specter (42)
https://mxnet.incubator.apache.org/api/scala/index.html <-- this shows mxnet (Amazon's deep learning library) has an Scala API. I know how to call Java from Clojure. Is there a way to call Scala from Clojure ? If not, any suggestions on how to test this from Clojure ?
Is there a nice easy way to pretty-print XML without dropping down to Java calls? We're using clojure.data.xml to build an XML doc with xml/element
calls, and it's all coming out on one line
the answer to my own question appears to be "it's possible" https://github.com/grandbora/clojure-scala-cantrips#clojure-scala-cantrips
I'm trying to call: https://github.com/apache/incubator-mxnet/blob/master/scala-package/core/src/main/scala/ml/dmlc/mxnet/NDArray.scala#L239 from clojure I have already done (:import [ml.dmlc.mxnet NDArray]) which works I can eval 'NDArray' ==> this works when I try to call "NDArray/ones" ==> it complains about not having the static method How do I get the boot repl to list for me all the static members of class NDArray ?
Hello! I have a part of my application where I sort values by inserting them in a map. The key creation process is automatic and generates keys from combinations of dates. This results in calls like this: (keyword "201701-201702")
. What is best practices in this scenario? Should I prepend the date string with a character: (keyword "_201701-201702")
or should I use the date string value as is as key? All look up in the map is done through (get m my-custom-key)
where the same function that created the key is used to generate the key for lookup.
and "sort values by inserting them in a map" sounds like a weird thing to do as maps are not inherently sorted. although there is a sorted-map
I'm doing a new ubuntu install. Will anything bad happen if I use openjdk-9 instead of openjdk-8 ?
Right, the last time I tried it it didn't work even when I used the runscript from the latest lein version. There was problem in bootclasspath (which could be solved by turning bootclasspath off) but other than that there was also some dynapath issue. After that I eventually gave up and reverted to java 8, since without leiningen my tooling is essentially useless. However, I'm able to run plain clojure repl with java 9:
clojure-repl-1.9: aliased to rlwrap java -cp /Users/jumar/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar:/Users/jumar/.m2/repository/org/clojure/spec.alpha/0.1.123/spec.alpha-0.1.123.jar:/Users/jumar/.m2/repository/org/clojure/clojure/1.9.0-beta1/clojure-1.9.0-beta1.jar clojure.main
I am having a problem with boot. After I call boot repl watch system I lose the ability to use the REPL. I made a short video of the problem here. Any help with this is much appreciated. Here is the short video: https://www.youtube.com/watch?v=TQsqkzzR-8g&feature=youtu.be&hd=1
@dpsutton i shouldnt have used the word sorted, it is more like I use the map and it's keys as buckets and collect values in lists associated with the keys. My concern is more if it is nescessary to prepend the keyword with a character to avoid them starting with a number?
you're turning strings into keywords and you're worried about the keywords being legal. why not just leave the keys to your map as the strings themselves and never worry about that at all?
but it looks like :3
is against the spec although it works now. So I think your instinct to move away from this is correct but I dno't see a need to introduce a bigger workaround than using the original strings as the keys to your map.
Exactly! I will do that! Thanks for taking your time answering me. Am I correct in assuming that the only functionality I will miss out on is that I can't use the strings as functions in for example threading macros?
that's for sure a worry. but in your example earlier you were using (get map key)
which should work just fine. If you need some more control over threading, you could swich to as->
which lets you introduce an alias for the threaded value so you can vary between first position and last
@blmstrm my strong preference is that if the identifier isn’t something I could ever use as a literal in my code (eg. your case where it’s generated at runtime so it will never be a code literal), I use strings instead of keywords, even when a keyword is passed in as an argument (and is meant to be a thing to look up and not generically a function to call) I still prefer the form where the map comes first (either calling the map, or explicitly calling get) - do remember that (map key)
works, regardless of the type of key
Thanks for reminding me about (map key)
and thanks for answering. I think I will go with your approach.
I strongly suspect that Go is a fad, and that once people have experience maintaining Go codebases, it will be suddenly uninteresting.
I don't think it's a fad. Simply for the fact that google is pushing it. That being said, I have been hacking some go in my spare time and get frustrated that it's not as expressive as clojure.
I wish I could get into Go, I love the idea. But languages that don't have functions as first class values... I don't know, I just don't think its worth it to me.
It could have staying power, the way Java has staying power. It could essentially replace 70% of greenfield C even. But I don't think it's going to stay on the developer "most loved" list.
yes, it definitely feels like a step backward to me. Goroutines are nice, but it is still easy to have race conditions.
A discussion for #other-languages perhaps?
I get the following error when I run "boot repl" on Windows 10 command line: [WARNING] No nREPL middleware descriptor in metadata of boot.repl$disable_exception_colors@4c415a68, see clojure.tools.middleware/set-descriptor! Any idea how to fix it?
@nick319 I get that too but haven't dug into why. I suggest you ask in #boot
@seancorfield Are you running boot on Windows in the windows commandline?
It is not Windows-specific. I get it on all platforms with Boot, starting a REPL.
I can reload clojure code in the reple server but my REPL clients don't see the code changes. Just asking, do you have any idea why?
I'd take that question to the #boot channel too.