This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-10
Channels
- # admin-announcements (2)
- # alda (16)
- # beginners (22)
- # boot (55)
- # cider (11)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (115)
- # clojure-art (1)
- # clojure-finland (3)
- # clojure-greece (18)
- # clojure-madison (2)
- # clojure-norway (2)
- # clojure-poland (50)
- # clojure-russia (122)
- # clojure-uk (9)
- # clojurescript (28)
- # core-async (7)
- # cursive (4)
- # data-science (4)
- # datomic (65)
- # devcards (3)
- # dirac (91)
- # editors (7)
- # emacs (9)
- # hoplon (1)
- # jobs (5)
- # jobs-discuss (10)
- # juxt (2)
- # keechma (7)
- # ldnclj (31)
- # leiningen (3)
- # off-topic (22)
- # om (129)
- # om-next (1)
- # onyx (6)
- # proton (15)
- # protorepl (2)
- # re-frame (49)
- # reagent (13)
- # remote-jobs (1)
- # ring-swagger (2)
- # yada (19)
has anyone worked with skyscraper (https://github.com/nathell/skyscraper) before?
@seancorfield: Obvious and brilliant, thanks
@swizzard: woooooOOOOOOOH
@echristopherson: it’s really cool!
I was just attempting to take your mind. But I must bow to the master.
hello. Has anyone gotten weavejester/crypto-password to produce a stable hash? I'm trying to hash passwords, but each time it kicks out a different hash for the same clear text.
virmundi: It’s not a hashing library, it’s a key derivation function (KDF) library
I guess I have to pull the whole profile back and then compare the stored hash server side
It’s supposed to return a different result each time.
The way you check it is to pull the data from the server, then use the check
function.
If it returned the same result each time, then it would be at risk from rainbow tables.
That’s one of the reasons KDFs are used over hashes for passwords.
@weavejester: learn something new every day.
I have a style question 1) is there a good shorthand for a seq of strings. Like instead of substrings use ‘ss’ and 2) when restructuring "first & rest” from that ‘ss’ would my bindings be ss-first & ss-rest? Naming stuff is hard 😩
@virmundi: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2015/march/enough-with-the-salts-updates-on-secure-password-schemes/
@ccann: I saw this while browsing through debugging lists, maybe does exactly what you’re after? https://github.com/philoskim/debux
I’ve just realized Prismatic’s open source projects are moved to be under plumatic https://github.com/plumatic
Here's a newbie question for you: If HTTP Kit is Ring-Compliant and *non-blocking*, thus enabling high throughput, why would anybody use Immutant?
@jan: non-blocking doesn't automatically mean higher throughput. But Immutant 2 (and Aleph) are also non-blocking.
@juhoteperi thank you for the reference. Are there things one should look out for to really be able to leverage the non-blocking aspect? E.g., should you be using a non-blocking database adapter as well? I'd be curious to know how people deal with this in the clojure world. So far my experience is only in nodeJS (all non-blocking all the time) and ruby-on-rails (all blocking all the time).
Yes, one should use non-blocking db adapter to get the benefits but I think most just write blocking handlers and it is not a problem.
Also, Ring middlewares are not really built for async programming, Pedestal interceptors should work better: https://github.com/pedestal/docs/blob/master/documentation/service-interceptors.md
I see. So people rather write blocking code and then scale by running several threads next to each other?
so, here's a fun problem i have to consider: what would be the best way to implement authorization in Clojure? I was inspired by a recent Datomic video i have seen, where they "transform" the database object into one that only contains the objects that the current user "owns", so you have authorization in the database layer
@jan That depends: For my login that doesn't happen all that often I block even for my ~30ms upload to S3, but I go async on my frequent operations in my main app. (I also use pedestal)
there's https://github.com/puniverse/quasar which has an adapter for core.async. Much more efficient way of running lots of "threads" of execution on the JVM
I'd also like to mention catacumba, an async web toolkit that supports HTTP, websockets and SSE https://github.com/funcool/catacumba
@jan: i've gone completely non-blocking with my latest project... using #C0702A7SB for the webserver and alia for an async cassandra client
and i've found https://github.com/funcool/cats to be super helpful in making async code easy to write and comprehend - thanks @dialelo
@jan there's certainly overlap with lots of webserver choices - and async is one part of that. While http-kit is certainly async, other stacks are more mature - such as aleph which is built on netty (proven for demanding workloads at Apple/Google/Facebook/etc.) or something like undertow which is solid NIO-based alternative - http-kit is very lightweight but at scale other factors come in to play, like buffer management.
@juhoteperi: I would disagree a little with your statement about Ring middlewares not being designed for async programming, that used to be true but no longer is, since Ring 1.2. I use Ring middleware in async contexts a lot - you just don't use the wrap- versions, but instead directly use the underlying -request,*-response functions they compose - I know what you're saying, but I think you do Ring a slight disservice
@lmergen: authentication and authorization are thoroughly implemented in #C0702A7SB: https://github.com/juxt/yada/blob/master/manuscript/100_security.md
@lmergen: that's really just a 'btw', not advocacy
I agree with @mccraigmccraig about the value of an async abstraction - #C0702A7SB uses @ztellman's manifold and I've found that to be a very useful/solid foundation for async work - a somewhat higher-level abstraction than core.async
checkout manifold's manifold.deferred/chain, loop, reduce and so on
I think these primitives provide a good alternative to monads, so there a choices, not saying one approach is better
Ring, however, in copying the synchronous design of CGI/WSGI/Rack/Servlet has made writing async services in Clojure somewhat harder, but today there are a number of options which make this problem go away (pedestal, #C0702A7SB, etc.)
cool, I really appreciate all those pointers. I'll definitely explore some of the options mentioned.
@yenda there is experimental form generate
in schema that generates schema base on provided variable
@malcolmsparks: are there any benchmarks for yada? Should I assume its performance is more or less the same as aleph's?
look for a Location
header, i think
yeah, ring has a lot of utilities for inspecting requests, not that many for inspecting responses
@urbanslug check the status code is between 300-400
@jstaffans no, there are not yet. It will be slower than aleph because it does more.
Thanks, did it. Check Status Code 302 and also Location <the uri you wish to redirect to>
Is there a library for nil-aware arithmetic? Such that (+ 1 nil)
is nil instead of 1 (since +
treats nil as 0)? I'm asking because I'm using nil as no-data, and want that status to propagate through arithmetic. I don't really want to use NaN as no-data since I'd like to not interfere with floating-point semantics (infinity, NaN, etc.).
@fasiha missing javascript already ? :)
id be surprised if there was such a library
i think id just cooerce to 0 using or
at the boundaries of whatever logic the arithmetic belongs to.
@val_waeselynck: ha, is that a known "feature" of Javascript weak typing? No, I've never dealt with surveys or missing data before Clojure/Script. Stats systems like R and Julia have dedicated no-data values (NDV) and I'm sure something like that exists for Clojure/Script, but I'd prefer to not have to buy into a huge stats library just for NDVs.
@fasiha ah ok interesting. Well, not that i know of :/
I'll probably wind up overwriting the result of + with nil if any input is nil after the fact, and pray 😄
oh i see i misunderstood your expectations
But I see what you mean about Javascript: in planck/cljs:
cljs.user=> (+ :ndv 31)
WARNING: cljs.core/+, all arguments must be numbers, got [cljs.core/Keyword number] instead. at line 1
":ndv31"
To those using the reloaded workflow and a user.clj dev namespace, how are you starting your repls?
I added :repl-options {:init-ns user} so I can use lein repl
but now this messes up lein test
I added the repl-options outside of the dev profile
Is that mistake?
@fasiha: maybe you can try using something like https://github.com/clojure/algo.generic and extending te operations to handle the :ndv case
hi! does anyone have done mutually recusive schemas with the schema library?
I'm trying that and getting a StackOverflowError
@smw thanks for the tip w/r/t debux — at first glance I don’t think it does exactly what I want but I’ll look deeper. I think rolling my own solution or making a feature request is my best bet at this point! thanks again!
hello. I'm trying to invoke as part of a Component work flow that's calling a custom made Ragtime extension an fn defined in an edn. The Ragtime extension works fine. It's loading the end properly. Component is loading the ns that contains the fn. Unfortunately when I try to execute the symbol, I get a resolve failure. Any ideas/
As part of Component, the reset function prints this: :reloading (travesedo.common travesedo.graph travesedo.database travesedo.core-test travesedo.collection travesedo.document travesedo.graph-test hms-api.routes.util hms-api.data.core waller.core travesedo.query travesedo.index waller.files waller.ragtime waller.ragtime-test waller.core-test hms-api.data.arango.core hms-api.domain.accounts hms-api.data.accounts travesedo.integration-test hms-api.routes.util-test hms-api.routes.accounts hms-api.handler hms-api.handler-test hms-api.data.migration hms-api.components hms-api.data.arango.by-example hms-api.data.arango.by-example-test hms-api.data.arango-test travesedo.transaction user travesedo.index-test hms-api.core travesedo.job)
I think so, here's what the console shows Attempting to run fn {:action :modify, :fn 'hms-api.data.migration/add-web-user!} Exception Cannot find the fn you want to migrate 'hms-api.data.migration/add-web-user! waller.files/eval23899/fn--23900 (files.clj:206)
you have the symbol quoted, which result in (quote symbol) unless the contents of the file were evaluated
neat. removing the quote looks like it resolved it properly. I thought I had to quote a fqfn in edn
as a data serialization format, edn doesn't have evaluation semantics, which is what quote effects
Hey! I have some doubts about setting up a configuration file for a production env. In particular, I am not sure where should I specify a route/path to a configuration file for and application built using lein uberjar. Can I use the uberjar profile entry from the projects.clj for that purpose?
'm trying to write a websocket client / server using httpkit. The client side is using goog.net.WebSocket. Has anyone run into the following problem using httpkit? Chrome: WebSocket connection to '<ws://localhost:3871/ws>' failed: Invalid frame header Firefox: The connection to <ws://localhost:3871/ws> was interrupted while the page was loading. this.webSocket_ = new WebSocket(this.url_); Thanks...
Is it possible to require multiple namespaces as one symbol e.g.
:require [foo-tests :as t] [test-helpers :as t]
I thought this would work, as long names in those namespaces won’t clash, but it seems to be not workingarel and sequel are ruby libs that have some similarity
> is there something like honeysql in ruby or other languages? You can tell Clojure is growing when you read stuff like this :)
I asked this before but has anyone been doing any work with Clojure an a Karaf/OSGI container?
@val_waeselynck: sorta but I am more curious about honeysql itself