This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-14
Channels
- # aatree (1)
- # admin-announcements (1)
- # beginners (12)
- # boot (359)
- # cljs-dev (23)
- # cljsjs (2)
- # cljsrn (1)
- # clojure (53)
- # clojure-czech (5)
- # clojure-madison (1)
- # clojure-russia (15)
- # clojured (8)
- # clojurescript (16)
- # community-development (2)
- # core-async (6)
- # cursive (19)
- # datomic (31)
- # emacs (48)
- # euroclojure (3)
- # hoplon (29)
- # microservices (7)
- # mount (46)
- # off-topic (7)
- # om (11)
- # proton (74)
- # reagent (4)
- # spacemacs (3)
hi all, new to clojure! i’m using "clj-http.client” in a project. how would i use the results of one api request in another? is there a concept of callbacks?
welcome
@euwyn: no, not really. It’s not required. Look into promises. http://dev.clojure.org/display/design/Promises
hi, has the http://clojuredocs.org/ domain expired ?
@shriphani: Doesn’t look like it. Why? What do you see?
I can't get to it...
Interesting... Long-lived DNS?
And St Petersburg, Russia!
Doing a whois on it, it seems like something was updated today. But it expires in 2017
Something just occurred to me... I have some code where I require a namespace as just user
. Later, I have a let
where I bind user
to a user hash. Then I call (user/do-whatever user)
... and it works.
Clearly this is confusing code to begin with, and I should rename one of the two things. But why does it work at all?
I'm just saying (require '[my.project.users :as user])
, but it would make sense if it worked by putting all the user/foo
defs into the namespace.
I'm actually struck by a different (and non-Clojure-specific) dilemma right now... it has to do with API design.
Let's say I have users and videos. I don't want unprivileged users to be able to list all users on the site, because even if I strip out emails, there's trolling potential. It just doesn't seem quite right. But I do want to have a list of videos created by those users, and I want the creator to be a field on each video so people get credit and... since you can look up a user profile if you have the username, we're back where we started. Classic privacy vs connection problem you run into on every community site ever made. I guess I'll prevent the user listing, but if someone really wants to write a script to individually look up each user's profile after finding them on the video or comments lists, so be it.
We say "CRUD" is the simplest of all application types... but somehow each one ends up having innumerable layers of complication, each with its own long-term consequences.
I want all my tests under test.api
to setup a test server, and the only solution I found so far is to copy and paste the use-fixtures
in every namespace
Hi people! I got problems transferring the following java line into clojure code: It just hits the limits of my understanding of java's class system: http://DataLine.Info info = new http://DataLine.Info(SourceDataLine.class, audioFormat);
The problem is, that I cannot instantiate DataLine itself, it looks like it goes only through Info, but I don't know the right form for this situation. Any suggestions would be highly appreciated .
Maybe that'll help: https://gist.github.com/santamon/1034374#file-audio-clj-L15 (the comments say there's an issue with .open
tough)
im also wondering how to (stuartsierra)componentize the https://github.com/mcohen01/amazonica library, so i can create a mock version of it too. has anyone done such thing yet?
currently the clojure functions in the various amazonica.aws.*
namespaces are hardwired to use the corresponding real implementation (`Amazon*Client`)
I don't think it has been announced yet
Is there a function in Clojure that can be used as a HOF and just return itself without acting on the arg? Instead of (fn [v] v)
kaffein: In the Clojure Remote community panel, Alex said they are still working on locations and should know (he hopes) in a few weeks. It will likely be in fall.
quick question, is there something like yesql that is a bit more mature and/or maintained?
i'm currently working through the 'web development with clojure' book and it recommends the library, but I've been playing around with it for my own project for a few hours now and i can't help but feel annoyed, the concept is brilliant, but there's very little documentation, some obvious features like batch-inserts are missing and some features are not working at all, with no reply on the issue for 5 months
@jbaiter probably nothing more mature than yesql, it sort of originated the templated query idea. What do you mean by batch-inserts? Here are 2 similar, but quite new libs. https://github.com/layerware/hugsql https://github.com/mikeball/foundation
mike: insert multiple rows with a single statement, like this: https://github.com/krisajenkins/yesql/issues/51
jbaiter: no problem. I'm actually the author of foundation, and can say that yes it supports batch inserts transparently, mostly because it uses a dsl for inserts/updates. https://github.com/mikeball/foundation/blob/master/docs/inserting-data.md Be aware it's a really new lib, departs from standard java.jdbc and is postgres specific.
mikeb: foundation sounds awesome I'm currently trying to stick with an embedded database, though, so it's unfortunately not suited for the current project 😕 but now I know what i'll use for the next bigger project or when I get sick of sqlite or h2 for the current one
jbaiter: Just looked into hugsql, and it has something called tuple param types which might work for batch inserts. You can always fall back and use good old https://github.com/clojure/java.jdbc and it's insert! function.