#clojure log - Sep 08 2015

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:48 KD35: hello

0:48 mungojelly: KD35: hi

0:48 KD35: i'm recently giving a try to clojurescript

0:49 and i found figwheel and reagent but couldnt udnerstand what's the basic different from each other

0:49 ska-fan: kavkaz: amalloy_: Thanks! :)

0:50 KD35: looks like both are using react feature

0:51 and even i can even start reagent app with 'lein figwheel'

0:52 was it actually different at the beginning but now it reached to same or

0:52 am i just not understanding the difference?

0:56 mungojelly: KD35: i'm new here so idk but it seems to me like reagent is some way of programming webpages, and figwheel is some way of enlivening that so it changes as soon as you change the code

0:57 justin_smith: mungojelly: that's pretty much it - reagent is a lib for dom update, figwheel is for live update and it gives you a live clojurescript repl to control or investigate the state of the browser

1:00 KD35: then figwheel includes reagent?

1:00 justin_smith: no

1:00 not at all

1:01 KD35: im new on web development as well as clojurescript

1:01 maybe i don get what update dom means

1:02 justin_smith: it means changing the contents of the page

1:03 KD35: then what 'figwheel is for live update' means?

1:03 isnt it abt update dom?

1:03 justin_smith: it is for changing your clojurescript code

1:03 which is not the same as changing the dom

1:03 KD35: aha

1:03 justin_smith: it changes the code that changes the dom

1:03 or you can use it to evaluate arbitrary clojurescript code

1:04 which could interact with reagent, but it might not

1:04 KD35: one more newbie questions, what is the case of dom update without changing code?

1:05 justin_smith: for example you have a click handler

1:05 your code changes the dom when the click happens

1:05 but that isn't changing your code

1:06 KD35: ok.. i think i almost got it

1:06 as i mentioned just above, i could start reagent app with 'lein figwheel'

1:07 justin_smith: yes, reagent uses react, which is a lib that the browser loads

1:07 KD35: doesnt it mean recent reagent project is including figwheel?

1:07 justin_smith: no

1:07 well - your project has a dependency for figwheel

1:07 but reagent does not

1:07 KD35: i got it.

1:08 justin_smith: reagent generates javascript that is loaded by your browser, figwheel can serve and update that javascript

1:09 KD35: justin_smith: thanks it was big help

1:10 justin_smith: KD35: clojurescript is very powerful, but in some ways it isn't very friendly if you don't know much javascript or clojure yet. You can probably figure it out but some things will be weird until you understand js and clojure better.

1:10 and browsers

1:10 well - I guess some stuff stays weird no matter how mcuh you learn

1:10 haha

1:12 KD35: justin_smith: im sure that makes the challenge more interesting.

1:12 thanks again

1:15 justin_smith: KD35: you are free to ask clojurescript questions here, but there is also #clojurescript too

1:19 oh, and now I see you asked there first :P

1:21 KD35: justin_smith: maybe i was too hurry haha

1:21 justin_smith: this channel tends to be a bit more active, and there is definitely some crossover of people who know clojure and clojurescript

2:04 kavkaz: amalloy: I made quite a long solution for #70, I did everything manually you could say

2:05 devtrope: Is it normal to see the heap slowly tick up toward it's max setting over many, many, many hours?

2:20 TEttinger: devtrope: I'd hope not

2:21 sounds like some sort of leak

2:21 devtrope: Hm. I've never seen it not do that, actually, but I don't often look.

2:22 TEttinger: some long-lasting loop that's accumulating references that can't be GCed, maybe

2:23 devtrope: This sort of thing: https://dl.dropboxusercontent.com/u/1266271/creep.png

2:24 I've got a ScheduledThreadExecutor that runs a function once a minute that pulls down data from a web api, does some transforms, then stuffs it in a db, then exits.

2:24 TEttinger: is the data still in memory?

2:24 devtrope: Not that I know of. I don't stuff it in an atom.

2:25 TEttinger: odd is that there's a spike every 30 seconds there

2:25 actually two, one smaller

2:26 devtrope: It's once a minute, which is how often the function runs. Pulls down a lot of data, runs some inserts, then throws it away.

2:26 TEttinger: but check the time on the graph

2:26 every 5 minutes, there's roughly 10 spikes

2:27 devtrope: Yeah, you're right.

2:27 TEttinger: maybe it's taking longer than 30 seconds to do the processing, so it GCs halfway through

2:28 devtrope: Does a bunch of requests. My little metric says it takes about 5 seconds.

2:28 Maybe it's 1/2 the web stuff, then some sort of postgres driver thing?

2:28 TEttinger: hm... can you profile it?

2:29 for time and/or memory usage

2:29 JVisualVM, comes with JDK!

2:29 devtrope: When I run a sample, most of the data is char[] and byte[] and object[] and long[].

2:30 TEttinger: the Object[] might be interesting.

