Fork me on GitHub
#clojure
<
2015-11-15
>
devn02:11:14

@deep-symmetry: I think I know who you are.

devn02:11:18

Welcome!

deep-symmetry03:11:07

Hi, @devn, you do indeed! simple_smile

eraserhd03:11:54

Why would I lose metadata on an object (a defrecord) that I assoc to a defrecord, then retrieve?

eraserhd03:11:02

Ugh, a typo. nm

roelof12:11:11

Someone who has succeed in running clojure with codeenvy ?

roelof14:11:57

Does someone succeed in running clojure on codeenvy ?

paulspencerwilliams15:11:39

I’m not convinced this is that right channel, but I’ll try… Does anyone know how to get the current username from https://github.com/cemerick/friend?

paulspencerwilliams15:11:16

I have successful facebook authentication working, but there’s little in the ring request map of interest.

majenful15:11:49

What’s the simplest way to upload a file (picture) with a compojure app ? Java’s library ? lib-noir (not outdated ?) ? Other ?

xeqi16:11:34

@paulspencerwilliams try (:username (friend/current-authentication))

roelof16:11:05

Anyone knows a good cloud ide that I can use for clojure?

bherrmann16:11:15

Hi. I'd like to deploy a reagent project to tomcat. I created a "lein new reagent myapp" project, then I added the lein-ring plugin. Then I "uberwar" and deploy. But I get the "ClojureScript has not been compiled!" message.... despite it being compiled during the "lein ring uberwar" What am I missing?

paulspencerwilliams16:11:13

xeqi: unfortunately there’s no :username attribute. Infact friend/current-authentication brings back

{:identity {:access-token “blahblahblah"}, :roles #{:friend-oauth2-examples.facebook-handler/user}}

xeqi16:11:59

Ah right, its whatever the credentials-fn returned, which oauth sends back :identity ...

xeqi16:11:10

I've only used it for local authentication. Maybe https://github.com/ddellacosta/friend-oauth2/wiki#5-set-up-your-credential-fn-to-find-user-metadata could have something useful

paulspencerwilliams16:11:26

xeqi: cheers, that pointer looks useful.

jaen17:11:25

Hm, anyone knows offhand if there is a way for many consumers to take from an async channel, competing for the messages? Is just several go loops doing !< on the same channel enough, or something has to be done like with mult or pub?

Alex Miller (Clojure team)18:11:40

multiple consumers can take from a channel

jaen18:11:40

Gotcha, thanks

roberto18:11:37

is there a dissoc-in in standard lib?

Alex Miller (Clojure team)18:11:53

but you can get similar effects via update-in

roberto18:11:04

oh, ok, thank you

Alex Miller (Clojure team)18:11:17

where the update fn is dissoc

roelof18:11:38

Is the brave book the best book for a beginner to learn clojure

doddenino18:11:08

roelof, I don't know if it's the best, but I liked it a lot simple_smile

roelof18:11:53

doddenino: thanks, Did you did and read the exercises of the whole book

roelof18:11:10

Exercise 5 and 6 of Do things chapter looks difficult to me

doddenino19:11:07

I read the online version some time ago, so I don't remember the excercises very well sorry!

roelof19:11:40

oke, brave is rewritten some weeks ago

roelof19:11:37

anyone tips for exercise 5 and 6 of this page : http://www.braveclojure.com/do-things/

doddenino19:11:29

Where are you stuck? Do you have anything working?

roelof19:11:30

at that point I have nothing. I have no idea how to solve this. changing the first half and named it middle or change something in the other functions which makes the left part

paulspencerwilliams20:11:08

xeqi: that worked a treat, got it all working. Cheers!

tdantas21:11:04

on FP we are always trying to achieve pure function/referential transparency. The FP holy grail. In a web application , how you guys are trying to achieve that ? the handler will receive Database / Email / Remote Services / http Request ?

(POST "/endpoint" request (handler db email-service remote-service request))

tdantas21:11:36

how do you guys try to achieve that ^^ ?

spei21:11:36

roelof: perhaps being comfortable with adding stuff to maps will help? You should be able to go from

{:a 1} -> {:a 1 :b 2}
. Then the problem becomes how do you read a key -> rename it -> add new key into map.

pguillebert23:11:55

tdantas: I understand your frustration. I suppose stuart sierra’s component (or similar libs) can help you decomplect the calls depending on other systems. I still have to try it myself though.

tdantas23:11:36

@pguillebert: reading right now simple_smile

eraserhd23:11:27

tdantas: I often try to isolate the state mutation on the “outside”, though this is often a design problem. There’s not often a single way to do this.

eraserhd23:11:31

For example, with database, I recently built a system where a lot of computation happened, but on just one record per request which needed to be locked for serialized updates. So my handler got the record, called a pure function, and put the result back in the database.

eraserhd23:11:01

The computation was a couple thousand lines, but pure and easily testable.

jaen23:11:31

How can one use apply with a Java interop method?

eraserhd23:11:33

I’m also writing an editor with a similar structure.

tdantas23:11:42

open source ?

tdantas23:11:50

what is the gh ?

eraserhd23:11:55

Essentially all the side-effecting happens in avi.core, the rest is pure. With one little exception that I don’t know how to solve 😄