Fork me on GitHub
#cursive
<
2016-12-02
>
imre09:12:02

@potetm nah, double-checked that. toolsns reload works OK btw. it's when I try to use cursive to execute tests after a tools ns reload is when the error comes out

imre09:12:25

cursive displays "loading such and such file..." then the error

yonatanel10:12:16

I'm learning om and noticed that although om.dom/div is a function and parameters will be indented according to the first one, the first param is the properties and the second is the body (children), so it seems more appropriate to indent it like a macro with a body param, by 2 spaces. Does this sound correct? I don't think there's a way to config that.

cfleming11:12:35

@yonatanel You can use https://cursive-ide.com/userguide/formatting.html under “Code style settings” and set the indentation for “om.dom/div” to 1

cfleming11:12:10

@imre I’m at the conj sorry, so I can’t investigate that easily - when I get back I’ll ping you.

imre11:12:36

thanks @cfleming and have fun

yonatanel12:12:52

@cfleming om.dom/div is not a macro so I don't get the option to change its setting. Anyway have fun at the conj.

cfleming12:12:07

@yonatanel That option works for functions too

yonatanel12:12:35

Not here. I'll try to play with it.

yonatanel12:12:44

Works for defui which is a macro. Not for functions :(

roelofw13:12:38

Why do I see here a lot of not resolved here :

(ns paintings.api-get
  (:require [clj-http.client :as client])
  

(defn read-numbers
  "Reads the ids of the paintings"
  []
  (let [ids (->> (client/get "" {:as :json})
                 :body
                 :artObjects
                 (map :id))
        ids (reduce (fn [results id] (conj results (.substring id 3))) [] ids)]
    ids))

(defn read-data-painting
  "Reads the title, description, date , collection, colors and url of a image"
  [id]
  (let [art-objects (-> (str "" id "?key=14OGzuak&format=json&type=schilderij&toppieces=True")
                        (client/get {:as :json})
                        :body
                        :artObject)
        description (:description art-objects)
        date (get-in art-objects [:dating :year])
        collectie (first (:objectCollection art-objects))
        colors (:colors art-objects)
        ]
    {:id id :description description :date date :collectie collectie :colors colors}))

(defn read-image-url
  "Reads the image-url"
  [id]
  (let [art-objects (-> (str "" id "/tiles?key=14OGzuak&format=json")
                        (client/get {:as :json})
                        :body
                        :levels
                        )
        url (filter #(= (:name %) "z4") art-objects)
        tiles (:tiles (first url))
        ]
    {:id id :tiles tiles}))


(defn do-both-in-parallel [ids]
  (let [paint-thread (future (pmap read-data-painting ids))
        image-thread (future (pmap read-image-url ids))]    
    (pmap merge @paint-thread @image-thread)))    

) 

roelofw13:12:24

the client/get and the read-data-painting and read-image-url are all not resolved

rauh19:12:19

So I just created a very very quick&dirty script that parses any CSS file and generates a list of keywords from the CSS classes in that file. Pretty nice to get autocompletion for all css classes in Cursive when using cljs. Ping me here and I'll link it