2:30 (some of those might somehow be doing JNI stuff for postgres if it's calling a C driver)

2:31 devtrope: It's just the regular old jdbc driver, far as I know.

2:31 TEttinger: I wonder if this is the A in HAMT, the data structure clojure uses heavily...

2:32 hash-array-mapped tries

2:32 no idea how HAMTs are internally, or what it takes to make them not GC certain parts

2:32 devtrope: But in general, you wouldn't expect things to ratchet up over time until there was some sort of balance for what remains in memory before a GC?

2:33 TEttinger: I haven't done enough watching of long-running processes to know if there's a point when they stop trying to acquire more heap

2:33 devtrope: Seems like it would smooth out after a while.

2:34 TEttinger: actually let me check my lazybot that's been open for a few days

2:35 devtrope: I had a service that kept a LinkedBlockingQueue full and that OOM'd fairly quickly. Some old bug where references weren't ever let go until the queue was empty.

2:35 Switched to ArrayBlockingQueue and solved. But it seems like that was proven by the process not dying. VisualVM didn't help.

2:36 TEttinger2: oh wow. my lazybot actually uses less memory every time someone enters a command

2:37 it spikes up about 8 mb, then goes down 10 mb after gc

2:37 opqdonut: heh

2:37 devtrope: I'm running this process on a 512MB virt. Just set max heap to 40mb, so perhaps something will shake out.

2:38 TEttinger2: heh, the lazybot is using 362,132 KB of RAM

2:38 devtrope: TEttinger: Some of that object[] might be my jmx observation stuff. ;)

2:43 Actually, heapdump -> classes -> instances shows a lot of clojure docstrings.

2:44 TEttinger: they might be interned?

2:44 are there duplicates?

2:45 devtrope: I don't think so. I just happened to click on one that had something like that in it.

2:51 Surely the act of monitoring via visualvm isn't having an effect.

5:20 jonathanj: what does one normally call a function that takes an ordered sequence of inputs and gives you the first "not empty" result?

5:23 oddcully: ,(some not-empty [nil [] "" "lerl"])

5:23 clojurebot: "lerl"

5:27 jonathanj: ah (some) is what i was looking for, thanks

5:47 ashnur: so, i am completely new to clojure. and i know nothing. but i know that lein starts slow because has to start the jvm and all the other stuff. but it's soooo damn slow. is it really something which doesn't bother people at all?

5:49 nooga: ashnur: it bothers us but not very much since when you develop an app you don't restart leiningen a lot

5:49 usually you

5:49 oddcully: might also depend on your box

5:49 nooga: ...you'd start something lein repl or lein ring server-headless which will reload your code

5:50 ashnur: yeah but still, starting it feels so heavy

5:50 nooga: and you develop your project without "recompiling" all the time

5:50 ddellacosta: argh, half an hour trying to decipher "java.lang.IllegalArgumentException: No value supplied for key: true" when I missed a ":refer" in my require statement. *grrr*

5:50 ashnur: it's like i am operating a multi ton machine

5:50 ddellacosta: sometimes Clojure exceptions really are terrible

5:50 oddcully: i don't mind the 2s it takes to start, since i have it running a very long time before i have to restart

5:50 nooga: I didn't notice on my machine

5:50 oddcully: if you don't need the "repl" part you can also start just java -jar clojure.jar

5:50 ashnur: when something starts this slow scares the shit out of me, it tells me that there is so many things happening, i will never understand exactly whats happening

5:51 2s?

5:51 if it were 2s, i wouldn't come here crying

5:51 MasseR: ashnur: that's the reason I stopped with clojure a few years ago :)

5:51 oddcully: yes. i have several plugins installed and some of them with "RELEASE" versions. so i guess some time goes into it looking for new versions

5:51 nooga: ashnur: clojure compiles stuff and calculates vars during startup

5:51 MasseR: It took something like 14 seconds to run a hello world

5:52 ddellacosta: MasseR, ashnur: the general usage is not to start and stop the repl constantly.

5:53 MasseR: ddellacosta: agreed. It is much better for daemon-kind of software. My use case was more like command line tools

5:53 ddellacosta: MasseR: yeah, it sucks for that. :-/

5:54 nooga: MasseR: write a daemon and bash script to interact with the daemon then :D

5:54 MasseR: nooga: or write it in chicken scheme :)

5:54 ddellacosta: MasseR: also, may want to take a look at https://github.com/pixie-lang/pixie

5:55 Clojure-influenced RPython-based lisp

5:55 MasseR: That .. sounds somewhat perverse

5:55 But definitely interesting

5:55 ddellacosta: MasseR: oh, you want perverse? https://github.com/alandipert/gherkin

5:56 MasseR: ...

5:57 ddellacosta: that one always gives me a chuckle

5:59 nooga: ...

6:01 haskell in rc is next

