This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-07
Channels
- # admin-announcements (2)
- # boot (111)
- # capetown (5)
- # cider (15)
- # clara (15)
- # cljs-dev (8)
- # clojure (78)
- # clojure-brasil (1)
- # clojure-dev (2)
- # clojure-greece (25)
- # clojure-hk (1)
- # clojure-russia (5)
- # clojure-seattle (1)
- # clojure-spec (120)
- # clojure-sweden (3)
- # clojure-uk (63)
- # clojurescript (161)
- # data-science (1)
- # datomic (21)
- # editors (43)
- # emacs (3)
- # funcool (1)
- # hoplon (72)
- # instaparse (11)
- # jobs (1)
- # off-topic (2)
- # om (212)
- # onyx (9)
- # other-languages (129)
- # proton (5)
- # re-frame (15)
- # reagent (18)
- # slack-help (4)
- # spacemacs (18)
- # untangled (224)
- # yada (21)
@juhoteperi: i saw you packaged the pdfjs.
we are trying it now, but we just get a forever pending promise from (.getDocument js/PDFJS "/some.pdf")
do you have any example somewhere which shows how to use it from clojurescript?
my suspicion is that it can't access the worker.inc.js
.
when i try to (set! (.-disableWorker js/PDFJS) true)
i get a 404 for
Two question : 1. How do you debug 500 error (using castra) ? 2. Why the castra-hoplon report: java.lang.ClassNotFoundException: clojure.lang.Tuple ?
@onetom: @jumblerg i’ve had issues with the webdriver and FF versions https://github.com/semperos/clj-webdriver/issues/167
tbh, i’m pretty worried that the last commit on the webdriver project is 9 months ago and there’s now compatibility issues popping up
i’m not sure what alternatives are out there with as nice an API as the taxi one
@thedavidmeister: onetom’s selenium dependency bump seemed to do the trick for me, once i upgraded to the latest release of firefox. there was a brief period of time i couldn’t run the tests locally, but everything’s working fine now (and on travis as well).
i haven’t had any issues with the clojure webdriver lib yet, but if they do arise, my instinct would be to go directly to the java webdriver api moving forward.
generally speaking, i’m suspicious that many of the clojure wrappers do more harm than good, as they (1) create an api separate from the already documented api in the host language that isn’t often documented as well (2) fall out of sync with the wrapped api, and (3) add another layer of code where things can go wrong.
i don’t have an opinion on this lib in particular though, haven’t looked into it enough.
@thedavidmeister: thanks for all your work on the tests, btw, they’ve proven quite helpful.
it would be awesome if we could get them running with something like saucelabs moving forward, so we can test against all the browsers instead of just ff.
@jumblerg: yeah that’s all probably fair criticism
if ff totally stops working i’ll go looking for alternatives
everything seems great to me so far. i haven’t had any issues other than that brief period of time ff and selenium were out of sync, and that resolved itself. the tests have been immensely helpful.
the problem with webdriver is that the API is so large you can't really wrap it effectively
and wrappers sometimes work very well when the API integration can be made data-driven or some unifying abstraction can be found that doesn't work well in Java but works in Clojure
good example: https://github.com/mcohen01/amazonica
and i also have to translate between the java method names and the clojure kebab notation
i would rather work with a pure clojure implementation which is based on the original aws rest interface docs
i prefer working directly with aws java sdk personally, making judicious use of ..
and their "fluent" bean API, the withFoo
methods that return new beans
i feel i could be happier without such setter/getter babbling: https://github.com/weavejester/clj-aws-s3/blob/master/src/aws/sdk/s3.clj#L52-L74
@onetom: i recommend against using that, it makes credentials harder
i ran into this one: https://github.com/mcohen01/amazonica/issues/223
@thedavidmeister: as i understand the clj-webdriver
doesn't need updates really because everything is factored out to the individual browser drivers, which now can evolve on their own, so im not worried about not seeing new commits. in fact it's a good sign probably.
@alandipert: so what do u recommend instead for credential handling?
credentials should be regularly renewed though if they are coming from the aws metadata service
right
iirc for the weavejester s3 thing yuo need to manually supply access key and id strings
so im forgiving this complexity to some extent, but still it feels a bit of an overkill
it doesn't automatically pick them up from the instance role
but yeah, whether or not that's bad would depend on your deploy setup
then i pass that env to clojure.java.shell or whatever as the environment when i shell out
oh i'm talking about in-jvm
with raw sdk you can do (AmazonS3Client.)
and it will try tons of ways to get creds
with the weavejester s3 lib you need to sniff them out yourself, then pass them to his clj stuff that does https://github.com/weavejester/clj-aws-s3/blob/master/src/aws/sdk/s3.clj#L77-L78
(defn upload-ctx
[{:keys [json meta json] :as ctx} & [client]]
(let [json-str (json/generate-string json)
report-id (get meta "ReportId")
client (or client (AmazonS3Client.))]
(.putObject client
HOENIR_REPORT_OUTPUT_BUCKET
report-id
(java.io.ByteArrayInputStream. (.getBytes json-str))
(doto (ObjectMetadata.)
(.addUserMetadata "loginid" (str (get-in meta ["AdzerkMeta" "loginId"])))
(.addUserMetadata "networkid" (str (get meta "NetworkId")))))))
representative of what i do usually
and the flipside
(defn get-ctx
[report-id & [client]]
(let [client (or client (AmazonS3Client.))
obj (.getObject client
HOENIR_REPORT_INPUT_BUCKET
(format "%s000.gz" report-id))]
{:csv (read-csv (GZIPInputStream. (.getObjectContent obj)))
:meta (get-meta report-id client)}))