Fork me on GitHub

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?


@euwyn: no, not really. It’s not required. Look into promises.


There might be better links than that one but it came first for me.


hi, has the domain expired ?


@shriphani: Doesn’t look like it. Why? What do you see?


Hmm, strange. I’m able to access it fine


I can't get to it...


only nanjing, China can pick it up as per whatsmydns


Interesting... Long-lived DNS?


And St Petersburg, Russia!


I’m in Japan though, so maybe that’s the difference


do we know who owns that domain? is it cognitect ?


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?


Can you try ((ns-resolve 'user 'do-whatever) user)?


I am guessing require creates a user/do-whatever var


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.


Hi guys, quick question, is there a way to setup a test fixture for a "package"?


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 classnames come from javax.sound.sampled)


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 .


@m you could try (let [info (DataLine$Info. SourceDataLine audioFormat)])


@m not 100% sure though simple_smile


Maybe that'll help: (the comments say there's an issue with .open tough)


cool, thanks for the link. DataLine$Info worked by the way!


im also wondering how to (stuartsierra)componentize the library, so i can create a mock version of it too. has anyone done such thing yet?


currently the clojure functions in the various* namespaces are hardwired to use the corresponding real implementation (`Amazon*Client`)


Hi people!does anyone know where Euroclojure will be held this year please ?


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.


dmitrig01: Thanks!


bridget oh thank you so much for the info ;-)


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


annoyed is the wrong word, it's more 'bummed'


@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.


mike: insert multiple rows with a single statement, like this:


thanks for the links!


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. Be aware it's a really new lib, departs from standard java.jdbc and is postgres specific.


mikeb: foundation sounds awesome simple_smile 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 and it's insert! function.