6:02 ddellacosta: nooga: what's rc?

6:04 nooga: https://en.wikipedia.org/wiki/Rc

6:05 ddellacosta: wow, never heard of that before. Thanks nooga

6:05 irctc_clojure: hi~

6:06 nooga: ddellacosta: Plan 9 and friends are awesome if you're looking for weird software

6:06 and it's good software IMO

6:06 ddellacosta: nooga: yeah, neat stuff, I really have to learn more about Plan 9

6:06 hello irctc_clojure

6:32 ashnur: that gherkin thing

6:32 almost killed me

6:32 i am crying

6:32 ddellacosta: :-)

6:32 don't die ashnur

6:33 ashnur: well, that's a promise no one should make

6:33 you can't keep it :)

6:33 clojurebot: It's greek to me.

6:34 ddellacosta: fair enough

6:34 let's just say, don't die because of gherkin

6:34 I think Alan Dipert would be sad, in particular

6:35 ashnur: Error loading refactor-nrepl.ns.clean-ns: clojure.lang.ArityException: Wrong number of args (2) passed to: StringReader, compiling:(abnf.clj:189:28)

6:35 this is why it takes so much, there is some timeout

6:35 Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.ns.clean-ns/wrap-clean-ns in this context, compiling:(/tmp/form-init6407138815863348269.clj:1:9428)

6:35 ddellacosta: ashnur: you're talking about starting up clojure? Are you seeing an error?

6:35 ashnur: i am trying to start the repl

6:36 will google these, probably some common error

6:36 ddellacosta: I don't know what abnf.clj is, but yeah, I've seen timeouts make it really painful

6:37 ashnur: how can i check what version of clojure I have?

6:38 oddcully: ashnur: the namespace would indicate the refactor-nrepl plugin. might be either added in your project or in your ~. might want to try without to test this

6:38 ,*clojure-version*

6:39 clojurebot: {:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}

6:39 oddcully: ashnur: ^^^ - in in repl. otherwise check your project file

6:40 ashnur: oh

6:40 ok, thanks

6:41 confuseduser: Hi

6:41 nooga: hi

6:41 ddellacosta: hi

6:41 confuseduser: What do you do when leiningen gives you possibly confusing deps error and overrides other dependencies?

6:42 ddellacosta: confuseduser: I run lein deps :tree and check the various dependencies

6:42 ashnur: this is unexpected though, i thought that i can just install clojure and do this tutorial on braveclojure

6:42 confuseduser: http://pastebin.com/W1Efa7rm

6:42 I did

6:43 but I don't what to do now

6:43 do I remove the offending dependency?

6:43 ddellacosta: confuseduser: did you add those exclusions?

6:43 confuseduser: those aren't errors

6:44 confuseduser: nope

6:44 tolu: hi

6:44 ddellacosta: those are all plugins aren't they...don't think it should affect your project

6:44 confuseduser: here's my leiningen project.clj:

6:46 http://pastebin.com/cqUSVRDU

6:46 My app currently doesn't compile

6:46 ubjar takes forever

6:46 It's a 30 line or so app

6:46 But uberjar has been running forever

6:47 ddellacosta: confuseduser: your app not compiling and the warnings you're getting are not related as far as I can tell. What's in your ~/.lein/profiles.clj?

6:47 confuseduser: here's my profiles.clj :http://pastebin.com/gN8khp71

6:48 * http://pastebin.com/gN8khp71

6:48 just the standard ones used for emacs and repl

6:48 I left uberjar running for 1.5 hours and it still isn't done

6:49 the code evaluates without errors in repl though

6:49 ddellacosta: confuseduser: yeah, all those warnings look like they're related to plugins in your profiles.clj, for the most part

6:49 confuseduser: leiningen is working perfectly, tried an helloworld app and it compiles perfectly

6:49 ddellacosta: confuseduser: I have no idea why your uberjar takes forever but could have something to do with having :aot all set

6:49 tolu: Is it possible to separate a single vector of vectors to their individual vectors?

6:50 [["1" "2" "3"] ["a" "b" "c"]]

6:50 ;;=> ["1" "2" "3"] ["a" "b" "c"]

6:50 nooga: tolu: huh? how would you return 2 or more vectors then?

6:50 ddellacosta: tolu what are you trying to do with those vectors?

6:51 tolu: of course you can apply or map over them...many ways to use them

6:51 confuseduser: ddellacosta: uberjar is set

6:51 *main is set

6:51 ddellacosta: confuseduser: set = done?

6:51 confuseduser: sorry, not sure what you mean

6:52 confuseduser: as in I followed the instructions on the leiningen tutorial

6:52 if you look at the pastebin

