#clojure logs

2012-11-06

00:00amalloySgeo: a change to use mexpand-all in clojail should be pretty simple. why don't you send a pull request?
00:00SgeoBecause I haven't looked at the Clojail source at all
00:08holohi
00:11holoi have a defmulti. its defmethods make a completely different task from each other. i notice only the defmulti supports docstring, even though its name can be self describing, but defmethods don't support it, and the name of the defmethods are all the same, so why the docstring isn't available to describe each one?
00:12technomancyholo: defmulti creates a var; defmethod does not
00:12holomaybe i have a code smell, and the reason doing too different tasks
00:13technomancywhere would the defmethod docstring live?
00:13holotechnomancy, i see
00:14holothanks
00:15technomancynp
00:20amalloyinterestingly, Sgeo, (mexpand '(.foo bar)) => (.foo bar), whereas (macroexpand '(.foo bar)) => (. bar foo)
00:21amalloymeaning it's not as easy as just using mexpand
00:57technomancy(ns ns.excluder (:refer-clojure :exclude [ns])) (resolve 'ns) ; -> #'clojure.core/ns
00:58technomancywhat are you doing here, ns. no one invited you to this party.
00:58ajmccluskeyI'm very new to Clojure and am looking at introducing some basic logging to my app. Does everyone just use clojure.tools.logging?
00:59amalloytechnomancy: i noticed today that load-file is a compiler special
00:59technomancyajmccluskey: no, tools.logging inherits a lot of unnecessary JVM craziness
00:59ajmccluskeymmm, it was confusing the heck out of me
01:00unlinkajmccluskey: it depends what you want. if you want to control your logging the same you you control, e.g., tomcat's logging, then yes.
01:01unlinkajmccluskey: but if you want to use it I hope the idea of a logging facade doesn't scare you
01:02ajmccluskeyTo give some more context I'm writing a web app using Noir. I guess I'm used to log4j. I like having a config file and different log levels.
01:02unlinkajmccluskey: I personally just use tools.logging with logback-classic.
01:03ajmccluskeytechnomancy: I'm checking out Timbre now
01:03ajmccluskeyunlink: the thing that confuses me most about tools.logging is that you don't choose your implementation, yet can make use of the implementation - e.g. log4j configs
01:04ajmccluskeyunlink: unless I'm missing something, which is entirely likely
01:04unlinktimbre looks decent if you want something that is essentially JVM-agnostic
01:04unlinkajmccluskey: yes, it transparently chooses an implementation based on its own heuristics and what is available.
01:04ajmccluskeyunlink: by "make use of the implementation" I mean implementation specifics
01:05ajmccluskeyunlink: I guess I disagree with that approach without some sort of common interface to things like config files
01:06WokenFurywe used timbre for a while but started running in to a lot of limitations, especially when using 3rd party java libs
01:06WokenFurylogback is pretty easy to integrate: https://github.com/vaughnd/clojure-example-logback-integration
01:07WokenFuryI'd suggest sending your logging calls through macros in your project ns so you can switch easily: https://github.com/vaughnd/clojure-example-logback-integration/blob/master/src/clojure_example_logback_integration/log.clj
01:07unlinkajmccluskey: if you know the heuristics, namely, slf4j > commons-logging > log4j > j.u.logging, IIRC, then it's just like using a facade.
01:08technomancyWokenFury: what kind of problems?
01:09ajmccluskeyWokenFury: I think macros is a good idea given how new all of this is to me. Will have to finish reading "Programming Clojure" so I understand the ins and outs of macros :p
01:10unlinkajmccluskey: my rule of thumb about macros is that you should use them if you want to extend the language, and never else.
01:10ajmccluskeyunlink: maybe my problem is that I don't understand the heuristics enough to control which implementation I get. Maybe I should work on that, but I guess from a philosophical point of view I don't think I agree.
01:10WokenFurytechnomancy: not problems, limitations. we're using Datomic so we need to control its logging. and I like using Pallet to slot in different confs depending on environment
01:10unlinkajmccluskey: I don't agree either. But it works well enough, it doesn't change often, it's simple and open source, and it's well enough supported, so I use it.
01:11technomancyajmccluskey: if you need to control the logging behaviour of 3rd-party libs that use tools.logging, there's no avoiding it. but if it's just your own code I recommend you stick with something simpler.
01:11ajmccluskeyunlink: fair play. I may well go down that path too
01:11technomancyajmccluskey: with leiningen we get by with just (defn info [...]) and (defn debug [...]) that check dynamic binding before calling println
01:12unlinkajmccluskey: the reason for that rule of thumb is that by writing macros, you write code that is called by the compiler, not called by normal code. consequently macros are not first class.
01:12technomancyeven doing simple things like changing the log level at runtime is a world of pain with tools.logging
01:13ajmccluskeytechnomancy: I'm new to this whole ecosystem and still getting my feet wet, so not sure if I'll end up having to control 3rd party logging.
01:13WokenFurytechnomancy: agreed. you have to dig deep into the Java code for that. I must add that to my example
01:14technomancyWokenFury: IIRC it's not possible to do consistently across backends
01:14unlinkperhaps my imagination is limited, but that sounds like a very strange requirement.
01:14amalloyindeed it's not
01:14ajmccluskeyunlink: I have heard that a lot of newcomers to Lisp get excited and overuse macros, and I'm probably a likely candidate. I should try to exercise restraint.
01:14WokenFurytechnomancy: yeah, you'd need to implement for each backend. but I just stick to logback and simplify my life
01:15technomancyunlink: not at all; you could have a live cluster and you want to debug it but you can't afford to redeploy.
01:15unlinkajmccluskey: no you should definitely write many macros. they are very fun to write. just make sure you that you do it at times that it's appropriate to be changing the programming language :-)
01:15technomancyWokenFury: no, I mean certain backends simply don't support it
01:15WokenFuryajmccluskey: don't think you need macros here. just a wrapper so you don't have to refactor your entire code base when changing logging implementations
01:16WokenFurytechnomancy: what madness is this? pretty sure log4j, logback, and sfl4jwhatsit support it?
01:16unlinktechnomancy: I guess my logging disipline is so ingrained with that architectural limitation that I've never wanted to do that.
01:16technomancyWokenFury: someone told me it was impossible with slf4j
01:16technomancyI've never seen any code that uses logback
01:17WokenFurytechnomancy: gross. think I'll avoid slf4j then
01:17unlinkWokenFury: slf4j is a facade
01:18technomancyso... https://github.com/Seajure/metaverse
01:18WokenFuryhttps://github.com/vaughnd/clojure-example-logback-integration/blob/master/src/clojure_example_logback_integration/log.clj#L4
01:19unlinkWokenFury: you don't just use slf4j, you use slf4j and some concrete implementation as well, logback and log4j being popular choices.
01:19WokenFurythat's how I change log levels in logback.
01:20WokenFuryunlink: I can see how it starts getting overly complicated
01:20technomancyonly on the JVM do you have more adapter/facade libraries than actual implementations...
01:20technomancyalso: the s in slf4j stands for "simple"
01:20WokenFurylol. too true
01:20technomancywhich is always a disturbing sign
01:21WokenFuryI've been pretty happy with logback after far too much log4j pain over the years
01:21unlinktechnomancy: from what I hear, .NET has a proliferation of them as well.
01:21WokenFuryand I need the syslog appender
01:22unlinkwhen I discovered it, logback was like an answer to my prayers
01:25technomancyso with metaverse you can load multiple versions of a clojure library into the same JVM
01:25Sgeotechnomancy, ooh what? Sounds cool
01:27amalloyusually the next step after loading multiple versions is sadness, one way or another
01:28technomancywell, I only have it working on namespaces
01:28technomancyso classes are a lot more complicated
01:30technomancybut there's no reason why you couldn't load every version of (say) hiccup into a single process
01:30amalloyof course. it's all possible, but in practice making it work is really hard. you might as well just use osgi, who've been working on the same problem for a lot longer than metaverse has
01:31technomancyosgi is completely baffling
01:31technomancyI can't even begin to understand what it's for
01:32technomancyanyway, clojure namespaces are first-class, so they're way easier to work with
01:36technomancyit is kind of interesting to note that there are only 3 libs in the top 20 that don't have java dependencies
01:36technomancyand one of them is swank =(
01:40technomancyhttp://wondermark.com/184/
01:43xeqitechnomancy: is metaverse a start on checksumed namespaces?
03:54ajmccluskeyunlink and WokenFury: thanks for the discussion on logging. I've got logback working through tools.logging now. Despite the philosophical grievance it seems to fit pretty easily with my previous logging experience.
03:55ajmccluskeytechnomancy: you too. Thanks.
03:55WokenFuryajmccluskey: great! yeah, coming from the java world I like leveraging existing java libs because I know they're battle-tested
03:58ajmccluskeyAgree. It's a big competitive advantage for Clojure that it works so easily with decades worth of Java resources.
03:58ajmccluskeyI feel like I've gotten somewhere, so off to have a scotch :p. Thanks again. Bye all!
04:00WokenFuryenjoy!
04:03WokenFuryanyone using Pallet? struggling like mad to run 'lift' against specific nodes
04:14clgvDid Clojure 1.3 disable metadata on function-instances? I have a macro which puts metadata on the var and on the `fn` object. but the fn object doesnt seem to keep that meta in 1.3
04:16Raynes1.3 pretty much broke and killed everything. I say we forget it ever happened and pretend they jumped from 1.2 to 1.4.
04:17clgvRaynes: lol right. but that breaks it as well, doesnt it
04:17clgvI see no note in the changelog on reversing that behavior...
04:19Raynes&(meta (with-meta (fn []) {:foo true}))
04:19lazybot⇒ {:foo true}
04:19Raynes&(clojure-version)
04:19lazybot⇒ "1.4.0"
04:20clgvRaynes: ah ok, thats what the changelog means with "explicitly supplied". so adding it to the fn form is considered implicit, I guess
04:26clgv&(meta (fn {:foo true} []))
04:26lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
04:26clgv&(meta (fn ^{:foo true} []))
04:26lazybot⇒ nil
04:40clgvRaynes: I think I found a portable way since I was tearing apart the defn macro anyway ;)
04:55amalloyclgv: (meta (fn ^{:foo true} [])) should return nil in any version of clojure ever, right?
05:00clgvamalloy: yes. that was a weird idea since there is no symbol that might be passed to a def ;)
05:00amalloyreally, just use with-meta
05:01clgvamalloy: my macro now finally expands to (list 'def (with-meta func-symb meta-map) `(with-meta (fn ~@func-body-list) ~meta-map)) similar to what defn does in the end
05:01amalloyhurrah!
05:02clgvI only use it for functions that are given in a configuration to at least check for arity.
05:03clgvit provides an adjust partial function as well...
05:03clgv*adjusted
05:10balinthey, I'm looking for an idiom for a common use case
05:10balintI want to find an element in a sequence for which a given predicate (that returns true of false) holds true
05:11clgvbalint: only one or all?
05:11balintI do something like this: (some #(and (pred %) %) sequence)
05:11balintbut it feels awkward
05:11balintclgv: only the first one
05:11niclHey all, wondering what the recommended setup is for Emacs? I have clojure mode installed, but what is the best repl solution? I had a look here http://dev.clojure.org/display/doc/Getting+Started+with+Emacs and it seems like I probably want inferior lisp mode. But I don't know how to set this up using Clojure. Any tips?
05:12clgvbalint: if you do it like that better use #when (pred %) %)
05:12amalloyclgv: no difference at all
05:12clgvbalint: otherwise you could not return an element that is false or nil
05:12amalloyoh, i see. sorry
05:13ejacksonnicl: check out https://github.com/overtone/emacs-live
05:13clgvbalint: if lazy behavior is no problem first+filter is an idiomatic choice
05:13amalloywait it's kinda late at night. they're both the same, right?
05:13Raynesbalint: (first (filter pred sequence))
05:13niclejackson: will have a look
05:14amalloybalint: you could also start with (defn check [pred] (fn [x] (when (pred x) x))) (some (check pred) coll)
05:14balintclgv: oh, I see, for a false or nil element, the predicate might return true but the some will still filter it out
05:14balintso I think it makes no difference
05:14clgvoh right ^^
05:14Raynesamalloy: Am I missing something? Isn't this just (first (filter ..))?
05:15clgvI only considered that treacherous `and` ;)
05:15amalloyRaynes: sure, it is
05:15balintI like the (first filter …) approach
05:15amalloyfirst/filter is probably best. but HOFs get me excited
05:16niclejackson: ok, looks like nrepl is used for REPL stuff.
05:16clgvbut soem has the charm not to do anything lazy - which is useful in some situations^^
05:16niclejackson: will check it out. Thanks
05:16balintamalloy: HOFs?
05:16Raynesbalint: Higher order functions.
05:16clgv*some
05:16RaynesFunctions that take other functions as arguments.
05:16clgv.. or return functions
05:19amalloyclgv: huh? some is exactly as lazy as first/filter
05:20clgvamalloy: no. it is a plain recursive function without any lazy stuff
05:21amalloyso? it eagerly evaluates enough of the input sequence to return you a single item, exactly as first+filter would
05:21clgv amalloy: but filter adds additional lazy overhead, right?
05:21amalloy*shrug* it adds some allocations, yes, so it's less efficient. but that's not the bottleneck, and i wouldn't describe that as "not doing anything lazy"
05:22clgvamalloy: if you have a bottleneck with that code it's nice to know what makes the difference, no?
05:23RaynesYou both hate being wrong, don't you?
05:23clgvwell, I had to explain what I meant, since I was not that specific on the first comment ;)
05:25balintthank you, guys, btw :)
05:25Rayness/explain what I meant/make sure I could not be perceived as incorrect/
05:25Raynes;po
05:25amalloyclgv: what makes the difference will never be the overhead of creating a single cons cell
05:25clgvRaynes: was it incorrect?
05:25amalloywhich is all that first/filter will create
05:25amalloymaybe two, i guess. but not n
05:25RaynesI guess not, semantically.
05:30clgvamalloy: well if the predicate matches on the n-th element for n=1000000 it is a facto 2 difference
05:32amalloyi think you're right with the current implementation of filter, since apparently it makes a new lazy-seq even if there's no element to return
05:32amalloyit doesn't have to be so careless, though, as far as i can tell. it could just tail-recur
08:49ChironHi, i added this to project.clj :plugins [[lein-scalac "0.1.0"]]
08:49Chironbut it is not getting fetched
08:49Chironmy lein 1.7.x
08:50clgvChiron: well you use lein2 syntax
08:50Chironwhat lein1's?
08:50clgvChiron: in lein 1.7.x you need to install plugins. see its readme
08:50clgvChiron: I think it was something like "lein plugin install ..."
08:51Chironactually it says "Add [lein-scalac "0.1.0"] to :plugins project.clj. (Or :dev-dependencies on Leiningen versions earlier than 1.7.0)"
08:53clgvChiron: hmm :dev-dependencies could works also...
08:54clgvChiron: I'd read the README on that ;)
08:55Chiron,:true
08:55clojurebot:true
08:56Chironclojurebot: if you make yourself more than just, if you devote yourself to an ideal. then you will become something else entirely
08:56clojurebotSomething weird that I noticed: & (use '[clojure.contrib.json :as json]) & &| (json/pprint-json nil) |&
08:56lazybotjava.lang.RuntimeException: No such namespace: json
09:00clgvuhhh bad chain ;)
09:28degHow can I, idiomatically and concisely, print a list with dashes between the elements, but not after the last element? That is, like (doseq [x [1 2 3]] (printf "%s-" x)), but with no trailing dash.
09:30ohpauleezdeg: You can use clojure.string/join and then print
09:30degThanks. join is exactly what I need.
09:31ohpauleezNo problem, happy to help!
09:35clgvdoes type hinting work at all when I use a function first-class and pass it to another function?
09:35ejacksonohpauleez: I always forget join, and and up using interpose :)
09:36ohpauleezclgv: Type hinting only works on Java interop, otherwise it's ignored. If you pass a type-hinted function around, it should type hint when applied (ala HOF)
09:37ohpauleezejackson: There's a kibit rule for that :)
09:37clgvok I was not specific enough: I meant primitive type hinting
09:37ejacksonthere should be kibit for any code written by me !
09:37ohpauleezhaha
09:39ejacksonclgv: i dunno, be interested when you find the answer though :)
09:43ohpauleezclgv: You mean to unbox something so it's only a primitive?
09:44clgvno. primitive type hints for functions that have been introduced with 1.3
09:45ohpauleezright with the numerics stuff
09:45clgvI wonder if I have (defn ^double f [^double a, ^double b] (+ a b)) and do something like (let [g f] (g 1.0 2.0)) whether that works right without boxing
09:45clgvbut I do not know how to check
09:46ohpauleezboxing occurs
09:47ejacksonwith timing ?
09:47clgv ejackson: you mean the same setup with and without typehints? hmm that could work
09:47clgvohpauleez: how do you know?
09:48ejacksonclgv: yeha
09:48ohpauleezclgv: By default, even if you type hint primitives, Clojure passes objects to a function
09:49ohpauleezand unless you package up the data in the let block, your floating points will be objects
09:49ohpauleezso the hints are ignored
09:49clgvohpauleez: oh thats not true. with type hinting from 1.3 on it wont box if I call f directly
09:50ohpauleezclgv: How did you confirm that?
09:51clgvohpauleez: thats the feature of the new numerics since 1.3 - it's in the description and you can confirm via reflection for (defn f ^double [^double a, ^double b] (+ a b)) there is the method: invokePrim : double (double,double)
09:52ohpauleezhmm, well in that case I'm willing to wager there is no boxing in the let block you presented
09:53clgvdepends on how the decision is made on call site. if it depends on the variable there might be.
09:56ohpauleezclgv: Thanks for reminding me about the primitive type hints
09:57ohpauleez(I just reread the docs on the wiki)
09:57clgvohpauleez: np ;)
10:03clgvoh grepcode.com loads forever on clojure.lang.Compiler.java
10:04_francisI'm googling around for how I would go about setting up an SFTP server with clojure and not finding much - could someone point me in the right direction?
10:04clgv_francis: you want to implement an SFTP server with clojure?
10:05_francisclgv: I would like to be able to boot and then destroy an SFTP server at will from clojure
10:06clgv_francis: well clojure.java.shell should be able to help you with that
10:07_francisclgv: thanks
10:07ohpauleezOr you can use interop and launch a java-based SFTP
10:39clgvohpauleez: ejackson: ok it seems to work.
10:39ohpauleezclgv: Ahh cool, good to know
10:42clgvmy test case is the following: https://www.refheap.com/paste/6448
10:44konr_trabIt seems that I cannot comment the string "\." with #_; just wondering if this is a bug worth reporting
10:44clgvkonr_trab: you mean like #_"\." ?
10:47jkkramerkonr_trab: "\." is not a valid string
10:48jkkramer#_ can only comment readable forms
10:48clgv,#_"\\."
10:48clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:48clgv&#_"\\."
10:48lazybotjava.lang.RuntimeException: EOF while reading
10:48clgvhehe
10:51antoineB,(comment (+ 1 1))
10:51clojurebotnil
10:51antoineB,(comment "\.")
10:51clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported escape character: \.>
10:52antoineB,(comment "\\.")
10:52clojurebotnil
10:56clgv,;"\."
10:56clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:58antoineB,(+ 1 1) ;"\."
10:58clojurebot2
10:59antoineB#_"\\." (+ 1 1)
10:59antoineB,#_"\\." (+ 1 1)
10:59clojurebot2
11:06konr_trabStrange... so #"\." is a valid regexp and "\." isn't a valid string
11:08lucianmakes sense. it's the same in languages with raw strings (like python)
11:10antoineBin string "." is a dot, but in regex it is every_char_expected_newline
11:17degCan I put a docstring in a defmethod?
11:19jweissanyone ( Raynes amalloy_ ) know how to get lazybot to understand that it's been disconnected and reconnect automatically? on our internal irc server he never reconnects on his own
11:25jkkramerdeg: nope, only on defmulti
11:35ibdknoxNew Light Table: http://www.chris-granger.com/2012/11/05/meet-the-new-light-table/ :)
11:36llasramibdknox: Just saw! Video looks great. What would be the best way to request a 64-bit Linux build? -- github issue?
11:37ibdknoxllasram: it's coming, but an issue seems appropriate
11:37llasramibdknox: cool beans
11:37ibdknoxllasram: does Linux not let you run 32 bit apps on 64 bit?
11:38llasramibdknox: You can, but you need 32-bit versions of all the libraries a given applications links to
11:38ibdknoxah
11:38ibdknoxwas unaware
11:38ibdknoxI will try to expedite that process
11:39llasramAwesome
11:41ejacksonibdknox: playing with it now - sweet
11:45clgvibdknox: lighttables with binaries know - what language do you use now for development?
11:46ibdknoxclgv: all CLJS :)
11:46ibdknoxit's running on top of a really neat project called node-webkit which is the node runtime embedded in chromium
11:47clgvand that one induces the 32bit/64bit above?
11:48ChironHi, any idea why lein isn't able to get [clj-http "0.5.6"] ?
11:49ibdknoxclgv: yeah
11:49ibdknoxchromium
11:49clgvkk
11:49Chironcheshire:cheshire:jar:2.0.2 dependency is preventing clj-http from completion
11:49scottjibdknox: have you built anything reusable for making cljs node-webkit apps?
11:52ejacksonibdknox: large vectors seem to upset it. (time (reduce + v)) where v is length 1e7 reports execution of 1 few ms, but takes some seconds.
11:52ejacksonand lost of CPU :)
11:53ibdknoxejackson: I wonder if you hit a bug in the cljs reader/javascript
11:53ibdknoxit's probably trying to parse a number that it can't
11:53ejacksonmaybe: does it throw exceptions somewhere I can look ?
11:53ibdknoxif that were the case, (pr-str ) might fix it?
11:53matt444I have a file that is not being compiled... I've tried rm -r target/*; lein clean; lein deps; lein compile
11:54ejacksonit comes up with answers that look correct, but takes absurd time
11:54ejacksonanyway, that's it from me corner case.
11:55ibdknoxllasram: http://temp2.kodowa.com.s3.amazonaws.com/playground/bins/LightTableLinux64.tar.gz
11:55ibdknox64 bit linux
11:55llasramWow, that was fast :-)
11:57DaReaper5I am having an issue using leiningen to compile java files. Is this the proper IRC to ask about this?
11:58S11001001DaReaper5: sure
11:58S11001001~ask
11:58clojurebotTitim gan éirí ort.
11:58DaReaper5When I use lein compile or lein javac to compile a java file it gives me an error:
11:59DaReaper5public class HelloTest (pointing at "c" in "class")
11:59DaReaper5this seems very odd to me
11:59S11001001DaReaper5: https://www.refheap.com/paste
12:00DaReaper5true
12:00DaReaper5one second
12:00llasramibdknox: I hate to contribute to the impression that Linux is a difficult platform to support, but that build of LightTable requires libc6 2.14, whereas even Debian wheezy (testing) has only 2.13
12:01ibdknoxllasram: haha it used to be windows that was going to be the death of me
12:01DaReaper5https://www.refheap.com/paste/6450
12:01antoineBjust use a vm :/
12:02DaReaper5been working at this for a while
12:03S11001001DaReaper5: ls -alR target
12:03S11001001DaReaper5: it's just pointing there because it didn't decide to open a file for writing until it got there. Each java source produces class files according to class declarations, not mere presence of a file (an empty java source produces no files)
12:04llasramibdknox: Welcome to -- the future! Looks like the Ubuntu LTS release from April has a sufficiently-recent libc, but that was the first. Not sure which distros you have intent to support
12:04scottjdebian stable!
12:05ibdknoxllasram: I'm not a linux guy, do you know of any resources that might talk about the way for me to get this working on most distros?
12:06ibdknoxor is that a pipe dream?
12:06ibdknoxwithout going one by one
12:09DaReaper5S111001001 ls -alR target shows all the class files from the dependencies indicated in project.clj. Also, from your next message are you trying to say that it is point there just cause and it did not actually open the file? "Didnt decide to open afile for writing until it got there" is confusing me a bit. And yes I understand how classes are produced in java, just usually i dont have headaches with compilation/compilers.
12:09llasramibdknox: I'm afraid I don't. In general, in general I think that'd be fairly pipe-dreamy, but for something as incredibly stand-alone as LightBox, it should mostly be a case of not linking to any libraries newer than your supported platforms provide.
12:10S11001001S11001001: the error "happened" there because it had no reason to try opening a file until it got there
12:10S11001001dammit what
12:10S11001001DaReaper5: ^^^
12:10S11001001DaReaper5: if your irc client is sane it has tab complete :)
12:11llasramibdknox: My off-the-cuff proposal would be to run on the oldest Ubuntu LTS version still receiving desktop support. That's older than both the current Debian stable and oldest still-supported Fedora release.
12:11S11001001DaReaper5: and you should check the permissions of those files, and, uh, why are you extracting the dependencies?
12:11DaReaper5unfortunatly i am using irc2go which does not have tab complete. I do not think i can access this irc through mibbit (my main client)
12:11scottjibdknox: debian stable uses libc6 2.11 fwiw
12:11ibdknoxllasram: yeah, sounds like the right way to go
12:12ibdknoxscottj: righto. I will make sure it gets back at least that far :)
12:12llasramscottj: And so does Ubuntu Lucid, which is the aforementioned oldest still-supported LTS release
12:12llasramanyway, lunch EST. Thanks for humoring Linux, ibdknox :-)
12:13DaReaper5S11001001 i have a feeling that it may be permissions so i have my backend guy trying to get java file compilation working (but i am impatient). Also, I have dependencies taht are being extracted because I am trying to add a feature to an existing clojrue web server.
12:14S11001001DaReaper5: dependencies get mixed fine with uberwar; no need to explode the jars into the compilation target directory
12:15DaReaper5I will inquire to my backend guy about this.
12:16DaReaper5However, all I want to do is have a core.clj file use my java file :). I think the best way of going about this is through lein compile.
12:16DaReaper5I cannot find a good tutorial online for this
12:17DaReaper5Am I right in my presumtions that all i have to do is specify the java directory and then compile
12:17S11001001DaReaper5: you explode the jars and the jar explosion process creates the dirs with the wrong permissions oh and by the way the existing classfiles and those written by javac/clojurec can arbitrarily collide
12:17S11001001recipes for disaster
12:18dnolenibdknox: congrats! can't way to get a free second to play w/ the new LT
12:18ibdknoxdnolen: thanks!
12:18DaReaper5but wouldn't they collide if they have the same name?
12:18ibdknoxI will likely soon pass out :)
12:19S11001001DaReaper5: yeah. But with uberjar they don't arbitrarily collide, they collide in a specific way
12:20DaReaper5sorry what is uberjar?
12:20DaReaper5i thought that was the jar that was created from everything
12:20DaReaper5including what lein compiles
12:21emezeskeibdknox: You could always statically link if compatibility is your concern
12:21emezeskeibdknox: Although that will bump the file size
12:21ibdknoxemezeske: yeah I dunno how big a statically linked chromium would be
12:22S11001001DaReaper5: yes
12:23emezeskeibdknox: Oh, chromium? Probably big :)
12:24DaReaper5wouldn't I want to use uberjar when I want to create a jar for everything. How would uberjar help me with dependency jars and avoiding exploding them into target/classes for use?
12:24S11001001lein can find the classes in your deps just fine *without* exploding the jars that contain them, that includes javac *and* clojure compilation
12:25DaReaper5Ok so we are doing an unessary expoding of them
12:25DaReaper5Also, just to confirm. Are you saying that I am having an issue compiling my java file because of the classes in target/classes?
12:25clgvprimitive type hinted functions cannot have metadata on the fn instance since with-meta wraps the function in as RestFn and thus makes it non-primitive :(
12:25emezeskeibdknox: Distributing binaries across multiple distros is nigh-on-impossible
12:26ibdknoxemezeske: :(
12:26emezeskeibdknox: Especially something with that many shared object dependencies
12:26emezeskeibdknox: Distributing dynamic binaries*
12:26S11001001DaReaper5: Sort of. The gist is that if you stop exploding them and start with a fresh tree, the problem you saw will go away.
12:26emezeskeibdknox: You can get away with static
12:28DaReaper5Ok, S11001001. I have sent a message to my backend guy to fix it :/ Thanks for your help.
12:31DaReaper5S11001001 could you point me to a tutorial or resource where you learned this?
12:35S11001001DaReaper5: if you've got a grasp on unix perms and the leiningen documentation, the rest is just experience; with more experimentation and playing with leiningen and deployment, you'll pick it up.
12:36algernonfwiw, I managed to get lighttable work on debian wheezy (the 32bit version, using multiarch)
12:38dakroneibdknox: OSX 10.7+‽ ಠ_ಠ
12:38DaReaper5S11001001, ok I was just wonding if you had a resource because me and my backend guy are trying to figure out how to prevent this.
12:38ibdknoxdakrone: need to get ahold of a 10.6 machine to compile it
12:38dakroneibdknox: will you be at the conj? I'll meet you there, you can compile it on my machine
12:38ibdknoxit *is* two major versions old now though :p
12:38ibdknoxand yes
12:38S11001001DaReaper5: do you have a test deployment environment?
12:39ibdknoxthe new ones suck
12:39ibdknoxlol
12:39DaReaper5s11001001 yes
12:39S11001001DaReaper5: that's it; there are a million things that can go wrong, the only total solution is to test a deployment, look for problems, and deal with them as they come up
12:40brainproxytalk to me about "class identity" and reify
12:41DaReaper5S11001001 so we should just test around and try different things to avoid jars from exploding into target/classes? (Pritty much just figure out on our own what is causing the explosion)
12:41S11001001The strangest deployment problem I ever encountered was due to two HTTP servers having different interpretations of what headers are legal to return with an HTTP 304 Not Modified response. How do you plan for that?
12:41DaReaper5True, but I was just assuming that our problem was not rare
12:41DaReaper5:P
12:41brainproxyit seems that if I have a fn (defn myfn (reify ...)) then I can expect (= (class (myfn ...) (class (myfn ...) ...)
12:42S11001001DaReaper5: it's rare because by default, lein itself won't explode your dependencies, and only uses the compilation space as a place to write things it compiles
12:42DaReaper5ok thanks again
12:42S11001001np
12:43DaReaper5I will tell him to try a fresh install/enviroment
12:43algernonibdknox: by the way, if you're interested, I can probably provide debian/ubuntu chroots for building lighttable (or a short howto on how to set those up quickly :)
12:44Chousukeisn't there a tool for creating those? I mean, in addition to just debootstrap
12:44algernonthere is
12:45algernonbut building things sensibly is a little bit harder (like 1.5 min harder)
12:45Chousukepbuilder seems to be the name of the tool
12:45algernonyup. or sbuild. but you need a debianised source for both. (and pretty much that's the 1.5min work :P)
12:47Chousukeyeah, creating a debian package isn't too difficult.
12:48Chousukethough it depends on what you're packaging. some weeks ago I packaged a newer version of systemd for myself; since systemd and udev have been merged, this required extracting udev and libudev from the result as well...
12:49Chousukein the end I got the system booting with the result, but I doubt the package would pass debian QA
12:50goraciohi suppose we inserted some html via ajax on the page and then need to reload scripts how to do that ? any thoughts ?
12:56emezeskegoracio: When you say "reload scripts", are we talking about ClojureScript?
12:57emezeskegoracio: You could always do an XHR and eval some JavaScript in the response. ClojureScript's REPL support makes it pretty easy to do that.
12:59hiredmanhttps://github.com/hiredman/nrepl-cljs-middleware
12:59hiredmanhttps://github.com/hiredman/drawbridge-cljs
12:59emezeskegoracio: what he said ^^
13:07goracioemezeske: i use fetch about scripts like main.js jquery.js and so on
13:08ttimvisherdo i have to explicitly declare a dependency in project.clj to use it from my source code when it's a transient dependency (i.e. it shows up in `lein deps :tree`)?
13:09ttimvisherspecifically, i'm trying to get the ring.middleware.stacktrace ns to wrap my handler in but it doesn't show up as a possible middleware.
13:09goracioemezeske: so after ajax call i get html string and insert it in the document but js code in that html is not working because helper scripts didn't loaded
13:12emezeskegoracio: That sounds like maybe a question for #js. I'm not an expert, but I know there are several approaches for ensuring the JS you need is loaded.
13:12emezeskegoracio: (e.g. Google closure apps use goog.require(), although that won't help you)
13:15frenchypgoracio: loading js code in an ajax response is generally a bad idea
13:15frenchypideally the response contains only data, not logic
13:15solussddoes clojurescript not support multiple arity functions? e.g. (defn blah ([arg] (println arg)) ([] (blah "default")))
13:15dnolensolussd: it does
13:16goraciofrenchyp: well it contains handler for js lib in the script - that's more correct
13:16solussdk… must be choking on me passing nil using the fetch library "remotes"
13:16goraciofrenchyp: so i just need to reload scripts some way i guess
13:18frenchypyou are going to have to eval the script: http://stackoverflow.com/a/511273/127810
13:18frenchypis the js in the response dynamically generated?
13:20goraciofrenchyp: well html contains input element with type="filesomething" then at the end of file i load script that uses that type something like jquery selector by id
13:22goraciofrenchyp: so when i load this input via ajax call there is no any scripts parsed because i load only chunk of html not the whole page
13:23ttimvisherwhat am i not groking about transitive dependencies. am i really not able to use included libraries because i don't explicitly declare a depency on them?
13:23emezeskettimvisher: I don't know the answer to your original question (whether that should work or not)
13:23emezeskettimvisher: However, you should depend on any libraries you use
13:24emezesketimvisher: That's just a good practice -- using transitively included libraries means your app will break of the library you do depend on changes its implementation to e.g. use a different library under the hood
13:25emezeskeErr, I responded to timvisher and ttimvisher there... I guess you are the same person? :)
13:25ttimvisheremezeske: 2 different boxes :)
13:25ttimvishermakes sense
13:26frenchypgoracio: I would have all the js in the original page. I would make an ajax query that returns json data like {'markup': "...<input type='filesomething'>....", type:"filesomething"}. In the callback of the ajax request I would add response.markup to my dom like you are prob doing, and I would call runJqueryTypeSelector(resp.type) to do whatever you are trying to do.
13:26ttimvisherwhat's strange is that when i explicitly declare a dependency on ring/ring-devel, i then can't load my file because it complains about hiccup not being there
13:26ttimvisherwhich is a dependency of ring/ring-devel, but i thought it would be taken care of by the transitive dependency management.
13:26ttimvisherotherwise what's the point of transitive dependencies?
13:27emezeskettimvisher: I think maybe you have run into a problem with two of your libraries requiring different versions of hiccup maybe
13:27frenchypgoracio: one step further would be to return just data from ajax request, and use something like mustache to define and populate your html template in the original page/dom and build it with JS, which is what you would want to do for a single page application
13:28emezeskettimvisher: Only one version can actually be used, obviously, so the library that depends on e.g. an older version is breaking
13:28emezeskettimvisher: That is total speculation though
13:29goraciofrenchyp: i use fetch library which is nice but need to solve this problem some how )
13:31ohpauleezibdknox: ping
13:31frenchypgoracio: what's fetch?
13:32ohpauleezfrenchyp: fetch is an RPC from CLJS<->CLJ that uses EDN/Clojure as the exchange format
13:32ibdknoxohpauleez: hey
13:32goraciofrenchyp: https://github.com/ibdknox/fetch
13:33ttimvisheremezeske: thanks. i'll look into that
13:33ohpauleezfrenchyp: Also look at Shoreleave's remotes, which are based on fetch but give you security guarantees
13:34xeqittimvisher: I put together https://github.com/xeqi/lein-pedantic to help with those cases
13:34xeqi*debug
13:34goracioohpauleez: i have a question about fetch can i pm :)?
13:34ohpauleezgoracio: Go for it
13:40frenchypgoracio ohpauleez : I see. I still think that the markup and data can be returned separatly in a hashmap for example so that JS code doesn't have to be eval'd from the response markup
13:41ohpauleezfrenchyp: Agreed I return them separately in my apps
13:41ohpauleezmarkup comes from a CDN (in the form of partial pieces of HTML), EDN comes from my server, enfocus mashes everything together
13:42TimMcEDN, that's that Clojure subset?
13:43ohpauleezyes
13:43ohpauleezreally… it's just Clojure
13:43ohpauleezhaha
13:44TimMcWhen I saw that it had keywords, symbols, *and* strings, I knew they weren't really aiming for crosslang stuff.
14:00UrthwhyteEDN seemed oddly positioned to me as well
14:01ToBeReplaceddoes anyone have an example end-to-end of using cemerick.friend.openid? i'm in need of a little hand-holding
14:01S11001001well, crosslisp
14:02S11001001many schemes have keywords as an extension and keywords are a special subset of symbols in cl
14:04amalloyaw TimMc, like three times in a row i read your statement as "were really aiming for crosslang stuff". the sarcasm was so biting, and now i'm sad to see you were just making an honest assessment
14:07ohpauleezEDN has been pretty usable in Python - that said I don't use it as extensively as I do in Clojure* environments
14:07ohpauleez(reader literals)
14:21frozenlockIs the body of a test supposed to be evaluated in order? I think I have a test evaluating upsite down... (deftest (stuff1) (is ...) (stuff2) (is...)), where stuff2 seems to be evaluated before stuff1.
14:21jweissanyone got a hint how to run light table 0.2 on linux? the download at lighttable.com appears to be 32 bit
14:22jweissis anyone who's going to try light table actually running a 32 bit os anymore :)
14:22ibdknoxjweiss: http://temp2.kodowa.com.s3.amazonaws.com/playground/bins/LightTableLinux64.tar.gz
14:22amalloyjweiss: didn't he tweet that earlier today?
14:22jweisssuhweet
14:22callenKorma...what's the story with that and Postgres arrays?
14:22jweissi haven't checked twitter in a few hours, sorry :)
14:22amalloyfrozenlock: you're wrong then. they're in order
14:23callenibdknox: picking through the .app let me know about the awesome node-webkit project. Great stuff :)
14:23jweissibdknox: thanks!
14:29ibdknoxI also just changed the link to point to the 64bit one
14:32TimMcs/n't// :-{
14:33TimMc(I typoed that emoticon but it looks better that way)
14:33seancorfieldibdknox: while you're here... i tried it on win8 and it can't connect to any projects - what process / command is it looking for?
14:33devnanyone have a suggestion for scheme or lisp for scripting purposes? I know I could use Clojure, but I'd like something with faster startup time. Is guile worth looking at?
14:33ibdknoxseancorfield: I think it's a pathing thing
14:33ibdknoxstupid / vs \
14:34seancorfieldibdknox: so it doesn't work on windows?
14:34ibdknoxit runs java with a jar in HOME/.lighttable/clients/
14:34rplevydevn: guile scheme is used is some GNU applications
14:34ibdknoxit sort of does. Best to wait until I push an update again later today
14:34rplevyoh I only read the first half
14:35rplevyyou actually mentioned guile
14:35rplevyhaha
14:35seancorfieldibdknox: I get CreateProcessW: The system cannot find the file specified
14:35emezeskedevn: Possibly clojurescript on node.js. I haven't done it but in principle it should work just fine.
14:35seancorfieldlet me know if i can help debug it ibdknox
14:35rplevydevn: emacs lisp can be run with shebang
14:35rplevyit's way faster to start than jvm
14:36rplevyI personally don't even notice the startup time, I have written command-line scripts in emacs lisp before that I use sometimes
14:37ohpauleezdevn: FWIW, I've been actively working on CLJS+Node
14:37ohpauleezwith much success
14:37seancorfieldibdknox: it would be real nice if pressing return when a choice is selected in the file navigator actually selected that choice - instead of requiring TAB first (where do i file bugs?)
14:38ohpauleezdevn: You can see an app in action here: http://www.pauldee.org/TTT-Intro.mov
14:38ibdknoxseancorfield: https://github.com/Kodowa/Light-Table-Playground/issues
14:38ohpauleezvery fast and uses shebang - #!/usr/bin/env node
14:38rplevyit looked like there were one or two talks at Clojure Conj next week pertinent to cljs + V8
14:39ohpauleezrplevy: We're few in numbers but we're making headway :)
14:39rplevy:)
14:40ohpauleezdevn: A full blog post here: http://www.pauldee.org/blog/2012/clojurescript-and-node-js-an-experience-report/
14:41TimMcdevn: I would guess Racket might be useful.
14:42rplevyheck you can shebang sbcl or clisp too
14:42ohpauleezI was just thinking that
14:42rplevyclisp was less of a headache last time I wanted to do that
14:42ohpauleezI've definitely used clisp and sbcl with shebang
14:42ohpauleezI also recall that too - clisp was better
14:43devnohpauleez: TimMc emezeske rplevy -- thanks, will take another look at cljs + node. the last time I looked was when cljs was alpha
14:44devnohpauleez: are you querying codeq from git ttt?
14:44ohpauleezdevn: Nope, ttt is just straight CLJS code. It just has it's own datalog-like query thing
14:44ohpauleezWritten as both a for-loop and using core.logic
14:44ohpauleezfor-comprehension**
14:45devngotcha
14:45devnthat's cool
14:45ohpauleezdevn: I've been patching CLJS to work better for Node.js. I think the latest release has everything you'll need. If you hit a Node issue, ping me and I can fix it right away
14:48devnohpauleez: will do, thanks
14:49ohpauleeznp
14:55mjgwhat is the library which tracks dependencies between namespaces for safe(r) reloading at runtime?
14:57Zabolekarbonjour. i have some difficulties with using ~ correctly. let us, for example, consider #(apply - `(~(f %))) where f is defined somewhere outside. i have no idea why ~(f %) works and (~f ~%) doesn't
14:57Chousukehm
14:58Zabolekarwhere can i read about it? the examples i found are rather too simple
14:58Chousuke,'#(apply `((f %)))
14:58emezeskeZabolekar: ~(f %) actually *calls* f at compile time, whereas (~f ~%) inserts f and % at compile time, but does not call f until runtime
14:58clojurebot(fn* [p1__27#] (apply (clojure.core/seq (clojure.core/concat (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote sandbox/f)) (clojure.core/list (quote p1__27__28__auto__)))))))))
14:58mjgOK clojure.tools.namespace :)
14:59amalloyemezeske: well, not at compile time. this doesn't look like a macroexpansion; it's at whatever time he's building the list
14:59Zabolekarah, ok
14:59emezeskeamalloy: Oh, I just saw the last part and ignored the first part
14:59Zabolekarmakes sense
14:59emezeskeZabolekar: see amalloy's response to me above
15:00Zabolekarthx
15:00amalloy&(let [f inc, x 1] `((~f ~x)))
15:00lazybot⇒ ((#<core$inc clojure.core$inc@fc074d> 1))
15:00amalloy&(let [f inc, x 1] `(~(f x)))
15:00lazybot⇒ (2)
15:01Zabolekarnice example
15:05seancorfieldthanx ibdknox https://github.com/Kodowa/Light-Table-Playground/issues/169
15:13kboUsing clojure 1.4, autodoc 0.9.0, lein 2.0, I get Exception in thread "main" java.lang.IllegalAccessError: sh does not exist - ideas?
15:15rplevykbo: maybe clojure.java.shell requires that you have sh installed
15:16kboSilly me, I thought "sh" meant, well, /bin/sh or the like :-)
15:16kboSo I need to add another project dependency?
15:16rplevythat's what I thought too
15:16rplevyhmmm
15:18kboMy sh is in /usr/bin/sh and not in /bin/sh as one would expect
15:18kboCould that be the problem?
15:18kboNo, I have /bin/sh as well, of course.
15:19rplevyI was just looking at the project and I think the git-tools.clj could probably benefit from using clj-jgit
15:21qubit[01]totally off topic, but Ive found fish to be an amazing shell, much better than bash for daily stuff
15:22rplevywell there's a var in git-tools called sh
15:22rplevymaybe there's a bug
15:23rplevywhat line does it happen on?
15:25kborplevy: at clojure.core$refer.doInvoke(core.clj:3778)
15:25kboI am running strace to see what it is looking for, it doesn't seem to be "/bin/sh" or anything like that.
15:26rplevywhat line in a file that is in autodoc though?
15:27kboThis happens when It run "lein autodoc" - autodoc itself never gets a chance to get started, if that's what you are asking.
15:28kboAt least it seems that way.
15:28rplevyno, I'm just saying there's a stack trace and at some point it is initiated from a point in the code you are running
15:29kboAh, I see. Sorry. at leiningen.autodoc$eval7$loading__4784__auto____8.invoke(autodoc.clj:1)
15:29kboThat's the 1st entry that mentions autodoc.
15:29kboIt then goes to at clojure.lang.RestFn.invoke(RestFn.java:457)
15:34rplevyI bet if you dig in and comment out lines involving shell calls etc you'll either find a bug or an environment setup problem
15:34kborplevy: https://gist.github.com/4027328 if that helps
15:35rplevythe first thing I would do personally is upgrade the project to 1.4
15:35kboOh, I'm certain it is either one of these :-) Question is what I can do about it. You mean digging in the sources of Clojure itself?
15:35kboThis is a brand-new empty project I'm trying to create
15:35rplevyno
15:36rplevynot your project, but autodoc
15:36jkkrameryou could also use codox to generate api docs instead
15:36kboAh - is 0.9.0 not the latest? I could easily switch. What is the right version # ?
15:36rplevymy assumption is autodoc is a little scruffy as it stands
15:37kbojkkramer: Does lein have a plugin for codox?
15:37jkkramerkbo: yes. https://github.com/weavejester/codox
15:37rplevyno I mean it is using 1.3
15:37rplevythe changes from 1.3->1.4 weren't that dramatic though
15:37kboIt only takes a small incompatibility to bring a software system down...
15:38solussdanyone have any suggestions for grouping POSTdata from an html form? I have a bunch of fields that are repeated n times across my form, n is arbitrary (the user can add more groups of fields). In php I can name my fields like this: "[4]fieldname" "[5]fieldname" "[4]anotherfield", etc, and get a map of maps. Is there a way to do this with compojure / noir / etc?
15:38rplevychances are, the pull request to migrate this project would take less time than this conversation
15:38kbojkkramer: What's the difference between codox and autodoc, from a newbie user point of view?
15:39jkkramerkbo: different output styling, amongst other things. codox was easier to get working IME
15:40rplevyit doesn't look like autodoc even has any tests
15:41kbojkkramer: Right you are, it "just worked". I guess that is a big advantage :-)
15:41rplevyyeah I would look into that or marginalia
15:42jkkramermy impression is that autodoc has been bogged down with clojure.core and contrib concerns which don't apply to most libs
15:42rplevywhich may be between maintainers
15:43kboDoes codox or marginalia support markdown notation in the description strings?
15:46jkkramerkbo: https://github.com/hugoduncan/codox-md
15:46rplevyI don't know but marginalia has markdownj as dependency so probably
15:47rplevylook at html.clj in marginalia
15:49kboWell, it seems I'm on the right path now. Many thanks, guys!
15:53jkkramersolussd: with the appropriate middleware, ring supports "field[]" and "field[foo][bar]" conventions
15:53solussdjkkramer: thanks, ill investigate
15:56babilenDoes anybody know if I can get LightTable for Linux compiled against glibc 2.13? There only seem to be a single binary on lighttable.com that seems to target Ubuntu and derivatives.
15:58rplevybabilen: I think that's 200 dollar donation on kickstarter
15:58rplevy(troll)
15:58babilenAh well, I am happy without LightTable anyway ...
15:59rplevylighttable is awesome, I don't know if I could be happy outside of emacs though
16:00babilenrplevy: I have to take your word on it -- I played with earlier trial versions, but this one is just binary-hell-of-doom :)
16:00ibdknoxrplevy: give me time ;) Rome wasn't conquered in a day
16:00rplevyibdknox: babilen: :)
16:01ibdknoxbabilen: yeah, I know virtually nothing about building for linux - looks like my options are pretty clear though and it'll get fixed soon
16:03babilenibdknox: Well, the problem is that you compiled against libc6 2.14 which is fine for a number of distributions, but not all. Ubuntu, for example, uses 2.15 in its stable release and I am on 2.13 -- All in all: Deployment on Linux is tough to get right like this.
16:04babilenI am actually not sure which mainstream distribution uses 2.14 now, so LightTable can only be used by a small minority of people.
16:05babilen(at least if compiled dynamically)
16:07babilenibdknox: But I just wanted to ask. It doesn't sound as if that is a concern or priority of yours at all right now. You might, at least, want to consider to offer statically compiled versions though.
16:13daniel___Has anyone had success with clojure 1.4.0 and zeromq?
16:14brehaut~anyone
16:14clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
16:14Raynesibdknox: ping
16:15daniel___I want a method of getting zeromq working with clojure 1.4.0. Tried http://antoniogarrote.wordpress.com/2010/09/08/zeromq-and-clojure-a-brief-introduction/ , no success
16:16daniel___Maybe there are more recent libraries
16:17daniel___to be more specific on the error: UnsatisfiedLinkError no jzmq in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1860)
16:17daniel___i added :native-path "/usr/local/lib"
16:29jweissI'm trying to write a function realized-part that returns only the part of a seq that has already been calculated. i'm having some success with certain types, but i got hung up on ChunkedCons. doesn't seem as easy as Cons.
16:34brehautjweiss: because it doesnt implement ipending?
16:36jweissbrehaut: yeah sort of, but neither does cons. but i can still succeed with (def x (take 10 (iterate inc 0)) (print (take 5 x) (realized-part x) -> (0 1 2 3 4)
16:37jweissbrehaut: but is that only because that is a cons of lazy-seq's that i can check one at a time?
16:37brehautim curious why you want this function btw
16:38jweissbrehaut: part of a tracing lib. i don't want the trace to force calculation that otherwise wouldn't have happened.
16:38brehautah smart
16:38jweisscurrently if i trace (iterate inc 0) i get however many items that *print-length* is set to, even if i never use the value
16:40jcromartiecoming from Ruby and Clojure projects to a Java project which has a 8-12min build time
16:40jcromartieJava + Flex
16:40jcromartiebut "ant clean build", which is frequently necessary, takes 10m on average
16:42brehautjweiss: i wonder if making your own realized protocol and implementing it for cons and chunked cons or something would be the easiest way round?
16:44jweissbrehaut: yeah that is what i'm trying to do, not sure how to extend the protocol to ChunkedCons.
16:44brehautjweiss: because its an inner class?
16:44jweisswell to be honest i don't know how it works at all yet, never had the occasion to look at it until now
16:48Raynesibdknox: Man, did you *have* to use this color theme? :\
16:49ibdknoxRaynes: set theme solarizeddark
16:49RaynesThank you. So much.
16:49ibdknoxI forgot to package the other ones
16:49ibdknoxit's pretty easy for you to hack it in if you want a specific one
16:49RaynesThat doesn't seem to do anything. Do I need to reload?
16:50ibdknoxnext editor you open
16:50RaynesCool
16:50ibdknoxdrop the css file in ~/.lighttable/css/whatever
16:50ibdknoxand add it into order.json
16:50RaynesHow do I close a tab?
16:50ibdknoxthen you can set theme mycooltheme
16:50ibdknoxcmd-w
16:51RaynesHrm
16:51Raynesibdknox: Is it supposed to look like this? https://www.evernote.com/shard/s84/sh/253a3e1d-cfa3-46c5-a463-498f426138d7/866820057a8b47601cebe36b74317734
16:51ibdknoxthat's what solarized dark looks like
16:52RaynesNo it isn't. Lol. At least, that isn't what it is supposed to look like. Is this theme in codemirror proper?
16:52ibdknoxno, it was one I found googling for solarized
16:52RaynesI might take a shot at doing a better one.
16:52ibdknoxI will add the rest of them in by tomorrow
16:53RaynesI did the theme for refheap which is a tomorrow-night theme.
16:53ibdknoxthat file lives in ~/.lighttable/css/themes/solarized.css I think
16:53RaynesYou can throw that in there if you like.
16:53ibdknoxsure thing :)
16:53RaynesLoving the new look and stuff. :>
16:53ibdknoxoh btw
16:53ibdknoxset line-numbers true
16:53ibdknoxjust for you
16:53ibdknoxnext editor again
16:53RaynesBang
16:54Raynes:p
16:54Raynesibdknox: Did you see that subpar thing?
16:54Raynes$google subpar paredit codemirror
16:54lazybot[achengs/subpar · GitHub] https://github.com/achengs/subpar
16:54ibdknoxI did
16:54ibdknoxI had it in there
16:54RaynesLooks promising.
16:54ibdknoxit is unbearably slow :(
16:55RaynesI was afraid of that.
16:55ibdknox150+ lines and it is unacceptable
16:55RaynesI wonder how it could be made to be fast...
16:55RaynesLike Emacs!
16:55ibdknoxI think he's parsing everything every time
16:55ibdknoxI didn't look to closely
16:56RaynesHe probably should have just ported petit's paredit.
16:56ibdknoxI mean the quickest thing to do would be to approximate brace completion
16:56daniel___Anyone got zeromq working with clojure 1.4.0? Mind sharing the dependencies/project.clj?
16:56Raynesibdknox: Would it be possible to do light table for Haskell?
16:56RaynesObviously not asking for it right now, just curious if it would be possible given the static nature of Haskell.
16:57ibdknoxI can't think of anything about that it obviously precludes it from working
16:57ibdknoxI don't know much haskell though
16:57RaynesOne thing is that ghci doesn't just take any code and evaluate it.
16:57ibdknoxthat I discovered
16:57RaynesLike, to define functions in ghci you have to put them in a let.
16:58ibdknoxis there any way to inject code into a process?
16:58ibdknoxthat's the main thing
16:58ibdknoxif no, then you're screwed
16:58ibdknoxit's not a big deal if you have to jump through hoops to do it
16:58Raynesibdknox: http://hackage.haskell.org/package/plugins There are things like this.
16:58RaynesBut I really don't know enough to have anything concrete.
16:59ibdknoxthat sounds like what you'd need
16:59ibdknoxsomething along those lines
16:59ibdknoxso if people are able to do that, then yeah
16:59RaynesI've been getting back into Haskell lately.
16:59Raynes<3
16:59ibdknoxI played with it at strange loop a little
16:59ibdknoxI was annoyed that I couldn't do types in the repl
16:59ibdknoxor at least it wasn't obvious how to
17:03rodnaphibdknox: any key bindings or modes in the lighttable settings?
17:03ibdknoxnot yet
17:04rodnaphlove the new look, feels really solid.
17:04ibdknox:)
17:04ibdknoxlong way to go
17:04ibdknoxbut it's a start
17:05rodnaphi'm getting into emacs right now as well, so having a lot of fun just geeking out with different editors.
17:07rodnaphi take it everyone say that datomic workspace tool someone put a video out for today? that's a really nice take on an established "i'm working with a database" idea too.
17:07rodnaph*saw
17:08ibdknoxrodnaph: link?
17:08rodnaphibdknox: http://www.screenr.com/J087
17:12rodnaphibdknox: are you interested in bug reports for lighttable at this point?
17:13ibdknoxrodnaph: https://github.com/Kodowa/Light-Table-Playground :)
17:13rodnaphok, ta
17:19callenanyone here ever had cause to generate a textual graph? like of a histogram?
17:19callenI need to generate an ASCII graph of x,y data.
17:20Apage43callen: I've done that on occasion
17:20callenApage43: am I hacking something up, or is there a library out there?
17:21Apage43I don't expect there's a library
17:21callenwell that's not true
17:21callenit's just a question of narrowing it down
17:21callenPerl has it, I've found aplotter.py, and I'm looking at a few otehrs.
17:21callenothers*
17:21Apage43for ASCII graphs?
17:21callenApage43: yes
17:22daniel___Could not find artifact org.zmq:zmq:jar :'(
17:23Apage43callen: if you find something, I'd like to know anyway. I've written really simple horizontal bar charts a few times
17:24callenApage43: http://scitools.googlecode.com/hg-history/e7dc9172a38b8c0c7963315be46b36084d9edd87/doc/api/sphinx-html/aplotter.html
17:24callenApage43: not really precisely what I want, but getting closer.
17:24hiredmanhttps://github.com/joegallo/doric has some bar chart functionality
17:24callenI see some histogram support.
17:30zakwilsonibdknox, Raynes: ghci appears to evaluate code in a do block of the IO monad. I think most code could be made to work through automated rewriting, but there might be a better way.
17:33daniel___http://stackoverflow.com/questions/13260494/clojure-zeromq
17:47eggheadhow can I have something loop forever without blowing the stack?
17:47eggheadHere is what I'm trying to do (which blows the stack) https://www.refheap.com/paste/46a6c8115bdbc2232e91ae01d
17:47nDuffegghead: loop/recur
17:47AdmiralBumbleBeeloop/recur
17:48nDuffegghead: ...now, mutual recursion is trickier.
17:48AdmiralBumbleBeetrampoline
17:48hiredman,(doc while)
17:48clojurebot"([test & body]); Repeatedly executes body while test expression is true. Presumes some side-effect will cause test to become false/nil. Returns nil"
17:48AdmiralBumbleBeewith some restructuring
17:48Apage43daniel___: it's in the Sonatype OSS repo. Add it to your :repositories
17:48Apage43 :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot; }
17:48eggheadtrampoline is basically y-combinator style right?
17:49hiredmanhttp://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html
17:49Apage43the version that is in there is 1.1.0-SNAPSHOT: [org.zeromq/jzmq "1.1.0-SNAPSHOT"]
17:49eggheadhiredman: if I do (while true f) and just have the sleep be part of it ?
17:51citizenparker1Anyone done much with parallelism in clojure (specifically pmap vs alternatives)?
17:56rplevycitizenparker1: pmap may serve your purposes, but the new approach is reducers using the fork/join framework
17:57rplevypmap is basically map but in divided up into future calls
17:58rplevyyou can just use pmap wherever you would have used map
17:58callenwhat's the advantage of reducers fork/join vs. pmap?
17:59callenflexibility?
17:59rplevypmap is stupid simple and unsophisticated
17:59rplevyreducers is the new hotness
17:59callenI get that reducers and fold are more powerful, just wondering.
18:00rplevyI think the main advantage of fork join over naive parallelism is that it's better algorithm for dividing up work efficiently
18:01Apage43Reducers aren't til 1.5 though, right?
18:01rplevythere's a lib though
18:01callenI need to find an excuse to (ab)use these things.
18:01Apage43rplevy: oh?
18:02rplevywell I thought so anyway
18:02rplevyit's been on my todo list to check out
18:04rplevyI think I was mistaken
18:05rplevybut they are working in 1.5 now so I've heard
18:05rplevyvia some blog post months and months ago
18:06citizenparker1Hey, sorry, AFK
18:06citizenparker1Yeah, I know fork/join is the cool new thing, but I'm working on some code already built using pmap everywhere
18:07citizenparker1Basically we have a seq of things, x, that we then need to put each item through a workflow where each step of the workflow is long and sleepy (io/network bound)
18:08citizenparker1Right now it's essentially (->> x (pmap step1) (pmap step2) (pmap step3) … )
18:12rplevyI don't know I would probably do it the same way. Or create worker threads that pull items from a queue.
18:12citizenparker1Hey, you know what. Nevermind, I just answered my own question in trying to ask it
18:12rplevyfutures rathere.
18:12citizenparker1Yeah, queue-based would probably be ideal
18:13citizenparker1But I'd rather put that off until it's worth the complexity
18:13rplevyyeah
18:44amalloypmap is pretty bad in practice. it exists more for advertising reasons: "look, you can add one character to your program and now it's running on multiple threads!"
18:44tickingwtf get is not defined for lazy seqs?
18:45amalloy&(doc get)
18:45lazybot⇒ ------------------------- clojure.core/get ([map key] [map key not-found]) Returns the value mapped to key, not-found or nil if key not present. nil
18:46amalloydoes a lazy-seq map keys to values, ticking?
18:46tickingamalloy, *facepalm*
18:46tickingyeah I whould get to bed
18:47tickingI just wrote "how to get the nth item then"
18:47tickingand imediatle bit my ass
18:47tickingsorry seems like the night was thougher than I though ^^
18:51TEttingerAny thoughts on how to improve this one-liner?
18:51TEttinger,(clojure.string/join " " (take 8 (repeatedly #(apply str "http://i.imgur.com/&quot; (apply str (take 5 (shuffle (vec "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890")))) ".jpg "))))
18:51clojurebot"http://i.imgur.com/QHi6U.jpg http://i.imgur.com/teZYd.jpg http://i.imgur.com/ubVT2.jpg http://i.imgur.com/YLN4K.jpg http://i.imgur.com/Dj7Y8.jpg http://i.imgur.com/uM7Bf.jpg http://i.imgur.com/wMfzZ.jpg http://i.imgur.com/OW4Mo.jpg "
18:52TEttingerthey are completely random, supposedly
18:52TEttingerso there might be something weird in there
18:52TEttingerbut I have had issues myself with clojurebot's RNG, it appears
18:52TEttingerit just seems non-random sometimes
18:56tomojshould cond-> accept an extra default arg?
18:57TEttingershould cond-> have a symbol in there?
18:57TEttingeri have a hard time telling what most of these symbolic functions do in clojure
18:57TEttingeri guess they are macros
18:57tomojsymbol in where?
18:58TEttingeri have no idea what the deal is with the meta function for example
18:58TEttinger->
18:58amalloythat's not the meta function. the meta function is named meta
18:58TEttingercond-> is that the name of the function
18:58TEttingeramalloy, sorry yeah
18:58TEttingerthe reader macro
18:58TEttingerfor meta
18:58TEttingeri can never remember it
18:58amalloy^?
18:59TEttingerso then what is #^
18:59brehautold for meta
18:59amalloyequivalent but old
19:01TEttingerthe not-actually-alphabet soup is probably my least favorite part of clojure, with the somewhat confusing what-returns-a-lazy-seq business second. but i like just about everything else, especially the non-lazy persistent collections
19:03TEttingerI personally don't mind the symbols when I code, but it makes it next to impossible to paste a sample and say "here, it is obvious what this does" if there's a ^ type hint or some other more unusual uses of the keyboard
19:03TEttingerit's hard to evangelize, is what I am saying
19:03brehautdifferent things are always hard to evangelize
19:04brehautbut if it wasnt different, what would the value be
19:04TEttingerI'm running a lazybot on a different IRC server, and no one else can figure out the clojure eval
19:04TEttingerpeople sometimes try...
19:05TEttingerthank god it is so well-sandboxed
19:05TEttingerlazybot is a quality program
19:05TEttingeramalloy, is it yours? I can't remember. if so, kudos
19:22AKFLOWhey ppl
19:23AKFLOWwould anyone here help a clojure |\|008
19:23xeqi~anyone
19:23clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
19:24AKFLOWI am just researching for a bit this clojure thing and was wondering if there's a swigg style script that can turn any .java code into a .clr
19:25brehaut.clj ?
19:25AKFLOWyes sorry..
19:25brehautjust use the java class
19:26brehautyou cant sensibly machine port java code to clojure, the idioms are api are completely distinct
19:26TimMc&(Integer/parseInt "16" 11)
19:26lazybot⇒ 17
19:26TimMcAKFLOW: ^ There's an example usage of a static Java method from Clojure.
19:26AKFLOWok
19:29brehautAKFLOW: clojure has pretty solid interop with java specifically so that you can use java code in clojure
19:29TimMcAKFLOW: Please don't ask for help in private messages unless you ask first.
19:30TimMcThe person you message may not be the best person to answer, so ask in the channel instead.
19:31AKFLOWuhhh... TimMc dont be a @========3 a link will just be fine dude ..... NP just tell me ok
19:31TimMc/ignore *!*@23.19.81.247 ALL
19:32AdmiralBumbleBeewtf
19:33TimMcSeptember was a couple months ago. Figures.
19:34AdmiralBumbleBeeperhaps they're just pushing start times forward a couple of months due to teacher shortages
19:34AKFLOWhey TimMc check this out this TOR 0-day for yaaaa ....
19:35AKFLOWI am leaving what a waste of time CIAO ... ttys TimMc
19:36chessguyanybody playing with light table? i'm having trouble getting it to work out of the box
19:39jonasacdoes clojurescript allow implicit tail recursion?
19:40brehauti dont know basically anything about cljs, but i think it would be unlikely
19:41TimMcSince Clojure doesn't, and JS VMs *likely* all don't have TCO, I'd say no.
19:41brehautthats my reasoning too
19:42AdmiralBumbleBeedoes anyone know what is/was going on with that project to add tco to clojure?
19:42mudge i used lein-localrepo to install a java jar (which doesn't have a POM file) -- and now I'm trying to use it in my clojure file and I get this exception: java.lang.ClassNotFoundException:
19:42mudgehow do I access classes in my clojure file that come from local repo java jars?
19:43brehautmudge: are you asking how to import a java class into a clojure namespace?
19:45mudgebrehaut: yes, but I tried it the normal way like this: within a namespace declaration: (import (com.inductiveautomation.com.vision.api.client.components.model AbstractVisionComponent)) and I am getting the class not found error
19:45brehautand the jar is your local maven repo?
19:45mudgebrehaut: that is correct
19:45brehautdo you have the jar in your lein dependancies?
19:46mudgeyes
19:46mudgebrehaut: yes
19:46brehautits out of my knowledge then sorry
19:47mudgebrehaut: maybe I am specifiying the dependacy wrong
19:47brehautits worth double checking all that stuff
19:47mudgebrehaut: i did it like this: [local.ignition-sdk/vis-client-api "7.5.3"]
19:47mudgedoes that look right?
19:48brehautassuming all that stuff is correct, yes
19:48mudgethe local repo is there: repository/local/ignition-sdk/vis-client-api
19:48brehautin your ns line do you have (import …) or (:import …) ?
19:48brehaut(note the colon)
19:48mudgeokay, well my jar file does not have a POM file in it and when i run lein run I get warning/errors saying the pom file can't be found
19:49mudgebrehaut: I have (:import )
19:49brehautah, well if lein is complaining aobut that, then that would be something to look at.
19:50mudgebrehaut: my next question is, is it possible to use Jars that don't have a POM file?
19:50brehautmudge: you'd need to ask someone who knows a lot more about lein / maven than i do sorry
19:50brehautbut im guessing not
19:50mudgebrehaut: okay, thanks
20:02zodiakis there a purdy changelist anywhere of what's going on in 1.5 ?
20:13mudgebrehuat: I solved it. I had the group-id written wrong in my :import
20:13mudgetypo
20:14moogatronicQuestion re: nrepl.el - Does/should it automatically close any existing 'jacked-in' connections when you 'jack-in' to another one? (Like when you're making dep changes in project.clj, etc)
21:18romanandregquick clojurescript question: how can I call a function defined in a cljs ns within a cljs macro (in clj source code)?
21:18romanandregit seems lein cljsbuild is not finding the cljs ns on the classpath
21:18romanandreg:-/
21:55mudgeajmcclusky: do you know kevin mcclusky?
22:12ajmccluskeymudge: nope, can't say that I do.
22:12mudgeajmmcluskey: okay, thanks
22:13ajmccluskeymudge: are they in the clojure/software world?
22:19mudgeajmcclusky: no, but he has the same last name: mccluskey
22:38mattmossIs there a way to accomplish: (apply . obj method [args]) ?
22:39brehautwell, . is a special form so you cant apply it
22:39brehautmethods arent functions either, so you cant apply them. you need to get the method in a function form
22:39mattmossHmm.
22:39brehautusing a #( … ) form is your best bet
22:40brehauthowever
22:40mattmossI currently have four clojure fns that wrap the four .method calls, the four clojure fns variants of a multimethod.
22:41brehautone java method with multiple overloads is actually multiple methods
22:41mattmossWhich just seemed overkill.
22:41mattmossDidn't know if there was something like... (invoke-method obj theMethod [args]).
22:42mattmosswhich would select the appropriate overload.
22:42brehautthat requires going via reflection
22:43brehautyou want to avoid treating a java object as a dynamic entity
22:44mattmossHmm, yeah.
22:47seannetbookibdknox: quick light table Q: how do i download the 32-bit linux version for my netbook? (this is seancorfield on a netbook)
22:48seannetbooknm, i think i guessed the URL
22:52twobitspriteis there a way to have nrepl load the current buffer/file in the nrepl window?
22:54twobitspriteThe documentation on the github page seems to only have bindings for evaluating lines and blocks and spitting the output to the status bar at the bottom...
22:54twobitspriteOther than toying around, I'm not sure what point there is to having an nrepl buffer if you can't send code to it
22:55xeqiC-c C-k
22:56brehautnrepl is just a protocol; its up to the enviroments nrepl implementation to make details like sending the current buffer to evaluate work
22:56brehaut'just'
22:56ForSparePartsIs there a way to do breakpoints in nREPL?
22:56twobitspritesorry, I meant the nrepl emacs mode/plugin/whatever
22:56twobitspritexeqi: that doesn't seem to do it
22:57twobitspritexeqi: it only seems to send the result to the *message* buffer
22:58xeqiit sends the buffer in the background, so anyting defined should be there
22:59xeqi my normal work flow is: C-c C-k to load the buffer, C-c M-n to change namespaces, C-x o to the repl, call functions defined from file
23:00twobitspriteahh, I see! :)
23:00twobitspritethanks
23:00twobitspriteahh, and of course, now I see those bindings listed in the docs... don't know how I missed them :P
23:13ForSparePartsFollowing up on my previous question: I've realized that ritz exists for this purpose, but I have absolutely no clue how to use it, and the readme doesn't say much on the subject. Could someone point me in the right direction?
23:13ForSparePartsAlso, is there emacs integration for ritz?
23:25xeqiForSpareParts: I haven't used it, but I know hugod made a nrepl-ritz.el, and I think some of that made it into nrepl.el
23:25xeqilooking forward to his talk at the conj about ritz
23:33ForSparePartsxeqi, I'll look into that, then. Thanks!
23:55samratin nrepl.el, how do I avoid having to do (use 'foo.core :reload) every time?