This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-02
Channels
- # adventofcode (5)
- # arachne (2)
- # bangalore-clj (1)
- # beginners (8)
- # boot (195)
- # cider (28)
- # cljs-dev (35)
- # cljsrn (4)
- # clojure (295)
- # clojure-brasil (5)
- # clojure-gamedev (2)
- # clojure-greece (2)
- # clojure-korea (13)
- # clojure-russia (60)
- # clojure-spec (58)
- # clojure-uk (92)
- # clojurescript (31)
- # clojurex (4)
- # css (1)
- # cursive (13)
- # datomic (40)
- # devcards (2)
- # emacs (17)
- # events (1)
- # flambo (3)
- # garden (9)
- # hoplon (31)
- # jobs (3)
- # klipse (1)
- # lein-figwheel (1)
- # london-clojurians (1)
- # luminus (2)
- # mount (36)
- # off-topic (13)
- # onyx (8)
- # pamela (1)
- # pedestal (1)
- # planck (3)
- # proto-repl (16)
- # protorepl (11)
- # re-frame (78)
- # reagent (4)
- # rethinkdb (6)
- # ring-swagger (1)
- # specter (8)
- # untangled (10)
- # vim (1)
@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
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.
@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
@imre I’m at the conj sorry, so I can’t investigate that easily - when I get back I’ll ping you.
@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.
@yonatanel That option works for functions too
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)))
)