6:52 tolu: I have (mapv vector ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"]) that creates a new vector but I dont want the result as a vector of vectors but rather individual vectors

6:53 nooga: tolu: but they are individual vectors inside a vector :>

6:53 ddellacosta: tolu: as nooga suggested you can't return multiple values from a single function like that. What you need to do is think about how you want to use the output, and we can help you figure out the right function to use.

6:54 tolu: i.e., what do you want to do such that you think you want individual vectors as you say you do?

6:54 tolu: yes nooga: but I dont want them inside a vector

6:54 ddellacosta: tolu: we are telling you you don't have a choice...haha

6:54 nooga: tolu: then how would you like to use them?

6:54 ddellacosta: confuseduser: sorry, I'm not really sure what's going on there--but try turning of AOT compilation and see what happens

6:55 confuseduser: I'm not much of an expert on uberjar generation or AOT issues, but that's probably a good place to start, and try asking again later here

6:55 confuseduser: ok

7:04 clojure-with-pri: Hi :) is there any privacy-respectful way to get help from the Clojure community? I just feel fucked when I see Clojure google group, Cider google group… why all Google?

7:05 oddcully: you mean like irc?

7:05 nooga: clojure-with-pri: I'd go with throwaway account via tor

7:10 clojure-with-pri: @oddculy: basically yeah ;-) but I just wonder whether it's the proper place. Actually I just wanna talk about that: http://piotr-yuxuan.github.io/topics/efficient-way-to-learn-chinese/references/

7:10 but I feel like a mailing list would be a better place for this. However I can't access Clojure Google group :/

7:10 ashnur: i got the repl working, it was some bad config, but running it is still over 10 seconds

7:11 and my machine shouldn't be that slow

7:11 nooga: tolu: ?

7:11 MasseR: ashnur: it really can be that slow

7:12 It was 14s for me at some point

7:12 clojurebot: Huh?

7:13 ashnur: what can i do about it?

7:14 MasseR: ashnur: keep it running

7:16 ashnur: i just dont get it why some of what it doesn can't be saved

7:16 so it doesn't have to repeat it

7:16 tolu: So I have a file that contains three columns and each column is a vector. I want to use the three columns (vectors) to form new separate vectors depending on the number of elements in the columns.

7:16 ["1"] ["2"] ["3"] ;;=> ["1" "2" "3"]

7:16 ["1" "2"] ["a" "b"] ["10" "20"] ;;=> ["1" "a" "10"] ["2" "b" "20"]

7:17 ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"] ;;=> ["1" "a" "10"] ["2" "b" "20"] ["3" "c" "30"]

