#clojure logs

2015-09-08

00:48KD35hello
00:48mungojellyKD35: hi
00:48KD35i'm recently giving a try to clojurescript
00:49KD35and i found figwheel and reagent but couldnt udnerstand what's the basic different from each other
00:49ska-fankavkaz: amalloy_: Thanks! :)
00:50KD35looks like both are using react feature
00:51KD35and even i can even start reagent app with 'lein figwheel'
00:52KD35was it actually different at the beginning but now it reached to same or
00:52KD35am i just not understanding the difference?
00:56mungojellyKD35: 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
00:57justin_smithmungojelly: 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
01:00KD35then figwheel includes reagent?
01:00justin_smithno
01:00justin_smithnot at all
01:01KD35im new on web development as well as clojurescript
01:01KD35maybe i don get what update dom means
01:02justin_smithit means changing the contents of the page
01:03KD35then what 'figwheel is for live update' means?
01:03KD35isnt it abt update dom?
01:03justin_smithit is for changing your clojurescript code
01:03justin_smithwhich is not the same as changing the dom
01:03KD35aha
01:03justin_smithit changes the code that changes the dom
01:03justin_smithor you can use it to evaluate arbitrary clojurescript code
01:04justin_smithwhich could interact with reagent, but it might not
01:04KD35one more newbie questions, what is the case of dom update without changing code?
01:05justin_smithfor example you have a click handler
01:05justin_smithyour code changes the dom when the click happens
01:05justin_smithbut that isn't changing your code
01:06KD35ok.. i think i almost got it
01:06KD35as i mentioned just above, i could start reagent app with 'lein figwheel'
01:07justin_smithyes, reagent uses react, which is a lib that the browser loads
01:07KD35doesnt it mean recent reagent project is including figwheel?
01:07justin_smithno
01:07justin_smithwell - your project has a dependency for figwheel
01:07justin_smithbut reagent does not
01:07KD35i got it.
01:08justin_smithreagent generates javascript that is loaded by your browser, figwheel can serve and update that javascript
01:09KD35justin_smith: thanks it was big help
01:10justin_smithKD35: 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.
01:10justin_smithand browsers
01:10justin_smithwell - I guess some stuff stays weird no matter how mcuh you learn
01:10justin_smithhaha
01:12KD35justin_smith: im sure that makes the challenge more interesting.
01:12KD35thanks again
01:15justin_smithKD35: you are free to ask clojurescript questions here, but there is also #clojurescript too
01:19justin_smithoh, and now I see you asked there first :P
01:21KD35justin_smith: maybe i was too hurry haha
01:21justin_smiththis channel tends to be a bit more active, and there is definitely some crossover of people who know clojure and clojurescript
02:04kavkazamalloy: I made quite a long solution for #70, I did everything manually you could say
02:05devtropeIs it normal to see the heap slowly tick up toward it's max setting over many, many, many hours?
02:20TEttingerdevtrope: I'd hope not
02:21TEttingersounds like some sort of leak
02:21devtropeHm. I've never seen it not do that, actually, but I don't often look.
02:22TEttingersome long-lasting loop that's accumulating references that can't be GCed, maybe
02:23devtropeThis sort of thing: https://dl.dropboxusercontent.com/u/1266271/creep.png
02:24devtropeI'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.
02:24TEttingeris the data still in memory?
02:24devtropeNot that I know of. I don't stuff it in an atom.
02:25TEttingerodd is that there's a spike every 30 seconds there
02:25TEttingeractually two, one smaller
02:26devtropeIt's once a minute, which is how often the function runs. Pulls down a lot of data, runs some inserts, then throws it away.
02:26TEttingerbut check the time on the graph
02:26TEttingerevery 5 minutes, there's roughly 10 spikes
02:27devtropeYeah, you're right.
02:27TEttingermaybe it's taking longer than 30 seconds to do the processing, so it GCs halfway through
02:28devtropeDoes a bunch of requests. My little metric says it takes about 5 seconds.
02:28devtropeMaybe it's 1/2 the web stuff, then some sort of postgres driver thing?
02:28TEttingerhm... can you profile it?
02:29TEttingerfor time and/or memory usage
02:29TEttingerJVisualVM, comes with JDK!
02:29devtropeWhen I run a sample, most of the data is char[] and byte[] and object[] and long[].
02:30TEttingerthe Object[] might be interesting.
02:30TEttinger(some of those might somehow be doing JNI stuff for postgres if it's calling a C driver)
02:31devtropeIt's just the regular old jdbc driver, far as I know.
02:31TEttingerI wonder if this is the A in HAMT, the data structure clojure uses heavily...
02:32TEttingerhash-array-mapped tries
02:32TEttingerno idea how HAMTs are internally, or what it takes to make them not GC certain parts
02:32devtropeBut 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?
02:33TEttingerI haven't done enough watching of long-running processes to know if there's a point when they stop trying to acquire more heap
02:33devtropeSeems like it would smooth out after a while.
02:34TEttingeractually let me check my lazybot that's been open for a few days
02:35devtropeI 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.
02:35devtropeSwitched to ArrayBlockingQueue and solved. But it seems like that was proven by the process not dying. VisualVM didn't help.
02:36TEttinger2oh wow. my lazybot actually uses less memory every time someone enters a command
02:37TEttinger2it spikes up about 8 mb, then goes down 10 mb after gc
02:37opqdonutheh
02:37devtropeI'm running this process on a 512MB virt. Just set max heap to 40mb, so perhaps something will shake out.
02:38TEttinger2heh, the lazybot is using 362,132 KB of RAM
02:38devtropeTEttinger: Some of that object[] might be my jmx observation stuff. ;)
02:43devtropeActually, heapdump -> classes -> instances shows a lot of clojure docstrings.
02:44TEttingerthey might be interned?
02:44TEttingerare there duplicates?
02:45devtropeI don't think so. I just happened to click on one that had something like that in it.
02:51devtropeSurely the act of monitoring via visualvm isn't having an effect.
05:20jonathanjwhat does one normally call a function that takes an ordered sequence of inputs and gives you the first "not empty" result?
05:23oddcully,(some not-empty [nil [] "" "lerl"])
05:23clojurebot"lerl"
05:27jonathanjah (some) is what i was looking for, thanks
05:47ashnurso, 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?
05:49noogaashnur: it bothers us but not very much since when you develop an app you don't restart leiningen a lot
05:49noogausually you
05:49oddcullymight also depend on your box
05:49nooga...you'd start something lein repl or lein ring server-headless which will reload your code
05:50ashnuryeah but still, starting it feels so heavy
05:50noogaand you develop your project without "recompiling" all the time
05:50ddellacostaargh, 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*
05:50ashnurit's like i am operating a multi ton machine
05:50ddellacostasometimes Clojure exceptions really are terrible
05:50oddcullyi don't mind the 2s it takes to start, since i have it running a very long time before i have to restart
05:50noogaI didn't notice on my machine
05:50oddcullyif you don't need the "repl" part you can also start just java -jar clojure.jar
05:50ashnurwhen 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
05:51ashnur2s?
05:51ashnurif it were 2s, i wouldn't come here crying
05:51MasseRashnur: that's the reason I stopped with clojure a few years ago :)
05:51oddcullyyes. i have several plugins installed and some of them with "RELEASE" versions. so i guess some time goes into it looking for new versions
05:51noogaashnur: clojure compiles stuff and calculates vars during startup
05:51MasseRIt took something like 14 seconds to run a hello world
05:52ddellacostaMasseR, ashnur: the general usage is not to start and stop the repl constantly.
05:53MasseRddellacosta: agreed. It is much better for daemon-kind of software. My use case was more like command line tools
05:53ddellacostaMasseR: yeah, it sucks for that. :-/
05:54noogaMasseR: write a daemon and bash script to interact with the daemon then :D
05:54MasseRnooga: or write it in chicken scheme :)
05:54ddellacostaMasseR: also, may want to take a look at https://github.com/pixie-lang/pixie
05:55ddellacostaClojure-influenced RPython-based lisp
05:55MasseRThat .. sounds somewhat perverse
05:55MasseRBut definitely interesting
05:55ddellacostaMasseR: oh, you want perverse? https://github.com/alandipert/gherkin
05:56MasseR...
05:57ddellacostathat one always gives me a chuckle
05:59nooga...
06:01noogahaskell in rc is next
06:02ddellacostanooga: what's rc?
06:04noogahttps://en.wikipedia.org/wiki/Rc
06:05ddellacostawow, never heard of that before. Thanks nooga
06:05irctc_clojurehi~
06:06noogaddellacosta: Plan 9 and friends are awesome if you're looking for weird software
06:06noogaand it's good software IMO
06:06ddellacostanooga: yeah, neat stuff, I really have to learn more about Plan 9
06:06ddellacostahello irctc_clojure
06:32ashnurthat gherkin thing
06:32ashnuralmost killed me
06:32ashnuri am crying
06:32ddellacosta:-)
06:32ddellacostadon't die ashnur
06:33ashnurwell, that's a promise no one should make
06:33ashnuryou can't keep it :)
06:33clojurebotIt's greek to me.
06:34ddellacostafair enough
06:34ddellacostalet's just say, don't die because of gherkin
06:34ddellacostaI think Alan Dipert would be sad, in particular
06:35ashnurError loading refactor-nrepl.ns.clean-ns: clojure.lang.ArityException: Wrong number of args (2) passed to: StringReader, compiling:(abnf.clj:189:28)
06:35ashnurthis is why it takes so much, there is some timeout
06:35ashnurException 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)
06:35ddellacostaashnur: you're talking about starting up clojure? Are you seeing an error?
06:35ashnuri am trying to start the repl
06:36ashnurwill google these, probably some common error
06:36ddellacostaI don't know what abnf.clj is, but yeah, I've seen timeouts make it really painful
06:37ashnurhow can i check what version of clojure I have?
06:38oddcullyashnur: 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
06:38oddcully,*clojure-version*
06:39clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}
06:39oddcullyashnur: ^^^ - in in repl. otherwise check your project file
06:40ashnuroh
06:40ashnurok, thanks
06:41confuseduserHi
06:41noogahi
06:41ddellacostahi
06:41confuseduserWhat do you do when leiningen gives you possibly confusing deps error and overrides other dependencies?
06:42ddellacostaconfuseduser: I run lein deps :tree and check the various dependencies
06:42ashnurthis is unexpected though, i thought that i can just install clojure and do this tutorial on braveclojure
06:42confuseduserhttp://pastebin.com/W1Efa7rm
06:42confuseduserI did
06:43confuseduserbut I don't what to do now
06:43confuseduserdo I remove the offending dependency?
06:43ddellacostaconfuseduser: did you add those exclusions?
06:43ddellacostaconfuseduser: those aren't errors
06:44confusedusernope
06:44toluhi
06:44ddellacostathose are all plugins aren't they...don't think it should affect your project
06:44confuseduserhere's my leiningen project.clj:
06:46confuseduserhttp://pastebin.com/cqUSVRDU
06:46confuseduserMy app currently doesn't compile
06:46confuseduserubjar takes forever
06:46confuseduserIt's a 30 line or so app
06:46confuseduserBut uberjar has been running forever
06:47ddellacostaconfuseduser: 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?
06:47confuseduserhere's my profiles.clj :http://pastebin.com/gN8khp71
06:48confuseduser* http://pastebin.com/gN8khp71
06:48confuseduserjust the standard ones used for emacs and repl
06:48confuseduserI left uberjar running for 1.5 hours and it still isn't done
06:49confuseduserthe code evaluates without errors in repl though
06:49ddellacostaconfuseduser: yeah, all those warnings look like they're related to plugins in your profiles.clj, for the most part
06:49confuseduserleiningen is working perfectly, tried an helloworld app and it compiles perfectly
06:49ddellacostaconfuseduser: I have no idea why your uberjar takes forever but could have something to do with having :aot all set
06:49toluIs it possible to separate a single vector of vectors to their individual vectors?
06:50tolu[["1" "2" "3"] ["a" "b" "c"]]
06:50tolu;;=> ["1" "2" "3"] ["a" "b" "c"]
06:50noogatolu: huh? how would you return 2 or more vectors then?
06:50ddellacostatolu what are you trying to do with those vectors?
06:51ddellacostatolu: of course you can apply or map over them...many ways to use them
06:51confuseduserddellacosta: uberjar is set
06:51confuseduser*main is set
06:51ddellacostaconfuseduser: set = done?
06:51ddellacostaconfuseduser: sorry, not sure what you mean
06:52confuseduseras in I followed the instructions on the leiningen tutorial
06:52confuseduserif you look at the pastebin
06:52toluI 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
06:53noogatolu: but they are individual vectors inside a vector :>
06:53ddellacostatolu: 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.
06:54ddellacostatolu: i.e., what do you want to do such that you think you want individual vectors as you say you do?
06:54toluyes nooga: but I dont want them inside a vector
06:54ddellacostatolu: we are telling you you don't have a choice...haha
06:54noogatolu: then how would you like to use them?
06:54ddellacostaconfuseduser: sorry, I'm not really sure what's going on there--but try turning of AOT compilation and see what happens
06:55ddellacostaconfuseduser: 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
06:55confuseduserok
07:04clojure-with-priHi :) 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?
07:05oddcullyyou mean like irc?
07:05noogaclojure-with-pri: I'd go with throwaway account via tor
07:10clojure-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/
07:10clojure-with-pribut I feel like a mailing list would be a better place for this. However I can't access Clojure Google group :/
07:10ashnuri got the repl working, it was some bad config, but running it is still over 10 seconds
07:11ashnurand my machine shouldn't be that slow
07:11noogatolu: ?
07:11MasseRashnur: it really can be that slow
07:12MasseRIt was 14s for me at some point
07:12clojurebotHuh?
07:13ashnurwhat can i do about it?
07:14MasseRashnur: keep it running
07:16ashnuri just dont get it why some of what it doesn can't be saved
07:16ashnurso it doesn't have to repeat it
07:16toluSo 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.
07:16tolu["1"] ["2"] ["3"] ;;=> ["1" "2" "3"]
07:16tolu["1" "2"] ["a" "b"] ["10" "20"] ;;=> ["1" "a" "10"] ["2" "b" "20"]
07:17tolu["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"] ;;=> ["1" "a" "10"] ["2" "b" "20"] ["3" "c" "30"]
07:18nooga,(mapv vector ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"])
07:18clojurebot[["1" "a" "10"] ["2" "b" "20"] ["3" "c" "30"]]
07:18noogaokay, now what do you want to do with hose thre?
07:19noogathose three*
07:19oddcully,(apply mapv vector [["1" "2"] ["a" "b"] ["10" "20"]])
07:19clojurebot[["1" "a" "10"] ["2" "b" "20"]]
07:19tolunooga: clojurebot: thats what I did but I want them separately. i.e without not in the square bracket
07:19noogatolu: you can't have them separately flying in air, that's why I'm asking what do you want to do with mapv output
07:20ashnurthey just want those 3 things :P
07:21noogaiterate over them? give them names?
07:21ashnurjust have them without bracketing, i guess
07:21ashnur:D
07:22noogaprint them without the square bracket?
07:23toluyes, something like that
07:24toluI dont know how to really explain it because I know functions only return a value
07:24nooga,(def rows (mapv vector ["1" "2" "3"] ["a" "b" "c"] ["10" "20" "30"]))
07:24clojurebot#'sandbox/rows
07:24RurikIs there any function that lets me see what another function is doing step by step
07:24Ruriklike reductions
07:24nooga,(let [[x y z] rows] (println x y z))
07:24clojurebot[1 a 10] [2 b 20] [3 c 30]\n
07:25noogathat will give them names, but I think you don't know how many you'd get
07:25tolunooga: yes
07:27nooga,(doseq [row rows] (println row))
07:27clojurebot[1 a 10]\n[2 b 20]\n[3 c 30]\n
07:27noogatolu: this will iterate over them with some side effects like writing to file or comething
07:27noogasomething*
07:27noogabut the point is
07:28noogayou want a vector of vectors
07:28Olajyd_Hi
07:29noogabecause if your vectors aren't inside another data structure, they're not accessible
07:30tolunooga: 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
07:31noogacool
08:10Olajyd_can somebody help me with this : (apply min [“2’ “16” “25”]) ;=
08:10Olajyd_can somebody help me with this : (apply min [“2’ “16” “25”]) ;=> “2”
08:11Olajyd_Hi, snowell
08:12tvaalenYou should probably ask a more specific question.
08:12tvaalenWhat is it you want help with?
08:13Olajyd_tvaalen, I want to get the minimum value from a vector of strings
08:13oddcullymin by what definition? shortest string? min value of the number?
08:14Olajyd_oddcully the minimum numeric value
08:14Olajyd_oddcully, yea :D
08:15oddcullywhy don't you convert the string to numbers then?
08:15Olajyd_oddcully I thought of that but dont knw where exactly to place the `read-string`
08:16jeayecould it just be something like (reduce (partial min parse-int) ["2" "16" "25")
08:16jeayeEh, with a ] there
08:16noogaor (apply min (map read-string ["1" "2" "3"]))
08:17Olajyd_nooga thanks, exactly what i wanted
08:18noogajeaye's solution would be faster I think
08:19noogayou'd have to (defn parse-int [x] (Integer/parseInt x))
08:22oddcullyOlajyd_: 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
08:25Olajyd_Oddcully, yup. actually did a filter to collect only numeric strings, and hence the need for the function to return only the minimum value
08:27Kneivat
10:19sobelis there a formal or semi-formal name for the functions/pattern that start with with- like with-open, with-transaction, etc?
10:20sobelare those closures?
10:30MasseRMore like higher order functions
10:30Leonidasno, it's not closures, that's something different
10:31Leonidastransaction wrappers? But that's not actually a term I'd use.
10:32MasseRsobel: closures are functions that close over some variable. (defn [x] (fn [] x)), here the anonymous function closes over the x.
10:45sobelok, wikipedia enlightens enough on what closures are, and they're not what i'm trying to identify in the with-* pattern/macro/functions
10:46dstocktoncontextual wrappers?
10:46dstocktonthey provide some context and make sure it doesn't leak and closes down properly
10:47sobelyes, my emphasis is on wrapping and leak-proofing
10:47sobelrather, wrapping for the purpose of leak-proofing
10:49dstocktonright
10:50dstocktonpython has a similar construct and calls them context managers
10:50sobelhm, i'm starting to think closure might actually fit and i'm just looking at a corner-case.
10:50dstocktonit's sort of like a closure, but not in the normal sense
10:50sobelyeah, i'm plenty familiar with OO nomenclature for this
10:50dstocktonit closes over a transaction or other IO operation usually
10:51sobelweird because we're interested in the side-effects
10:51sobeland the leak proofing
10:51MasseRdstockton: do they really close over?
10:52MasseRIsn't it rather (with-file (fn [fd] (dostuff fd)))
10:52MasseRSure you can have outside context closed over, but it has nothing to do with the with-file
10:53MasseRsobel: how about 'resource acquisition pattern'?
10:53MasseROr something like that
10:53sobelMasseR: that sounds fine to me, but will it be understood outside this conversation? :)
10:54sobeldon'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:54MasseRsobel: good question. In haskell it's called 'bracket'
10:55MasseRIt's a bit ecosystem dependent I think
10:55MasseRhaskell: bracket, python: context manager, clojure: ???
10:55MasseR:)
10:55sobeli guess that's just the way my cookie crumbles, then
10:55sobelSpring: SimpleWhateverTemplate
10:56MasseR:D
10:56dstocktonthey do all have 'with' in common
10:56snowellThe with-* 'functions' are actually macros, I believe
10:56sobeltypically, yeah
10:56dstocktonseems that is also a haskell naming convention
10:56snowellSo "context-macros" sounds appropriate
10:57dstockton'with context' pattern
10:57sobeli like context-macros. gonna just roll with that until i find something better or more widely accepted.
10:58sobeli'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:02dstocktonquite true i think
11:02dstocktonclojure does a good job of emphasising a 'right' way so the social issues don't get out of hand
11:31justin_smithwhen there is less RAM to spare, lisps have technical issues too :P
11:41gfrederickshttp://www.yesodweb.com/blog/2015/08/thoughts-on-documentation
11:42gfredericks^ that's maybe one of the most saddening aspects for me about the current jira model
11:42gfredericksI know cljs added a github wiki, not sure if open-collaboration was the main motivation
11:44gfredericksthough 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:44gfredericksI'm sure that's been talked about before but can't recall if anybody tried anything
11:44drbobbeatygfredericks: 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:45gfredericksdrbobbeaty: yeah I agree with the article about wikis; I haven't seen software project wikis be useful almost ever
11:45drbobbeatygfredericks: ...and yet they *have* the capability... it's just not working out that way. Not that I've seen.
11:45gfredericksright 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:54puredangerThere are some plugins for newer jira that can work in combination with prs
11:54preyalonewhy 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:55puredangerI have been looking at migration to jira cloud for Clojure and contrib but the migration process is pretty complicated
11:56puredangerI've got a couple other large projects in the works before I dive fully into that one though
11:57puredangerBut just sorting through the atlassian support and license issues took several weeks so that's done at least
12:12OlajydHi All :)
12:13OlajydI 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:14Olajyd *[[Pepsi 25 34], [Coke 16 ], [Coke 2 3]]
12:14oddcullygfredericks: 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:15wasamasa,(concat [1] [2 3])
12:15clojurebot(1 2 3)
12:16Olajydgiven [([“Pepsi” 25 34]), ([“Coke” 16 “” ] [“Coke” 2 3])] something like [[“Pepsi” 25 34], [“Coke” 16 ] ,[“Coke” 2 3]] sorry for the typo
12:17OlajydI apologize for the typo
12:18wasamasa,(concat [[:foo 1 2]] [[:bar 3] [:baz 4 5]])
12:18clojurebot([:foo 1 2] [:bar 3] [:baz 4 5])
12:20OlajydSo 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:20wasamasa...
12:20wasamasaso you want to do more than concatenating two lists
12:21wasamasasounds very much like a xy-problem if you ask me
12:21Olajydok
12:21Olajydso how can I implement that in a filter
12:21wasamasawould you please explain the problem you intend to solve with this?
12:22OlajydI have a large data-set to analyse, more like cleaning the dataset using a set of rules
12:25gfrederickspuredanger: thanks for working on it
12:25Olajydwasamasa, 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:25Olajydwasamasa, and not as groups like this [([“Pepsi” 25 34]), ([“Coke” 16 “” ] [“Coke” 2 3])]
12:26Olajydwasamasa, just thought about it, it may not be a filter, jets implement it using a map function rather :)
12:27Olajyd*let us
12:35puredangergfredericks: one of the projects in front of that is doc-related, hopefully something to talk about in near future
12:39BronsaI just upgraded my slime setup to cider 0.9.1, let's see how this goes
12:39kavkazBronsa: The debugger in CIDER 0.9+ is awesome
12:40BronsaI'm actually having some trouble getting it to work correctly :(
12:41Bronsait doesn't seem to work if a function doesn't take any argument
12:42Bronsaand it's doing some weird stuff with font-locking where it doesn't reset the expression aspect after I quit the instrumentation
12:42Bronsamight be something weird with my config though
12:42sdegutisWhen provisioning a new remote web server, is it common to have to fill in details like IP addresses in its config files?
12:43kavkazBronsa: 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:43sobelsdegutis: if it's a real server i'm used to specifying what ip/ports to bind. that's not unusual.
12:44sobelsdegutis: but usually it comes with a questionable default that lets you get up and running for minimal purposes
12:44sdegutissobel: what tools do you use to fill that in, assuming it's an automated process?
12:44sobelsdegutis: it's been a while since i automated that with perl-based regex replace
12:45sdegutisAh
12:45sobelnothing pretty
12:45sobelfrom 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:47gfrederickspuredanger: w00t
12:50xemdetiasdegutis, 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:50sobeli wrote a heredoc out of a config
12:54gfredericksdoes 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:55sdegutisxemdetia: interesting
12:56sdegutissobel, xemdetia: I've been using this homegrown tool https://github.com/sdegutis/management/ but I'm looking to get away from NIH-things
12:56sdegutisMost people recommend Ansible but it still looks over complicated when all I think I need is ssh/scp and something for templating.
12:58xemdetiasdegutis, ansible is fine but it really is a management layer than what I think you are describing
13:05hiredmangfredericks: yeah, also using conj and rest
13:06hiredmanconj 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:09gfrederickshiredman: oh yeah good point
13:09gfrederickshiredman: in this case it's probably assumed to be under the control of the internal code, but is probably still worth changing
13:18amalloydoes ` not do namespace resolution in cljs?
13:18amalloyit's just weird to me that the cljs.test functions are fully qualified, but conj isn't
13:33sdegutisThanks everyone.
14:14dnolenamalloy: 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:14dnolenamalloy: in the compiler we swap clojure.core for cljs.core
15:25felipedvorakany idea of a good resource to learn regexp?
15:26pbxfelipedvorak, http://www.regular-expressions.info/
15:27felipedvorakpbx: thanks
15:35felipedvorakpbx: does clojure use a special kind of regexp or the common one?
15:35oddcullyfelipedvorak: it uses the java ones
15:35Empperidefine "common ones" :)
15:36Empperishould I read it as "the perl version"? :)
15:36felipedvorakI 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:37Empperianyway, it uses java regexps like said above
15:37Empperiwhich is one of the better implementations
15:37oddcully#"(?i)lerl" vs /lerl/i
15:37Empperithe java API to use regexps is horrid but fortunately clojure provides nice to use api
15:38Empperiit has pretty much all the bells and whistles you'd need from regexp engine though and it's fast
15:39felipedvorakawesome, I'll try to find a tutorial on java regex
15:39Empperinamed groups, lookbehinds/aheads and so forth are all supported
15:39Empperifelipedvorak: http://www.regular-expressions.info/java.html
15:41felipedvoraksweet, thanks everyone
15:42Empperifelipedvorak: however, when using clojure you can use the #"pattern" -syntax
15:43felipedvorakgot it
16:52noogaI have a gen-class with only ^:static methods and I'd like to have static state
16:52clojurebotNo entiendo
16:52noogais that possible?
16:52hiredmanstatic state is def
16:52hiredmanclojurebot: static state is def
16:53clojurebotIn Ordnung
16:53noogaI'm exposing this to Java
16:53hiredmanso?
16:53clojurebotso is (add-to-list 'erc-keywords '("\\bso\\b" erc-default-face))
16:54noogaI don't like the idea of having (def foo (atom something)) in my namespace
16:54rhg135Write a static method to retrieve the immutable state
16:54hiredmanwhy?
16:54noogadone
16:54clojurebothiredman: because you can't handle the truth!
16:55hiredmanit is semantically the same as a java static variable in a class
16:55noogaI was just wondering is I can utilize gen-class :state here
16:55mdeboardDoes anyone know if the Eulalie lib will read from ~/.aws/credentials ?
16:56hiredman(def foo (atom something)) is just as gross as a static variable, so I suspect you are fooling yourself
16:56rhg135Static state seems limited
16:56hiredmana global def for state looks gross, so I will hide it in some gen-class construct, which is semantically identical
16:59rhg135Slightly less gross than a static field. As it's atomic at least
17:01noogalook, this is just an interface to my whole program, used in java like this: Foo.init(); Foo.startService(); Foo.stopService(); Foo.deinit();
17:02noogait's static because nobody will need instances of it
17:03hiredmanright, and you want to stick a global reference to that state some where
17:03noogaright
17:03hiredmana global reference is a def
17:03noogaokay then, def it is
21:00mordocaiI'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:01mordocaiAnnnnddd.... stupid one letter typo in the require.
21:02mordocaiSigh, always happens right after I ask.
21:39mungojellyhow do i collapse (a (b (c d))) into something reasonable like (something d c b a) or w/e pls?
21:45TEttingermungojelly: are those function calls?
21:45mungojellyTEttinger: yeah, call c with d and then call b on that and then a on that
21:45TEttingergotcha
21:46TEttingerthat seems like ->
21:46TEttinger,(str (inc (char \A)))
21:46clojurebot#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:46TEttinger,(str (inc (int \A)))
21:46clojurebot"66"
21:47TEttinger,(char (inc (int \A)))
21:47clojurebot\B
21:47mungojellyor 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:47TEttinger,(-> \A int inc char)
21:47clojurebot\B
21:47Wild_Catmungojelly: (-> initial-value fn1 fn2 fn3)
21:48TEttingeryep
21:48Wild_Catalso works if your fns take extra arguments. -> will place your value as the first argument to the fns, ->> as the last
21:48TEttingerabout to say that, heh Wild_Cat
21:49mungojellyWild_Cat: ok i'll look up -> thanks, looks beautiful, clojure is a beautiful language with all the {}[] and such i'm enjoying it
21:49mordocaiAlright, 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:49mordocaimungojelly: It's called the thread-first macro, for better googling
21:55newtoclojureHello
21:55newtoclojureHow do I compile java files installed by maven install?
21:56newtoclojureI.e. I only have the java sources compiled by maven install, how do I install it from leiningen?
22:05mordocaiIs 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:05mordocaiI don't see a way in the docs
22:06chomwitti 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:11amalloychomwitt: require causes namespaces to be loaded; refer does no loading, but provides local aliases for the vars in another already-loaded namespace
22:13chomwittamalloy: but what are the implications of 'loading' another ns ? what does it mean?
22:13chomwitti mean ..
22:13gfredericksmordocai: oh!
22:13amalloyif you don't load it, none of the stuff it defines will exist
22:13gfredericksmordocai: I bet you want gen/gen-fmap → gen/fmap
22:14chomwitt..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:14amalloythat is what refer does
22:14gfredericksmordocai: the gen-foo functions are lower level, almost never useful for users
22:14chomwitti've not read so far sth like :" also require will also do that .. and that.. and that means ..that :" :-(
22:14chomwitt:-)
22:16chomwittamalloy: but in eather case i can call another ns's function then what's the diff?
22:16chomwittamalloy: but if in eather..
22:16amalloyyou can't
22:16amalloyif you never require the namespace, stuff in it does not exist, at all
22:18chomwittamalloy: 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:18amalloybecause that namespace was already required
22:18amalloyit'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:18emdashcommaWhy 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:19emdashcommaEr, "lein repl started from the terminal" meaning outside of that project
22:20chomwittas 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:20chomwittso that i can see the diff you say
22:37amalloychomwitt: create a file (ns my.ns) (def foo 1), and put it in src/my/ns.clj
22:37amalloynow try accessing my.ns/foo
22:38amalloythen require my.ns, and try again
22:39chomwittone moment
23:04chomwittamalloy: ok
23:06chomwitti 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:31justin_smithchomwitt: did you use an :as or :refer clause at all?