This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (28)
- # beginners (30)
- # boot (6)
- # cljs-dev (48)
- # clojure (72)
- # clojure-android (8)
- # clojure-australia (1)
- # clojure-italy (9)
- # clojure-japan (12)
- # clojure-russia (21)
- # clojure-sg (1)
- # clojurescript (109)
- # core-async (11)
- # core-logic (17)
- # cursive (33)
- # datascript (1)
- # datomic (30)
- # dunaj (4)
- # editors (38)
- # events (1)
- # ldnclj (17)
- # off-topic (156)
- # om (2)
- # overtone (1)
- # re-frame (2)
- # reagent (63)
@bjarnagin: with the caveat that you won’t be protected from SQL injection if you do that
@danielcompton: Good call out. I use replace for things like replacing the table name or an alias but I still use the parameter list for user injected variables. Yeah, I would never inject user-provided strings into sql.
@danielcompton: fortunately i won’t be accepting user inputs here. i am just making a quick ETL job to process data from multiple client databases and wanted a convenient way to query each db in turn without opening a new connection or going to the effort of sending a USE DATABASE query.
Hi! Someone mentioned me a clojure lib to request datastructures (ala get-in but much more sophisticated) and I can't find the name again. Do you know it ?
hi! I have a question… if I have a vector [1 2 3] and I want [2 3 1], something like (-> v cycle (drop 1) (take 3)) but without having to know the length… any ideas?
no, that’s it it just doesn’t work with empty vectors, but it’s okay @colin.yates. thank you a lot
Am I correct in thinking that in a multi-module project, lein test will run tests from all sub-projects, not just the top-level one?
@cfleming: Leiningen has no built-in support for multi-module projects. Modules are handled by plugins such as lein-sub or lein-modules, and they determine the behavior.
@jonpither: I tried. I implemented the redis protocol using gloss and aleph (largely based on code I fished out of old versions of aleph; it used to have a redis protocol implementation). It ended up being very slow.
@stuartsierra: Right, but from what I can tell, lein test finds all namespaces on the classpath using bultitude - I don’t know whether that includes tests from dependencies or not. Thinking about it, I guess not, since at that point your sub-module deps are just like any other lib.
@ds300: as far as I could tell, yes. (but I could be wrong.) It got very noticeable in requests that were doing hundred of pipelined HGETALLs, each with a dozen fields. (Carmine was much faster but still too slow for my need; I ended up using Jedis, which was still slower than the python redis library that we’ve been using.)
So I feel like I should know this, but I don’t. Is there a way to test if something is sequable?
seq will perform various conversions but fails if it can’t produce one, so it’s not so good as an idiomatic check.
Well, in this case there are various other tests I could use since I’m only working on a known subset of classes, and I think the sequable ones all implement ISeqable, but it seems like something there ought to be a generic check for.
And in a way, a test like “can this thing be converted into a seq of some kind” really does get out of the type testing to a much greater extent than what seem to be the current options.
Hey everyone - I seem to be getting an error when trying to run “lein repl”
I wondered if there was any common solutions to this? (and I hope this is the right place to ask!)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context
@jamesmintram: That kind of error is caused by a use of a symbol (`create` in this case) before it has been defined. It is happening when you run
lein repl because something else is trying to load the Clojure source file containing that bad code, perhaps from a
user.clj file. The solution is to search your code for instances of
create that are not defined.
Thanks stuart - this error only occurs when I add a dependency (amazonica) - I think I have just found a work around (exclude
com.fasterxml.jackson.core/jackson-databind) - doesn’t seem a great solution though..
[project-name :scope "test"] in Clojure dependencies a lot, but I can't find it documented anywhere (the :scope keyword). Is this a feature specific to boot (I see it in boot projects primarily)? What does it do?
@jamesmintram: I admit, I'm not sure how adding a dependency would cause that problem, but it might have something to do with dependency conflicts or a bug in that library.
probably-stupid liberator question... I'm sending a map in the body of a POST request... how do I get it back to a map in my handler?
@mahinshaw Thanks, I wasn't sure because it's not documented in sample.project.clj.
@martinklepsch: I think so too. I picked up boot a few months ago, and ran into this. I actually prefer the boot way, although I don't see why you couldn't use the same notation in lein, since it is using maven as well
So it's usually used in boot because boot doesn't have a convenient notion of profiles as lein does?
@aengelberg: you can make profiles in boot, both ways are fine I guess. (see https://github.com/boot-clj/boot/wiki/Boot-for-Leiningen-Users#profiles-middleware)
@aengelberg: Nice thing about boot is, you don't really need the dev profile. The tasks take care of that.
I have a query template stored in a file with format specifiers for variables i need to pass in. i’m
slurping that file into my program, but when i call
format on it, i get a
java.util.MissingFormatArgumentException, even though the format arguments are in the file. Am I doing something wrong here?
I think I found what was going wrong... kept getting a "no operator found for text = jsonb" error.