7:18 nooga: ,(mapv vector ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"])

7:18 clojurebot: [["1" "a" "10"] ["2" "b" "20"] ["3" "c" "30"]]

7:18 nooga: okay, now what do you want to do with hose thre?

7:19 those three*

7:19 oddcully: ,(apply mapv vector [["1" "2"] ["a" "b"] ["10" "20"]])

7:19 clojurebot: [["1" "a" "10"] ["2" "b" "20"]]

7:19 tolu: nooga: clojurebot: thats what I did but I want them separately. i.e without not in the square bracket

7:19 nooga: tolu: you can't have them separately flying in air, that's why I'm asking what do you want to do with mapv output

7:20 ashnur: they just want those 3 things :P

7:21 nooga: iterate over them? give them names?

7:21 ashnur: just have them without bracketing, i guess

7:21 :D

7:22 nooga: print them without the square bracket?

7:23 tolu: yes, something like that

7:24 I dont know how to really explain it because I know functions only return a value

7:24 nooga: ,(def rows (mapv vector ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"]))

7:24 clojurebot: #'sandbox/rows

7:24 Rurik: Is there any function that lets me see what another function is doing step by step

7:24 like reductions

7:24 nooga: ,(let [[x y z] rows] (println x y z))

7:24 clojurebot: [1 a 10] [2 b 20] [3 c 30]\n

7:25 nooga: that will give them names, but I think you don't know how many you'd get

7:25 tolu: nooga: yes

7:27 nooga: ,(doseq [row rows] (println row))

7:27 clojurebot: [1 a 10]\n[2 b 20]\n[3 c 30]\n

7:27 nooga: tolu: this will iterate over them with some side effects like writing to file or comething

7:27 something*

7:27 but the point is

7:28 you want a vector of vectors

7:28 Olajyd_: Hi

7:29 nooga: because if your vectors aren't inside another data structure, they're not accessible

7:30 tolu: nooga: thanks, there would be side effects but knowing there might be some methods is enough a relief. I can then look for optimising the result

7:31 nooga: cool

8:10 Olajyd_: can somebody help me with this : (apply min [“2’ “16” “25”]) ;=

8:10 can somebody help me with this : (apply min [“2’ “16” “25”]) ;=> “2”

8:11 Hi, snowell

8:12 tvaalen: You should probably ask a more specific question.

8:12 What is it you want help with?

8:13 Olajyd_: tvaalen, I want to get the minimum value from a vector of strings

8:13 oddcully: min by what definition? shortest string? min value of the number?

8:14 Olajyd_: oddcully the minimum numeric value

8:14 oddcully, yea :D

8:15 oddcully: why don't you convert the string to numbers then?

8:15 Olajyd_: oddcully I thought of that but dont knw where exactly to place the `read-string`

8:16 jeaye: could it just be something like (reduce (partial min parse-int) ["2" "16" "25")

8:16 Eh, with a ] there

8:16 nooga: or (apply min (map read-string ["1" "2" "3"]))

8:17 Olajyd_: nooga thanks, exactly what i wanted

8:18 nooga: jeaye's solution would be faster I think

8:19 you'd have to (defn parse-int [x] (Integer/parseInt x))

8:22 oddcully: Olajyd_: only use read-string if it's a) the one from edn or b) you can be 100% certain, that only numbers are there to parse

8:25 Olajyd_: Oddcully, yup. actually did a filter to collect only numeric strings, and hence the need for the function to return only the minimum value

8:27 Kneiva: t

10:19 sobel: is there a formal or semi-formal name for the functions/pattern that start with with- like with-open, with-transaction, etc?

10:20 are those closures?

10:30 MasseR: More like higher order functions

10:30 Leonidas: no, it's not closures, that's something different

10:31 transaction wrappers? But that's not actually a term I'd use.

10:32 MasseR: sobel: closures are functions that close over some variable. (defn [x] (fn [] x)), here the anonymous function closes over the x.

10:45 sobel: ok, wikipedia enlightens enough on what closures are, and they're not what i'm trying to identify in the with-* pattern/macro/functions

10:46 dstockton: contextual wrappers?

10:46 they provide some context and make sure it doesn't leak and closes down properly

10:47 sobel: yes, my emphasis is on wrapping and leak-proofing

10:47 rather, wrapping for the purpose of leak-proofing

10:49 dstockton: right

10:50 python has a similar construct and calls them context managers

10:50 sobel: hm, i'm starting to think closure might actually fit and i'm just looking at a corner-case.

10:50 dstockton: it's sort of like a closure, but not in the normal sense

10:50 sobel: yeah, i'm plenty familiar with OO nomenclature for this

10:50 dstockton: it closes over a transaction or other IO operation usually

10:51 sobel: weird because we're interested in the side-effects

10:51 and the leak proofing

10:51 MasseR: dstockton: do they really close over?

10:52 Isn't it rather (with-file (fn [fd] (dostuff fd)))

10:52 Sure you can have outside context closed over, but it has nothing to do with the with-file

10:53 sobel: how about 'resource acquisition pattern'?

10:53 Or something like that

10:53 sobel: MasseR: that sounds fine to me, but will it be understood outside this conversation? :)

10:54 don't get me wrong, i'm happy to coin my own names for this but i'd like to be able to use the googles and talk to other people who aren't here

10:54 MasseR: sobel: good question. In haskell it's called 'bracket'

10:55 It's a bit ecosystem dependent I think

10:55 haskell: bracket, python: context manager, clojure: ???

10:55 :)

10:55 sobel: i guess that's just the way my cookie crumbles, then

10:55 Spring: SimpleWhateverTemplate

10:56 MasseR: :D

10:56 dstockton: they do all have 'with' in common

10:56 snowell: The with-* 'functions' are actually macros, I believe

10:56 sobel: typically, yeah

10:56 dstockton: seems that is also a haskell naming convention

10:56 snowell: So "context-macros" sounds appropriate

10:57 dstockton: 'with context' pattern

10:57 sobel: i like context-macros. gonna just roll with that until i find something better or more widely accepted.

10:58 i'm reminded of a quote i can only paraphrase now, but something about how some languages have technical frameworks/challenges to work around, but in lisp they are all social issues

11:02 dstockton: quite true i think

11:02 clojure does a good job of emphasising a 'right' way so the social issues don't get out of hand

11:31 justin_smith: when there is less RAM to spare, lisps have technical issues too :P

11:41 gfredericks: http://www.yesodweb.com/blog/2015/08/thoughts-on-documentation

11:42 ^ that's maybe one of the most saddening aspects for me about the current jira model

11:42 I know cljs added a github wiki, not sure if open-collaboration was the main motivation

11:44 though it's not as if jira can't be more automatable; could probably even make it easier than PRs, at least once you have CA+jira-account

11:44 I'm sure that's been talked about before but can't recall if anybody tried anything

11:44 drbobbeaty: gfredericks: but it's true, and there are decent reasons for the feeling. Most I've seen are that the data is structured in a pull-request, but completely unfocused on a Wiki (or it can be). That means the difficulty in _finding_ the content is _liable_ to be much harder on the Wiki. With enough experiences like that, people stop looking to a Wiki.

11:45 gfredericks: drbobbeaty: yeah I agree with the article about wikis; I haven't seen software project wikis be useful almost ever

11:45 drbobbeaty: gfredericks: ...and yet they *have* the capability... it's just not working out that way. Not that I've seen.

11:45 gfredericks: right now I'm thinking about documentation for contrib projects, and how it could likely be a lot better if the contribution process was streamlined for minor edits

11:54 puredanger: There are some plugins for newer jira that can work in combination with prs

11:54 preyalone: why do i get "lein: Text file busy", when running lein repl immediately after chmod a+x /usr/bin/lein? https://github.com/mcandre/docker-leiningen/blob/master/Dockerfile

11:55 puredanger: I have been looking at migration to jira cloud for Clojure and contrib but the migration process is pretty complicated

11:56 I've got a couple other large projects in the works before I dive fully into that one though

11:57 But just sorting through the atlassian support and license issues took several weeks so that's done at least

12:12 Olajyd: Hi All :)

