This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-28
Channels
- # aws (3)
- # beginners (14)
- # boot (222)
- # cider (9)
- # cljs-dev (14)
- # clojure (107)
- # clojure-chicago (1)
- # clojure-dev (31)
- # clojure-nl (1)
- # clojure-poland (3)
- # clojure-russia (44)
- # clojure-sg (13)
- # clojure-za (3)
- # clojurescript (81)
- # core-async (5)
- # core-logic (4)
- # cursive (3)
- # data-science (3)
- # datomic (13)
- # events (7)
- # ldnclj (6)
- # leiningen (1)
- # off-topic (4)
- # om (298)
- # re-frame (13)
- # ring-swagger (7)
- # yada (12)
is there some one liner that’s equivalent to cat a.txt b.txt > c.txt
?
in simple cases spit and slurp would work but I think that breaks with binary contents?
@cfleming: Having problems opening Leiningen projects with latests Cursive (0.1.67) https://www.refheap.com/4cbd307737daa513a119e8839
you probably have lot of “report to cursive” reports but though that I’d be extra brutal and send you one in chat
@martinklepsch: (spit "boot.sh" (concat (slurp "head.sh") (slurp "my.jar")))
@mishok13: I think that does not work because slurp coerces the contents into strings (I tried it)
I'd isolate writing one file to a separate function, so that the code would look sorta like this:
clojure
(with-open [...]
(append! head bin)
(append! head ujar))
yeah, nio is going to be a better answer for stuff like this
In particular look at FileChannel.transferFrom()
another java q. how do I get a reference to this class: https://github.com/eclipse/jgit/blob/9e5380e7fb797e83b6f6b5754249bea4cae534e7/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java#L106
more likely org.eclipse.jgit.lib.ObjectIdRef$PeeledTag
That worked thanks @alexmiller @rbxbx!
Is anyone developing their clj apps in docker containers? If so. How are you getting your emacs to load all the namespaces?
@petr: I don't and have no idea about docker, but does it prevent you from using leiningen or boot? Wouldn't those do the job for you?
@meikemertsch: I am using leiningen. My issue is that when trying to jump to a fn it doesn’t work unless I’ve already evaluated a namespace in my cider repl
atyz: don’t know about emacs, but with fireplace/vim you’ll need to have a local copy of the deps checked out (as I recall)
Sorry, then I cannot help you :(
@rbxbx: I found that just to get cider to connect I had to do this lein repl :headless :host 0.0.0.0 :port 4343
aytz yup – I ended up just mounting an nrepl server inside the application itself and having the dockerfile RUN
a separate -main
for local development.
anyone here get liberator wrap-trace to work when using bidi for routes? It requires compojure.core which liberator doesn’t and I get CompilerException java.io.FileNotFoundException: Could not locate compojure/core__init.class or compojure/core.clj on classpath
atyz: I haven’t used the setup in a while – you mean jumping to function definitions and such?
@albaker nice!
I am trying to the --no-sandbox
flag to chromeOptions, when setting up the webdriver ->
caps {:acceptSslCerts true
:javascriptEnabled true
:browserName "chrome"
:chromeOptions {:args ["--no-sandbox"]}}
[_server driver] (s/new-remote-session {:host host
:port port
:existing true}
{:browser :chrome
:capabilities caps})]
the :chromeOptions
is a guess from me on how it should be, but am having a hard time actually providing the right input.
I also tried ->
(let [chrome-opts (doto
(ChromeOptions.)
(.addArguments ["--no-sandbox"]))
caps {:acceptSslCerts true
:javascriptEnabled true
:browserName "chrome"
:chromeOptions chrome-opts}
[_server driver] (s/new-remote-session {:host host
:port port
:existing true}
{:browser :chrome
:capabilities caps})]
the error I am getting is -> `cannot parse capability: chromeOptions from unknown error: must be a dictionary`
hard to say, doesn't appear to be documented and I never had to pass in those options
stopachka: FYI this is what I was looking at: https://github.com/semperos/clj-webdriver/blob/b6eefcd077552dc22a0669c1ee9ecd96f69bdf49/test/webdriver/util_test.clj
hey all. looking at YeSQL vs HugSQL. If anyone has experience please share.
I prefer the composability afforded by Honey SQL myself
I like YeSQL but I don't care for the way it litters my namespace with vars. And makes it hard to use from a component.
@andyparsons: YeSQL is pretty easy to get up and running to see if you like it and test your use cases - definitely try it with your most complex query and make sure it works.
yes, in the middle of that. Can’t see any shortcomings give the problems it solves, so we’re wondering what HugSQL is better at
Ahh, when I saw the HugSQL announcement I wondered the same thing. Haven't looked into it yet though.
@donaldball: that’s new to me. thanks @ghadi taking a look
@andyparsons: I started on HoneySQL and ran into issues with queries with lots of columns, may be fixed now - I think there was a limit of 20 or so when I tried it. Moved from that to YeSQL as YeSQL was a lot better for my requirements.
It is a really cool library though if it fits your needs
yeah, this particular need is a fairly complex jumble of SQL so I don;t need a DSL or composability so much as a nice way to do raw sql
I've ended up using java.jdbc for a lot of things as well as YeSQL, I prefer it for some types of queries
I've found yesql very good. Most of the SQL DSLs I've tried were OK with simple stuff, but didn't scale well. Yesql seems to provide that nice mix of power and convenience. I can develop my SQL as normal and get all the power of the db, letting sql do what it does well and easy integration with my clojure. The conman package is a useful addition which makes managing pooled connections with yesql very easy see https://github.com/luminus-framework/conman With respect to vars polluting the namespace, I've not found this a problem. I put groups of queries into different files and then add them in separate namespaces and then just require the namespace I need and reference the queries in that namespace accordingly.
new core.async release (0.2.371) is available https://groups.google.com/d/msg/clojure/NdQMUs1mTUU/sfq3uSlxBQAJ
andyparsons: for another option, I’ve been pretty happy with https://github.com/r0man/sqlingvo + java.jdbc fora while now.
cool @rbxbx i will take a look!
SQL is a pretty good DSL already
my only problem with Yesql (and many other libs) is the global connection… generally prefer to keep the db connection parameterized/componentized
good point, not a pragmatic concern for this particular case for me
i’ll report back. working nicely so far. thanks all
I’m trying to understand how 1.8’s socket repl and tools.nrepl compare. Is there something novel about it that tools.nrepl doesn’t support or is this mostly about better integrating repl servers in general?
@martinklepsch: for your file concat question, you can use
instead of manual read/write loop. Still need to manually create the outputstream though to use as destination
@xeqi: cool thanks, that really makes it simpler.
Any sente users here? How do people generally handle routing? We've been using a multimethod like the reference project shows, but it's getting a bit messy now (~70+ impls spread over multiple namespaces)
@martinklepsch: from what I've picked up it is about having a network/socket repl built in that can be started without adding any code. Though I remember reading something about stdin being a stream where as nrepl uses discrete messages with a request for more input (ie requires client support for stdin)
@xeqi: I looked at https://github.com/puredanger/replicant and the binding stuff seems interesting but probably nothing you couldn't do with nrepl (?)
Also understood that it's mostly about being built in