This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-29
Channels
- # aleph (4)
- # architecture (12)
- # bangalore-clj (1)
- # beginners (87)
- # boot (3)
- # cider (19)
- # cljs-dev (84)
- # clojars (10)
- # clojure (79)
- # clojure-italy (7)
- # clojure-nl (19)
- # clojure-russia (10)
- # clojure-spec (9)
- # clojure-uk (55)
- # clojurescript (64)
- # core-async (7)
- # core-typed (4)
- # cursive (7)
- # data-science (2)
- # datomic (8)
- # devcards (6)
- # docs (1)
- # duct (5)
- # fulcro (117)
- # graphql (1)
- # instaparse (1)
- # leiningen (13)
- # lumo (103)
- # nyc (3)
- # off-topic (54)
- # om (9)
- # onyx (1)
- # pedestal (6)
- # planck (3)
- # portkey (7)
- # re-frame (26)
- # reagent (20)
- # ring-swagger (14)
- # shadow-cljs (164)
- # sql (11)
- # tools-deps (25)
- # yada (1)
@twashing I think your "completing" arity needs to do something with state
(the [accumulator]
arity).
Hmm, you're returning c'
from the 2-arity branch... that would lose the accumulator
value... is that what you intended?
@seancorfield I’m wanting to return the joined values that are in c'
, to the result list.
So part B, vs part A.
...
;; A
record {:uuid 1, :last-trade-price 11.1}
record {:uuid 2, :last-trade-price 11.2}
record {:uuid 1, :last-trade-price-exponential 10}
record {:uuid 2, :last-trade-price-exponential 11}
record {:uuid 3, :last-trade-price 11.3}
record {:uuid 3, :last-trade-price-exponential 12}
;; B
c' {:tick-list {:uuid 1, :last-trade-price 11.1}, :ema-list {:uuid 1, :last-trade-price-exponential 10}, :sma-list {:uuid 1, :last-trade-price-average 10.1}}
c' {:tick-list {:uuid 2, :last-trade-price 11.2}, :ema-list {:uuid 2, :last-trade-price-exponential 11}, :sma-list {:uuid 2, :last-trade-price-average 10.2}}
c' {:tick-list {:uuid 3, :last-trade-price 11.3}, :ema-list {:uuid 3, :last-trade-price-exponential 12}, :sma-list {:uuid 3, :last-trade-price-average 10.3}}
does someone know if its possible to load a keras model in clojure and make predictions with it?
Might be possible with Cortex. Below links from quick googling that might be helpful : Reddit post : https://www.reddit.com/r/Clojure/comments/5fo9ym/machine_learning_importing_a_keras_model_into/ Archive link since original link points to 404 : https://web.archive.org/web/20170419160312/http://benkampha.us/2016-11-29.html
Found the article: http://benkampha.us/posts/2016-11-29/ but is has a disclaimer: Note: this post describes a path that no longers work in Cortex, which is itself falling out of mainteance at this point (May 2018). Many of the recommendations also no longer apply as I’m using a mixture of TensorFlow and MXNet for model deployment today, rather than Cortex.
yeah I'm playing with that... no luck
(-> "/Users/me/foo/../bar" (Paths/get (into-array String [])) .toAbsolutePath str) ;; -> dumb result which still has '..'
user=> (require '[ :as io])
nil
user=> (require '[clojure.string :as str])
nil
user=> (def path "/Users/james/foo/../bar")
#'user/path
user=> (-> (apply io/file (str/split path #"/")) (.getCanonicalPath))
"/Users/james/bar"
Nice! Had gotten this one meanwhile
(-> the-path (Paths/get (into-array String [])) (.toRealPath (into-array [java.nio.file.LinkOption/NOFOLLOW_LINKS])) str)
Looks like I'll go for yours 😉Hi here! I studied clojure in the past months, and in the following weeks I would like to propose it to my company to rewrite an old background job we have. The alternative to Clojure would be to rewrite it using JavaRx.
For what I understood the async
module plus the transducers
can do the same job as RxJava in clojure, but the fact that I can't find any tutorial/guides/resources about it make me doubt that I'm not on the right track.
Am I looking at the right modules to do it?
Do you know any resource to do it?
while I would always encourage someone to use clj over java, i would be concerned about rewriting a whole process flow without someone who has more than “past months” of expertise
especially if this is the first introduction of clj to your company. a rewrite seems like a disaster waiting to happen where the language will take the blame of any failures
try to sneak it in with something small, manageable, and predictable.. then grow it to tackle larger and larger projects
good advise, I was thinking about making a poc of it to test clojure for a "real" use case, but no plan to have it in production in the near future. The use case is small, and has very few dependencies on other services, so that I can focus more on the "clojure" part than the "integration" one.
about the transducers and async instead, do you know any resource from which I can study them?
sorry I don’t know anything other than the guide on the clojure site… they’re a tricky thing to wrap your head around
you won't be able to destructure them
It’s bad-ish, in that it will prevent you from doing :keys
destructuring and cause issues any other time you try to turn it into a symbol
but clojure.core/keyword
will happily create kws for any string, including ""
, so by that definition anything goes
I believe at the moment, clj allows them and cljs does not
this is a long unresolved point of syntax
I think it’s unlikely we will ever make them stop working in clj
works in cljs too
> (-> "1a" keyword name keyword)
:1a
at least in bootstrapped cljs
They seem to work in both clj and cljs. Emacs doesn’t highlight them as keywords and it got me worried.
yup works in JVM cljs as well
As it seems like it’s gray area I think I’ll use strings instead. Thanks for the answers @pesterhazy @michael.gaare @alexmiller
I was talking about reader support, not the keyword function
also works
maybe this got changed though in 1.10
when compiling non-self-hosted cljs you are still running in clojure, so it accepts keywords clojure does. if you read a keyword using cljs code (eg read, edn/read) cljs will reject those keywords
if you’re parsing from json (or converting from any javascript object for that matter) it is definitely possible to get numeric keyword keys in a map in clojurescript:
(js->clj #js {"1" "val"} :keywordize-keys true)
=> {:1 "val"}
right, keyword function accepts any garbage
The other day when working with SQLite I had to do this: (keyword "last_insert_rowid()")
😄
@seancorfield maybe its worth mentioning this on the sqlite tips and tricks section? is this something I could a PR for?
@U3QUAHZJ6 Yeah, the Tips and Tricks page should probably list the "generated key" name for all the databases... https://github.com/seancorfield/next-jdbc/blob/develop/test/next/jdbc/sql_test.clj#L94-L101 might be a helpful jumping off point for the DBs that it gets tested against.
but the cljs reader is more picky than the clj reader
I remember this being the case, but it could have changed...
would it be horrible if i wrote a transducer that mostly depended on a state-transition chart bound into it at creation?
@martinklepsch I just hit the https://cljdoc.xyz/d/com.bhauman/spell-spec/0.1.0/ endpoint and no dice https://clojars.org/com.bhauman/spell-spec
I did some refactoring to support snapshots earlier, will look into it. 1s
Greatly appreciated, fix is being deployed :hugging_face:
doing some manual clojars-path stuff which I probably shouldn’t and forgot that dots in group-id are causing new directories… https://github.com/martinklepsch/cljdoc/commit/44990648d29b418467367a09eb9e70a2a2bc94f7
neat library too, could use this for the cljdoc configuration file
I’m using codox for the actual analysis so I think it should.
I’d also like to experiment with emphasizing vars that seem well-documented and perhaps de-emphasizing others — if you have thoughts on that, lmk
I’m a bit undecided as to where to draw the line and what that would actually look like, will have to come up with some variants…
Do people make much use of dependency injection libraries such as integrant, component or mount?