Fork me on GitHub
#clojure
<
2015-09-18
>
wqhhust00:09:48

did anybody use clj-webdriver? in the wiki, it used a set-driver! function, but if look at the github source code, I can't find such method.

lvh05:09:12

Can anyone recommend a static site generator for not-just-a-blog? Most of them seem to be focused on blogs.

bensu07:09:45

@lvh I'm using https://github.com/magnars/stasis which is very very bare

bensu07:09:22

it offers some functions to read static files/templates and some other functions to write them. it's up to you to build a pipeline in the mirror

bensu07:09:42

I'm using it for a blog that might evolve into something more interesting

bensu07:09:54

but I'm happy with it

magnars07:09:53

@lvh @bensu I wrote Stasis because I was specifically not creating a blog, but wanted to build a smart static site (automatic cross-linking etc). Happy to answer any questions about it.

bensu07:09:51

@magnars: thanks! i had the same set of needs and it works very well.

Pablo Fernandez08:09:54

Anybody using Braintree? do you know if their v.zero API supports storing CC details in the vault?

borkdude11:09:45

Fun trick question. Why does this return the empty list? (remove (comp zero? :questions) ({:questions 1} {:questions 0}))

magnars11:09:37

because you're not making a list simple_smile

magnars11:09:03

that was tricky to spot

borkdude13:09:45

what's the difference between ns-unmap and ns-unalias

arrdem13:09:52

borkdude: looks like unalias is for refers

borkdude13:09:50

