Fork me on GitHub
#clojure
<
2016-04-11
>
escherize01:04:08

why does this string fail to be read: "What\'s"

skynet01:04:44

java.lang.RuntimeException: Unsupported escape character: \'

skynet01:04:13

so just use "What's"

urbanslug08:04:35

Hey when I want to write a lot of comments in a namespace do I do it before or after the namespace declaration?

urbanslug08:04:52

Like say what the namespace does or doesn’t and what not

rauh08:04:05

@urbanslug: This goes right after the ns name: (ns foo.core "your doc string" ...)

urbanslug08:04:37

Oh I didn’t know that a namespace could have a docstring.

casperc09:04:01

What is the best way to embed an NREPL server in a jar? I have a job that I am running on a remote server that I want to be able to hook into via nrepl. Right now I am adding a dependency to NREPL and running (nrepl/start-server :port 7888) but it opens a repl prompt when running the jar. What I am looking for is for it to allow connections in the background without opening the prompt.

casperc09:04:21

Anyone have experience doing this?

fp10:04:35

I'm looking for a small open source project in clojure to contribute to. Any ideas?

sveri10:04:21

@fp depends on the domain you want to work on

fp10:04:59

Mathematics or algorithms

fp10:04:33

Anything to get me deeper clojure knowledge is good though

raynes11:04:21

it's so wild we have a slack now.

fp11:04:38

@sveri: does that help?

darwin11:04:26

@casperc: AFAIK clojure.tools.nrepl.server/start-server does not start a repl prompt, it just runs the server

zzamboni11:04:31

@fp: not open source projects, but there’s a bunch of math/algorithmic exercises on http://www.4clojure.com

darwin11:04:33

@casperc: here is what I do to start an nREPL server to run a bunch of tests against it: https://github.com/binaryage/dirac/blob/master/src/test/dirac/test/nrepl_server_helpers.clj

sveri11:04:19

@fp well, I am working on a web framework, but as this is not really math / algorithm stuff it might not be for you

fp11:04:01

@sveri Something like clojure script/om?

fp11:04:40

Thanks @zzamboni ive also done a number of the advent of code exercises that were fun -> http://adventofcode.com/

fp11:04:58

Xmas is over, but you can still do them :)

zzamboni11:04:33

@fp yw, there’s also an interesting thread about this right now in #C053AK3F9, with a bunch of good pointers

sveri11:04:46

@fp no, more like RoR so a combination of front end backend, whereas most work is done in clojure up to now

nielsk13:04:31

@fp http://open-source.braveclojure.com/ shows a list of OS projects in Clojure looking for active development

arrdem14:04:42

@raynes: whaddup slacker parrot

fp17:04:35

@nielsk: awesome, thanks

shaunxcode17:04:53

has anyone dealt with aleph and getting websocket frames to aggregate properly?

samueldev17:04:41

does anybody know if Peter Taoussanis (@ptaoussanis) hangs out on this slack somewhere? or any channel for / related to Sente (https://github.com/ptaoussanis/sente) ?

sveri17:04:27

@samueldev: not sure, but I know he is very responsive about github issues

kwladyka19:04:45

I wrote article when use vars, atoms, agents, refs and async. I share it with you http://clojure.wladyka.eu/posts-output/2016-04-06-concurrency.html Please give me feedback if all is clear. Maybe i can improve something? It is very complex topic and i want stay with short text. What do you think about flowchart? Do you agree with it? Any idea how can i do it better? I feel i can do it better but i need some feedback simple_smile

Alex Miller (Clojure team)19:04:04

@kwladyka: your let example is not an example of vars - those are local bindings, which are not global (and not vars)

kwladyka19:04:22

@alexmiller: What do you think about flowchart?

Alex Miller (Clojure team)19:04:46

well, it doesn't match how I think about it, but I'm not a big fan of these flowchart things

hiredman19:04:28

lumping core.async in with the reference types is weird

kwladyka19:04:29

It is complex topic, it is hard to make it clear on flowchart. I am open for suggestions simple_smile

hiredman19:04:24

so is a flowchart that recommends "async" over the other reference types for performance

Alex Miller (Clojure team)19:04:49

I think you are mashing together state and concurrency when they are separate concerns

Alex Miller (Clojure team)19:04:13

I tried to summarize the concurrency part of things here http://clojure.org/guides/faq#concurrency_features

kwladyka19:04:36

That is true. I wanted put in on one flowchart, but maybe it is bad idea.

sveri19:04:32

It's distracting, looking at it I was like, uhm, something is wrong here, reading @alexmiller answer made it clear what it was.

kwladyka19:04:44

thanks for your suggestions

kwladyka19:04:28

@sveri: i had the same feeling, that is why i asked about feedback simple_smile

sveri19:04:32

@kwladyka: Yea, its always nice to have so many helpful people here simple_smile

Alex Miller (Clojure team)19:04:58

another quasi category of things are things that do value conveyance - chans, promises, and maybe Java queues fit in that category

kwladyka19:04:31

So i will remove async part and change the topic to Share state - when use vars, atoms, agents and refs? I will write about concurrency maybe in another article. This one i think is closer to sharing state then concurrency.

hiredman19:04:07

the other split is in the usage of channels, queues, etc, core.async provides channels which are about value conveyance, and the go macro stuff which lets you write code that is asynchronous in its usage of channels that looks synchronous, but you can use channels synchronously as well using the block ops just fine and they work great

Alex Miller (Clojure team)20:04:10

yeah, you could see future, async/thread, and async/go, and maybe even Java executors as "process-like" things

kwladyka20:04:25

I will in the next article simple_smile

kwladyka20:04:56

thank you again! simple_smile

ethan82620:04:32

I wonder if I can bug you with a question: Is it considered more idiomatic / better practice to create several single-purpose helper functions, or to do the work with let binding (assuming each intermediate value doesn't require a ton of code)?

sveri20:04:45

@ethan826: What I mostly do is thinking about the function name. If it is save-to-db-and-send-mail it should be two functions instead. But if I can find a good name that tells the purpose of the function I'll leave it like that, as always this is a rule of thumb with exceptions.

ethan82620:04:57

@sveri: Okay, that's very helpful. In my case, the stuff in the let binding is filtering, applying frequencies, sorting by frequencies, etc., all in the service of a single purpose.

sveri20:04:00

Another pointer is that maybe some code can be reused for similar datastructures, but that then mostly goes into some kind of a helper namespace

ethan82620:04:36

Thanks. I think some of it may be reusable, so I'm following your suggestion.

sveri20:04:49

And finally, try yourself out, make mistakes, look back in 3 months, 6 months. You will recognize what you did good and what was bad.

kwladyka21:04:47

@ethan826: I am doing register-step-1, register-step-2 (as business language) and inside this functions call save-to-db and send-email (technical language). Personally i always care about simplicity, clear architecture, readability and flexibility for changes. Make glue register-step-2 for db-changes and send-email is one of the things what i am doing to achieve that. Choosing the name is sometimes difficult task simple_smile

leov21:04:55

hi guys. can I ask what are you using for authentication in your projects?

leov22:04:08

do you have anything with SAML authentication?

leov22:04:26

(web applications, I mean)

bostonaholic22:04:29

@leov: we are using Okta

bostonaholic22:04:54

(which uses SAML)

bostonaholic22:04:18

I published ring middleware for auth through Okta https://github.com/Hendrick/ring-okta

base69822:04:51

Wow, Hendrick auto was big in the area I grew up. I can't believe clojure has caught on there

base69822:04:59

and it's even the center of the universe