Fork me on GitHub
#clojure
<
2016-08-24
>
abolduc01:08:24

@pesterhazy For some reasons, it worked. Is there a bug in those middleware ? Looks like a side effect to me..

tom03:08:26

For anyone that has used Clojure Lambada for writing Jars for AWS Lambda, is there a way to decrease the size of the standalone when it's unzipped? I keep hitting the limit of lambda. I am trying to include the amazonica library, but it's quite large using the Amazon SDK.

andrewtropin06:08:40

Hey, guys. Can you suggest a topic related to clojure for my bachelor thesis? Will be grateful for any ideas.

kidpollo06:08:20

@tom you should onlu include the amazonica stuff you actually use

kidpollo06:08:11

@andrewtropin academic or practical?

andrewtropin06:08:15

@kidpollo I want to do something more practical, but academic is ok for me too.

kidpollo07:08:43

Find proof that clojure spec is better than a type system 😛

korny07:08:37

I have a weird thing - I have a very simple app that reads from in and writes to out - it does this explicitly for reasons.

korny07:08:52

It works fine with “lein run” - but when run from an uberjar, I get no output

korny07:08:07

found it - bizarre, with an uberjar I have to explicitly call (.flush out) or it doesn’t write.

korny07:08:23

(.flush \out\)

pesterhazy08:08:26

@abolduc, not a bug, it's just that properly reloading everything is error-prone, so if you run into weird problems, Just Restart The Repl [TM]

andrewtropin09:08:53

@kidpollo It was my first idea, probably I'll try to do some research on that. Any other suggestions?)

gerrit09:08:31

@andrewtropin: how about adding negation to datascript: https://github.com/tonsky/datascript/issues/50 there is even a 300$ bounty and it is both practical as well as academic

andrewtropin09:08:59

Thx a lot @gerrit . It's another interesting topic for me. I'll take a look.

rickmoynihan10:08:28

What's the easiest way to do a bounded slurp of a string from an inputstream. Basically I want to reject inputs larger than a certain size (and not consume them into memory)

rickmoynihan10:08:46

could obviously write something myself - but wondering if there's anything out there I can leverage easily

slackwise13:08:59

Pardon my ignorance, but can I release a personal Clojure project under the GPLv3 license?

alexmiller13:08:40

(caveat: this is not legal advice and it is a generally tricky area so probably don’t trust me)

alexmiller13:08:21

you can release a Clojure project under GPLv3, however users will not be able to combine that with other Clojure EPL libraries to do anything, so it is not very useful

alexmiller13:08:53

there are exception clauses you can add that may make this permissible

slackwise13:08:04

Hmm, thanks. Looks like I'll have to research the details.

alexmiller13:08:00

you may also want to consider LGPL or Apache 2

rickmoynihan14:08:42

slackwise: is there something wrong the EPL for your uses; or do you want to ideologically pick a Free Software License (nothing wrong with that btw).... Are you creating an opensource application or library? If you're writing a library I'd be strongly tempted to pick the EPL license - as other licenses might be unusable for many others. If you're creating an application you might be able to choose GPLv3 - but I don't know the details... for example it might require people to build it locally (rather than have you ship it pre-built etc...)

slackwise14:08:35

If the project is an end user app, not a library, there shouldn't be any problems though, right?

rickmoynihan14:08:57

Like I said I can't remember the details but there might be problems shipping the binary directly as you will then be distributing EPL code with additional (free software) obligations.... if end users build it they're combining it not you

slackwise14:08:10

It would be for ideological reasons, yes. The end result would be a server app and several client apps that the user would have to run and host.

slackwise14:08:31

I know I've read conflicting information from just Googling around. I wonder if the EFF would be appropriate to contact to get a confirmation: https://www.eff.org/pages/legal-assistance

slackwise14:08:22

Things seem to point to "no" due to using any Clojure libraries that are EPL licensed.

eraserhd15:08:15

Do we have an official vocabulary about the two arguments to a reducing function? I've seen result and input. I've used acc for result, but I'm not sure if I stole that or invented it.

quoll15:08:00

acc is short for “accumulator”, and has come to us historically from assembler programming

eraserhd15:08:47

@quoll That would have been why I stole it, if I stole it. 😄

eraserhd15:08:53

Except that when I did assembly, it was just A.

quoll15:08:34

My assembler was obviously a much later version, with lots of bells and whistles (like mnemonics) that made life trivial for us novice programmers of the day 😉

pesterhazy16:08:12

did not know that "accumulator" came from assembly

seancorfield16:08:42

