#clojure logs

2013-12-22

00:47arrdembitemyapp: bro that's just friggin creepy.
00:48bitemyapparrdem: ?
00:48arrdembitemyapp: the last pic you sent me
00:49bitemyapparrdem: yeah, Dolan is amazing.
00:49bitemyapparrdem: school is in session in #haskell bhtw
00:49bitemyappbtw*
00:49danlentzbitemyapp: do you work at runa?
00:49arrdembitemyapp: coppy that, I'll listen
00:50bitemyappdanlentz: no, I work for a genetics company that uses mostly Python, but I've been shoving FP down their throats.
00:51danlentzheh. sorry i must have mixed up names
00:52danlentzgnentics are cool though -- as in bioinformatic type stuff?
00:52bitemyappdanlentz: it's fine. I help maintain Korma with Baranosky, that might be where the confusion comes from.
00:52bitemyappdanlentz: my company does their own sequencing, lab work, and bioinformatics.
00:52danlentzy i think your are right
00:54danlentzi spent some time talking with the authgor of tawny-owl phil lord who is involved with a bunch of bio at manchester. in the end though i found the lib not very useful
00:55danlentzdatomic may have finally cured me of rdf fixation
00:56danlentzalthough some people do seem to be impressed w/ stardog
00:56danlentzhavent spent any time w/ it tho
00:56danlentzits verey interesting field tho
00:58danlentzi took one grad class in bioinformatics but was massivly outclassed when it came to the chemistry
00:58danlentzit wasnt all that computer-oriented of a class unfortunately...
01:00danlentzthe computing pretty much limited to teaching bioligists how to do blast searches using a web browser :)
01:01bitemyappThat's regrettable.
01:01bitemyappI have zero background in bio, I'm there because I'm pure software and useful.
01:03danlentzy. ontogenisis web site may have some interesting articles about what theyre doing over there with mapping epidemiologic data using owl metamodels and inferencing techniqurs tho
01:20TEttingerMandus, were you Mandar before?
01:29TEttingerok, checked the logs, glad Mandar got the issue fixed
01:41yediis there a fn that removes non-alphannumeric characters from a string
01:44TEttingeryedi, sure. ##(clojure.string/replace "there's a hole in the bucket, elijah." #"\PL|\PN" "")
01:44lazybot⇒ ""
01:44TEttingeroh crud
01:46yedisweet: (str/replace "a, rando-string, that's removing... certain chars" #"\W|_" " ")
01:46yedi,(clojure.string/replace "a, rando-string, that's removing... certain chars" #"\W|_" " ")
01:46clojurebot"a rando string that s removing certain chars"
01:48TEttingerright \W
02:14TEttingeragh this is very hard for me... does anyone have a good alternative to keep-indexed for transient collections? I'm not entirely sure how to work that magical reduce to have indices
02:22danlentzis there any consensus about which is the best clojure book?
02:22danlentzpractical, joy of, programming, oreilly...
02:23danlentzsome other?
02:25brand0I found that the online resources combined with the classic lisp stuff was fine
02:32danlentzy ive gotten by I was thinking maybe if one was well regarded it wouldnt hurt to read
02:32danlentzi got a lot from the various common-lisp classics
02:40TEttingerfigured it out, I could use areduce since I was using arrays in the first place, and areduce has an index arg
03:39ivanIDEA can't save my .cljs file because System has a lock on it
03:39ivanWindows: not even once
03:41ivanoh, duh, I just had to kill the jig process running on another machine to get Windows SMB to release the lock
03:41TEttingeranother... machine.
03:41TEttingerwow
03:42TEttingerthat seems really easy to exploit
03:46ivanWindows filesystem operations are designed to have no guarantees of doing what you want to do, if anyone has ever heard of the file you created
03:46ivanstdlib open() prevents deletion of files that are open
03:49Cr8that one was a huge pain point
03:49Cr8because there's no way to get it NOT to
03:49Cr8you actually have to start using the windows filesystem API if you want to delete open files
03:50ivanyou can also open files with CreateFile + FILE_SHARE_DELETE
03:50Cr8yeah
03:50Cr8that's what I wound up having to do
03:50ivanI considered writing a program that used mhook to patch running processes to do that
03:51ivanthat was after a more hare-brained idea to make the kernel do it
03:51Cr8and then there's some way to get a fd off of that Handle but I wound up just having an i/o abstraction layer so that I could just use pure windows api ops on windows because the compat layer is just awkward as hell
03:54ivanyeah, I ended up doing that once in Python with ctypes
04:06TheMoonMasterCan anyone help convert a haskell list comprehension to Clojure?
04:10TEttingerTheMoonMaster, maybe? it probably uses for
04:11TEttingerhttp://clojuredocs.org/clojure_core/clojure.core/for can be helpful
04:14TheMoonMasterTEttinger: Yeah, it's kind of a crazy one imo, allStrings = [ c : s | s <- "": allStrings, c <- ['a'..'z'] ++ ['0'..'9'] ]
04:15TheMoonMasterMy Haskell is very very weak.
04:15TheMoonMasterAnd I'm not sure if the recursion would work with Clojure in this case
04:16TEttingerthis is an infinite sequence?
04:17TheMoonMasterYes.
04:18noidiI think that might work, if you create a function that returns the result of the list comprehension, and the list comprehension invokes the function
04:21TEttingerI would just use lazyseqs... if I was familiar with them
04:22TheMoonMasterHmmm
04:24noidiactually that won't translate to clojure directly because clojure is strict and not lazy
04:25noidiclojure would have to evaluate the recursive call to allStrings before it can return from the outer allStrings
04:25noidithere's no base case so you get infinite recursion
04:25TheMoonMasterYeah, I was thinking the recursion wouldn't work in the clojure version.
04:26TheMoonMasterI just need a way to take an array of characters and generate an infinite sequence, eg: [a b c 1 2 3] return a, b, c, 1, 2, 3, aa, ab, ac etc
04:26TheMoonMasterI was trying to think of a decently functional way to do that instead of using an atom to change the value and increment it.
04:28TEttinger##(let [all ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"]] (nth (iterate #(for [base % more all] (str base more)) all) 1))
04:28lazybot⇒ ("aa" "ab" "ac" "ad" "ae" "af" "ag" "ah" "ai" "aj" "ak" "al" "am" "an" "ao" "ap" "aq" "ar" "as" "at" "au" "av" "aw" "ax" "ay" "az" "a0" "a1" "a2" "a3" "a4" "a5" "a6" "a7" "a8" "a9" "ba" "bb" "bc" "bd" "be" "bf" "bg" "bh" "bi" "bj" "bk" "bl" "bm" "bn" "bo" "bp" "bq" "... https://www.refheap.com/22114
04:28TEttinger(let [all ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"]] (iterate #(for [base % more all] (str base more)) all))
04:28TEttingerthat last one I didn't run, because it will run forever
04:29TheMoonMasterAh, got it.
04:29TEttingerTheMoonMaster: ^
04:29TEttingeriterate returns an infinite sequence
04:29TheMoonMasterThanks TEttinger, I appreciate it.
04:30TEttingeryou can get an entry with nth or all entries with take, like in haskell
04:30TEttingersure, np
04:30TEttingerthis was a fun brain challenge
04:30TheMoonMasterYeah, it was a bit too much for me to do myself.
04:31TEttingerI used ideone to help verify what the haskell... did
04:31TheMoonMasterHahaha, I can't stand Haskell to be honest.
04:31TheMoonMasterTried getting into it quite a few times and quit each time.
04:37TEttingerTheMoonMaster, be aware that that does not like calculating the combination of 5 or more letters... it gets slow
04:38TEttingeror rather, it just ran out of memory
04:38TheMoonMasterInteresting.
04:38TheMoonMasterLuckily I don't need it past 4
04:39TEttinger4 it does fine
04:39TEttingerI have 8 GB RAM, and it seems fine
04:40TheMoonMasterSame here.
04:41TEttingerthe number of 4-char combinations is 1,679,616
04:41TEttingergoooooood
05:08yediso i made this thing: https://gist.github.com/yedi/8080527
06:01TEttingerTheMoonMaster, oh this is fun
06:01TEttinger##(take 200 (let [all ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"]] (nth (iterate #(for [base % more all] (str base more)) all) 7)))
06:01lazybot⇒ ("aaaaaaaa" "aaaaaaab" "aaaaaaac" "aaaaaaad" "aaaaaaae" "aaaaaaaf" "aaaaaaag" "aaaaaaah" "aaaaaaai" "aaaaaaaj" "aaaaaaak" "aaaaaaal" "aaaaaaam" "aaaaaaan" "aaaaaaao" "aaaaaaap" "aaaaaaaq" "aaaaaaar" "aaaaaaas" "aaaaaaat" "aaaaaaau" "aaaaaaav" "aaaaaaaw" "aaaaaaax" "a... https://www.refheap.com/22116
06:01TheMoonMasterHaha, obsessed now?
06:02TEttingerit can calculate less, if it does it on-demand
06:02TEttingernah, disconnected for an hour
06:02TEttingerwas wondering why it was running out of memory
06:03TheMoonMasterAhhh
06:03TEttingerwhat were you using this for?
06:06TheMoonMasterTEttinger: Just comparing Clojure with Haskell with a friend
06:06TEttingerah ok
06:06TEttingerthey are very different languages
06:07TEttingeronce you get to macros I think clojure has a real edge
06:07TEttingerbut I haven't needed macros yet
06:07TEttinger(to write my own, I haven't needed it)
06:07TheMoonMasterYeah, same.
06:08TheMoonMasterI understand macros far better than other concepts
06:08TEttingerlazyseqs are tricky...
06:10TheMoonMasterYeah, but I love the language.
06:13TEttingersame
06:13TEttingerI write utility scripts in clojure because by now it's faster than anything else I know
06:14TheMoonMasterI'm aRuby / JS guy but play with Clojure
06:14bitemyapparrdem: around?
06:15TEttinger@seen arrdem
06:15TEttinger&seen arrdem
06:15lazybotjava.lang.RuntimeException: Unable to resolve symbol: seen in this context
06:16TEttingerdollar sign.
06:16TEttinger$seen arrdem
06:16lazybotarrdem was last seen talking on #clojure 5 hours and 27 minutes ago.
06:26hyPiRionTEttinger, TheMoonMaster: https://www.refheap.com/22117 is a solution which works in constant space (if you don't retain head) and runs in inverse factorial time for a single solution n.
06:27TheMoonMasterDude nice.
06:27TheMoonMasterNow to wrap my head around it
06:28hyPiRionheh, yeah
06:30TEttingerclever, hyPiRion
06:30TEttingerquot mod
08:08daGrevishi! can someone show me an example of reduce with f, val and coll in it?
08:08daGrevisso far I can use reduce with f and coll, no idea how val works.
08:09angerman,(doc reduce)
08:09clojurebot"([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i...
08:09cark,(reduce + 5 [1 2])
08:09clojurebot8
08:10angermandaGrevis: so the thing is: reduce takes two arguments, if you hand it a collection, what do you reduce the first value with? You can either specifiy it explicitly with val OR (default behaviour) simply reduce the first and second element ast first step.
08:12angermanas clark mentioned: reduce with + on [1 2] does 1 + 2, reduce with [1 2 3] would do (1 + 2) + 3, reduce with an initial value of 5 and [1 2] would do ((5 + 1) + 2)
08:13daGrevisangerman, thanks, i got it :)
08:14carkhow's this clark you speak of hungerman !?
08:14carkwho*
08:14angermancark, sorry :(
08:14carkhehe =)
08:17daGreviscurrent status https://twitter.com/daGrevis/status/414746316233646080
08:18daGrevisyee, (count "foo") works!
09:19Mandarthe-kenny, updated my code to use repeatedly, it's much clearer now, thanks! https://github.com/agolp/sangria/blob/master/src/sangria/guessing_game.clj
10:39lsdafjklsdHey all
10:40justin_smithhello
10:41rurumateHas anyone tried cassaforte? As soon as I put [clojurewerkz/cassaforte "1.3.0-beta5"] in project.clj, I can't even start a repl anymore, getting ExceptionInInitializerError, caused by "ClassNotFoundException: org.apache.cassandra.db.marshal.UTF8Type"
10:42justin_smiththe first thing I would try is adding the dep for the project providing that class directly
10:43rurumatejustin_smith: good idea
10:43justin_smithlikely a version of the dependency that is too old / new to provide that class is being used, or the packagers did not specify their dependencies properly
10:43justin_smithhttp://mvnrepository.com/artifact/org.apache.cassandra
10:44justin_smithyou can use the pom info to specify the dep
10:45justin_smithmaybe try [org.apache.cassandra/cassandra-all "2.0.3"]
10:46rurumatejustin_smith: I downgraded cassandra-driver-core to 1.0.4, repl works now. Any cassaforte devs here, or should I file a bug report?
11:19rurumateOK I've decided to made this an issue. https://github.com/clojurewerkz/cassaforte/issues/26
11:38sritchiehey guys - once I have an enlive sequence,
11:38sritchiewhat's the proper way to convert it to a single string?
11:38sritchiejust concatenate?
11:44raeksritchie: depends on what you want to do with it. to print it? yes, just use (apply str the-sequence).
11:44sritchiesend it over the mandrill API as the html body of an email
11:44sritchieover to*
11:45raeksritchie: if you want it to be sent in an HTTP response using ring, then ring already handles sequences of string so you don't need to do anything in that case
11:45raeksritchie: what does the mandrill API expect? a string?
11:45sritchieI'm using http-kit's client interface, actually
11:45sritchieyeah, a string
11:45raekthen (apply str ...) it is :)
11:45sritchieboom, so easy :)
11:45sritchiethanks
12:13m09I'm trying to use clojure.core.logic.unifier and I'd like to unify variables created at some other point in my program. When I create logic/lvars the unifier doesn't work. I have to create variables of the form ?x. Is there a way set a variable "name" dynamically or to use lvars directly during the unification?
12:49malcolmsparkstry unifying the lvars to a single named ?x
12:50malcolmsparkshad that problem before too
12:57m09thanks for the suggestion. I was investigating symbols to create programatically variables with names respecting the ?x pattern but that might be simpler :)
12:57danielszmulewiczgf3: gist for pushState and secretary (as promised): https://gist.github.com/danielsz/8086074
13:57yedifor ppl who like rap... check out this thing i made: https://gist.github.com/yedi/8080527
14:11seangroveyedi: It's pretty cool
14:19yediseangrove: thanks! https://github.com/yedi/rhyme-finder
14:19yedimy first real clojure project, its been fun
14:20yediits weird but refreshing to code by thinking about your input and output data first b4 thinking about the logic
14:36gsdhgcvertgrjhWARNING WARNING WARNING, WARNING
14:36gsdhgcvertgrjhWARNING WARNING WARNING, WARNING WARNING
14:36gsdhgcvertgrjh YOU MAY BE WATCHED
14:36gsdhgcvertgrjhYOU MAY BE WATCHED
14:36gsdhgcvertgrjh YOU MAY BE WATCHED
14:36gsdhgcvertgrjhDo usa&israel use chat&social communication prog(facebook&twitter) to collect informations,,,,can we call that spying!!!!
14:37bitemyappit's IRC.
14:37bitemyappEverything is public here.
14:37bitemyappI don't know how that escapes people.
14:38bitemyappFuckin' loon.
15:04winkbitemyapp: pssssst, just connect via SSL and all is secure!
15:05bitemyappwink: right.
15:09justin_smithwink: to interfere with that, one would need to subvert the network infrastructure itself, and only the US government or something could do that
15:09justin_smithso that should be fine
15:10winkcongratulations on outtrolling me, I rest my case
15:14dotemacshi, i've got a little problem working out why the call to this macro works fine when calling it with an instance and a string fine, but when called in a doseq it bombs out: https://www.refheap.com/22124 If you could give a pointer, I'd be grateful, thanks :)
15:15justin_smithwink: oh I don't go in for that trolling stuff, I was going for old fashioned transperent iron there
15:15justin_smith*irony
15:16winkand I already wanted to say "it's transparent aluminium you thought about"
15:16justin_smithdotemacs: minor thing, do in a doseq is redundant
15:17justin_smithdotemacs: the issue is that the macro is not expanded at runtime inside the loop, it is expanded at compile time in the function body
15:18justin_smithdotemacs: also memfn is deprecated, . syntax is preferable
15:20dotemacsjustin_smith: thanks for the pointers, regarding the 'do' fine, no problems. Regarding 'memfn' fine also. But what should I do to make it work? As in, should I create a function instead of a macro or ... what's your advice ?
15:21mikerodis there a way to get leiningen to stop "Compiling ClojureScript." every time anything is ran; like `lein install` or `lein test`
15:22dobry-dendotemacs: i think you use a function in that case
15:23dobry-deni dont know the right way but you can `eval` your string fn
15:24dotemacsdobry-den: i was hoping there might be another way... thanks
15:26dobry-dendotemacs: there probably is. im probably at your exp-level with macros, i run into that kind of issue, and my solution so far is to turn it into a func with eval
15:26justin_smithI think there is a way to do it with clojure.reflect
15:27justin_smithbecause zooming out, what you really want is to be able to find a method on an object using a dynamically constructed name
15:27justin_smiththat is reflection
15:28dotemacsjustin_smith ok, i think i started to look at that, but didn't find any examples so when with the solution i presented. I'll look into it again, thanks for the constructive tip :)
15:28dotemacs s/when/went/
15:45whilojustin_smith: or just a dumb ssl protocol (which weakens encryption): https://twitter.com/ioerror/status/398103261061738496
15:45dsrxwhat the hell (yes, this is somehow relevant) http://www.reddit.com/r/AdviceAnimals/comments/qqcjg/rich_hickey_y_u_no/
15:46justin_smithlol
15:53whiloi have managed to use https://github.com/openlayers/ol3 with lein-cljsbuild (defining the :libs location), but when i try to edit config.edn in pedestal by adding :compiler-options {:libs ["libs"]} to different aspects, i can get the data-ui handler running by hand-copying "libs" in the out folder.
15:54whilois anybody familiar with the pedestal build process?
15:57yediI keep getting "Unknown build identifier" when tryna compile with lein cljsbuild auto
16:09coventryIs there a better way to figure out the maximum java stack size than binary search? It's falling over with -Xss256m, which surprises me because I'm running it on a 10G vm.
16:09coventry(vm with 10G of ram, that is.)
16:11justin_smith the stack is per-thread
16:11justin_smithso I think you allocate 256xN where N is your thread count?
16:12coventryAh. Thanks justin_smith
16:12justin_smithmaybe you could also limit thread count
16:12justin_smithnow that I think about it, that means that threads become more expensive the larger the stack you need
16:21coventryYeah, that's interesting. I've run into a SO running lein cljsbuild, so I don't need many threads in this case, though.
16:30egosumhmm…I can't find a nice way to do async postgres queries/updates. Would be cool to build a library around posting updates to core.async channels, and receiving responses on other channels
16:31cjfriszdotemacs: I know your question was already answered, but it inspired me to write up a gist that explains why the original macro didn't work as intended: https://gist.github.com/cjfrisz/8088647
16:31dotemacscjfrisz: cool, checking it out now, thanks
16:33justin_smithcjfrisz: nice explanation
16:33cjfriszjustin_smith: thanks!
16:39tbaldridgehttp://www.infoq.com/presentations/functional-pros-cons awesome talk
16:41coventryYeah, I enjoyed that.
16:43cjfrisztbaldridge: That's already on the list of presentations to watch...which is probably 10+ hours at this point
16:44cjfriszReally need to set aside some time to whittle down that list
16:50deadghostok just making sure I'm doing things right
16:50deadghostI have a local dependency
16:50deadghostit's a lein project
16:50deadghosthttps://github.com/kumarshantanu/lein-localrepo
16:50deadghostdo I just use that
16:50justin_smith lein install is easier
16:54justin_smithlein localrepo is for things that are not lein projects and don't have pom files
16:54justin_smithlein install is the best thing if the local dep is already a lein project
16:55deadghostok that's way easier
16:55justin_smithyeah, very simple to use
17:12cYmenDoes anybody have sufficient lighttable knowledge to tell me how to fix this connection error: https://www.refheap.com/e943f011bb4195fde91aa5a00
17:15justin_smithwell, something is going on with cljs, clearly
17:15justin_smithcan lighttable handle cljs?
17:15cYmenI don't know I have never used it I'm just following this clojure web development book I just bought.
17:15deadghostthere's a book?
17:16s_kilkhi all, does anyone have any experience with using the quarzite scheduler from within a ring app?
17:19andyfdeadghost: He is probably referring to this one: http://pragprog.com/book/dswdcloj/web-development-with-clojure
17:19cYmenYeah, http://pragprog.com/book/dswdcloj/web-development-with-clojure
17:20cYmentiming
17:20andyfI've got a copy, and it is a decent start.
17:20cYmenWell, I was kind of excited to give lighttable a shot but I have no idea what to do with this error.
17:20andyfI don't mean that to be a criticism, just a comment that you won't come out of it being an expert Clojure web developer, but you'll be on your way.
17:21cYmenThe tricky part with books is buying the ones that are right for you without reading them first.
17:23edwRe: books, it seems almost counterproductive to buy books for nascent technologies e.g. Clojurescript.
17:26cYmenI only buy books because I like having some guideline to follow. I almost always learn stuff faster by just diving right in.
17:27edwcYmen: Following along with a book at your computer was very effective for me. Also, having a Scheme REPL open as I watched the H-P 6.001 lectures gave me a huge edge over the people in the audience.
17:29edwBack in my day, books (and magazines) were all you had. I learned a lot of assembly language from Nibble magazine.
17:30cYmenBack in your day..you're still here!
17:31edwPlus or minus.
17:34danielszmulewicznoprompt: Secretary and pushState gist (as promised): https://gist.github.com/danielsz/8086074
17:34cYmenIs there a good cider cheatsheet somewhere?
17:35nopromptdanielszmulewicz: good deal. don't forget syntax highlighting :-)
17:37edwcYmen: Aside frmo the repo README?
17:37danielszmulewicznoprompt: Ha! You got me. But I selected Clojure when I edited the file. Where did that go?
17:37edwI printed it out and taped it on the wall.
17:37m09I'm looking for a way to unify different lists of terms at the same time with clojure.logic, any hint on if it's possible or not? (at the same time = share the same variables)
17:38cYmenedw: ah there
17:39edwHalf the binding don't work for me.
17:40cYmenDisappointing. No source and no docs for (serve ...) in a lein compojure-app.
17:40nopromptdanielszmulewicz: you might have to go back in and add an extension.
17:41danielszmulewicznoprompt: Yes, that must be it.
17:51edwcYmen: What do you mean about `serve`'; it doesn't appear to exist in compojure at all?
17:52TEttingeranyone else getting 503 Service Unavailable on github ?
17:53dobry-denyeh
17:54edwThat's a downer.
17:54edw(Yeah, me too.)
17:56edwGithub's back.
17:57dobry-dencYmen: https://github.com/weavejester/ring-server/blob/master/src/ring/server/standalone.clj#L74
18:02dobry-dencYmen: didnt know about `compojure-app` til now but from what i looks like, its repl.clj namespace is deprecated by https://github.com/weavejester/lein-ring
18:04dobry-dennvm i think it's using https://github.com/weavejester/ring-server for easy env management
18:05dobry-denthat's useful. i have a compojure app almost ready for prod and i havent yet set up some prod-specific things
18:06dobry-denwas just gonna let my users read my stacktraces. hopefully theyd send git patches by mail
18:07cYmenAfter creating new projects with lein which I can run with lein ring server, how do I connect all this to emacs?
18:07cYmenCurrently I just edit and restart the server.
18:08cYmenOr maybe the better question is, how do y'all do your editing?
18:08dobry-dencYmen: `lein ring server` picks up changes on reload
18:09cYmen"on reload"?
18:09dobry-denf5 in browser
18:09dobry-denmy emacs is connected to a seperate nrepl process
18:09dobry-denfor code evaluation
18:10cYmenyou mean just for experimenting?
18:10dobry-denyeh, while im developing
18:11cYmenWell, that's pretty much what I'm using.
18:12dobry-deni guess using the repl.clj file you could launch the server in emacs repl
18:12dobry-denbut i dont see off the top of my head what that would afford me over just having lein ring server running in its own tab
18:16justin_smithcYmen: you can start nrepl from inside your handler
18:16justin_smiththat is how we do it in caribou
18:17justin_smiththen you can connect to that with any of the many nrepl clients (I use nrepl.el, I guess I will upgrade to cider eventually)
18:19cYmengrrr
18:19cYmennow I get an error starting cider
18:20cYmenhave there been any breaking updates recently?
18:20dobry-deni thought cider was the breaking update
18:20cYmenjava.lang.IllegalAccessError: pp does not exist
18:20cYmendobry-den: I've used cider since the beginning.
18:21lsdafjkl_If I see this as a dependency "[com.facebook/react "0.8.0"]", what does that mean
18:21lsdafjkl_where is that
18:21danielszmulewiczCider is OK to install now. This time, I survived the attempt.
18:24edwcYmen: This seems to happen when dependencies transitively depend on older Clojure versions (< 1.3?); I have perhaps successfully handled this by making sure my clojure dependency is the final dependeny in my project.clj file. This is merely my somewhat-informed conjecutring.
18:24justin_smithcYmen: I think pp is in the cl package
18:24justin_smithoh wait, that was a java problem
18:24justin_smithn/m
18:24edwjustin_smith: pp's in clojure.pprint.
18:24justin_smithyeah, my bad
18:25justin_smiththe emacs cl package has its own pp :)
18:25edwLet of cross polination between Clojureland and Emacsistan...
18:25edws/Let/lot/
18:26npI need to migrate from Clojure 1.2 to 1.5. I'm thinking of adopting the new libraries first (the ones which replace contrib), and the migrating over.
18:27npBut I'm not sure if the new libraries are compatible with 1.2.
18:27npFor example, can I replace contrib.json with clojure.json?
18:27cYmen"Symbol's function definition is void: ...." what?
18:28justin_smithcYmen: I have not had success with cider, I don't think it is stable
18:28justin_smiththat error message is emacs-ese for "nobody defined this function but somebody tried to call it"
18:28cYmenI know, the relevant part was that the function was cider-repl-set-ns
18:28cYmenand this worked before
18:29justin_smithheh
18:30lsdafjkl_Sorry guys, I got it
18:30lsdafjkl_it's all in clojars
18:30justin_smithlsdafjkl_: oh, I missed your question above
18:30justin_smiththat vector describes a library and version
18:31justin_smithit encodes the same info that is in an mvn pom.xml file
18:31justin_smithwhich is used by tools like lein and maven to find and resolve dependencies for you
18:32justin_smithif you declare the dep in your project.clj lein will find it, download it, and make sure your project sees the right version at runtime
18:34lsdafjkl_justin_smith: thanks! I was just being confused by 'com.facebook', like it was a different location... but it was just dnolan naming the repo idiomatically
18:34justin_smithright
18:34lsdafjkl_:D
18:34lsdafjkl_is there a way i can see how he made a javascript file a jar?
18:34lsdafjkl_not a ton of info here https://clojars.org/com.facebook/react/versions/0.8.0
18:34justin_smithwell, a jar file is just a zip
18:34justin_smithyou can unzip it and look inside
18:35justin_smiththere is also a jar command, but I just use unzip, less to remember that way
18:35lsdafjkl_oh cool
18:35lsdafjkl_i'm a huge newbie when it comes to the java world
18:35justin_smithsome editors (like vi or emacs) can open a jar as if it were a directory so you can look at the files inside without unpacking it
18:36justin_smithwell not vi, I meant vim
18:36lsdafjkl_cool, using macvim i'll give that a shot
18:47radsdnolen: I noticed in the om todomvc app, there are a couple root state values (showing and editing) that get passed to the child components in different ways. for example, the "main" fn receives the app value from the parent and reads showing directly, but the editing value is extracted when om/build is called and passed as an option
18:48radssince the main fn gets updated when the root gets updated, is there any difference between these two ways of passing down the data?
18:48dnolenrads: yep this will get sorted out at soon
18:48dnolenrads: basically we want something similar to React prop / state distinction
18:48arrdembitemyapp: how is typeclass dispatch implemented?
18:48dnolenrads: that doesn't currently exist
18:49arrdembitemyapp: I had this "aha" moment that currying helps, but now I'm no sure
18:49radsdnolen: good to know, thanks
18:50lsdafjkl_dnolen: what command did you use to create the jar for react?
18:50dnolenlsdafjkl_: lein jar should work
18:52lsdafjkl_dnolen: Still leaving out the react folder with the deps
18:52dnolenlsdafjkl_: they need to be :source-paths
18:52dnolenneed to be on
18:53Caitlin_AzJust wondering if there was a general timeline (release schedule) for clojure? If so, version 1.6.0 (stable) might be released by...?
18:57arrdemCaitlin_Az: yep. wheneer the core team thinks it's ready.
18:57Caitlin_AzSo no release schedule posted then?
18:58Caitlin_AzOh, sorry.
18:58Caitlin_AzThanks arrdem.
19:03edwLots of nice little stuff in 1.6, it seems; am I missing anything life-changingly awesome?
19:06arrdemedw: as->
19:07hyPiRionarrdem: that's in 1.5 though
19:07arrdemhyPiRion: ah. I should read the 1.6 changelog then :P
19:08newbluedoes anybody have experience enabling mouse dragging in a Seesaw listbox? I need to make a list of items re-orderable and rolling my own listbox from Swing's JList doesn't looks a bit harder than this needs to be
19:08newblues/doesn't/just/
19:13Mandarnewblue, never used it but have you looked at this: http://daveray.github.io/seesaw/seesaw.dnd-api.html ?
19:17TEttinger(inc Mandar)
19:17lazybot⇒ 1
19:17TEttingerseesaw is wonderful
19:17newblueMandar: I was looking at that but it looks like it's more for moving files around? Taking a second look at it it might(?) do what I need...it looks a little more hopeful than http://daveray.github.io/seesaw/seesaw.behave-api.html#seesaw.behave/when-mouse-dragged
19:19andyfCaitlin_Az: See http://dev.clojure.org/display/design/Release.Next+Planning although obviously they didn't release Clojure 1.6 by Dec 6 2013. Note that core.async, even though it works with Clojure 1.5, was developed mostly after 1.5 was released and in some ways is considered part of the Clojure 1.6 release.
19:19TEttingernewblue, yeah, dnd is meant for drag and dropping stuff not within your application to your app, I think -- like an image from photoshop, dragged into your image editor in swing
19:20newblueTEttinger: seesaw's been great, DaveRay also has a little project called Dorothy that's a bit of fun to play with
19:20newbluehttps://github.com/daveray/dorothy
19:20justin_smithTEttinger: it is more general than that though, it is totally valid to dnd within one app
19:20TEttingerjustin_smith, I didn't see a widget flavor, so I was somewhat confused
19:21justin_smithlocal-object-flavor
19:21justin_smitharbitrary java object, within one app
19:21TEttingerah ok
19:21justin_smithso it could be a widget, or it could be an atom, or a keyword
19:21TEttingerneat
19:21justin_smithwhatever makes sense for your workflow
19:22jtoyhow is it possible for this to cause an exception sometimes: (:value arm 0) , arm is always a map
19:23jtoyI got this: Exception in thread "main" java.lang.NullPointerException
19:23justin_smithare you sure it is in that expression?
19:24newbluejustin_smith: so, local-object-flavor should work to drag and drop a listbox item from the 3rd to the 5th position (assuming I get the syntax figured out)?
19:24jtoyjustin_smith: that is the line it failed on
19:24justin_smithnewblue: yeah, but you may not need to even set the listbox item itself as the object - you can set what the source for the drag is in the draggable thing
19:25justin_smithso it may make sense to make it a map with the data for the listbox item
19:26justin_smiththe general idea is you take the thing that should be draggable, you specify what type of data it carries, and the contents, then the target must declare how it handles that type of data
19:32newbluejustin_smith: do you know of any examples of something at least similar? it's a little unclear how or if to use default-transfer-handler to do this and I'm not finding the usual links to seesaw/test/examples to see these things in action
19:34justin_smithdefault-transfer-handler is just for debugging
19:36justin_smithhttps://github.com/daveray/seesaw/blob/681b2e2117e920028e865a75dbe7ed4effbca693/src/seesaw/event.clj#L204
19:36justin_smithnewblue: that is an example that comes with seesaw, linked to the line with the relevant functions
19:36justin_smith*definitions
19:37justin_smithoh sorry
19:37justin_smiththat is where he defines the handlers, there should be examples of using them somewhere...
19:39justin_smithhttps://github.com/daveray/seesaw/blob/681b2e2117e920028e865a75dbe7ed4effbca693/test/seesaw/test/examples/game_of_life.clj#L97 this one is actually an example
19:43newbluejustin_smith: thank you, this definitely gives me something to chew on. This add-behaviors pattern is really interesting, it's never crossed my mind
20:53ethanishiya folks, I just wrote a ray tracer as an example of a simple project using core.typed
20:54ethanisbut I am struggling with a few final type errors!
20:54ethanisAnd I'm looking for guidance
21:05edw,(let [λ 14.7] (/ 1 λ))
21:05clojurebot0.06802721088435375
21:07TEttingeredw: ##(#(% '☃) #(= % '☃))
21:07lazybot⇒ true
21:07ncthom91hi guys. Is this the right place for clojurescript talk as well?
21:08TEttingerthere is #clojurescript , but that one has mostly people also in here
21:08TEttingerask away
21:11justin_smith,(take 20 (let [☃ '(❅ ❆)] (cycle (concat '(☃) ☃))))
21:11clojurebot(? ? ? ? ? ...)
21:12justin_smith&(take 20 (let [☃ '(❅ ❆)] (cycle (concat '(☃) ☃))))
21:12lazybot⇒ (☃ ❅ ❆ ☃ ❅ ❆ ☃ ❅ ❆ ☃ ❅ ❆ ☃ ❅ ❆ ☃ ❅ ❆ ☃ ❅)
21:12cjfriszethanis: there's a #typed-clojure room here on freenode, and those folks should be able to help you if nobody here can
21:13cjfriszethanis: but go ahead and just ask your question or give a link to pastebin/refheap/gist that demonstrates your problem
21:14edwNo need for ceremony, after all this isn't #java.
21:14ethanisalright! sorry for the delay
21:15justin_smithedw: now I imagine someone on #haskell saying "sorry we can't answer that, your question isn't well typed"
21:15ethanisthe project: https://github.com/sherbondy/rt/blob/master/src/rt/core.clj
21:15ethanisand the gist with the remaining type errors: https://gist.github.com/sherbondy/8090910
21:18edwjustin_smith: Reminds me of a Shit HN people say quote from Twitter.
21:19edwWorld's biggest eye-roll: https://twitter.com/shit_hn_says/status/263945818275467264
21:21justin_smith"I personally have been a PHP developer since 2001, I haven't maintained any bad code"
21:22justin_smith'tis brilliant, the essence of comedy
21:23edwjustin_smith: Not sure what's the poster is saying: "All my bad code is left unmaintained?" Lot of face-palm material tweeted on that account.
21:24edws/\?"/"?/
21:26justin_smith"Ironically, I most likely wouldn't hire Kernighan or Ritchie because of their poor programming style."
21:33xeqicemerick: is there any known nrepl bugs around using *err*?
21:34cemerickxeqi: that's some pretty wide-open criteria ;-)
21:35xeqiheh, I've got something weird where I'm (pr-str %) the message as part of a transport function, and things written to *err* seem to be printing without quotes
21:35logic_progI have [org.clojure/core.rrb-vector "0.0.10-SNAPSHOT"] in project.clj. However, when I do (in cljs/main.cljs): ":require [cljs.core.rrb-vector]", lein cljsbuild auto compiles -- however, when I load the page, goog.require complains "cannot find cljs.core.rrb-vector" <-- how do I fix this?
21:35xeqiso fail to be read-string on the other side
21:35xeqistill tracking it down
21:35cemerickmrph
21:35cemerickxeqi: which frontend?
21:35xeqiumm, I'm writing a cljs frontend
21:35cemerickheh
21:35cemerickwell
21:35xeqiand a nrepl server using sse
21:36xeqiwhich is why I'm deep in there :/
21:36cemerickxeqi: hiredman wrote something along those lines?
21:36cemerickthat was probably synchronous xhr stuff tho
21:36xeqisimilar, this seems to be more related to the server side though. I'll keep tracing since it doesn't ring any bells
21:36xeqiyeah, I used that for my first prototype
21:36cemerickyeah, nothing here
21:37cemerickxeqi: why isn't pr-values sufficient?
21:37xeqipr-values?
21:38xeqiah
21:38cemerickxeqi: chunk of std middleware to get values across the wire in a readable way
21:39cemerick(q @s (plan {:select [?a] :where [[_ ?a]]}))
21:39cemerickbah
21:40xeqiheh, that only handles the eval results right? I'd like to get the whole nrepl-message back. eventually want to use other ops
21:40cemerickoh
21:40cemerickhrm
21:41cemerickYeah, that's only touching :value
21:41cemerickor whatever it's call
21:44chrislso ive spent a bunch of time on 4clojure.com and i think i get things. I am however having a real rough time transitioning to actually creating a project with lein and using other libraries (mostly the later). Is there any good places that describe the package system/namespaces etc?
21:47justin_smithchrisl: http://blog.8thlight.com/colin-jones/2010/11/26/a-leiningen-tutorial.html this looks decent
21:49logic_progARGH :-)
21:49logic_proghow am I supposed to use https://github.com/clojure/core.rrb-vector/blob/master/project.clj from cljs ?
21:50cjfriszethanis: I gave those a look...if nobody else bites, they sound like questions for ambrosebs (although he doesn't seem to be around)
21:51ethanisha, yeah, they're a little tricky!
21:51cjfriszethanis: and for some reason I thought it was clojurescript instead of normal clojure, so that makes me scratch my head a bit
21:51cjfriszer, a bit more
21:51ethanisyeah, it is normal clojure for now, although I will certainly be porting to cljs with the help of cljx
21:52cjfriszI know when I experimented with core.typed in cljs, there were a number of things Ambrose hadn't done yet, but I that stuff should probably all work in clojure
21:52cjfrisz*I think that stuff
21:52ethanisyeah, everything has been working splendidly with the exception of these last few cryptic errors
21:53ethanisI think the issue might step from core typed having trouble inferring whether a sequence is empty or not, as all of the errors have something to do with my weird compound TimeIntersect/Seq type alias
21:53cjfriszthe only thing I can think of is that the filter and map may want a little more type annotation on the variables you're using, but I don't play with core.typed seriously enough to know how much annotation is enough
21:53ethanisah, okay, will look into that as a possibility
21:54cjfrisztake my advice with a grain of salt, though; I'm probably am not qualified to help you with these type errors :-)
21:54ethaniswill play with this a bit more and then ping ambrose if it doesn't work out. That's a nice guess though.
22:14edwTEttinger: I've only now gotten to teasing out the source of your Unicode brain teaser. Well played!
22:23ddellacostatechnomancy: see this latest post? http://blog.fsck.com/2013/12/model-00.html
22:23ddellacostawant
22:25ncthom91hey all, anyone here playing around with clojurescript? curious about why so much google closure boilerplate is included if my build target is node
22:27bitemyapparrdem: doters?
22:27bitemyapparrdem: or DayZ?
22:28bitemyappddellacosta: happy holidays!
22:28technomancyjustin_smith: oh man are those c64 keycaps?
22:28bitemyappddellacosta: going to see any family or do anything?
22:28ddellacostabitemyapp: happy holidays to you too sir! Thanks!
22:28technomancyoops I mean ddellacosta
22:28cjfriszddellacosta: don't make me freak out and want things like that
22:28technomancyyou guys have the same color nicks
22:28ddellacostabitemyapp: naw, just hanging out w/wife, but her mom is coming over for New Years
22:28ddellacostatechnomancy: haha, no worries...
22:28bitemyappcool :)
22:29ddellacostacjfrisz: yah, pretty sweet huh?
22:29ddellacostabitemyapp: yourself?
22:29bitemyappddellacosta: staying at home and working on Haskell side projects and the like, but I have good news!
22:29bitemyappddellacosta: I have the go ahead from my company to go remote!
22:29technomancyplust justin_smith is talking in #emacs which is right next to this window, heh
22:29bitemyappI'm making plans to visit Austin and Seattle for a few weeks apiece sometime in late winter or early spring.
22:29ddellacostatechnomancy: to answer your question, no idea, but they look like they could be...I couldn't find out where he sourced the caps from this article but I assume he mentions it somewhere: http://blog.fsck.com/2013/12/better-and-better-keyboards.html
22:30ddellacostabitemyapp: oh, sweet...I envy you. Wife and are talking bout where to move in the U.S., and those two cities come up...
22:31bitemyappddellacosta: yeah it's basically a trade-off of Seattle's weather, trees, ocean etc. to Austin's probably friendlier culture and cheaper housing.
22:31justin_smithhttps://www.google.com/search?q=tandy+102&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ei=Ka63Usx8zfigBNqtgZAM&amp;ved=0CAkQ_AUoAQ&amp;biw=1276&amp;bih=899 I have a tandy102 that I have thought about connecting to a serial / USB convertor just to use it as a keyboard - should be possible
22:31ddellacostabitemyapp: right, gotcha...can see great things about both cities
22:31bitemyappddellacosta: houses are $350-600k in Seattle vs. 120-170k in Austin.
22:31justin_smithruns on batteries, solid clicky keys
22:31ddellacostaoh wow. But still, sane compare to San Fran
22:32ddellacostajustin_smith: omg do it
22:32bitemyappddellacosta: right. What surprised me was that North Carolina was roughly as expensive as Seattle, I thought it would be closer to Austin.
22:32drewgleddellacosta: and 500k-zillions in DC :)
22:32ddellacostahuh...well, not *too* surprised at that, it's been a major computer industry and academic hub for a while I guess. I like that area too
22:32ddellacostadrewgle: ugh. :-(
22:32justin_smithddellacosta: the thing is pretty sweet as is too, those things are rock solid and run on AA batteries, week of usage on a recharge
22:33ddellacostajustin_smith: never touched one...definitely getting retro-tech lust talking to you guys
22:33bitemyappddellacosta: I mean even outside of the research triangle. You have to live in a place like greensboro to find cheap places.
22:33drewgleIf I use deftype in one namespace can I refer/use it from another namespace?
22:33ddellacostajustin_smith: loving this picture: http://homepages.paradise.net.nz/tmcgavin/jpg/weather_station.jpg
22:34ddellacostadrewgle: sure, why not?
22:34justin_smith32 k rom, 8 line (64 pixel) display 300 baud modem
22:34justin_smithnot 300k, just 300
22:34ddellacostabitemyapp: ah, gotcha
22:34ddellacostanice
22:34ddellacostathat'll get ya going
22:34ncthom91has anyone else used clojurescript lately and seen an error with setting the property Unicode on goog.string? goog.string = undefined :/
22:35drewgleddellacosta: I'm getting an error: CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: ParsingError
22:35drewgleWhere ParsingError is my deftype'd class
22:37ddellacostadrewgle: are you importing it?
22:37ddellacostadrewgle: http://stackoverflow.com/questions/3690784/how-do-you-use-a-type-outside-of-its-own-namespace-in-clojure/3691022#3691022
22:38drewgle(ns a.b.c (:gen-class) (:use x.y.z)) -- should import x.y.z.ParsingError into a.b.c, right?
22:38justin_smithdrewgle: you may need to import
22:38drewgleOK
22:38ddellacostadrewgle: yah, pretty sure you'll need to import--give it a shot.
22:39drewgle(ns lordvarnish.varlord.cmdline
22:39drewgle (:gen-class)
22:39drewgle (:require [clojure string])
22:39drewgle (:use clojure.set
22:39drewgle lordvarnish.cmdline)
22:39drewgle (:import [lordvarnish.cmdline ParsingError]))
22:39drewglehaha
22:39drewglewrong window :)
22:39dsapalaanyone know how to do something like '1,2,3'::int[] in sqlingvo?
22:40drewgleYep, that worked
22:40ddellacostadrewgle: excellent. :-)
22:41justin_smithdrewgle: yeah, that is because a deftype makes a class, and you need import to refer to classes
22:42drewgleYeah, that makes total sense
22:44dsapalaactually it's like this: SELECT * FROM "user" WHERE ("id" = any('{1,2,3}'::int[]))
23:12xeqiany ideas how (= text (pr-str text)) can happen when text is a string?
23:13dee5is there any special way for getting macros running in clojurescript, or is that not possible?
23:16justin_smithxeqi: given that pr-str always adds \" on each side of a string, there is now way that any string could come out of pr-str unchanged
23:18bitemyappimplementing tries and trees in Haskell is downright pleasurable.
23:28ivanxeqi: does (type text) say it's a java.lang.String?
23:28ivanif yes I have no idea
23:33l1xhey guys, i would like to log with clojure.tools.logging the function execution so i do this (info '(square 5) (square 5)) is there a better way doing this?
23:35xeqiivan: yep
23:36xeqiand apparently at this spot i can do (= "x" (pr-str "x")) and have it be true. so somethign weird is happening
23:37ivan(source pr-str)
23:37chrislI think i am missing something fundamental here. If I require something shouldnt i be able to access the things within its namespace? ie: http://pastebin.com/idVMm3Qn If I do the same with say, clojure.strings it works
23:38justin_smithchrisl: is it a private definition?
23:39chrislnot sure, actually
23:39justin_smithhttps://github.com/oubiwann/clj-rackspace/blob/master/src/rackspace/api.clj it is coming from rackspace.identity
23:39justin_smiththey are using it in that ns, and that is why you can use it when you switch to that ns
23:40justin_smithrackspace.api is just an empty ns that uses other stuff
23:40ivanI think rackspace.api was intended to be used but the author wrote it wrong?
23:41justin_smithI have no idea
23:41justin_smithit is weird
23:41chrislso should I be able to
23:41chrisl rackspace.api=> (require 'rackspace.identity) FileNotFoundException Could not locate rackspace/identity__init.class or rackspace/identity.clj on classpath: clojure.lang.RT.load (RT.java:443) ?
23:41justin_smithmaybe they thought :refer semantics were transative between namespaces
23:42justin_smithchrisl: weird, check out the version of rackspace.api in your jar
23:42justin_smithit could be a change in the ns between what you use and the version on github
23:43justin_smithchrisl: you can use lein classpath to see where the jar is / which jar, and then open the jar with your editor or unzip it to check the code
23:44chrislyeah looks a little different
23:44chrisllet me try it, thanks
23:46chrislyeah they renamed it from rackspace.auth. thanks so much! saw their lib was built in clojurejars oct 2013 so thought was uptodate
23:53xeqicemerick: apparently I'm in a spot were *print-dup* and *print-readably* are false
23:56TEttingeredw, you would love hyPiRion's swearjure
23:57TEttingerhttp://www.hypirion.com/musings/swearjure
23:57xeqicemerick: which might make since as I'm running in a (future ...)
23:57xeqiblah, dynamic bindings