#clojure logs

2015-04-28

01:30vilmibmsup
01:31vilmibmI need to parse some html and kind of want something slightly less hacky than regexes but slightly lighter than a full on sax parser
01:31vilmibmliterally just pulling one div out of some source and then stripping it of tags
01:31vilmibmany thoughts?
01:32vilmibmcurrently staring at hickory
01:40engblomvilmibm: If it really is one single div you want to pull out, I would not consider regex to be hacky.
01:41vilmibmthat's encouraging
01:43engblomvilmibm: All other methods for extracting that single line requires more code and is an over-kill in this case. Just add a comment line above telling the structure of that html-tag you want to extract, and it will be easier to read the code later.
02:18govtis clojure ever going to be freestanding of JVM/CLR? Like a core language, and dialects for different platforms?
02:22wasamasaI doubt that would be practical :P
02:23noidigovt, isn't it already, with clojurescript? :)
02:23govtha, i wouldn't touch js with someone else's pole
02:23govtI'm talking about a core language, self-hosted basically
02:26wasamasawat
02:27wasamasawas that gavino or why that quit message
02:29m1dnight_why go through the trouble of writing a VM if you already have a free one?
02:29m1dnight_oh he's out
02:40wasamasaFYI, gavino is a troll who finds pleasure in visiting IRC channels and such of programming languages, then asks very targeted questions about their known weaknesses
02:42justin_smiths/known weakness/premise for existing/
02:43justin_smithcommon-lisp and scheme are out there
02:43wasamasalike, the inability of CL to emit small, self-contained binaries
02:43justin_smithclojure does not need to fill their niche
02:43wasamasaor scheme not being real-world enough
02:43TEttingerscheme's plenty real-world
02:44TEttingergreenspun's tenth rule probably means there's a lot of partial schemes in large programs to this day :)
02:44wasamasahe went over to #chicken (which feels pretty real-world) to me and then asked why it hasn't got native threads yet
02:44clojurebotPardon?
02:45engblomThe biggest complain I have about Clojure is the huge startup time. You would never write a shell tool in clojure and then run it for each file found by "find". It would take too long time to finish.
02:45wasamasaI thought cljs would fill that niche
02:46wasamasathen I found out it's not self-contained yet
02:46wasamasaand that people aren't fond of the idea of using npm as package manager anyways
02:47TEttingerwell there is some demand for clojure's strong data structure support, really different handling of state, etc. in native environments. there's clojurec but I don't think it's actively maintained
02:48TEttingerJulia's standard lib is rather similar to clojure's and seems to draw on similar inspiration, but last I checked Julia was only usable in the interpreter, not even capable of producing a standalone binary
02:48wasamasa._.
02:49justin_smithTEttinger: pixie is a good start
02:49TEttingeris Pixie native? I guess it's closer to VM-less languages since it has its own...
02:49engblomIs the startup time the same long for Clojure on CLR?
02:50TEttingerprobably not
02:50justin_smithengblom: it's a little better, but not a lot better
02:50wasamasaah, the joys of fast and dynamic languages
02:50TEttingerI think Java 9 may help quite a bit
02:51wasamasafortunately I have another candidate for writing shell tools, so it's fine
02:51engblomwasamasa: What is your candidate?
02:51wasamasaengblom: chicken
02:51wasamasaengblom: compiles to fairly performant C
02:51wasamasaengblom: and it's a lisp dialect, so that's covered, too
02:52engblomwasamasa: Is chicken having the same good built in data structures as Clojure?
02:52wasamasaengblom: it's a scheme :D
02:52engblomI have a bit been considering Hy as an alternative to Clojure for shell tools.
02:53wasamasaso, yes, you have data structures, just less convenient syntax for some of them
02:53justin_smithengblom: pixie has a similar underpinning, but has immutable datastructures
02:53wasamasajustin_smith: no support for python interop though, right?
02:54TEttingerPixie is also not interoperable with Python
02:54justin_smithwasamasa: there is no python at runtime
02:54TEttingerit is with C now
02:54wasamasaoh, is it
02:54justin_smithit's interop with C / the kernel
02:54justin_smithit uses python to compile its vm
02:55TEttingerthis is a very WIP document but it looks like all this is intact https://github.com/pixie-lang/pixie/wiki/FFI-(interop-with-C)
02:57engblompixie-lang looks very promising
02:58TEttingerit's at an early state, but if you don't need JVM libs it could be very handy performance-wise. whether it actually starts up DRASTICALLY faster I don't know
02:58justin_smithTEttinger: not much faster, DRASTICALLY faster startup
02:58TEttingerah cool
02:58justin_smithbut not faster at runtime
02:58justin_smithbecause no jvm
02:59justin_smithnot even *as fast*, and no in-vm threads
02:59justin_smithbut for scripting, it is perfect, starts up about as fast as bash
02:59justin_smithand uses about 3x the mem of bash, which isn't bad at all
03:00engblomFor scripting, the startup time is the most important aspect, I think.
03:01justin_smithyeah - for raw perf you wouldn't be doing quick startup and disposal anyway
03:01augustlanyone here happen to know if there's a way to build mori (cljs data structures for JS) in a half-optimized way, so that I get normal variable names but dead code elimination?
03:03engblomIs it possible to run ClojureCLR on Linux?
03:03justin_smithengblom: yes, via mono
03:04justin_smithor on osx, the same way
03:04engblomDo you know about any guide to get it working? I would be interested to test it
03:04justin_smithengblom: I just downloaded it, and followed the readme
03:05justin_smithif you get the version that is already compiled, just point mono at clojure.dll
03:05engblomOk, thanks!
03:05justin_smithor whatever it is named there
04:43PupenoHow can I find all the possible options for lein new luminus?
04:47dstocktonanyone here written a book? what markup does one use to best publish in multiple e-formats?
04:50clgvHello, I have the following problem with clojure.java.jdbc when using SQLite: When using `with-db-transaction` I get the exception "class java.sql.SQLException - cannot rollback - no transaction is active"
04:50oddcullydstockton: not a book, but docs and sphinx (pdf via latex, html, and mobi for me) worked well
04:52schmirclgv: I've used jdbc/with-db-transactions successfully with sqlite on windows and linux
04:53dstocktonoddcully: want something suited to books more than documentation, seems like that isn't the purpose of sphinx
04:53dstocktoni remember people using docbook, i don't know if this is the easiest way anymore
04:53clgvschmir: so it is supposed to setup its own transaction right? I wonder why it can complain there there is no transaction active
04:54borkdudeclgv show the exact code snippet
04:55dstocktonfound some reading on it
04:55dstocktonhttps://gist.github.com/mojavelinux/1705966
04:55oddcullydstockton: i hardly see much difference of a stock sphinx pdf and an apress book
04:56clgvborkdude: (jdbc/with-db-transaction [conn db] (jdbc/insert! conn :my-table some-data)
04:56clgvwhere `db` is a map containing an active connection
04:57schmirclgv: wow, there's not much that can go wrong...
04:57borkdudeclgv looks good
04:57clgvwell I can investigate the root-cause that triggers the rollback. but I'd assume the rollback should just work
04:58dstocktonoddcully: might just give it a go with markdown, want something simple
04:59dstocktonseems like i can convert it to most formats
04:59TEttingerdstockton: pandoc?
04:59elvis4526Why this http://pastie.org/10117840 throws me: can't find catch in this context?
04:59elvis4526wtf?
04:59dstocktonyes TEttinger
04:59TEttingerbut I think it depends on what your publisher wants
05:00TEttingerLaTeX is supposed to be indispensable
05:00dstocktonthis is for me, i would self publish it
05:01brainproxycooked up a little thing that lets my transduce over infinite lazy seqs of transducers vs. using (comp ...) to build stacks
05:01brainproxylets *me
05:01TEttingerthen anything that can generate a PDF and some epub formats I guess
05:01TEttingerI think Pandoc should suffice, it's a bit... low on formatting I think
05:02TEttingerI don't know if there's a way to, say, tell it to add a background shading behind certain text
05:02brainproxyI'm getting 12+ million stack ops per second, depending on what transducers are in the stack
05:02brainproxyi.o.w. it's working better than I hoped
05:02TEttingerwowza brainproxy
05:02elvis4526Do I need to require something to use catch ?
05:03TEttingerelvis4526, it needs to be in try, IIRC, but other than that it's in clojure.core
05:03TEttinger(as in, within the form of try)
05:04TEttinger,(try (/ 100 0) (catch))
05:04clojurebotTEttinger: Titim gan éirí ort.
05:04TEttingeroh right, clojurebot doesn't do try/catch
05:04TEttinger##(try (/ 100 0) (catch))
05:04lazybotjava.lang.SecurityException: You tripped the alarm! catch is bad!
05:04brainproxyTEttinger: there's a lot more to do w.r.t. to tests and cleaning up the code, but I will do a writeup soon
05:04TEttingerha
05:04m1dnight_Im trying to run an uberjar as a service in linux but (slurp "conf/file") is obviously not found. I figured I added the source of my lein project as classpath but that doesn't resolve it.
05:04m1dnight_Anyone have an idea?
05:05m1dnight_Id go ask in Java, but they tend to have a poopy attitude :<
05:05TEttingeroh, elvis4526, in your example: catch needs to be the last form IIRC
05:05TEttingerat the same level as let, not within let
05:06oddcullym1dnight_: (slurp (io/resource "")) then?
05:06TEttingerm1dnight_, I'm not sure if slurp looks on the classpath, oddcully is right
05:06TEttingeryou may need a resources dir in your project that holds things that will be embedded in your uberjar
05:07TEttinger(inc oddcully)
05:07lazybot⇒ 4
05:07m1dnight_ah, i will give that a shot then! :)
05:07m1dnight_Thank you
05:07elvis4526TEttinger: Oh shit okay. How do I make something happen if there is no exception?
05:08TEttinger(doc try)
05:08TEttingerlet's see...
05:08clojurebotHuh?
05:08TEttingerhttp://clojure.org/Special%20Forms--(try%20expr*%20catch-clause*%20finally-clause?)
05:09TEttingerafter catch you can have a finally clause
05:09elvis4526I thought finally was for "no matter if there is an exception or not"
05:09TEttingerfinally happens regardless of exception being caught or thrown or whatever, it always happens
05:09elvis4526"execute this"
05:09TEttingerso you want something to happen specifically if there is no exception?
05:09elvis4526well okay
05:10elvis4526yes
05:10clgvborkdude: is there a limitation of 1 transaction per connection or something similar? I inherited that code from a student, so I am not that familar with SQLite
05:10borkdudeclgv don't know
05:10TEttingerwell if anything throws an exception it doesn't execute past that point, it skips to the catch block
05:11elvis4526Alright
05:11elvis4526Thanks
05:11TEttingerthe last thing in your let, before the let ends and the catch starts, will only execute if there have been no exceptions thrown
05:11elvis4526yeah I just put the last thing before the catch
05:11elvis4526(there is a comma between thing and before)
05:12elvis4526oh okay I get it the catch can't be inside the let
05:20m1dnight_(inc oddcully) It worked! :)
05:20m1dnight_(inc oddcully)
05:20lazybot⇒ 5
05:21m1dnight_(it was (slurp (io/file (io/resource <file>))) though
05:22the-kennyhuh, (slurp file) should work too
05:29m1dnight_it was for a file that was present in my classpath
05:29m1dnight_Im running an uberjar in init.d
05:29m1dnight_then that doesn't work
05:37m1dnight_hmm, runtime is making some weird paths
05:37m1dnight_it works fine when I use lein run, but when i create an uberjar i get this:
05:37m1dnight_IllegalArgumentException: Not a file: jar:file:/home/christophe/clojbot/target/clojbot-0.1.0-SNAPSHOT-standalone.jar!/servers.edn
05:38m1dnight_So i'm guessing it prepends the path of the jar to the (io/resource) or something
05:40m1dnight_aha, you dont need to give a classpath to a jar file..
05:44oddcullym1dnight_: (slurp (io/resource)) works quite fine for me. but i have only tried it with a file in filesystem right now (added /tmp to -cp for a repl)
05:45m1dnight_im trying locally what works and what doesnt :D ill let you know
05:47m1dnight_odd, I must have made a typo. It owrks indeed
05:47m1dnight_again, thank you oddcully
05:47oddcullyyw
05:47Guest___how to write porno site in clojure
05:47m1dnight_bad troll is bad
05:48Guest___gay bukkake
05:49m1dnight_well, what the heart thinks..
05:51wasamasalol
06:50PupenoHow can I see all the options for a lein app template?
06:53m_m_Hi. I am searching good html parsing lib. Any clues?
06:54omm_m_: enlive?
06:54omm_m_: if you don't mind working with css selectors!
06:54m_m_om: I can download html from website and parse it with enlive ?
06:56omm_m_: you can parse a string, or file, and probably even pass it directly an URL object
06:57m_m_om: Thank you. "om" like clojurescript om lib ?
06:57omm_m_: check the tutorials (beware it is both a templating and parsing library)
06:59omm_m_: not at all! (om is david nolen aka swannodette's baby!)
07:01omm_m_: he also wrote one of the good tutorials for enlive btw
07:50jcromartie#clojure people HALP
07:51jcromartieThis project I am on has fallen in love with "->" in function names
07:51jcromartieeverything is something->something
07:51jcromartieand it makes it damn near impossible to read
07:51jcromartieand it gives me a feeling of "I am 12 years old and what is polymorphism?"
07:52jcromartieare there any resources that offer a good argument against this
07:52jcromartiebesides my own ramblings....
07:52tbaldridgeWhat are the two parts of the name?
07:53tbaldridgeI have nothing against id->customer. But I'd probably have a problem with number->string vs to-string
07:53jcromartiesome-kind-of-thing->some-other-kind-of-thing
07:54jcromartiebut for every kind of thing you can imagine
07:54ro_styeah. context is important
07:54oddcullyjcromartie: https://github.com/bbatsov/clojure-style-guide#arrow-instead-of-to
07:54jcromartieconcept->loggable-string
07:54ro_stjcromartie: perhaps if you took a small part and rewrote it using the concepts you feel are more suitable and contrast the two?
07:54tbaldridgeI'd say it depends if it takes more than one thing. So anything->string should just be to-string. But int->float could keep the ->
07:55ro_stthat might help you to elucidate the reasons driving your instinctual dislikes
07:55jcromartieimagine if clojure.core were filled with functions like seq->vector function->memoized-function
07:57gfredericksvar-doesn't-exist->var-just-got-deffed
07:57gfredericksside effects are just functions from one situation to another
08:02tbaldridgesa one argument for your approach is that it's basically a variant of Hungarian notation
08:02tbaldridgeseq->vec assumes that any non-seq passed to the function will fail. While that's completely not true
08:02tbaldridge,(vec {1 2})
08:02clojurebot[[1 2]]
08:03tbaldridgeso I'd see that as the strongest argument against it, you shouldn't be encoding types into the function name like that.
08:03tbaldridgeNow encoding business object names may be a different matter
08:09oddcullyjcromartie: and do you then call (log (concept->loggable-string theconcept)) ?
08:10CookedGryphonWhat's the easiest way to debug the contents of channels in core.async?
08:10CookedGryphonI'm getting a deadlock somewhere...
08:10CookedGryphonbut I have no idea who's waiting for what
08:10isaac_rksis clojure a cult?
08:10CookedGryphonand quite a lot of candidates
08:11jcromartieoddcully yup
08:12jcromartieobviously "log" could just be a multimethod or a protocol function
08:12sobelisaac_rks: yup
08:12sobeltry the kool-aid
08:12dnolenCookedGryphon: good use case for a proper debugger (i.e. CursiveClojure), you can examine threads
08:13CookedGryphonI need something that'll work on Android
08:14i-blis1isaac_rks: more precisely, a cargo cult
08:14CookedGryphondo you know if there are any solutions that'll let you connect to android's debugger
08:15i-blis1isaac_rks: i.e. after which wealth is expected to flow ;-)
08:15dnolenCookedGryphon: I don't do Android dev, but I thought IntelliJ had good support for that. Not sure what that means for CursiveClojure though.
08:16CookedGryphondnolen: The other aspect is that I'd quite like to have feedback on this remotely, as it's not very easy to reproduce locally with a debugger attached
08:25nicferrierwhen I do lein deploy I'm getting the uberjar+uberjar thing
08:25nicferrierI want just the uberjar
08:25nicferrieranyone know how to handle that?
08:40justin_smithnicferrier: the jar is an intermediate step in creating the uberjar
08:40justin_smithyou can delete it, of course
08:41p_l/act/
08:41p_loops
08:49nicferrierjustin_smith: it seems to be sending that one to nexus
08:49nicferrierthe uberjar+uberjaar
08:49nicferrieris the uberjar+ubjerjar the actual uberjar?
08:50justin_smithoh, this is a different issue than I thought maybe
08:50justin_smithhow do you make lein deploy an uberjar?
08:50nicferrieruberjar generates 2 jars. one name.jar and one uberjar+name.jar (or the other way round)
08:50nicferrierjustin_smith: set uberjar_name in the project
08:54justin_smithnicferrier: so my understanding was that setting the uberjar name changed the behavior of "lein uberjar" but did not cause "lein deploy" to deploy an uberjar
08:57justin_smithof course you can manually supply the uberjar as a thing to deploy "lein deploy repository identifier version target/uberjar-name.jar"
08:58nicferrierjustin_smith: it does deploy the uberjar
09:06clojerIn my Luminus app I have a schema/swagger service-route containing :path-params [day :- Int month :- Int .... but the error says "java.lang.RuntimeException: Unable to resolve symbol: Int"
09:06justin_smiththen clearly I don't understand how this works, because I don't see any mechanism whereby naming an uberjar would lead to it automatically being created and deployed with the standard deploy command
09:07justin_smithclojer: Int is not a type
09:07justin_smithmaybe you want Integer?
09:07justin_smithor int
09:07clojerjustin_smith: Schema has s/Int
09:08nicferrierI'm not actually clear what the uberjar+ubjerjar thing is
09:08justin_smiththen why are you calling it Int
09:08clojerjustin_smith: Because it seems to be defined as s/Int not s/Integer
09:08justin_smithbut if it's s/Int I don't get why you would say Int
09:09clojerjustin_smith: Maybe I'm looking at the wrong docs
09:09justin_smithunless you explicitly used or referred it
09:09justin_smithor imported or whatever is needed for that datatype
09:09mnngfltgclojer, try s/Int
09:10mnngfltgif you've require'd it like this: schema.core :as s
09:10clojerjustin_smith: OK, when it's defined as simply Integer, where is that coming from? Schema?
09:10clojer:- Integer I mean
09:10justin_smiththat's a built in class
09:10justin_smith,Integer
09:10clojurebotjava.lang.Integer
09:10clojerjustin_smith: OK, where is the :- coming from then?
09:10noncom|2is cursive currently better than ccw?
09:10justin_smiththat's a keyword
09:11justin_smith,:-
09:11clojurebot:-
09:11mnngfltgclojer, it's prismatic schema syntax
09:11justin_smithnoncom|2: it's got a more advanced feature set right now
09:12justin_smithyeah, it's a keyword that schema interprets specially
09:12clojermnngfltg: So Schema can be mixed with java Integer class?
09:12noncom|2so you think i better move to cursive?
09:13noncom|2i'm just getting tired of some peculiarities of ccw.. although in general it is quite nice...
09:13mnngfltgclojer, I think schema also accept java classes as "types", but schema.core/Int is probably better
09:14justin_smithbut schema.core/Int is not automatically in scope
09:16noncom|2justin_smith: how good is multiproject support in cursive? like if i have a clojure project that depends on 2 other clojure projects?
09:17noncom|2and on, say, 1 java project
09:17justin_smithnoncom|2: from what I hear it handles that well
09:17Empperino problems here
09:17justin_smithcfleming can provide more info than I
09:17Empperiwe have a project here with 7 different idea modules currently
09:18Empperisome of them are libraries for actual applications which share common code
09:18Empperiwe do not have java libraries written by us though, just clojure
09:19noncom|2Empperi: do you setup the project dependencies through leiningens checkouts, or through some idea mechanism?
09:19Empperinoncom|2: via leiningen
09:20noncom|2Empperi: did you move to cursive from ccw?
09:20Empperiwhen I develop one of the actual apps and I need to make changes to a library I just load the libary namespace to repl
09:20Empperiyeah I actually did
09:20Empperianyway, after I'm happy with the changes in the library, I make commits to it, run tests etc and push
09:20Empperithen it'll be handled by our CI and deployed to Nexus
09:21Empperiand all the apps get the updated lib from there
09:21Empperiby leiningen
09:21noncom|2ah, so you're having it in deps in project.clj, not refer to it in checkouts?
09:21Empperiyeah
09:24noncom|2Empperi: how is git/mercurial integration?
09:32sverinoncom|2: I was using webstorm (intellij family) a lot of years ago and it was one of the first big IDEs having awesome git integration from the start, the same goes for Intellij IDEA, cannot say anything about mercurial though
09:36noncom|2does idea support other themes as easy as eclipse does it with Eclipse Color Themes?
09:38dnolennoncom|2: it has good support for color themes
10:15noncom|2how do i set a checkouts dependency to be considered, in cursive? currently it simply cannot require namespaces from the dependant project...
10:20noncom|2cfleming ping
10:21sverinoncom|2: the last time I used checkouts (maybe half a year ago) cursive recognized the linked projects and added them to the project viewbar automatically. However, I found it to be more disturbing and liked it more to have several intellij windows open
10:22noncom|2sveri: well, currently my problem is even more basic: it simply does not compile
10:23noncom|2it either does not find dependant projects when i run the repl as lein, or it finds them, but fails to see the java sources in them if i run it as "normal jvm"
10:23sveridid you run "lein install" for each linked project? you have to do that at least once, and add each project to the dependency section of your project.clj
10:25noncom|2sveri: no, i did not run lein install. actually, i do not want them to be installed to the local maven repo
10:25noncom|2in ccw i just had them in the source form
10:25noncom|2as normal dependency projects
10:27sverinoncom|2: I understood the documentation: https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies so that you have to run lein install. I don't know if cursive provides a feature without installing it, sorry, I cannot help you there
11:08borkdudeis anyone familiar with the phenomenon that when sending an edn collection param to a luminus application, when containing a single element it gets merged into the params as the single element and not as the collection?
11:09borkdudeI wonder why it does that. Can't find that in ring-middleware-format
11:10noncom|2reading docs on lein and multiprojects, i find that it is suggested that i put the dependant projects under the main project...
11:11noncom|2i do not really like this idea..
11:11noncom|2cursive seems to encourage this pattern...
11:12noncom|2borkdude: can you give an example?
11:13borkdudeyes, I'm sending {:class-ids ("e4gp-ig7t-cox9-lu14-9jel")} as application/edn from clojurescript. in my handler I see :body-params is the same, but in :params :class-ids is only the string
11:17noncom|2borkdude: you mean, it is no longer the list, just its first element?
11:17noncom|2that's strange..
11:17borkdudeyes
11:17noncom|2and what if you send two elements?
11:17borkdudenoncom|2 then it's the list
11:18cminusborkdude: have you tried a vector instead of a list? Or have you tried quoting the list?
11:20sveriborkdude: I am not sure if it is part of the luminus project, but is the ring-edn (not sure about the name exactly) middleware included?
11:25borkdudecminus sveri I'll check both of your remakrs
11:25borkdude*remarks
11:29borkdudesveri I'm still using luminus with lib-noir
11:29borkdudeand I don't see ring-edn
11:30borkdudelib-noir uses ring-middleware-format
11:32borkdudecminus with a vector it's the same behavior
11:56noncom|2how do i strat a repl and load the current file in it in 1 hotkey in cursive?
11:57noncom|2* and switch the current repl ns into it
11:57noncom|2all at once
12:17borkdudesveri it's ring-nested-params
12:17borkdudering.middleware.nested-params> (nested-params-request {:params {:class-ids ["123"]}}) ;;=> {:params {"class-ids" "123"}}
12:28jimrthyHas anyone managed to get the Chrome react.js working with Om?
12:28dnolenjimrthy: what does that mean?
12:29dnolenjimrthy: as what does Chrome have to do with React? Also there's a #clojurescript channel :)
12:30jimrthy@dnolen Ah, oops, didn't realize that
12:31jimrthy@dnolen I'll go ask (and explain) over there. Thanks!
12:35zarkonehello. sometimes i've got such errors: java.io.FileNotFoundException: Could not locate clojure/core/incubator__init.class or clojure/core/incubator.clj on classpath. This happened after i've add [com.cemerick/url "0.1.1"] and has also [com.ashafa/clutch "0.4.0"] (latest). I change url's version to 0.0.6 like in ashafa and the error disapears. Is it possible to use 0.1.1 url version somehow, or deps should always correspond each other?
12:37hiredmanzarkone: it sounds like an undeclared dep
12:38hiredmanmaybe clutch uses clojure.core.incubator, but doesn't say it does, so everything works as long as some other library depends on it
12:38hiredmanbut as soon as no other libraries says it depends on it, then it isn't there when clutch tries to use it
12:39hiredmanI would try just adding a dependency on core.incubator to your project
12:40hiredmanhttps://github.com/clojure-clutch/clutch/issues/86 and look at that
12:40hiredman(also it looks like clutch moved)
12:40zarkonejust to be clear, i has clutch before. The error appear after i add url
12:40hiredmanright
12:41hiredmanyou specified a newer version of url which does not depend on core.incubator
12:41zarkoneoh, yes, i've got what you mean
12:41zarkonethank for explanation
12:42zarkonehiredman: and also, for the issue link =)
12:44zarkonejust sometimes i've got such issues, and guessed that i don't get some general ideas..
12:45hiredmansure
12:47zarkone"This fix is only on master, not in any release yet.", thats why..
14:21mmitchellI'm using prismatic's schema and would like to find a way to produce end-user error messages. Anyone know if a project exists for this or if there's a recommended way of going about this?
14:27jimrthymmitchell: github.com/datil/schema-rosetta seems like it might be something along those lines
14:28mmitchelljimrthy: oh snap, I'll have a look. Thanks.
14:44timvishercan i tune the midje print level in a project.clj to anyone's knowledge?
15:02caternok clojure friends
15:03caternwhat is the best video of an introductory talk for clojure you've seen?
15:03caternI'm giving a clojure talk tomorrow
15:03caternand I need 2 prepare
15:03caternalso, I need to be re-enthused about clojure
15:03caternotherwise I might just paint a dismal picture of it
15:18puredangerI don't know that I have a best talk to point to for intro'ing clojure - it's such a big thing that it's impossible to actually cover it in a single talk
15:19puredangermy favorite talk from an inspiration point of view may actually be Stu Halloway's talk http://www.infoq.com/presentations/Clojure-tips
15:24svericatern: watch any of the top talks of rich hickey, I think he is the most motivating person I know regarding programming talks
15:24puredangermy last public attempt at explaining why I think Clojure is great is here: http://www.infoq.com/presentations/clojure-data-state-value (excuse the title) which might at least give you some ideas
15:24nicferrierlein vcs tag seems to require gpg
15:24nicferrierI don't want it to require gpg
15:29akira__hi! can anyone tell me the best latest debug tool with breakpoints for use with the lein repl and vim?
15:29caternemacs
15:31wasamasahmm
15:31wasamasareminds me that I should give the basic debugger malabarba wrote a try
16:06caternso if I wanted to give a presentation from emacs/cider/a clojure file
16:06caternis there anything I'd want to do to make this go nicely?
16:06catern(I only just realized I've never done such a presentation with clojure before)
16:08nicferriermake the font big
16:08nicferrierchange the background to black and the fg to white (high contrast works better in some situations)
16:09caternbesides those two
16:09caterni mean more things like
16:10caternI guess I should just flip between buffers as I give the presentation
16:10caternnevermind
16:11puredangerexpect no one to be able to read the minibuffer - either it's too small or it's too low on the screen to see
16:12justin_smithisn't there a way to do presentations from org mode?
16:20nicferrierthere is
16:20nicferrierI do all mine with org mode and elnode
16:22caternI think before giving my talk, while waiting for people to file in, I'll play https://www.youtube.com/watch?v=5-OjTPj7K54
16:30wasamasacatern: you know, so far I've just hit SPC in a minimal PDF viewer
16:30wasamasacatern: and it worked out pretty well for me!
16:31caternwasamasa: naaaaah I don't like presenting with PDFs
16:31caternwith slides
16:31caternit's boring
16:31wasamasamy slides are also pretty minimal
16:31wasamasasometimes I dare putting something else than another bullet point on them
16:39TimMc*grumble grumble polyglot project*
16:45bucketh3adI have a sequence of numbers. I can find the minimum with min, but what is a good way to find out what places in the sequence the minimum occurs?
16:46amalloybucketh3ad: wellll, you can do that, but usually when your plan involves using the indexes of a sequence there is a better algorithm available
16:46TimMcI have this project where the source is in Java and the tests in Clojure... except for this one JUnit test.
16:47TimMcThis works if I include :java-source-paths ["src/main/java" "src/test/java"] and lein-junit, but if I try to use *maven* to compile via the pom.xml, it fails.
16:47TimMcI know that the generated pom.xml is not supposed to be usable but it's so... close...
16:48TimMcIf anyone is curious: https://github.com/brightcove/johnny/blob/master/project.clj
16:48amalloyTimMc: i think you're supposed to put test source paths in a different place, for maven
16:48bucketh3adamalloy: I'm not using the indexes for anything. They are the final answer I'm trying to derive.
16:49amalloybucketh3ad: probably nothing better to do than use a reduce, then
16:50bucketh3ad(filter #(= % <min value>) <sequence>) is good enough then. Thanks
16:52jfcaronI'm looking to make a portable app that people can use to keep track of who speaks during meetings & for how long.
16:52jfcarone.g. the user would input names of people at the meeting, arrange them in the seating order, and click/tap to indicate when people are talking.
16:53jfcaronThen the app would generate a report at the end showing the conversation links, who talked the most, etc.
16:53amalloybucketh3ad: i would write: ##((fn [xs] (first (reduce (fn [[i x] [j y]] (if (< y x) [j y] [i x])) (map-indexed vector xs)))) [1 2 1 0 8])
16:53lazybot⇒ 3
16:53amalloyoh, but you're looking for multiple places
16:53bucketh3adYeah, good call. I forgot filter would just give me the values. Not the most useful when I already know the min.
16:53jfcaronIs clojure a good choice for this project? I'd like to learn clojure but this seems a little hard given that I don't know any other lispy/functional languages.
16:53TimMcamalloy: Yeah, maven doesn't like compiling the junit tests without junit. :-)
16:54akjetmaAnybody know of any medium-sized applications using reagent with public source code?
16:54akjetmatrying to see how others handle state management
16:55amalloybucketh3ad: ((fn [xs] (first (reduce (fn [[is x] [j y]] (cond (< y x) [[j] y], (= y x) [(conj is j) x], :else [is x])) [[] Double/POSITIVE_INFINITY] (map-indexed vector xs)))) [1 2 1 0 8 0]) to get multiples
16:55amalloyof course it's a bit messy to handle the case where xs is empty
17:13bucketh3adamalloy: Thanks for your help. Inspirited by your use of map-indexed, I came up with this solution that I like a bit better: (defn mins [xs] (let [m (apply min xs)] (for [x (map-indexed vector xs) :when (= m (second x))] (first x))))
17:13amalloybucketh3ad: well, the nice thing about my version is it only traverses the list once
17:14bucketh3adIt's better for efficiency, no doubt, but a bit worse for clarity, as efficient algorithms often are
17:14amalloyyours keeps the whole list in memory at once; but if you know your lists will be small enough that that's not a big deal, yours is better
17:14amalloywell, it's not so much efficiency as like...correctness when given a large input
17:15amalloyeg (mins (range 1e8)) or whatever is large enough to run you out of heap
17:16hiredmanapply mins
17:16hiredmanmin
17:16hiredmanoh
17:18bucketh3adIt worked well enough for my test set of ~82,000 length
17:18amalloysure, 82k isn't big
17:18bucketh3adBut I'll keep your algorithm around in case I need to run it on anything in the millions
18:33drojaswhat0s the difference between clojure.edn/read-string and clojure.tools.reader.edn/read-string ?
18:42Bronsadrojas: if you can use c.edn/read-string there's not much value in using c.t.r.edn/read-string
18:42Bronsadrojas: its main purpose was making the edn reader available for versions of clojure that didn't have clojure.edn
19:38drojasthanks Bronsa
20:38aaelony, (read-string "07")
20:38clojurebot7
20:38aaelony, (read-string "08")
20:38clojurebot#error{:cause "Invalid number: 08", :via [{:type java.lang.NumberFormatException, :message "Invalid number: 08", :at [clojure.lang.LispReader readNumber "LispReader.java" 324]}], :trace [[clojure.lang.LispReader readNumber "LispReader.java" 324] [clojure.lang.LispReader read "LispReader.java" 248] [clojure.lang.LispReader read "LispReader.java" 195] [clojure.lang.LispReader read "LispReader.java" ...
20:38aaelonyis that a bug?
20:40dnolenaaelony: don't think so, 07 is a valid octal, 08 is not
20:41aaelonyok. just weird to me. thank-you.
20:41caternlooking for a good way to demonstrate the Java interop
20:41thearthuraaelony: you and many programmers under 50
20:41caternwhat's a good Java library to demo using from Clojure?
20:41caternor maybe I should write some Java, compile it, then load the JAR/call methods in it?
20:44aaelonyWhat is the proper way to cast "08" to a the integer 8 ?
20:44dnolen,(Integer/parseInt "08")
20:44clojurebot8
20:45aaelonythanks again. I realized that I should have googled better the first time..
20:50caterndear #clojure, why should I choose clojure over scala?
20:50caternI should just google
20:59TEttingercatern, clojure code tends to be a lot shorter. scala's standard lib is rather over-complex, especially compared to clojure's. Here's the inheritance/trait hierarchy for a List in Scala http://nurkiewicz.github.io/talks/2014/scalar/img/list-scala.png
21:00TEttingerscala has a better type system for certain tasks
21:00TEttingerscala may perform better, in particular with regards to startup time (they should be similar on a long-running well-optimized app in either language)
21:01TEttingerscala has some concern over backwards compatibility in the past, stuff has broken in odd ways before. clojure remains pretty backwards-compatible, I can't recall the last time something broke
21:03TEttingerclojure has a significant benefit in the expressiveness of its primary data structures, and how inter-changeable they are
21:05TEttingercatern, as to demoing a java lib from clojure... look at seesaw
21:05TEttingeran idiomatic clojure wrapper around swing
21:05TEttingerwriting swing by hand in java is pretty awful
21:05TEttingerbut it's easy in clojure with seesaw
21:08caternTEttinger: I mean specifically showing the Java interop
21:08caternin a demo
21:08caternnot using a wrapper library
21:09TEttingerthe original ants demo is pretty good for that
21:10caternhuh?
21:11TEttingerthis hasn't been updated for newer conveniences but should still run https://github.com/juliangamble/clojure-ants-simulation/blob/master/src/ants.clj#L222
21:11TEttingerthat's the line where the interop starts
21:13caternew, swing
21:14pdkit's a swingin' good time
21:21caternhmmm, I will be presenting to a bunch of people who may well be experienced concurrent programmers with distributed systems
21:21caternand I'm not
21:21caternI think I will avoid the concurrency features of clojure
21:21justin_smithwoah, they are like the best part
21:21caternbut I don't understand them enough
21:22caternand I might embarass myself
21:22caternI suspect they will be biased against Clojure enough because it's dynamic
21:22justin_smithbig picture: clojure is awesome because the little rules you have to follow or else your concurrency system just breaks are almost always the simple / straightforward way to do something in clojure
21:22caternand this is static type country
21:22cddrIs there a function (sort of like concat) but which doesn't split strings into chars?
21:22justin_smithstr
21:23cddrBut if one or more of the items of the input are vectors, it should behave like concat for those items
21:23cddr(f [[:foo :foo]] "foo")
21:23cddr=> [:foo :foo "foo"]
21:24justin_smithcddr: your problem is that foo isn't in a collection
21:24justin_smithI mean :foo or 'foo would cause a straight up error
21:26cddrHm, yeah I'm trying to convert an XML doc into a map so I can validate it with prismatic's schema
21:27cddrKinda surprised someone hasn't already cracked this nut. Probably because there are a few different ways to represent the XML
21:28justin_smithI mean clojure.xml/parse will give you a data structure back
21:28justin_smithor whatever that function is...
21:28cddrYeah I want something that looks like hiccup
21:28cddrMaybe that's a silly thing to want?
21:29justin_smith,(require 'clojure.xml)
21:29clojurebotnil
21:29justin_smith,(clojure.xml/parse (slurp "http://google.com&quot;))
21:29clojurebot#error{:cause "denied", :via [{:type java.lang.SecurityException, :message "denied", :at [clojurebot.sandbox$enable_security_manager$fn__887 invoke "sandbox.clj" 69]}], :trace [[clojurebot.sandbox$enable_security_manager$fn__887 invoke "sandbox.clj" 69] [clojurebot.sandbox.proxy$java.lang.SecurityManager$Door$f500ea40 checkRead nil -1] [java.io.FileInputStream <init> "FileInputStream.java" 135] [c...
21:34tomjacksurprising: naively, hiccup does not seem well-suited to validation with schema, compared to the stuff clojure.xml gives you
21:35tomjackI mean, naively I think "hiccup is for humans, clojure.xml is for computers"
23:49kenrestivowell this is a fine mess. i have an ancient noir app, which uses *noir-session* dynamic var for sessions, on heroku, and now it seems sessions no longer work, it's like there are multiple threads and *noir-session* keeps changing between requests
23:49kenrestivoworks fine locally. broken on heroku.
23:50codefingerkenrestivo: how does noir-session work?
23:50kenrestivoalso i'm geting ring-session cookies constantly changing, which points to some kind of dumb dynamic var probem.
23:51kenrestivocodefinger: it's just a dynamic, thread-specific var, storing the session
23:51kenrestivobest guess is that there are multiple threads, with different values for *noir-session*. it's not feasible to rewrite or do a major upgrade on the app.
23:52codefingerso you don't think it's specific to heroku or anything? (asking be I work there)
23:52codefingers/be/because/
23:53kenrestivooh, it may be, and it's awesome that you do, thanks for responding!
23:53kenrestivoit appears to be specific to heroku, because on jetty there's no problem.
23:54codefingerjetty locally you mean? are you running jetty on heroku?
23:54kenrestivojetty locally.
23:54kenrestivobtw this is a cedar-10 app
23:55kenrestivothis whole thing is severely bitrotted. ancient noir, cedar-10, etc.
23:56codefingerhow many dynos?
23:56kenrestivoi dunno, i might just give up. the amount of time it could take to unbitrot this could be not economically sensible.
23:57kenrestivoit says dyno=web.2
23:57kenrestivoand sometimes dyno=web.1, so i guess 2 dynos?
23:58codefingerdoes noir-session require sticky sessions?
23:58kenrestivoit's complicated, but there's an atom storing the session data, and a dynamic (thread-specific) var also used to store session info, i'm still trying to refresh my memory
23:59kenrestivohttps://www.refheap.com/100183
23:59codefingeryou should try turning on session affinity (sticky sessions) to see if it helps: https://blog.heroku.com/archives/2015/4/28/introducing_session_affinity
23:59kenrestivocool, thanks