I feel a Four Yorkshiremen moment coming on… "Assembler, eh? You were lucky! I had one job where we had to use hexadecimal and poke it directly into memory."

noprompt17:08:03

i haven't dug through jira yet but is there any prospect of supporting the #: reader with the other collection literals? e.g. #:foo #{:bar :baz} => #{:foo/bar :foo/baz}.

noprompt17:08:59

i can't think of any corner cases off the top of my head where that would be a problem in the reader.

dpsutton18:08:01

when using jdbc to delete an entire table, we are running (jdbc/delete conn tablename ["1 = 1"]) since it requires a where clause. Is there a better way to do this, like maybe (jdbc/execute! conn ["truncate tablename"])?

spei18:08:12

@dpsutton you can drop the table

dpsutton18:08:22

i'd like to not drop and rebuild the table

dpsutton18:08:37

as then i'd need a script to recreate the table which seems like extra work

dpsutton18:08:49

it's a temp table we fill with results

dpsutton18:08:54

so not looking to drop and recreate

tanzoniteblack18:08:54

@dpsutton I would probably go with truncate; but I also think you can call jdbc/delete with the where clause as just nil

dpsutton18:08:17

yeah you can call it with nil, just didn't like the way it reads

dpsutton18:08:55

introducing a new person to the codebase and they were confused by the presence of the "1 = 1", and wanted to see if there was a more readable way to do it

dpsutton18:08:55

but not a huge deal

blueberry18:08:18

@seancorfield memory? you were lucky! we had to wire vacuum tubes.

blueberry18:08:35

and we were also lucky! before that, we were building with mechanical gears...

tom19:08:20

@kidpollo Thanks, I guess I'm not clear on leiningen's way of excluding parts of amazonica, are there any keywords to look up?

wanderlustzoe19:08:32

in scala, java, etc you have:

/**
*
*/
whats the equivalent in clojure?

hans19:08:33

(comment foo bar)

hiredman19:08:57

that is not entirely correct

hiredman19:08:24

comment is a macro, meaning the arguments to it have to be valid syntax, and it expands to a result

hiredman19:08:55

so the behavior can be surprisingly different from comments like //

hiredman19:08:20

; is the closest thing, but it is more like // in C

mpenet19:08:21

You can just use a multiline string literal

bostonaholic19:08:59

@wanderlustzoe there isn’t a shortcut for multiline comments

wanderlustzoe20:08:37

thanks everyone!

stand20:08:01

Is there a clojure http library that provides the option to submit requests with a client certificate? It's not clear to me how one could do it with clj-http.

lvh20:08:40

FYI: that post should specify more clearly that you can totally do it with aleph, I just didn’t need to

lvh20:08:44

or couldn’t because of other reasons

lvh20:08:54

it’s not particularly difficult to do with Aleph, you just need to speak more netty

tanzoniteblack20:08:15

in general I prefer using http-kit over aleph, but that’s just personal preference

stand20:08:35

@tanzoniteblack Yes it does! I wasn't aware of the :keystore and :truststore options. I will have to experiment.

dfcarpenter20:08:17

So I’m trying to create an image rendering service. I want to render an html page to an image and stream the image to s3. I’m assuming a headless browser is the way to go but i’m curious if people have done this type of thing and if this is in fact the best (or only) way to go about it.

exupero20:08:25

Look up webkit2png

fenton21:08:43

is there documentation somewhere on the format allowed in clojure logging messages and % formatters?

fenton21:08:43

can i do something like: (log/debugf "My float %.1f" my-float-val)

fenton21:08:59

if i want my float to be only one decimal place.

tanzoniteblack21:08:03

I belive it just uses java’s formatters, so you should be able to use anything specified in https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html (or whatever version of java you’re using)

tanzoniteblack21:08:13

so “%.1f” will round it to 1 decimal point

fenton21:08:08

cool...gotta stop smoking crack apparently!

alexmiller21:08:24

@noprompt that’s been proposed by others. Vectors would be relatively useful and straightforward but the notation fights with literal sets and things seemed less clear by the time we got to that point. So, for now, just maps.

noprompt21:08:58

@alexmiller that's surprising it would cause a conflict. it's been a while since i read the LispReader code but it would seem relatively forward (in principle) for #: to read the next form and then determine what to do from there.

alexmiller21:08:39

I mean conflicts wrt readability

noprompt21:08:49

ha! this is lisp!

alexmiller21:08:50

#:my.ns#{:a 1}

noprompt21:08:09

i've been moonlighting in array based programming languages so it doesn't offend my eyes. but i can imagine it being a issue for others.