I did (ns-unmap ns 'html) because I referred the html function from hiccup.core, that worked

arrdem13:09:03

Not sure. they're both single form interop fns on clojure.lang.Namespace, I'd have to dig that source out.

bronsa13:09:50

@borkdude: ns-unalias removes an alias (e.g clojure.string :as s), ns-unmap removes a mapping (e.g. clojure.string :refer [trim])

craigglennie14:09:52

Hi, I have some code that writes out a CSV file of numbers, and I'm sometimes seeing "230" and sometimes "2.3E+2". I don't understand why I'm getting the latter (I realise this may be more of a Java question than strictly a Clojure question)

craigglennie14:09:27

I'd like to just write out the normal form of the number (230, not 2.3E+2) because I'm not sure the software reading the CSV file will understand the other form

craigglennie14:09:01

Is there some form of the number 230 that would cause it to be written as 2.3E+2 when str is called on it? That's all that the data.csv writer seems to do

rauh14:09:11

@craigglennie: "230" would be an integer and the "2.3e+2" is a float. THe latter is also called "scientific notation" and produced by "format %e" across most languages

craigglennie14:09:01

Thanks @r4um. I wasn't able to reproduce until just now. I see that (str 2.4E+2) -> "240.0" but (str 2.4E+2M) -> "2.4E+2"

lvh15:09:36

magnars: cool, thanks!

borkdude16:09:14

I'm currently running lein check combined with lein auto. Makes refactoring a little easier

borkdude16:09:16

maybe it would be better if I could configure lein auto to wait for some input and then do the job. Does something like that exist?

borkdude16:09:58

of course I could let lein auto watch a specific file and edit the file when I need to perform the action again

tsdh18:09:32

Grrr, clojure 1.8.0-alpha5 seems to be not available anymore from maven central.

tsdh18:09:54

It's still listed on http://repo1.maven.org/maven2/org/clojure/clojure/1.8.0-alpha5/ but clicking the jar link gives a 404.

tsdh18:09:21

And now my travis builds fail because they can't download the deps. 😞

Alex Miller (Clojure team)18:09:35

that's super weird. I file an issue with sonatype.

tsdh18:09:51

Yeah, just found that, too. simple_smile

sgrove18:09:53

I thought the problem would be lein’s preference for nrepl 0.2.6, but 0.2.11 is clearly loaded there

pbostrom18:09:35

you need [cider/cider-nrepl "0.9.1"] plugin in your project.clj or profiles.clj

pbostrom18:09:57

also, there is a #C0617A8PQ channel if you continue to have trouble

sgrove19:09:20

@pbostrom: Thanks, will move the convo there

jaen19:09:25

Is there a limit to what you can upload to Clojars? If so, would 3.1M + 2.0M jars be over that limit?

curtosis20:09:26

anyone tried running clojure/ring under Spring Boot? Googling has so far been unhelpful, especially given boot+clojure as the wrong pair for this sense.

gtrak20:09:31

I do it under dropwizard.

gtrak20:09:47

also I built a prototype servlet-filter->ring thing

gtrak20:09:53

that might be helpful

gtrak20:09:59

but it's not tested at all.

curtosis20:09:20

it looks like you probably have to do something similar: build a Java class with the right annotations for dropwizard/Spring.Boot to find

beppu20:09:44

@jaen: There seems to be a max-file-size of 2MB for uploads in clojars-web: https://github.com/ato/clojars-web/blob/master/src/clojars/scp.clj#L17

jaen20:09:31

@beppu: whoops, what now, any place where I can upload it then?

beppu20:09:07

I don't know. Maybe you can ask @tcrawley to adjust the limit? (Out of curiosity, what are you trying to upload and why is it so big?)

jaen21:09:42

@beppu: I want to host a jar of closure compiler somewhere.

jaen21:09:50

And why is it so big then I wouldn't know; I don't really understand how ant and maven work, I trust GClosure guys to have setup it properly.

jaen21:09:32

And cljs compiler isn't all that much smaller either.

tcrawley21:09:46

@jaen: the limit @beppu found is just for scp uploads, I believe the limit for http uploads is larger

tcrawley21:09:53

but I'm not sure what it is

tcrawley21:09:21

@jaen: was your deploy rejected?

jaen21:09:55

> Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://clojars.org/repo/org/clojars/jaen/closure-compiler/1.0-SNAPSHOT/closure-compiler-1.0-20150918.200014-1.jar. Return code is: 413, ReasonPhrase: Request Entity Too Large.

jaen21:09:57

Is what it said

tcrawley21:09:55

hmm, we have jars larger than 5Mb in the repo. that error sounds like it's coming from nginx

tcrawley21:09:10

what is the actual size of that jar?

tcrawley21:09:25

I just checked the nginx config, and the max body size is set to 20Mb

tcrawley21:09:38

so something 5Mb should be fine

jaen21:09:43

Welp, I killed the dir, but it was about 3.1M (classess jar) + 2.0M (sources jar) I think. And when I do ant build I end up with a 6.1M jar

tcrawley21:09:58

is there a proxy between you and clojars?

jaen21:09:01

But I'm not really sure which one mvn tries uploading

jaen21:09:22

How would I test that? I'm not using one consciously at least

tcrawley21:09:40

if you mvn install, that jar should end up in target/

tcrawley21:09:15

I don't know how to check for a proxy, but you would likely know (it would be a corp restriction or somesuch)

tcrawley21:09:28

let me look in the clojars log

tcrawley21:09:43

hmm, "client intended to send too large body: 3223815 bytes"

tcrawley21:09:48

that's only about 3Mb

tcrawley21:09:59

let me check the config again

jaen21:09:34

-rw-r--r--  1 jaen users 3.3M Sep 18 23:43 closure-compiler-1.0-SNAPSHOT.jar
-rw-r--r--  1 jaen users 2.0M Sep 18 23:43 closure-compiler-1.0-SNAPSHOT-sources.jar

jaen21:09:41

Is what I get after mvn install

tcrawley21:09:19

we're running that version of nginx, and have it in a location block

tcrawley21:09:25

let me mess with it for a sec

jaen21:09:44

Hah, thanks for investigating that

tcrawley21:09:43

@jaen: can you try to deploy again now?

jaen21:09:41

Hm, give me a second, I wiped the hacked pom, need to reproduce it

jaen21:09:25

I'm no longer getting size error, but I'm getting

jaen21:09:33

Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: . Return code is: 401, ReasonPhrase: Unauthorized.

jaen22:09:09

But project root is probably not where I should have put settings.xml then

tcrawley22:09:36

@jaen: good deal! my pleasure.