This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-01
Channels
- # admin-announcements (8)
- # arachne (11)
- # beginners (17)
- # boot (64)
- # cider (26)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (115)
- # clojure-belgium (2)
- # clojure-dusseldorf (15)
- # clojure-poland (15)
- # clojure-russia (62)
- # clojure-spec (86)
- # clojure-uk (208)
- # clojurescript (36)
- # cursive (4)
- # datavis (11)
- # datomic (44)
- # editors (9)
- # hoplon (21)
- # jobs (4)
- # mount (21)
- # off-topic (3)
- # om (113)
- # onyx (65)
- # parinfer (2)
- # perun (3)
- # proton (6)
- # re-frame (29)
- # reagent (20)
- # yada (3)
if I directly use bdy as in first snippet, it adds entry in mongodb correctly. however if i try to read property of the body and add (e.g. by replacing {:text bdy} by {:text text}, :text is added as null
@udhan: Is the key in your bdy map "text" or :text?
can you print/log bdy to see what's actually in there?
anyways, was just a guess as I head to bed. good luck!
@codonnell: no problem. Gn!
@pesterhazy: regarding coercion, let's take simple example of transforming {:a name :b age} to {:a age b: name}, but not manually, because I want all the good stuff that Schema gives me, like validation and handling more than this one example.
Perhaps this is a bug in clojure/data.json:
When I convert /
to json in Ruby I get this "/".to_json #=> "\"/\""
When I do the same in Clojure I get this (json/write-str "/") => "\"\\/\""
And when I apply Base64 encoding to the outputs I get different results as well.
Am I missing something?
I'm trying uploading files to AmazonS3 from front-end. In order to do that I need to generate a base64 signature. And the signatures based on data which includes pathnames.
As I can check, cheshire does it in the same way as ruby:
(require '[cheshire.core :as json])
(json/encode "/")
;; => "\"/\""
how to fix this? why this appeared I didn’t change any dependency just reopened idea and now I have this trace with 0 info in it
i think a good way to reduce to struggle with setup and tools is to limit the amount of automatic updates etc
then when I try to load any clj file from my project it with throw again Loading src/eem_rest_api/scenarios.clj... java.lang.NoClassDefFoundError: Could not initialize class clojure.core.async.impl.channels__init clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: Could not initialize class clojure.core.async.impl.channels__init, compiling:(clojure/core/async.clj:1:1)
@hans we have a winner! why the hell it uses something from target folder? Why this “something” is broken? How I could figure it out without slack?
how are you people staying sane being a programmers - I don’t know, it’s a mess, total mess.
i think it is fair to say that there are different types of problems, and dealing with package manager quirks is not high on my list of problems i like to solve either
i like solving problems, but I don’t like battling with tools and digging into error messages with 0 info, It’s like if I use hammer yesterday and it worked, and today it became screwdriver.
however, in defense of clojure, it’s a relatively new language and not as mature as, say, java. the toolset voor java (or even scala) is much more mature.
@ilukinov: it only feels like that because you're inexperienced. this is certainly a problem with clojure (or most lisps, for that matter)
@ilukinov: after only a few years, you can make sense of the error messages even though they're sometimes not very explicit (or, which is often worse, too explicit).
so you saying that you figured out that I need to clean my target/ folder from that error message about core/async?
yes. if you get low-level class-not-found errors, they're often caused by outdated .class files.
I found similar stuff in dependency detection in almost all languages that I have used. Although, clojure error are not the best on the world, I found similar stuff and cryptic errors in a bunch of other languages (in majority more mature that clojure...)
here is another one WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean? WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean? WARNING: bounded-count already refers to: #'clojure.core/bounded-count in namespace: clojure.core.async, being replaced by: #'clojure.core.async/bounded-count WARNING: Inst already refers to: #'clojure.core/Inst in namespace: schema.core, being replaced by: #'schema.core/Inst WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: fipp.visit, being replaced by: #'fipp.visit/boolean?
what does this mean? how the hell definition was replaced? what about name spaces? Does this mean that boolean? is no longer boolean? clojure’s native boolean? was replaced? why?
Yeah, that’s because they just added boolean?
to clojure.core — it wasn’t there before so a bunch of libs all implemented it, and now it’s generating warnings
I’m pretty sure it’s safe to ignore for now, I haven’t heard of any problems with it
If you revert back to clojure version 1.8.0, you can avoid that, but you won’t get any of the clojure.spec stuff
@ilukinov: tbh, running a beta version of clojure is not a good idea if you don’t like these kind of problems
My REPL keeps getting into a bad state where things like this happen:
(def first-of-month "2015-01-01")
=> #'user/first-of-month
(str first-of-month)
=> "Unbound: #'user/first-of-month”
If anyone has any idea where I’ve gone astray I’d love to to know.It’s a Cursive REPL and I’m attempting to use the ‘Reloaded’ pattern
mostly successfully
but I have to restart the REPL a lot more often than I want to, because it gets into this state
it’s starting to get annoying, so I thought I’d try and solve it
I found a reproduction case: calling (reset)
causes it, but only when (set-refresh-dirs “src” “dev”)
includes user.clj. I’ve clearly not got to ‘the bottom’ of it. But I’m not updating user.clj very often so I can lose that for now.
yep - its a convenient way of loading a bunch of (development / non-prod) code into the REPL
well, there’s the namespace, and there’s the code that defines it - in that sense there are 2 things
i think the repl's define a default namespace called user, and you have also defined a namespace called user
so its possible that it's getting interned in the other user when you are in a different user
I would be surprised if the REPL were maintaining two separate namespaces with the same name.
that (IMHO) would violate the principle of least astonishment
not easily at the moment - I can try to produce a minimal repro case later
sorry:
(ns user
(:require
[clojure.repl :refer :all]
[clojure.tools.namespace.repl :refer [refresh refresh-all set-refresh-dirs]]
[com.stuartsierra.component :as c]
[clojure.string :as string])
(:import (java.sql BatchUpdateException)))
https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/user.clj
anyone used https://github.com/Factual/s3-journal before? have couple of questions
(inst/parse-timestamp (java.util.Date ) "2016-07-29T13:43:00")
is throwing an error saying that it can't java.lang.Class cannot be cast to lang.IFn, which seems valid, but what "constructor" or date creation function can i use here
(java.util.Date.)
<— note the .
at the end
you're supposed to pass it a function
(fn [years months days ...] ...)
you'd write your own
Ah, wasn’t sure what inst
was...
what are you actually trying to do?
i didn't think that i needed a full fledged library, but i looked out and about and I see seancorfield with a library 🙂
try inst/read-instant-date
hackier thing that also would have worked: (read-string "#inst \"" time-string "\"")
or (read-string (str "#inst " (pr-str time-string)))
@seancorfield: , appreciate you chiming in so quickly. do you also maintain clj-time?
and much appreciated gfredericks. that code got super dense inside there pretty quickly
@dpsutton: Well, "maintain" is a broad term… I’m one of the two official maintainers (with Michael Klishin) but mostly we just review and merge other people’s PRs these days.