Fork me on GitHub
#clojure
<
2016-05-18
>
tom00:05:07

For any users of compojure-api, are :query-params required or are the allowed to be absent?

annarcana07:05:11

@tom Do you mean in terms of can they be sent as nil?

ikitommi12:05:58

@tom to make single query-parameter optional, you need to provide a default using the fnk-syntax :query-params [{q :- s/Int 1}]

abdullahibra12:05:14

how can i submit a form in clojure for scrapping task?

zane14:05:44

@danielwoelfel: Sure. You could write your own coercer.

senya2215:05:28

what would be the right way to undo(remove) the effect of prefer-method function?

grant15:05:13

Does anyone have any suggestions on running regexs over large files? I was hoping to be able to do something like (re-seq #"..." (lazy-slurp "path/file.txt")) but I haven't found a good way to get there. (i.e. I'm not sure of the best way to get from a java.io.BufferedReader to a java.lang.CharSequence.)

agi_underground15:05:15

hi, maybe someone know what i`m doing wrong: when i do "lain uberjar" for my project , i reseive these error: java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelConnector, compiling:(jetty.clj:1:1)

agi_underground15:05:08

i`m use [info.sunng/ring-jetty9-adapter "0.9.3"] for ability use latest 9.3.8 jetty server

hiredman15:05:49

check lein deps my guess is you are using a plugin or whatever that is overriding the jetty9 dep from that library

seancorfield15:05:14

So maybe you need an explicit dependency on org.eclipse.jetty/jetty-server?

mpenet15:05:37

an exclusion would probably be nicer. lein deps :tree would help find the culprit

hiredman15:05:30

depending on the cause an exclusion may be a pain

hiredman15:05:04

you would think you would notice a jetty requirement in your project.clj, but if a plugin is adding it

plexus15:05:37

@agi_underground: also post lein deps :tree, that's the best way to see if some dependencies are interfering

hiredman15:05:43

lein-ring is almost certainly injecting a dependency on another version of jetty

agi_underground15:05:46

yes, ring include jetty-adapter with another version: [ring-server "0.4.0"] [ring-refresh "0.1.2"] [watchtower "0.1.1"] [ring "1.3.2"] [ring/ring-jetty-adapter "1.3.2"] and, can i do something with it?

zane15:05:18

This is such a common problem. I wonder if lein or boot could make resolving these kinds of issues easier.

agi_underground15:05:02

this means i can not resolve this problem simple way, only delete from deps one of the packages?

roberto15:05:05

you can use exclusions

roberto15:05:39

[some-pack “1.0.0” :exclusions [ring-server]]

agi_underground15:05:36

@roberto: if i wont exclude [ring/ring-jetty-adapter "1.3.2"] from [ring-server "0.4.0"] i need to write like this: [ring-server "0.4.0" :exclusions [ring/ring-jetty-adapter "1.3.2"]] right?

zane16:05:29

There's no shorthand for (fn [& args] x), is there? I keep reaching for (just x) or similar.

agi_underground16:05:53

can`t exclude adapter: errors. yes this is a problem with deps

smt16:05:20

@zane is this what you mean: (constantly x)

zane16:05:35

Ah, right! Thanks.

escherize23:05:20

#( %& x) may work

ghadi23:05:28

your coworkers may hate you for using %&

ghadi23:05:38

¯\(ツ)