12:13 I want to implement a filter function given [([Pepsi 25 34]), ([Coke 16 ] [Coke 2 3])] to give something like [[Pepsi 25 34], [Coke 16 ] [Coke 2 3]]… is this possible?

12:14 *[[Pepsi 25 34], [Coke 16 ], [Coke 2 3]]

12:14 oddcully: gfredericks: also the GH wiki is not versioned with the code and is not searchable. if you can't find it by external means or ctrl-f, you have to clone the wiki repo and grep on your own

12:15 wasamasa: ,(concat [1] [2 3])

12:15 clojurebot: (1 2 3)

12:16 Olajyd: given [([“Pepsi” 25 34]), ([“Coke” 16 “” ] [“Coke” 2 3])] something like [[“Pepsi” 25 34], [“Coke” 16 ] ,[“Coke” 2 3]] sorry for the typo

12:17 I apologize for the typo

12:18 wasamasa: ,(concat [[:foo 1 2]] [[:bar 3] [:baz 4 5]])

12:18 clojurebot: ([:foo 1 2] [:bar 3] [:baz 4 5])

12:20 Olajyd: So given [([“Pepsi” 25 34]), ([“Coke” 16 “” ] [“Coke” 2 3])] is the result of a function and I want to implement a filter that will format each element and the result after the flter will be like [[“Pepsi” 25 34], [“Coke” 16 “” ] ,[“Coke” 2 3]].. :)

12:20 wasamasa: ...

12:20 so you want to do more than concatenating two lists

12:21 sounds very much like a xy-problem if you ask me

12:21 Olajyd: ok

12:21 so how can I implement that in a filter

12:21 wasamasa: would you please explain the problem you intend to solve with this?

12:22 Olajyd: I have a large data-set to analyse, more like cleaning the dataset using a set of rules

12:25 gfredericks: puredanger: thanks for working on it

12:25 Olajyd: wasamasa, so I used group-by to get related keys, for each of this group, filter out values that are not equal to a value, after that collect everything as a set of individual rows

12:25 wasamasa, and not as groups like this [([“Pepsi” 25 34]), ([“Coke” 16 “” ] [“Coke” 2 3])]

12:26 wasamasa, just thought about it, it may not be a filter, jets implement it using a map function rather :)

12:27 *let us

12:35 puredanger: gfredericks: one of the projects in front of that is doc-related, hopefully something to talk about in near future

12:39 Bronsa: I just upgraded my slime setup to cider 0.9.1, let's see how this goes

12:39 kavkaz: Bronsa: The debugger in CIDER 0.9+ is awesome

12:40 Bronsa: I'm actually having some trouble getting it to work correctly :(

12:41 it doesn't seem to work if a function doesn't take any argument

12:42 and it's doing some weird stuff with font-locking where it doesn't reset the expression aspect after I quit the instrumentation

12:42 might be something weird with my config though

12:42 sdegutis: When provisioning a new remote web server, is it common to have to fill in details like IP addresses in its config files?

12:43 kavkaz: Bronsa: I had some problems too, especially since I use evil mode and have some extra bindings that conflict with it, but you'll find a way around these problems

12:43 sobel: sdegutis: if it's a real server i'm used to specifying what ip/ports to bind. that's not unusual.

12:44 sdegutis: but usually it comes with a questionable default that lets you get up and running for minimal purposes

12:44 sdegutis: sobel: what tools do you use to fill that in, assuming it's an automated process?

12:44 sobel: sdegutis: it's been a while since i automated that with perl-based regex replace

12:45 sdegutis: Ah

12:45 sobel: nothing pretty

12:45 from the looks of it apache and nginx both support config includes so it's not crazy to bake in a bit of generated config from the main config

12:47 gfredericks: puredanger: w00t

12:50 xemdetia: sdegutis, what I normally use is a templated shell/perl script. I pass args at shell and it writes the right config script for me

12:50 sobel: i wrote a heredoc out of a config

