Fork me on GitHub
#clojure
<
2015-10-21
>
grounded_sage01:10:05

does anyone know how I can do % keyframes with Garden?

tom04:10:24

@jjw: what is an example query and query map? What sort of message is it giving?

jjw05:10:47

@tom:

FROM table
WHERE (:organization_id IS NULL OR :organization_id = organization_id)
      AND (:id IS NULL OR :yard_id = yard_id)
      AND (:id IS NULL OR :id = id);
The error was something like cannot determine type for $3

jjw05:10:36

I got around it this way

FROM table
WHERE (:has_organization_id IS FALSE OR :organization_id = organization_id)
AND (:has_yard_id IS FALSE OR :yard_id = yard_id)
AND (:has_id IS FALSE OR :id = id);

asolovyov09:10:10

I have a project with HTTP API written in Clojure and client written in CLJS. I want to separate them so that running/developing/creating uberjar for API doesn't touch CLJS, but then I want to run dev version of CLJS with Clojure in a single process, and I want to use shared code from Clojure's project. I still want them to be in same repo, just in two different dirs. I wonder if there's a good way about doing that? Should/can I somehow just append Clojure's dir to CLJS' classpath? Or should I do something else?

thheller10:10:31

@asolovyov: not sure what you are asking. cljs/clj can live side by side without issues, having the .cljs in the uberjar should not hurt although I'm pretty sure you could configure leiningen to exclude .cljs files when packing things together

thheller10:10:59

two different dirs is fine ... i have been using src/clj src/cljs for as long as I can remember

asolovyov11:10:09

@thheller: to be honest, I'm just concerned with clojurescript itself living in the uberjar

asolovyov11:10:17

uberjar is 44m for me instead of 24m

thheller11:10:08

@asolovyov: ah yeah, you can just put cljs into the :dev profile

thheller11:10:21

along with all other cljs libs

thheller11:10:59

:profiles {:dev {:dependencies [[org.clojure/clojurescript ...]]}}

thheller11:10:17

or even create a :cljs profile

asolovyov11:10:33

ok, thanks, I'll consider doing just that simple_smile

verma14:10:16

fwiw, the clj-slackbot has been updated to work with slack-rtm api now

verma14:10:48

its way more responsive through RTM api, changes are kind of new, but I've been testing it in some of the other slack channels and it hasn't failed me yet.

iwillig15:10:12

Is the select-keys function the best way to force the order of keys in a clojure hash with more than 8 key value pairs ?

ul15:10:05

how will it force the order?

iwillig15:10:10

I guess I thought select-keys forced the order. Maybe a better way to ask if whats the best way to force the order of keys in a hash map

iwillig15:10:25

sorted-map?

ul15:10:39

it will create new hash-map without order guarantees

ul15:10:47

sorted-map — yes, good solution

mpenet15:10:50

sorted-map will "sort" by key not preserve order (if that's what you want)

ul15:10:52

but sorted-map will sort, not preserve custom order

ul15:10:05

ha-ha, the same thoughts in the same time 😃

iwillig15:10:06

yeah i guess we do have a custom order

ul15:10:22

so, you can use lib proposed by mpenet or consider reviewing if right type was chosen

ul15:10:31

may be map is not what you really want

iwillig15:10:04

@ul yeah makes sense

iwillig15:10:32

thanks for your guys help @mpenet and @ul. I think we have what we need.

ul15:10:45

happy hacking!

nonrecursive15:10:28

hi folks, just wanted to mention that http://braveclojure.com has been updated with all the new and revised content from the print book (the macro chapters are way better, and the concurrency chapter has a fun new intro, among a million other improvements)

gusbicalho15:10:55

nonrecursive: thank you very much for that book! I had to teach myself Clojure in a very short time and it did the job awesomely

nonrecursive15:10:03

gusbicalho: woohoo! I’m glad it was helpful simple_smile hope you’re enjoying Clojuring

gusbicalho15:10:54

Gus ❤️ Clojure

mahinshaw15:10:53

@nonrecursive: FYI there is a typo for Chapter 11 -> "Chapter 11: Master Concurren Processes with core.async" - missing the t in Concurrent

mahinshaw15:10:56

On the homepage

nonrecursive15:10:07

whoops! thanks!

mahinshaw15:10:08

@nonrecursive: Np - Great book btw, thanks

pupeno16:10:27

How do I construct a schema for a map that should have one of two keys but not both? (xor)

jimmy16:10:57

great book ! Keep the good work 👍

roberto16:10:49

how do you log to a file with timbre?

roberto16:10:15

I can’t find anywhere in its documentation how to specify a file to log to..

roberto16:10:17

<rant> If your doc says See X, make X a link to whatever that thing is.</rant>

wambat16:10:02

For 4.x i'm doing it this way in project.clj: `:injections [(do (require 'taoensso.timbre) (require 'taoensso.timbre.appenders.core) (taoensso.timbre/merge-config! {:appenders {:spit (taoensso.timbre.appenders.core/spit-appender {:fname "your.filename"}) :println {:enabled? false}}}))]'`

roberto16:10:23

ah, :fname

jarredlhumphrey18:10:10

@pupeno using Prismatic schema?

juhoteperi18:10:23

@pupeno: (s/conditional :a {:a s/Str} (constantly true) {:b s/Int})

artofshine18:10:58

Hello guys. I am studying clojure. I created my first code snippet. Can you review code and add comment on gist. Thanks...

akiva19:10:04

Just after a quick glance, you have a function calling another function that’s defined after the calling function. They have to be defined in order (line 23).

akiva19:10:06

Line 21: Not sure why you have a cond that’s just an :else. I’d ditch that. Also, you shouldn’t need a threading macro when you’re starting with an empty state. Let the first function call establish initial state. And then I’d use comp.

akiva19:10:59

Also, there’s a lot of conds in there. That’s usually a sign of imperative-style programming. It’d probably be more idiomatic to use defmulti.

akiva19:10:25

Oh, ‘add comment on gist’. Guess I’m not that good at reading.

alwaysbcoding22:10:17

Does anyone know how to customize the printing of a custom record in the REPL? I overrode print-method and this seems to work -- but when pretty-printing is enabled in the REPL it doesn't display properly. The pretty printing functions are mostly undocumented so I'm pretty confused on how to go about changing how the record prints. anyone know?