2012-02-25
| 00:12 | muhoo | is there any non-painful way to redirect println's to a tcp-connected lein repl? |
| 00:13 | muhoo | cause, if i run (println "foo") in the lein repl connected via tcp, i get "foo" , life is good. but, if i put (println "foo") in a function that's called from a server, like, say aleph/netty, it gets output to stdoout, not to tthe lein repl |
| 00:14 | muhoo | ah, nm i see #<OutputStreamWriter java.io.OutputStreamWriter@602f958> |
| 00:14 | muhoo | *out* is different in each |
| 00:15 | muhoo | &*out* |
| 00:15 | lazybot | ⇒ #<StringWriter > |
| 00:15 | muhoo | ,*out* |
| 00:15 | clojurebot | #<StringWriter > |
| 00:33 | tardo | (= (__ "Dave") "Hello, Dave!") to make that true, i thought i should use str "Hello, " but alas that's not right |
| 00:34 | tardo | shoot that wouldn't hit the "!" |
| 00:40 | theconartist | tardo: concatenate |
| 00:40 | tardo | theconartist: i found a solution |
| 00:40 | tardo | ut |
| 00:40 | tardo | but |
| 00:41 | tardo | i did (fn [x] (str "Hello, " x "!")) |
| 00:41 | tardo | and i see that #(str "Hello, " % "!") works |
| 00:41 | tardo | but why does it need the "#" |
| 00:41 | tardo | is it just a shorthand for a function? |
| 00:41 | theconartist | yea it's a macro |
| 00:42 | tardo | cool |
| 00:42 | theconartist | str is just string concat btw, so yea |
| 00:43 | alexyk | one can extract multiple keys into a vector like: &(map {:a [10 11] :b [20 21] :c 3} [:a :b]) |
| 00:43 | alexyk | &(map {:a 1 :b 2 :c 3} [:a :b]) |
| 00:43 | lazybot | ⇒ (1 2) |
| 00:43 | alexyk | now I want to extract first elements of vectors under keys |
| 00:44 | alexyk | &(map {:a [10 11] :b [20 21] :c 3} [:a :b]) |
| 00:44 | lazybot | ⇒ ([10 11] [20 21]) |
| 00:44 | alexyk | but I want |
| 00:44 | alexyk | &(map {:a [10 11] :b [20 21] :c 3} [(comp first :a) (comp first :b)] |
| 00:44 | lazybot | java.lang.RuntimeException: EOF while reading, starting at line 1 |
| 00:45 | alexyk | can I get the first elements in the same map, without a second (map first …) |
| 00:45 | alexyk | ? |
| 00:58 | qbg | &(map (comp first {:a [10 11], :b [20 21]}) [:a :b]) |
| 00:58 | lazybot | ⇒ (10 20) |
| 00:58 | qbg | alexyk: like that? |
| 00:59 | alexyk | yeah |
| 00:59 | mdeboard | Does the `_` here mean something specific or just a generic local variable binding: `(defmethod fib 0 [_] 1)` |
| 00:59 | qbg | Generic ignorable parameter |
| 00:59 | alexyk | the problem is more general: I want a key :a and a first element of a sub vector under ut but the whole :b |
| 01:02 | qbg | &(map #(({:a first, :b identity} %) ({:a [10 11], :b [20 21]} %)) [:a :b]) |
| 01:02 | lazybot | ⇒ (10 [20 21]) |
| 01:03 | qbg | That problem sounds more complex than it needs to be (without knowing context at least) |
| 01:04 | IceD^ | technomancy, hey |
| 01:04 | IceD^ | technomancy, how do we add various slime extensions when we loading slime from clojure-jack-in] |
| 01:06 | IceD^ | for example, I'd like to have thouse fuzzy expansions, but don't want to resort writing too much about it into .emacs |
| 01:06 | murm | how would I do a map lookup with a regex? |
| 01:06 | IceD^ | murm, ? |
| 01:06 | IceD^ | murm, what do you mean |
| 01:06 | murm | (re-verb {"match-me" "value"}) |
| 01:07 | murm | (re-verb "match" {"match-me" "value"}) |
| 01:07 | murm | rather |
| 01:07 | IceD^ | you want to match key and return value? |
| 01:07 | murm | (re-verb "match" {"match-me" "value" "nomas" "val2"}) => "value" |
| 01:07 | murm | yea |
| 01:07 | IceD^ | as usually |
| 01:07 | IceD^ | re-match key, get value by key |
| 01:08 | qbg | If multiple match, which one would be returned? |
| 01:08 | murm | first |
| 01:08 | IceD^ | map isn't ordered ;] |
| 01:09 | IceD^ | but yes - as I said - use (keys map) |
| 01:11 | qbg | &(->> {"match" 1, "nomas" 2} (filter (comp (partial re-matches #"mat.*") first)) first second) |
| 01:11 | lazybot | ⇒ 1 |
| 01:11 | qbg | But that is just insane... |
| 01:11 | emezeske | ,(first (filter (fn [[k _]] (re-matches #"a$" k)) {"a" 1 "b" 2 "c" 3})) |
| 01:11 | clojurebot | Execution Timed Out |
| 01:11 | emezeske | &(first (filter (fn [[k _]] (re-matches #"a$" k)) {"a" 1 "b" 2 "c" 3})) |
| 01:11 | lazybot | ⇒ ["a" 1] |
| 01:12 | murm | mm |
| 01:12 | emezeske | Heh, I guess that's pretty much the same as qbg's ^_^ |
| 01:12 | qbg | &(first (filter (fn [[k _]] (re-matches #"a$" k)) {"a" 1 "b" 2 "c" 3})) |
| 01:12 | lazybot | ⇒ ["a" 1] |
| 01:13 | qbg | Made yours a bit shorter :) |
| 01:13 | qbg | &(first (filter (fn [[k]] (re-matches #"a$" k)) {"a" 1 "b" 2 "c" 3})) |
| 01:13 | lazybot | ⇒ ["a" 1] |
| 01:13 | qbg | There we go |
| 01:13 | emezeske | qbg: Oh, nice, I didn't know you could do that |
| 01:13 | emezeske | &(let [[a] [1 2 3 4 5]] a) |
| 01:13 | lazybot | ⇒ 1 |
| 01:14 | emezeske | Neat |
| 01:15 | IceD^ | does bot have protection from (repeat 1)? |
| 01:15 | emezeske | IceD^: Yeah I think there are sandboxy limits set up |
| 01:15 | IceD^ | wana try? :) |
| 01:16 | emezeske | &(repeat 1) |
| 01:16 | lazybot | Execution Timed Out! |
| 01:16 | emezeske | "Execution Timed Out" is my guess |
| 01:16 | emezeske | ah |
| 01:16 | IceD^ | :) |
| 01:16 | IceD^ | nicely |
| 01:17 | IceD^ | sideeffects goes to /dev/null I think |
| 01:17 | IceD^ | &(println 123) |
| 01:17 | lazybot | ⇒ 123 nil |
| 01:17 | IceD^ | mhm |
| 01:17 | IceD^ | &(println "1\n2\n") |
| 01:17 | lazybot | ⇒ 1 2 nil |
| 01:17 | IceD^ | well, at least it eats newlines |
| 01:21 | qbg | &(let [m {"a" 1 "b" 2 "c" 3}] (m (some #(re-matches #"a$" %) (keys m)))) |
| 01:21 | lazybot | ⇒ 1 |
| 01:22 | emezeske | qbg: I like that one |
| 01:32 | IceD^ | back to my issue |
| 01:33 | IceD^ | I did some reasearch and still don't see how to get my fuzzy expanding in clojure-jack-ined slime |
| 01:33 | IceD^ | main problem here - I go tune my emacs when I'm tired and can't do anything productive ;] |
| 01:34 | IceD^ | so some help 'd be welcome |
| 01:39 | IceD^ | or just give me quite few .emacses here at list ;) |
| 02:14 | tjgillies | how do i not use state here? https://refheap.com/paste/839 |
| 02:14 | tjgillies | typically i would make :name be a ref and mutate it, but i think thats wrong way to be doing it |
| 02:16 | tjgillies | or should i be using a ref since im working across threads? |
| 02:16 | IceD^ | make person a ref |
| 02:17 | IceD^ | all data are immutable unless you ref |
| 02:17 | tjgillies | should person be a ref? or should :name be a ref? |
| 02:17 | IceD^ | I'd vote for person |
| 02:17 | tjgillies | why? isn't that really OOish? |
| 02:17 | IceD^ | you are mutating person, not name |
| 02:18 | tjgillies | im mutating the name attribute of person |
| 02:18 | tjgillies | ideally i would not like to mutate anything and just update the structure "tyler" variable points to |
| 02:18 | tjgillies | but im not sure i can do that across threads |
| 02:18 | tjgillies | s/not like to/like to not/ |
| 02:27 | qbg | &(doc alter-var-root) |
| 02:27 | lazybot | java.lang.SecurityException: You tripped the alarm! alter-var-root is bad! |
| 02:27 | qbg | ,(doc alter-var-root) |
| 02:27 | clojurebot | "([v f & args]); Atomically alters the root binding of var v by applying f to its current value plus any args" |
| 02:28 | qbg | Still, indirecting through a(nother) reference type would be nicer |
| 02:29 | tjgillies | woah thats a cool function |
| 02:29 | tjgillies | never seen that before |
| 02:29 | qbg | Very little reason to use it though |
| 02:30 | qbg | Using an atom or ref is almost always better |
| 02:30 | tjgillies | ok |
| 02:30 | tjgillies | thats what i was asking |
| 02:30 | tjgillies | clojure seems to have an anti-state mentality |
| 02:31 | tjgillies | so i wanted to know when to use stateful things |
| 02:31 | qbg | When you have to :) |
| 02:31 | tjgillies | yes |
| 02:31 | tjgillies | that is clever, but not entirely helpful |
| 02:31 | tjgillies | :) |
| 02:32 | qbg | You usually try to push all of your state into just a few instances of the reference types |
| 02:32 | qbg | Depends on what you need to do though |
| 02:32 | bsteuber | it's not really anti-state, more like "be conscious about your state" |
| 02:32 | tjgillies | im a ruby guy so im used to everything being an object |
| 02:33 | tjgillies | then i go to clojure where its "theres not really any such thing as an object" |
| 02:33 | qbg | They're still objects, but immutable objects |
| 02:33 | bsteuber | oh everything is still an Object in java sense :) just not mutable most of the time ^^ |
| 02:33 | bsteuber | argh, too slow |
| 02:34 | qbg | We just don't tie functions to our objects |
| 02:34 | bsteuber | data is always stateless |
| 02:35 | bsteuber | but a reference can hold different data over time |
| 02:35 | bsteuber | an "object" is a lot of things at once |
| 02:35 | bsteuber | clojure rather gives you all aspects split apart |
| 02:36 | tjgillies | which is what i meant by "theres not really any such thing as an object" |
| 02:36 | tjgillies | theres aspects, that combined, can be called an "object" |
| 02:37 | tjgillies | im talking more in the philosophical sense, not what literally is happening on the JVM because i realize the datastructures are objects there |
| 02:39 | callen | tjgillies: just pass data around man. |
| 02:39 | callen | no need to mutate 99% of the time. |
| 02:39 | qbg | For simple applications, you can store all of the state in a single atom or ref |
| 02:40 | qbg | Create the future using a pure function of the past |
| 02:40 | tjgillies | thats the part that scares me |
| 02:40 | tjgillies | decoupling state from object identity |
| 02:40 | tjgillies | keeping those together is so familiar to me ;) |
| 02:40 | bsteuber | the funny thing is, once you're familiar with it you will consider everything else insane |
| 02:40 | dbushenko | hi all! |
| 02:40 | callen | bsteuber is quite right here. |
| 02:41 | tjgillies | i look forward to that day, hence my presence here |
| 02:41 | dbushenko | what is the best library for parsers implementation with clojure? |
| 02:41 | callen | tjgillies: just do some 4clojure exercises. |
| 02:41 | callen | dbushenko: well, depends on the kind of parser |
| 02:41 | callen | dbushenko: there's a clj-peg IIRC |
| 02:41 | tjgillies | oh cool |
| 02:41 | tjgillies | just googled 4clojure never been there before |
| 02:41 | dbushenko | callen, and what are the options? |
| 02:41 | tjgillies | looks neat |
| 02:42 | tjgillies | callen: thnx |
| 02:42 | qbg | Consider an address book application. The state would probably be a map of names to entries. |
| 02:42 | callen | tjgillies: once you've made yourself comfy, implement something using idiomatic Clojure, avoiding mutation. |
| 02:42 | emezeske | bsteuber: I'm quite familiar with immutability and functional programming, and I definitely don't find everything else insane. |
| 02:43 | qbg | To change, say the city of "bob", you'd do (swap! the-state assoc-in ["bob" :city] "Anytown") |
| 02:43 | qbg | *the city bob lives in |
| 02:44 | tjgillies | i think he meant specifically coupleing state and object identity is insane |
| 02:44 | tjgillies | coupling* |
| 02:44 | tjgillies | i could be wrong however |
| 02:44 | emezeske | tjgillies: Right, and I don't think it is :) |
| 02:44 | tjgillies | ah |
| 02:44 | callen | tjgillies: it's just hard to manage once you're doing something non-trivial or concurrent. |
| 02:44 | emezeske | I happent to quite like functional stuff |
| 02:44 | callen | tjgillies: it's not a big deal if the problem is relatively simple, but then anything would suffice. |
| 02:44 | emezeske | But that doesn't mean that everything else is insane. |
| 02:44 | dbushenko | callen: clj-peg looks much like yacc or antlr. are there any libraries like parser combinators (except fnparse, its old) |
| 02:45 | callen | emezeske: prolific mutation is insane, mutation in and of itself isn't insane. |
| 02:45 | rplevy | dumb question: when a literal string is processed by the reader, but before it is evaluated there doesn't appear to be any way to see it has metadata, but it does, as you can see after it is evaluated. is there any way to get at the metadata prior to evaluation? Example part 1: (read-string "(def ^:private foo)") => (def foo) , Example part 2: (meta (eval (read-string "(def ^:private foo)"))) => {... , :private true |
| 02:45 | rplevy | , ...} |
| 02:45 | callen | dbushenko: it's a new lang, I'd say implement your own if your needs are that specific. |
| 02:45 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ... in this context, compiling:(NO_SOURCE_PATH:0)> |
| 02:45 | tjgillies | i like to program everything that starts out relatively simple as if i were programming it relatively complicated, because in practice thats how it usually works out |
| 02:45 | tjgillies | so i would rather not program something with the mentality that is "ok" to do it that way as long it stays simple |
| 02:45 | bsteuber | emezeske: ok maybe it was a bit exaggerated, but you get the point |
| 02:46 | emezeske | callen: I think "insane" is the wrong word. I mean, we're writing programs that get executed by machines, which are by their nature massively stateful |
| 02:46 | qbg | ,(meta (read-string "^:foo hello")) |
| 02:46 | clojurebot | {:foo true} |
| 02:46 | tjgillies | emezeske: and insane ;) |
| 02:46 | emezeske | Insanely cool, maybe |
| 02:47 | bsteuber | dbushenko: a friend of mine and me also wrote a parser lib that is quite usable |
| 02:47 | arohner | dbushenko: there's also parsatron, though I haven't used it |
| 02:47 | bsteuber | https://github.com/contentjon/tools/blob/master/gen/src/main/clojure/com/contentjon/gen/core.clj |
| 02:47 | arohner | I used fnparse a long time ago, which was pretty cool, but very easy to make something dog slow |
| 02:47 | bsteuber | the tests document how it works |
| 02:47 | qbg | ,(-> "(def ^:foo hello)" read-string second meta) |
| 02:47 | clojurebot | {:foo true} |
| 02:47 | qbg | rplevy: Works for me... |
| 02:48 | bsteuber | we did pretty much fnparse with a few extras |
| 02:48 | rplevy | oh I was apply meta on the def expression, duh |
| 02:48 | rplevy | ok it really was a dumb question |
| 02:48 | rplevy | I only half-believed it was actually |
| 02:53 | tjgillies | on https://www.4clojure.com/problem/95 what is meant by "predicate" ? |
| 02:54 | qbg | Function that returns a boolean |
| 02:55 | qbg | For example, odd?, even?, etc. |
| 02:55 | tjgillies | qbg: thnx |
| 02:55 | qbg | (predicates in Clojure tend to end in ?) |
| 02:55 | callen | a handy but small thing to steal from Ruby. |
| 02:55 | tjgillies | i know them from ruby didn't know they were called predicates |
| 02:56 | qbg | or Scheme |
| 02:56 | qbg | I like it better than the Common Lisp approach of having it end in p or -p |
| 02:56 | callen | that's where Hickey got them from |
| 02:56 | callen | but most people know Ruby better. |
| 02:56 | callen | qbg: there were many things in CLisp that were kind of ugly. |
| 02:57 | qbg | Though sometimes the p convention makes for good jokes |
| 02:58 | tjgillies | is that where condp comes from? |
| 02:59 | qbg | Don't think so. condp is a version of cond that takes predicates |
| 03:01 | IceD^ | ritz throws stacktrace on me on start |
| 03:01 | IceD^ | I'm very, very sad panda here |
| 03:30 | tjgillies | so from what im hearing this seems to be the way to decouple state and object identity in clojure: https://refheap.com/paste/840 |
| 03:31 | callen | tjgillies: don't over-rely on refs when they're not necessary man |
| 03:31 | callen | tjgillies: just contain them in a map. |
| 03:31 | callen | tjgillies: stop trying to shove a square peg in a round hole |
| 03:32 | tjgillies | callen: what do you mean contain them in a map? |
| 03:33 | tjgillies | to stop shoving a square peg in a round hole, one must first identify what is round and what is square |
| 03:34 | callen | tjgillies: https://refheap.com/paste/841 |
| 03:34 | callen | tjgillies: no mutation, just returns a new map with the appropriate changes. |
| 03:34 | callen | tjgillies: just do 4clojure man. You'll get the idea. |
| 03:38 | tjgillies | ok thanks |
| 03:39 | callen | I'm not convinced he was convinced. |
| 03:56 | emezeske | Wooooooo, finally, released lein-cljsbuild 0.1.0 |
| 03:56 | emezeske | That took way too forever |
| 04:58 | espringe | How do I check if a value implements a particular (user-defined-protocol) ? |
| 04:59 | espringe | I want something like "extends?" but that can accept a value rather than the record name itself |
| 05:19 | morphling | espringe: ##(doc satisfies?) |
| 05:19 | lazybot | ⇒ "([protocol x]); Returns true if x satisfies the protocol" |
| 05:19 | espringe | morphling: thanks |
| 05:49 | _ulises | morning all |
| 06:18 | tdrgabi1 | I'm failing to insert in a table, using clojureql, if the table has a column with auto_increment |
| 06:18 | tdrgabi1 | I tried with :id nil or with missing :id at all, but I get evaluation aborted |
| 06:18 | tdrgabi1 | if I remove the column from the table, conj! works |
| 06:19 | tdrgabi1 | anyone worked with clojureql before? |
| 10:54 | photex | if there happens to be anyone out there that's familiar with data.zip.xml: data.zip.xml/text apparently gives me the text from *all* the nodes below the current node instead of just "" or whatever might be at the current level |
| 10:54 | photex | is there some way for me to avoid this? |
| 10:54 | photex | I'm processing xml that is essentially schema-free and can take several forms |
| 10:55 | photex | in a couple of places |
| 10:55 | photex | I'm make a gist with the variations that are possible |
| 10:59 | photex | https://gist.github.com/1909221 |
| 11:00 | photex | my original attempt to parse the xml documents was this large, callback-ish soup and I'd more or less handle any of these |
| 11:00 | photex | the exception being when the default attribute on an option element is used to indicate a value |
| 11:00 | photex | anyway, once I learned about zippers I have started to re-implement my ingestion process |
| 11:01 | photex | and it's largely a big win |
| 11:01 | photex | but I'm not understanding some aspects of them |
| 11:01 | photex | if anyone has advice about this I'd be very grateful |
| 11:03 | photex | Ideally, when I use data.zip.xml/text on a node I'd like it to return "" or nil if nothing is there, rather than give me all the text that sits below |
| 11:44 | h0x5f3759df | Hi, Is this talk moved away? http://blip.tv/clojure/clojure-sequences-740581 |
| 11:44 | h0x5f3759df | When i try to watch it, It ends in < a minute |
| 11:50 | ivan | h0x5f3759df: try youtube-dl on it, I seem to be getting a lot more than a minute |
| 11:53 | technomancy | whoa; youtube-dl works on other sites? |
| 11:55 | ivan | yeah, it works on a lot of sites |
| 11:55 | ivan | even infoq sometimes |
| 12:00 | technomancy | slick |
| 12:03 | ivan | I use a bookmarklet to hit a server that youtube-dls the URL I passed in |
| 12:03 | ivan | now my disks are full |
| 12:10 | jjcomer | I'm trying to get auto-complete working in clojure-mode. I have enabled it as a global major mode, installed ac-slime, and followed the setup instructions. AC works in slime, but not in clojure-mode. I'm using the emacs-prelude settings pack. Any thoughts? |
| 12:14 | kiras | jjcomer: i think in slime you can just press tab to trigger auto-completion, but in clojure-mode it defaults to C-c tab. have you tried that? |
| 12:17 | jjcomer | kiras: I'm looking to get the autocomplete where the menu pops up with the doc strings and such. |
| 12:19 | kiras | jjcomer: oh... so not just the list of currently matching functions? how do you get what you're talking about to show up in slime mode? |
| 12:20 | jjcomer | kiras: here is a screencast detailing the setup and usage http://goo.gl/npGQD |
| 12:22 | kiras | jjcomer: i see. i haven't used that. sorry to waste your time. :/ |
| 12:24 | jjcomer | kiras: no worries :) |
| 12:25 | h0x5f3759df | ivan: thanks, it worked |
| 12:31 | kij | Hey, what is the most simple way to run a noir app on my server?. I thought that a "lein uberjar", would give me a working jar. No ? |
| 12:33 | photex | kij totally been wondering that myself, I've just been using 'lein run' on a clone of the repo |
| 12:35 | kij | photex: goodie - we will be told how to get that manifest file shortly :) |
| 12:36 | tomoj | did you use `lein noir new`? |
| 12:37 | kij | tomoj: i did |
| 12:37 | tomoj | hmm.. should work then |
| 12:38 | photex | I'm trying it now... haven't actually given it a shot ;) |
| 12:39 | kij | lein new testjar; cd testjar; lein uberjar; java -jar testjar-1.0.0-SNAPSHOT-standalone.jar, Gives me :Failed to load Main-Class manifest attribute |
| 12:39 | kij | DAMN\ |
| 12:39 | kij | ;/ |
| 12:40 | tomoj | right.. `lein noir new` sets up :main in project.clj and creates a server.clj to set it to |
| 12:40 | tomoj | of course, it doesn't work :( |
| 12:40 | tomoj | need to add (:gen-class) to the ns form in server.clj |
| 12:42 | photex | ah, that was the issue |
| 12:42 | tomoj | those are the three general steps I guess 1) add ":main my.main.namespace" to project.clj, 2) (defn -main [& args] ...) in src/my/main/namespace.clj, 3) put (:gen-class) in the my.main.namespace ns form |
| 12:44 | photex | starting with lein noir new, I just had to had :gen-class in server.clj |
| 12:47 | kij | That gives me an java.util.zip.ZipException: ZIP file must have at least one entry |
| 12:56 | tomoj | kij: hmm |
| 12:56 | tomoj | `jar tf youruberjar.jar` is empty? |
| 12:57 | tomoj | you get that error when trying to create the uberjar, or when running it? |
| 12:59 | kij | tomoj: Not anymore, should be (:gen-class) Thanks! |
| 13:29 | rplevy | the compiler knows what file it is compiling, so is there a java call that can be made in a macro to introspect what file is being compiled? |
| 13:30 | rplevy | in a function call you can use (.getStackTrace (Thread/currentThread)) |
| 13:30 | qbg | *file* |
| 13:30 | rplevy | but in a macro no useful info on what is being compiled can be found |
| 13:31 | rplevy | *file* ? I'll try that... |
| 13:34 | rplevy | qbg: awesome |
| 13:34 | qbg | I also know how you can get the line number if you really want to |
| 13:48 | emezeske | Does anyone in here have the privileges to un-moderate me on the Clojure google group? |
| 13:48 | emezeske | I'm stuck in a time bubble :( |
| 13:50 | qbg | I think it usually only takes a few accepted posts |
| 13:52 | emezeske | I've had a few, maybe not quite enough. |
| 13:52 | emezeske | Seems to be a manual process, I'm guessing. |
| 15:14 | stuartsierra | emezeske: moderation is manual, after a period of time (determined by G.Groups) you will become unmoderated by default |
| 15:15 | Raynes | stuartsierra: I has question. |
| 15:15 | stuartsierra | uh oh |
| 15:16 | emezeske | stuartsierra: Thanks. |
| 15:16 | stuartsierra | Raynes: hit me |
| 15:17 | Raynes | stuartsierra: When I sent my CA in a couple of years ago, I signed my name as Anthony Simpson. That was before I had the plane ticket mishap that scared me into using my legal last name canonically. Over time, I've managed to get my name changed to Grimes across the entire internets, but it is still AnthonySimpson on JIRA and my name was signed as Simpson on that CA. Should I send in another CA and what should I do about getting that Jira account |
| 15:17 | Raynes | changed? |
| 15:18 | stuartsierra | You should probably send in another CA. Email clojure-dev about changing your JIRA account. |
| 15:19 | Raynes | Sounds like a plan. |
| 15:19 | stuartsierra | cool |
| 15:32 | TimMc | Raynes: They wouldn't let you through security? |
| 15:58 | Raynes | TimMc: No, I realized my screw up a few days before the flgiht. |
| 15:58 | Raynes | flight* |
| 15:58 | Raynes | TimMc: It was a miracle they let us change the name on the ticket |
| 15:58 | Raynes | cemerick is my hero |
| 16:11 | Null-A | ,,3 |
| 16:11 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT> |
| 16:14 | TimMc | ~suddenly |
| 16:14 | clojurebot | CLABANGO! |
| 16:15 | qbg | ,(/ ) |
| 16:15 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT> |
| 16:15 | qbg | ,(/ 0) |
| 16:15 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT> |
| 16:15 | qbg | http://nooooooooooooooo.com/ |
| 16:16 | Null-A | heh |
| 16:16 | qbg | Poor clojurebot, we hardly knew ye |
| 16:16 | TimMc | &(+ 1 2) |
| 16:16 | lazybot | ⇒ 3 |
| 16:16 | TimMc | phew |
| 16:25 | muhoo | ,alive? |
| 16:25 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: alive? in this context, compiling:(NO_SOURCE_PATH:0)> |
| 16:25 | muhoo | ~alive? |
| 16:26 | clojurebot | Cool story bro. |
| 16:26 | muhoo | heh |
| 16:28 | Raynes | amalloy_: You need to spend time with me on the weekends. I get lonely. |
| 16:29 | muhoo | heh _VALID_URL = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/)(?!view_play_list|my_playlists|artist|playlist)(?:(?:(?:v|embed|e)/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=))?)?([0-9A-Za-z_-]+)(?(1).+)?$' |
| 16:29 | Raynes | ... |
| 16:29 | muhoo | now you have two problems |
| 16:29 | Raynes | No, you have about 37. |
| 16:32 | muhoo | wow. it works on dailymotion, google, photobudket, vimeo,depositfiles, facebook, blip(!?), comedycentral(!) .. heh. and xvideos |
| 16:32 | muhoo | i had no idea |
| 16:34 | Raynes | muhoo: (def titlere #"(?i)<title>([^<]+)</title>") |
| 16:34 | Raynes | My favorite regex. |
| 16:34 | Raynes | It has never ate my kitten. |
| 16:36 | gfredericks | Is there a way to restart the swank-server after running `lein deps`? Or must I restart all of emacs? |
| 16:37 | Raynes | gfredericks: The swank server isn't in Emacs. Just delete the slime repl buffer which will kill the connection and then you can run M-x clojure-jack-in again. |
| 16:38 | gfredericks | man I swore that didn't work last time |
| 16:38 | gfredericks | but I'm willing to try again |
| 16:38 | gfredericks | and if it does I swear not to swear as much in the future |
| 16:42 | gfredericks | Raynes: right you are sir. Thanks. |
| 16:42 | muhoo | Raynes: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags |
| 16:43 | Raynes | muhoo: ? |
| 16:44 | muhoo | check the top-voted answer |
| 16:44 | muhoo | but yes, ([^<]+) works in a pinch |
| 17:11 | murm | Is there a better way than selenium to take an existing webfrontend and putting a slicker one on top? |
| 17:20 | TimMc | I thought selenium was a website test framework. |
| 17:20 | TimMc | Is it used that way too? |
| 17:21 | bbloom | It's more of a browser automation API |
| 17:21 | bbloom | a library to be used by a test framework |
| 17:21 | bbloom | In practice, it's a giant time black hole ;-) |
| 17:23 | murm | Yea, I've been using it to automate some repetitive activities in webinterfaces that I can't change (don't have access to) |
| 17:24 | bbloom | I personally (and quite a few smart people I know) have wasted an incredible amount of time trying to get it to work just right and have a sensible API for writing integration tests…. what works in practice much better is something like QUnit |
| 17:24 | murm | But if I wanted to scale that up I'd have to deal with the issue of needing a running webdriver for every user of the new front end |
| 17:25 | bbloom | basically: stick your app in an iframe, automate it from the outside using a little javascript, and run your tests using the browser's refresh button |
| 17:26 | bbloom | then you can use selenium to load the page, manage the refresh button, and parse out the test results…. ie the minimum required to automate test execution… but not the tests themselves |
| 17:27 | murm | So basically dome dom manipulation from an iframe? |
| 17:27 | murm | couldn't clojurescript do that? |
| 17:27 | bbloom | sure, why not? |
| 17:27 | murm | could that be implemented as a browser plugin or extension? Because technically a middle server wouldn't be necessary, right? |
| 17:28 | bbloom | maybe? what we did for our app was to simply make a /test route which loads the test framework and then loads the root route in an iframe… we just run our tests by navigating to http://localhost/test |
| 17:29 | TimMc | haha |
| 17:29 | TimMc | Sounds like it's time for a better web automation lib. |
| 17:29 | bbloom | there's a great one already: it's called jQuery :-P |
| 17:30 | bbloom | the problem with selenium is that it's extremely low level |
| 17:30 | bbloom | but also oddly perscriptive |
| 17:30 | espringe | I want to make a function which accepts a key-value array. E.g. [:a foo, :b blah, c: dog]. Being a dynamically typed language, I assume the best way to do this is to accept an array where every 2nd element is a key? If so, what's the best way to "destructure" this, and iterate two-elements at a time, so i can use it easily |
| 17:30 | bbloom | it's designed to be run via java RMI, so it has totally non-useful operations for non-java clients |
| 17:31 | bbloom | it has things like assertTextContent, but then you get a remote server error… so you need to do hasTextContent and implement the assert client side in ruby/javascript/python/whatever-non-java you're using |
| 17:31 | espringe | (Also, I can't use a map -- because I don't need random access, and order is important) |
| 17:31 | amalloy | espringe: you sure you don't just want to accept an array of pairs? |
| 17:32 | murm | what does it do if a new window is opened? |
| 17:32 | espringe | amalloy: That sound reasonable, would that be the standard way of doing it in clojure? |
| 17:32 | amalloy | *shrug* |
| 17:32 | murm | this isn't for a front end that I have development access to |
| 17:32 | amalloy | your scenario is too vague to have a standard. ##(hash-map 1 2 3 4) takes them flattened, and ##(into {} [[1 2] [3 4]]) takes them paired |
| 17:32 | lazybot | (hash-map 1 2 3 4) ⇒ {1 2, 3 4} |
| 17:32 | lazybot | (into {} [[1 2] [3 4]]) ⇒ {1 2, 3 4} |
| 17:32 | murm | I'm taking a public facing front end automating some business processes |
| 17:34 | espringe | amalloy: I noticed functions like "let" seem to just take an array, where every 2nd element is a value |
| 17:34 | espringe | So wouldn't it be best to go that style? |
| 17:35 | amalloy | let is a macro, so the forms are typed in by a human and asking for manual pairing is a bit mean |
| 17:35 | bbloom | murm: take my advice here with a grain of salt… my team is relatively new to integration testing browsers… we've got a custom test framework… it's all coffeescript |
| 17:37 | espringe | amalloy: fair enough, i'll do it as you suggest. So for an end-user it'll look like: |
| 17:37 | espringe | [[:a foo] [:b foo] [:c foo]] right? |
| 17:37 | amalloy | looks that way |
| 17:42 | murm | bbloom: can you click on elements within an iframe using qunit? |
| 17:42 | bbloom | depends on what you mean by "click" |
| 17:42 | bbloom | if you mean "trigger the onclick event handler" then yes |
| 17:42 | murm | like getElement "username" (click) |
| 17:43 | bbloom | if you mean "simulate the act of a user clicking the button with the mouse at a particular point on the screen" |
| 17:43 | bbloom | then "it depends" |
| 17:43 | murm | and then put data in that text field, log in, etc |
| 17:43 | bbloom | the containing frame own's the iframe's DOM as long as they are on the same domain |
| 17:44 | jamii | If anyone has any comments on this idea I would love to here them - http://www.reddit.com/r/Clojure/comments/q5xf7/crowdfunding_an_opensource_clojure_library_for/ |
| 17:44 | bbloom | so you can just myIframe.getElementById('foo').click() |
| 17:44 | murm | well, if on a seperate server... |
| 17:44 | bbloom | murm: then probably not, due to same origin access policy |
| 17:44 | murm | and you could run that on rhino headlessly, right? |
| 17:45 | bbloom | dunno |
| 17:46 | murm | From the user's perspective, I'd want to make the iframe invisible, and provide them a much more simplified interface. |
| 17:46 | bbloom | can you do the work server side? |
| 17:46 | murm | yea |
| 17:47 | bbloom | the same domain origin access policy is a feature of browsers to protect users & doesn't apply if you're not using an iframe really |
| 17:47 | murm | would probably be better too.. from a business model question |
| 17:47 | bbloom | so you could just load a page in any old javascript execution environment, like rhino, and poke and prod it from the outside however you want |
| 17:47 | bbloom | that assumes rhino has a headless dom emulation library, which i'd be surprised if it didnt |
| 17:48 | murm | how would that be different than selenium? |
| 17:48 | bbloom | selenium is an API for remotely controlling real browsers |
| 17:48 | bbloom | you don't actually need a browser to communicate with web servers ;-) |
| 17:48 | murm | true, but it has htmlunit, that runs headlessly on rhino |
| 17:49 | muhoo | murm: in general, javascript breaks the way i used to do stuff like this: by screen scraping |
| 17:49 | murm | I know, but I need to crawl and navigate the page, sometimes executing javascript to do so, fill forms, etc... so what's the best tool for that? |
| 17:49 | muhoo | but if the app is javascript-based, scraping it with something like htmlunit is not going to work too well |
| 17:49 | murm | muhoo: what do you mean? |
| 17:49 | bbloom | http://www.envjs.com/ |
| 17:50 | bbloom | http://zombie.labnotes.org/ |
| 17:50 | bbloom | those are both js-based. i'm sure there are comparable components in the JVM world |
| 17:51 | muhoo | actually, i was told there is no such thing in java world |
| 17:51 | muhoo | there's rhino, but that's not quite the same |
| 17:51 | muhoo | but i haven't done really exhaustive research either |
| 17:51 | bbloom | well, you could probably run envjs in rhino |
| 17:51 | bbloom | i mean, you *already need* a javascript execution env to use something like envjs |
| 17:52 | bbloom | however, it's probably better supported on nodejs |
| 17:53 | murm | envjs' docs refer to running it on rhino |
| 17:53 | bbloom | perfect :-) |
| 17:53 | bbloom | go with that :-P |
| 17:54 | murm | this is all very testing focused though. Looking for docs on things like "how to enter credentials into texts fields and click login." |
| 17:54 | bbloom | yeah, testing tends to be the motivator for these things |
| 17:54 | muhoo | um, isn't entering data into form fields a crucial part fo testing? |
| 17:55 | bbloom | b/c scraping is doable with libcurl or whatever http lib you have |
| 17:55 | bbloom | usually |
| 17:55 | bbloom | unless you need to execute javascript |
| 17:55 | bbloom | which is basically google and bing :-P |
| 17:56 | bbloom | and, apparently, you — and surely a growing number of people as more sites b/c javascript dependent |
| 17:57 | muhoo | my god, is there one web framework for every person on the planet now? |
| 17:57 | muhoo | s/every/each/ |
| 17:57 | bbloom | muhoo: ? |
| 17:58 | muhoo | it seems like everywhere i turn, there's a new web framework |
| 17:58 | bbloom | heh. |
| 18:00 | muhoo | wow, rhino is the default implementation of envjs! exciting, a clojure-scriptable headless browser? |
| 18:00 | muhoo | i could turn every damn website i have to deal with into a command-line app :-) |
| 18:00 | bbloom | i don't see why not ;-) |
| 18:01 | muhoo | heh "remember that all javascript executed will have read/write access to your file system" |
| 18:01 | muhoo | clojail here we come |
| 18:10 | bbloom | so… i've been looking at this thread: https://groups.google.com/d/topic/clojure-dev/bjZsHQ6u7Fk/discussion |
| 18:11 | bbloom | does anyone have an experience with multiplexed repls? i'm interested in evaluating code simultaneously in various clojurescript environments at once… like if i want to quickly send a message to multiple browsers that are connected to the same server |
| 18:11 | rogererens | murm: I'm pretty sure that I don't understand what you're looking for, but is Diazo http://docs.diazo.org/en/latest/index.html perhaps something you could use? |
| 18:12 | bbloom | holy xml nightmare flashbacks batman! |
| 18:14 | murm | rogererens: I'll check it out. Thanks. |
| 18:20 | muhoo | so, i'm confused now. if i wanted to fire up envjs inside cljs, how would i do that? |
| 18:20 | muhoo | cljs already runs inside of rhino, so that part's done. i'm not clear how to wedge envjs in there thoguh |
| 18:23 | bbloom | i'd assume it involves a rhino repl and a call to load-file :-P |
| 18:23 | bbloom | envjs is just a javascript lib |
| 18:23 | bbloom | http://www.envjs.com/doc/guides#running-rhino |
| 18:24 | muhoo | the cljs part was what confused me though |
| 18:24 | muhoo | but then again, why not, there's js interop |
| 18:24 | bbloom | a cljs repl is just like a rhino repl…. with different syntax :-P |
| 18:36 | muhoo | wait, i'm conffused |
| 18:37 | muhoo | i thought the clojurescript repl was connected to the browser |
| 18:37 | muhoo | not to rhino |
| 18:37 | bbloom | there are two backends: |
| 18:37 | ibdknox | it can be either |
| 18:37 | bbloom | https://github.com/clojure/clojurescript/tree/master/src/clj/cljs/repl |
| 18:37 | muhoo | thx |
| 18:38 | muhoo | i see, i'm using clojurescript one, which uses the browser epl |
| 18:38 | muhoo | i gotta go bareback |
| 19:46 | murm | what's the throughput over nfc for phones? |
| 19:56 | murm | 424 kbps |
| 19:58 | murm | which is 424 kbps, right? |
| 19:58 | murm | I mean 53 KBps, right? |
| 20:02 | kij | murm: wrong chan ? |
| 20:03 | murm | and with SMS at 140 bytes, you should be able to transmit 378 sms messages a second over nfc. |
| 20:04 | murm | kij: it's just an idea for an application |
| 20:09 | murm | who wants to build an android app?! |
| 20:09 | murm | we could build it in clojure |
| 20:21 | rads | anyone know why lein-cljsbuild is giving me a JSC_DUPLICATE_NAMESPACE_ERROR when I try to compile? |
| 20:25 | dnolen | rads: it's not telling you which namespace? |
| 20:25 | cemerick | alexbaranosky: Shrink looks like a good direction. |
| 20:25 | rads | dnolen: it's one of my application code namespaces |
| 20:26 | rads | not a library or anything like that |
| 20:26 | rads | seems to work fine until I have two files that try require/use the same namespace |
| 20:26 | alexbaranosky | cemerick, thanks, do you have any constructive criticism? |
| 20:27 | rads | actually it seems to just give me that error any time I require/use one of my application namespaces |
| 20:27 | alexbaranosky | cemerick, I think at some point I'll want to know how to shrink arg-lists full of values, not just one at a time |
| 20:27 | amalloy | alexbaranosky: the readme could use a link to a description of what shrinking is |
| 20:27 | dnolen | rads: helpful to know if you can recreate with just CLJS or if it's a lein-cljsbuild specific issue |
| 20:28 | alexbaranosky | I haven't hooked it up to Midje yet, so that is usually when the use cases you forgot about show up |
| 20:28 | alexbaranosky | amalloy, good idea |
| 20:28 | rads | dnolen: I had it working with cljs-watch. I'm trying to migrate over to lein-cljsbuild and only started getting errors now |
| 20:29 | dnolen | rads: ah k, might wanna check with emezeske then |
| 20:30 | cemerick | alexbaranosky: nope, just unvarnished encouragement. :-) |
| 20:30 | alexbaranosky | amalloy, it is surprisingly hard to find an article about it.. I might have to write something short myself. |
| 20:32 | rads | dnolen: I was setting my source-dir to "src/my-app/client" rather than just "src", since I have src/my-app/client and src/my-app/server, where the client is browser JS and the server is Node.JS, so I need different compilers for that |
| 20:32 | rads | it seems that it breaks unless you set the source-dir to the root of the source files rather than a couple folders deep into the namespaces |
| 20:36 | kwertii | What happens to stdout/stderr when you do M-x clojure-jack-in? |
| 20:39 | cemerick | kwertii: stdout/err falls into the console for the process |
| 20:39 | kwertii | cemerick: the Swank process or the Emacs process? |
| 20:39 | cemerick | kwertii: swank process IIRC |
| 20:41 | kwertii | cemerick: thanks |
| 20:50 | emezeske | rads: What version of lein-cljsbuild? |
| 20:50 | rads | emezeske: 0.1.0 |
| 20:51 | emezeske | rads: Did you ever have an older version installed? |
| 20:51 | rads | emezeske: I did at one point, but I just restored from a backup recently which I believe did not have it |
| 20:51 | rads | so I don't think so |
| 20:52 | rads | and by backup I mean backup of my entire hard drive |
| 20:53 | emezeske | rads: Would it be possible to paste your project.clj somewhere? |
| 20:54 | rads | sure |
| 20:56 | rads | emezeske: https://gist.github.com/5ed4cfc51b8b9e87ed15 |
| 20:56 | rads | the first revision is the broken version, the second revision is the one that works |
| 20:57 | emezeske | ah, cool |
| 20:57 | emezeske | That's pretty weird! |
| 20:58 | emezeske | And so for the second one, you're just moving the whole src/clicktrip/client dir to src-client? |
| 20:58 | rads | yeah, so it's src-client/clicktrip/client now |
| 20:58 | emezeske | oh, so the namespace is clicktrip.client? |
| 20:58 | rads | yeah |
| 20:58 | emezeske | I see |
| 20:59 | emezeske | The :source-path just tells cljsbuild where the toplevel dir is |
| 20:59 | emezeske | So if you specify src/clicktrip/client, it's going to use that as the toplevel |
| 20:59 | emezeske | So the directory/namespace structures will be out of whack |
| 21:00 | rads | I guess I should just keep my node.js CLJS and browser CLJS into separate source directories |
| 21:00 | rads | rather than the same source directory, but separate namespaces |
| 21:00 | emezeske | What are you using to compile the node.js part? |
| 21:01 | rads | I've been using cljs-watch for both, and now I'm trying to migrate to cljsbuild. I got stuck at this part before I tried adding the node.js compilation |
| 21:01 | emezeske | Gotcha. |
| 21:01 | emezeske | Yeah, I think separate directories might be the way to go |
| 21:01 | emezeske | You have to set a compiler option for node.js output, right? |
| 21:01 | rads | yeah |
| 21:02 | emezeske | That's cool, I hadn't thought about a fully clojurescript app |
| 21:03 | rads | I'm actually just using the node.js component for client-server STM/OT using racer: https://github.com/codeparty/racer |
| 21:03 | rads | the main server is noir, though I'm considering just going all node if that turns out to be simpler |
| 21:03 | rads | so I've actually got browser cljs, node cljs, and clj in one project |
| 21:04 | emezeske | Very cool! |
| 21:05 | rads | yeah, it's been quite the learning curve getting all this to work together. I plan to write about it after I get some experience with it |
| 21:06 | emezeske | I'd read about it. |
| 21:07 | rads | setting up a cljs project is pretty finicky right now, but I'm looking forward to getting my own workflow down and using that knowledge to make it easier for others |
| 21:08 | emezeske | Yeah, there's definitely a big gap in the "best practices" area |
| 21:08 | emezeske | Not a whole lot of examples to go off of |
| 21:09 | emezeske | Somebody's gotta go out there and make mistakes for us all to learn from :) |
| 21:11 | rads | emezeske: yeah. I'm just picturing a year or two from now when we can have something like rails for a clojurescript project. not in terms of features, but something that gives you good conventions to follow right from the start |
| 21:12 | rads | clojure/cljs could make JS-heavy apps much eaiser |
| 21:26 | kwertii | rads: that'll be nice when the rough edges are smoothed out and stuff comes out of the box already configured and ready to go. That's still a big advantage for Ruby. I'm currently several hours into just setting up logging on a clojure project. |
| 21:37 | muhoo | whomever it was who pointed me to env.js, THANK YOU! |
| 21:44 | scriptor | *whoever |
| 21:44 | scriptor | hmm |
| 21:44 | scriptor | actually it is *whomever |
| 21:44 | scriptor | since you used "it was" |
| 21:45 | kwertii | Is there a way to make SLIME pretty-print hashes (with newlines and indentation) instead of dumping them linearly? |
| 21:46 | scriptor | kwertii: check out http://clojuredocs.org/clojure_core/clojure.pprint/pprint |
| 21:46 | kwertii | scriptor: cool, thanks! |
| 21:47 | kwertii | Any way to hook the SLIME REPL up to that so it does that automatically to everything it gets back at the top level? |
| 21:48 | scriptor | hmm, I'm not sure |
| 21:48 | scriptor | the closest I know is pp, which pprints the last result |
| 21:51 | emezeske | muhoo: Have you used PhantomJS? I'm curious how env.js compares |
| 21:51 | amalloy | i doubt if you really want everything pprinted. it's not always gorgeous |
| 21:51 | muhoo | emezeske: env.js works inside rhino, so i can run it from clojurescript |
| 21:52 | muhoo | i haven't tried phantom |
| 21:52 | kwertii | amalloy: dunno, it seems nicer than just dumping gigantic hashes out linearly, which is what it does now. that's kind of useless. |
| 21:53 | muhoo | emezeske: actually phantom was a PITA to try to build, so i tried and gave up |
| 21:55 | emezeske | muhoo: Ah, cool. Yeah, running in rhino seems like a nice thing |
| 21:55 | emezeske | muhoo: What platform are you on that you have to build phantomjs yourself? |
| 21:55 | muhoo | linux, debian squeeze |
| 21:56 | emezeske | muhoo: That sucks, I can't believe they don't offer a .deb |
| 21:57 | emezeske | muhoo: Debian stable is always like a decade behind, though |
| 21:57 | muhoo | their pre-built binaries required versions of libc that are later than what i have |
| 21:57 | muhoo | whatev, i'm happy with env.js |
| 21:57 | emezeske | Yeah it sounds cool |
| 21:58 | muhoo | now i'm going to try to run it from cljs. wish me luck |
| 21:58 | muhoo | it'll be good to translate ugly crap like $.map($("#mainmenu li > a"),function(j,i){return(j.innerHTML)}); into nice cljs sexps |
| 21:58 | muhoo | sorry sequences :-) |
| 21:59 | emezeske | good luck! |
| 22:00 | muhoo | thx |
| 22:03 | muhoo | kwertii: i saw in some project.clj files, stuff like :pretty-print true |
| 22:03 | muhoo | i have no idea what it does though |
| 22:04 | kwertii | muhoo: interesting, thanks, I'll check it out |
| 22:09 | amalloy | clojure.repl/repl has pluggable options for each phase, including the print phase. lein exposes those options somehow, but i don't know how. if you look into the arguments to repl, and the options in project.clj, you should find what you want |
| 22:11 | kwertii | amalloy: great, thanks! |
| 22:27 | technomancy | kwertii: there's also C-c S-i *1 |
| 22:28 | kwertii | technomancy: nice, thanks |
| 22:28 | amalloy | really? for maps? i wouldn't have expected that to be pretty |
| 22:29 | muhoo | emezeske: and that brings me to lein-cljsbuild, which i'm going to try now :-) |
| 22:30 | kwertii | it only understands the top level of the hash. subhash values are still linear strings |
| 22:31 | kwertii | map, sorry. I've been working in Ruby lately. |
| 22:31 | amalloy | hash is fine too |
| 22:31 | kwertii | (at least they're not called dictionaries...) |
| 22:32 | amalloy | and it seems to not be very general either. it does a pretty poor job of inspecting (reify clojure.lang.IPersistentMap (count [this] 2) (seq [this] (seq {:a 1 :b 2}))) - thinks the contents are empty and the meta has elements |
| 22:32 | kwertii | I'm fine with just piping the output of everything into (pp) |
| 22:32 | technomancy | the inspector is actually like the one part of the swank internals I actually have played with |
| 22:33 | technomancy | it's not too gnarly; you should try to fix it =) |
| 22:33 | amalloy | where is it? |
| 22:34 | technomancy | src/swank/commands/inspector.clj |
| 22:34 | amalloy | of, uh...what project? i don't know anything about what parts of swank are where |
| 22:34 | technomancy | I added support for showing implemented interfaces |
| 22:34 | technomancy | all the clojure is in swank-clojure |
| 22:39 | amalloy | it does indeed look pretty straightforward. can't see a reason why it doesn't work :P |
| 22:40 | amalloy | oh, nm. statements are just in the wrong order. ez fix |
| 22:45 | amalloy | technomancy, kwertii: any opinion on whether slime inspector should print metadata before or after contents? it was written to do...neither of those things, so i get to make the choice |
| 22:45 | technomancy | I'd do before since ^ is more common than with-meta |
| 22:45 | amalloy | cool. that's what i thought too (though for different reasons) |
| 22:46 | kwertii | I can see it both ways. before, because, well, it's META data that is conceptually higher up the hierarchy than the data. after because people will normally be interested in the data rather than the metadata, so that should be more easily accessible. |
| 22:46 | amalloy | personally i want it before, because the meta will usuqally be small, and the contents might be large |
| 22:46 | kwertii | amalloy: good point |
| 22:52 | muhoo | heh https://refheap.com/paste/857 |
| 22:57 | amalloy | technomancy: how do i test my changes? |
| 22:57 | muhoo | this too https://refheap.com/paste/858 |
| 22:58 | muhoo | works from inside raw rhino though. just don't know how to do it from inside cljs though |
| 22:58 | technomancy | amalloy: it's a bit more awkward now that lein-swank is spun out; need to "lein install" inside swank-clojure then get lein-swank to assoc in the updated version |
| 22:59 | technomancy | amalloy: I guess that means I need to make lein-swank skip associng in a swank-clojure version if one is already present |
| 23:02 | technomancy | amalloy: actually screw it, just do "lein swank" inside swank-clojure itself |
| 23:07 | muhoo | emezeske: i give up. if you feel like a quick writeup of how to use lein-cljsbuild to get a working cljs repl using an env.js emulated headless browser, that'd be great, but i can tell it's way over my head to figure it out on my own. |
| 23:08 | amalloy | technomancy: pull request flying your way |
| 23:10 | technomancy | woooo |
| 23:18 | muhoo | technomancy: is there a sane way to pool all my jars so that for every project lein deps doesn't pull down a separate jar of, say, clojure-1.3.0.jar, commons-codec-1.4.jar, compojure-1.0.1.jar, hiccup-0.3.8.jar etc |
| 23:18 | technomancy | muhoo: yes: use leiningen 2! |
| 23:18 | muhoo | i must have like 10 copies of those jars littering my drive |
| 23:18 | technomancy | it just keeps everything in ~/.m2/repository |
| 23:18 | muhoo | is lein2 out yet? |
| 23:18 | muhoo | well, there are some things in my ~/.m2/repository |
| 23:19 | muhoo | and sometimes stuff gets loaded there, sometimes not |
| 23:19 | technomancy | course it's out; it's on github. =D |
| 23:19 | muhoo | if i use pomegranite, it puts stuff in ~/.m2/repository . but lein deps doesn't |
| 23:19 | technomancy | it's not technically released yet, but you know... |
| 23:19 | technomancy | why be picky? |
| 23:19 | amalloy | wait, doesn't lein1 do that too? it's not actually re-downloading all the jars for every new project; it's just copying the ones from ~/.m2 |
| 23:19 | technomancy | amalloy is correct |
| 23:20 | technomancy | it copies them from ~/.m2 into lib |
| 23:20 | muhoo | oh |
| 23:20 | amalloy | i guess it's not clear whether he was complaining about the download or the disk space |
| 23:20 | amalloy | but since people who complain about disk space are CRAZY i assume the former |
| 23:20 | muhoo | well, that's still disk space littering |
| 23:20 | technomancy | amalloy: I took a patch to do symlinking from someone who complained about disk space |
| 23:21 | amalloy | sure it is. and it's good that lein2 stops doing it. but you have like a trillion bytes available |
| 23:21 | technomancy | it was only done for hysterical raisins |
| 23:21 | technomancy | ahem |
| 23:21 | technomancy | historical reasons |
| 23:21 | muhoo | i have a netbook with a flash drive, so disk space matters. and my main internet connection is via tmobile 3g, so bandwidth matters too |
| 23:21 | technomancy | well there's not really any help for bandwidth |
| 23:21 | technomancy | unless you rsync ~/.m2 from another local machine |
| 23:21 | muhoo | if it's just copying, then bandwidth is not a problem |
| 23:23 | technomancy | it'll still go checking for snapshots, so don't use them unless absolutely necessary |
| 23:23 | muhoo | that's ok, if there's newer stuff, grab it. |
| 23:24 | technomancy | well it also slows everything down |
| 23:24 | muhoo | but as long as it's not downloading a new copy of clojure-1.3.0.jar from clojars every time i type lein deps, i'm fine |
| 23:24 | technomancy | yeah, it never did that |
| 23:24 | technomancy | but you should still use lein2 |
| 23:25 | muhoo | well of course. i'm on lein 1.6 atm. i'm also on debian stable :-) |
| 23:25 | technomancy | I'm on squeeze too |
| 23:25 | alexbaranosky | anyone know of a good list of all the different characters as they are used in cl-format? |
| 23:26 | technomancy | nix is really the only thing that makes squeeze bearable though |
| 23:26 | muhoo | nix? |
| 23:26 | clojurebot | nix is a purely functional package manager exhibiting many similar characteristics to Clojure's persistent data structures or git commit trees: http://nixos.org/nix/ |
| 23:26 | muhoo | reallly, cool |
| 23:26 | amalloy | ,(map char (range 65532)) ;; alexbaranosky |
| 23:27 | clojurebot | (\ |
| 23:27 | amalloy | omg that 2 should be a 5. nobody tell me i'm an idiot plz |
| 23:27 | muhoo | i dunno, i've been using apt-get for, like, 9 years now, and i'm happy with it. |
| 23:27 | alexbaranosky | amalloy, nice |
| 23:28 | technomancy | muhoo: apt-get is fantastic for system-level stuff |
| 23:28 | technomancy | but sometimes you just *have* to have multiple versions installed side-by-side, and apt-get is awful for that |
| 23:28 | juhu_chapa | is it posible to declare global var with def where its value references a function not yet defined, (def name get-name) |
| 23:28 | technomancy | plus flawless rollbacks with nix are just fantastic |
| 23:28 | muhoo | hehe true. i remember the nightmares of trying to have jackd and jackdmp installed at the same time |
| 23:28 | muhoo | (now known as jack2) |
| 23:29 | technomancy | juhu_chapa: you can use resolve to delay lookup to runtime. |
| 23:29 | technomancy | muhoo: the papers on nix are really accessible |
| 23:29 | technomancy | there are some really great ideas in there; I highly recommend it |
| 23:29 | muhoo | nice, nix looks like github for binaries |
| 23:29 | muhoo | sorry git for binaries |
| 23:29 | technomancy | the similarity is quite strong |
| 23:30 | technomancy | it's also great in that it can coexist fine with other package managers |
| 23:30 | technomancy | so you can keep all your system stuff stable with squeeze but still get cutting-edge versions of stuff when you need it in a totally isolated package tree |
| 23:31 | muhoo | was nix written by a clojure person? |
| 23:32 | technomancy | no, but it does have Leiningen packaged |
| 23:32 | juhu_chapa | technomancy: how does resolve works? |
| 23:32 | technomancy | I should update the package though; it's still 1.6.2 |
| 23:32 | technomancy | juhu_chapa: (resolve 'clojure.set/difference) looks up the clojure.set/difference var at runtime, so even if it wasn't loaded when your code was compiled, it should still work |
| 23:34 | muhoo | what? no /lib??! http://nixos.org/nixos/screenshots/nixos-terminals.png |
| 23:35 | muhoo | how, what the, how can..... what does ldd /usr/bin/something actually do? |
| 23:35 | technomancy | hehe |
| 23:35 | photex | tells you which libraries are linked at runtime |
| 23:35 | juhu_chapa | technomancy: why "declare" does not work in this case? |
| 23:35 | technomancy | you'll have to read the paper; it's awesome |
| 23:35 | muhoo | is everything statically linked then? |
| 23:36 | technomancy | muhoo: no, but you can actually tell just by using grep every dependency of a package |
| 23:36 | technomancy | because of the way it stores everything by cryptographic hashes |
| 23:36 | muhoo | so, for example, how does grep link with, say, libc.so.x ? |
| 23:36 | muhoo | if there is no libc.so.x ? |
| 23:37 | technomancy | it's in /nix/store/kqn6mcxay9a3i43q971xaqy9br53wzaf-glibc-2.12.2.drv |
| 23:37 | muhoo | yeah, i gotta look at this paper. |
| 23:37 | technomancy | it's impossible for a package to have dependencies that are undeclared in the package definition |
| 23:37 | muhoo | ok, so ldd will give you a long spew of paths llike /nix/store/kqn6mcxay9a3i43q971xaq then, ok |
| 23:38 | technomancy | start with "Nix: A Safe and Policy-Free System for Software Deployment" on http://nixos.org/docs/papers.html |
| 23:38 | muhoo | it's not like there is no /usr/lib, it's more like they link the packages to paths like that |
| 23:38 | technomancy | if you install nix on debian then there's still /usr/lib, but all the nix packages are isolated from it |
| 23:39 | technomancy | if you install nixos (an entire nix-based OS) then there's no /usr/lib |
| 23:39 | muhoo | i'm getting old. when people move the furniture around on me, it makes me angry :-) |
| 23:39 | technomancy | heh |
| 23:39 | muhoo | i'm going to have to fire up a vm and try this out |
| 23:39 | technomancy | you don't need a VM |
| 23:39 | technomancy | since everything is isolated |
| 23:39 | technomancy | if things go wrong you can blow away /nix and start over |
| 23:39 | m0smith | Noir question |
| 23:39 | muhoo | ok, a chroot then |
| 23:40 | muhoo | atually, i don't even need a chroot |
| 23:40 | technomancy | yeah, that's the beauty of it |
| 23:40 | muhoo | if these things don't link to /usr/lib, i get it. |
| 23:40 | technomancy | I mean, you can try nixos, but that's more hardcore and experimental |
| 23:40 | muhoo | unless of course it has kernel dependencies, but in general, yeah. |
| 23:40 | photex | does anyone here actually use nixos on daily basis |
| 23:41 | photex | I've been tempted to move to Arch |
| 23:41 | photex | but recently discovered nixos |
| 23:41 | photex | discovered == stumbled upon clicking links |
| 23:41 | technomancy | a couple people I talked to had trouble getting nixos working |
| 23:41 | photex | this was my worry |
| 23:41 | technomancy | I'd recommend starting by just adding nix to whatever you're currently using |
| 23:41 | photex | especially on a laptop |
| 23:41 | muhoo | i know a few people who really love arch |
| 23:42 | photex | I setup an arch box on a vm and enjoyed it |
| 23:42 | photex | I've been running Suse for a while |
| 23:43 | photex | anyway, don't mean to hi-jack the discussion |
| 23:43 | muhoo | it's already a free-for-all :-) |
| 23:43 | technomancy | nix and debian stable is the best of both worlds as far as I'm concerned |
| 23:43 | muhoo | though it has somewhat diverged from clojure. |
| 23:43 | muhoo | yeah, i have to try it |
| 23:44 | technomancy | system-level stuff hums along flawlessly; fresh stuff flows in with no risk of destabilization |
| 23:44 | muhoo | i have an old box that runs lenny, and it'd be nice to have some modern stuff on it, i was using a chroot with squeeze, but i suppose nix might be better |
| 23:44 | photex | technomancy is that what you're running? |
| 23:44 | technomancy | photex: yeah |
| 23:44 | photex | laptop or desktop? |
| 23:44 | technomancy | laptop |
| 23:45 | muhoo | hence why destabilizationis a concern :-) |
| 23:45 | muhoo | once you get a laptop working right with linux, you kinda don't ever want to change anything |
| 23:45 | photex | muhoo exactly why I've been running my install for so long |
| 23:45 | photex | i3wm, custom .xinitc instead of a desktop env |
| 23:45 | technomancy | well, it seems like debian's fine as long as you stick with stable |
| 23:45 | photex | soooo much built up over time |
| 23:46 | muhoo | i'm fucked because ion3 is gone now |
| 23:46 | photex | /home is it's own partition, but ya never know what lies ahead |
| 23:46 | photex | muhoo tried i3wm yet? |
| 23:46 | muhoo | and the successor, notion, won't read my customizations. |
| 23:46 | muhoo | havne't, mmaybe i should. |
| 23:46 | photex | closer to ion than xmonad imo |
| 23:50 | muhoo | looks cool, will have to try it. |
| 23:50 | muhoo | maaybe with nix |