12:54 gfredericks: does it look buggy that this isn't a try/finally? https://github.com/clojure/clojurescript/blob/27046fc69cc720a14d3319d803766a9f651ba8e9/src/main/cljs/cljs/test.clj#L195

12:55 sdegutis: xemdetia: interesting

12:56 sobel, xemdetia: I've been using this homegrown tool https://github.com/sdegutis/management/ but I'm looking to get away from NIH-things

12:56 Most people recommend Ansible but it still looks over complicated when all I think I need is ssh/scp and something for templating.

12:58 xemdetia: sdegutis, ansible is fine but it really is a management layer than what I think you are describing

13:05 hiredman: gfredericks: yeah, also using conj and rest

13:06 conj being polymorphic, rest turning things in to seqs and operating on seqs, you have the potential for starting with a vector and ending up doing things in the wrong order with a seq

13:09 gfredericks: hiredman: oh yeah good point

13:09 hiredman: in this case it's probably assumed to be under the control of the internal code, but is probably still worth changing

13:18 amalloy: does ` not do namespace resolution in cljs?

13:18 it's just weird to me that the cljs.test functions are fully qualified, but conj isn't

13:33 sdegutis: Thanks everyone.

14:14 dnolen: amalloy: this is an old hack, syntax quote will resolve clojure.core syms of course macros will refer to them and they will have equivalents in cljs.core

14:14 amalloy: in the compiler we swap clojure.core for cljs.core

15:25 felipedvorak: any idea of a good resource to learn regexp?

15:26 pbx: felipedvorak, http://www.regular-expressions.info/

15:27 felipedvorak: pbx: thanks

15:35 pbx: does clojure use a special kind of regexp or the common one?

15:35 oddcully: felipedvorak: it uses the java ones

15:35 Empperi: define "common ones" :)

15:36 should I read it as "the perl version"? :)

15:36 felipedvorak: I don't really know, but I guess I'll refer to what my mind called "common one" as "perl version" from now on then XD

15:37 Empperi: anyway, it uses java regexps like said above

15:37 which is one of the better implementations

15:37 oddcully: #"(?i)lerl" vs /lerl/i

15:37 Empperi: the java API to use regexps is horrid but fortunately clojure provides nice to use api

15:38 it has pretty much all the bells and whistles you'd need from regexp engine though and it's fast

15:39 felipedvorak: awesome, I'll try to find a tutorial on java regex

15:39 Empperi: named groups, lookbehinds/aheads and so forth are all supported

15:39 felipedvorak: http://www.regular-expressions.info/java.html

15:41 felipedvorak: sweet, thanks everyone

15:42 Empperi: felipedvorak: however, when using clojure you can use the #"pattern" -syntax

15:43 felipedvorak: got it

16:52 nooga: I have a gen-class with only ^:static methods and I'd like to have static state

16:52 clojurebot: No entiendo

16:52 nooga: is that possible?

16:52 hiredman: static state is def

16:52 clojurebot: static state is def

16:53 clojurebot: In Ordnung

16:53 nooga: I'm exposing this to Java

16:53 hiredman: so?

16:53 clojurebot: so is (add-to-list 'erc-keywords '("\\bso\\b" erc-default-face))

16:54 nooga: I don't like the idea of having (def foo (atom something)) in my namespace

16:54 rhg135: Write a static method to retrieve the immutable state

16:54 hiredman: why?

16:54 nooga: done

16:54 clojurebot: hiredman: because you can't handle the truth!

16:55 hiredman: it is semantically the same as a java static variable in a class

16:55 nooga: I was just wondering is I can utilize gen-class :state here

16:55 mdeboard: Does anyone know if the Eulalie lib will read from ~/.aws/credentials ?

16:56 hiredman: (def foo (atom something)) is just as gross as a static variable, so I suspect you are fooling yourself

16:56 rhg135: Static state seems limited

16:56 hiredman: a global def for state looks gross, so I will hide it in some gen-class construct, which is semantically identical

16:59 rhg135: Slightly less gross than a static field. As it's atomic at least

17:01 nooga: look, this is just an interface to my whole program, used in java like this: Foo.init(); Foo.startService(); Foo.stopService(); Foo.deinit();

17:02 it's static because nobody will need instances of it

17:03 hiredman: right, and you want to stick a global reference to that state some where

17:03 nooga: right

17:03 hiredman: a global reference is a def

17:03 nooga: okay then, def it is

21:00 mordocai: I've messed up something, probably dumb. I'm getting https://www.refheap.com/109330 on this project: https://github.com/mordocai/clojure-maildir. As far as I can tell I have the leiningen defproject and require statement right for test.chuck but it doesn't like me. Anyone see what is wrong?

21:01 Annnnddd.... stupid one letter typo in the require.

21:02 Sigh, always happens right after I ask.

21:39 mungojelly: how do i collapse (a (b (c d))) into something reasonable like (something d c b a) or w/e pls?

21:45 TEttinger: mungojelly: are those function calls?

21:45 mungojelly: TEttinger: yeah, call c with d and then call b on that and then a on that

21:45 TEttinger: gotcha

21:46 that seems like ->

21:46 ,(str (inc (char \A)))

21:46 clojurebot: #error {\n :cause "java.lang.Character cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Character cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers inc "Numbers.java" 112]}]\n :trace\n [[clojure.lang.Numbers inc "Numbers.java" 112]\n [sun.reflect.NativeMethodAccessorImpl invoke0 "NativeMethodAccessorImpl.java" -2]\n [sun.re...

21:46 TEttinger: ,(str (inc (int \A)))

21:46 clojurebot: "66"

21:47 TEttinger: ,(char (inc (int \A)))

21:47 clojurebot: \B

21:47 mungojelly: or is it idiomatic in clojure to think (a (b (c d)))? i was just thinking to myself (compose (light-blue (wiggly (ferns))) (dark-blue (wiggly (ferns))) (green (wiggly (ferns)))) and i felt like, that can't be quite right

21:47 TEttinger: ,(-> \A int inc char)

21:47 clojurebot: \B

21:47 Wild_Cat: mungojelly: (-> initial-value fn1 fn2 fn3)

21:48 TEttinger: yep

21:48 Wild_Cat: also works if your fns take extra arguments. -> will place your value as the first argument to the fns, ->> as the last

21:48 TEttinger: about to say that, heh Wild_Cat

21:49 mungojelly: Wild_Cat: ok i'll look up -> thanks, looks beautiful, clojure is a beautiful language with all the {}[] and such i'm enjoying it

21:49 mordocai: Alright, now that I have my tests running at all... I'm getting a nullpointer exception in test.check and having trouble tracking down the cause. Stacktrace: https://www.refheap.com/109333 and code: https://github.com/mordocai/clojure-maildir/blob/master/test/clojure_maildir/core_test.clj#L37-L39

21:49 mungojelly: It's called the thread-first macro, for better googling

21:55 newtoclojure: Hello

21:55 How do I compile java files installed by maven install?

21:56 I.e. I only have the java sources compiled by maven install, how do I install it from leiningen?

22:05 mordocai: Is it possible yet in cider to enter debug mode where an exception is encountered so I can see the locals + stack at that point?

22:05 I don't see a way in the docs

22:06 chomwitt: i read about refer and require and i dont get it.. the difference about refering to another namespace's symbols either with their full name or not seems superficial. Is there any other difference more profound?

22:11 amalloy: chomwitt: require causes namespaces to be loaded; refer does no loading, but provides local aliases for the vars in another already-loaded namespace

22:13 chomwitt: amalloy: but what are the implications of 'loading' another ns ? what does it mean?

22:13 i mean ..

22:13 gfredericks: mordocai: oh!

22:13 amalloy: if you don't load it, none of the stuff it defines will exist

22:13 gfredericks: mordocai: I bet you want gen/gen-fmap → gen/fmap

22:14 chomwitt: ..in the explanation and tutorial i read it seems that the diff is only a matter of convenience to avoid the full qualified name

22:14 amalloy: that is what refer does

22:14 gfredericks: mordocai: the gen-foo functions are lower level, almost never useful for users

22:14 chomwitt: i've not read so far sth like :" also require will also do that .. and that.. and that means ..that :" :-(

22:14 :-)

22:16 amalloy: but in eather case i can call another ns's function then what's the diff?

22:16 amalloy: but if in eather..

22:16 amalloy: you can't

22:16 if you never require the namespace, stuff in it does not exist, at all

22:18 chomwitt: amalloy: i dont get it.. i've just made in a lein repl and example of calling another ns's function by only using refer. i didnt use require

22:18 amalloy: because that namespace was already required

22:18 it's a two-step process stuff in the namespace doesn't exist ==require==> you can use stuff in the namespace via its full name ==refer==> you can use a shorter name

22:18 emdashcomma: Why would the same code work if I type it in a lein repl started from a terminal, but not if I start the lein repl with that code in src/.../core.clj?

22:19 Er, "lein repl started from the terminal" meaning outside of that project

22:20 chomwitt: as i get it ns-map shows me the 'stuff' that i can refer to. how can i see the 'stuff' that is required in my current ns?

22:20 so that i can see the diff you say

22:37 amalloy: chomwitt: create a file (ns my.ns) (def foo 1), and put it in src/my/ns.clj

22:37 now try accessing my.ns/foo

22:38 then require my.ns, and try again

22:39 chomwitt: one moment

23:04 amalloy: ok

23:06 i had to use the full name from my myappname/core.clj in the require in order to use the symbol in myappname/myns.clj

23:31 justin_smith: chomwitt: did you use an :as or :refer clause at all?

Logging service provided by n01se.net