#clojure logs

2012-03-27

00:01dnolenduncanm: I think CS is well on its way to being the most widely used transpile-to-JS lang.
00:02duncanmdnolen: yeah, and i dearly wish it could be this nice non-lisp language with a sensible repl that i'd like ;-P
00:03dnolenduncanm: you could probably hack swank-js to make it work right?
00:03duncanmdnolen: the version installable from ELPA i think is quite old compared to what's available on github
00:04duncanmdnolen: and the version from ELPA requires some bleeding-edge (non-ELPA) Swank/Slime
00:04duncanmdnolen: i could probably look into doing it, but hacking elisp so that i can hack coffeescript seems kinda, backwards
00:04dnolenduncanm: yeah. Lisp folks have a very specific perspective on development that only Smalltalk people seem to understand.
00:05duncanmdnolen: yeah, i was a squeaker before i hacked on scheme48/scsh
00:05duncanmdnolen: and after that, i used clojure
00:05dnolenduncanm: which why I'm glad Bret Victor's talk resonated - maybe it'll encourage people to you know, adopt 1970s ideas today.
00:07duncanmdnolen: i had one nagging thought while watching that video - it was probably more work to write the code to make those demos work (the changes to the dev env) than it is to write the code to cause those effects
00:07duncanmi dunno if i articulated that properly...
00:07duncanmdnolen: do you get what i mean?
00:07dnolenduncanm: I doubt that, the demos were pretty much hard coded prototypes as far as I know.
00:07duncanmright
00:08seancorfield_can i get some extra eyes on a pull request for clj-time? https://github.com/seancorfield/clj-time/pull/19
00:08duncanmdnolen: i just think, for most people, they're more interested in getting the work they need done, than to spend the time to hack the environment, so that they might get the work done quicker
00:08duncanmwith a spiffier environemnt
00:09seancorfield_it feels a bit... um... idk... not clojure-y with the alter-var-root stuff and all...
00:09duncanmseancorfield_: is clj-time a wrapper around joda-time?
00:09seancorfield_yes, duncanm
00:09dnolenduncanm: I disagree - I think most people are just oblivious to Lisp or Smalltalk
00:10duncanmdnolen: well, i agree that most people have no idea how lisp/smalltalk worked
00:10dnolenduncanm: which why I was also annoyed with Bret's talk - but I understand his goal was to speak to a wide audience - not nerd out on CS.
00:12seancorfield_Bret? Who are we talking about at which conference? *curious*
00:12duncanmseancorfield_: http://computinged.wordpress.com/2012/02/21/bret-victors-inventing-on-principle-and-the-trade-off-between-usability-and-learning/
00:12duncanmwith comments from Alan
00:13seancorfield_ah, inventing on principle... that rings a bell... thanx for the link...
00:14duncanmdnolen: this is kinda neat, https://github.com/Benvie/Node.js-Ultra-REPL
00:14mkthat was a good talk, with great demos
00:15amalloyseancorfield_: set-timezone! looks like a disaster to me - what if two different libraries in the same program want to use clj-time, and one of them works in utc while the other wants to work in some other timezone?
00:15yoklovyeah, that talk definitely blew me away, especially because i've struggled with that in game development
00:16yoklovthe delay between making a change and seeing it
00:16duncanmamalloy: i was wondering how *in* gets defined
00:17dnolenduncanm: neat!
00:17duncanmseancorfield_: you basically want it to be a fluid binding, in scheme terms - which i think is called binding in clojure
00:17duncanmthe difference between let and binding
00:17duncanmi'm kinda rusty with clojure
00:18duncanmdnolen: it reminds me of things like turbo pascal - people who were wholy out of the lisp/smalltalk culture, and built these IDEs that are completely different from the lisp world
00:18amalloyit wouldn't be as horrible to have *default-timezone* and let it be thread-bindable (though i still don't like it - what if lib a binds a timezone and later calls into lib b, not knowing that lib b uses clj-time)
00:19duncanmamalloy: you'd want it to work like *in*, right?
00:19duncanmdnolen: do you read alan's fonc list?
00:20duncanmdnolen: he mentioned something about semantic typing the other day, and i thought that was a neat idea
00:20amalloythat's what i just said wouldn't be as horrible, duncanm
00:20duncanmamalloy: right
00:20dnolenduncanm: my thoughts exactly.
00:20dnolenduncanm: I do follow fonc
00:20mkyoklov: yeah - his main point is spot on, about delay being harmful. I wonder, though, about how to generalize his ideas beyond the examples he gave
00:21duncanmdnolen: i guess the struggle is to give up on insisting that (f x) will definitely call some function 'f'
00:21dnolenmk: spend a week with Squeak, scales pretty darn well
00:22duncanmdnolen: message passing/dispatch meant that there's a dispatch thing between the caller and 'f', and then the logic/search/prolog stuff that you've been working on brings that distance even further
00:22mkthe talk was good on its own, but it also got me thinking about how the final interface the user sees, and the code the programmer sees - those are just interfaces into a single process
00:23duncanmmk: you mean user interface?
00:23yoklovdnolen: is that what writing code in squeak is like?
00:23mkduncanm: sure - any interaction the user has with the system, really
00:24duncanmyoklov: i used to code in squeak
00:24yoklovis that what it's like?
00:24duncanmyoklov: like that video?
00:24duncanmnot quite, but it's more immediate, yeah
00:24yoklovor even that level of interactivity?
00:24dnolenduncanm: oh yeah I read that AK email. Some deep stuff ...
00:25duncanmyou can pick up UI objects and drop into an inspector (like a REPL)
00:25yoklovwow
00:25duncanmyoklov: you can look at the lively kernel stuff
00:26duncanmit's basically an implementation of morphic (squeak's GUI system) in JS and SVG and all that
00:26duncanmsqueak runs faster than morphic, but the ideas are the same
00:26duncanmi mean
00:26duncanmsqueak runs faster than lively
00:26dnolenEclipse is the result of Visual Age Smalltalk
00:27duncanmdnolen: oh i know!
00:27dnolenInterface Builder is the result of ExperLisp
00:27duncanmthat's one of my favorite stories, the story of VisualAge for Java
00:27duncanmdnolen: oh, i knew that IB had some lisp roots
00:27duncanmdnolen: is there anything written down on the history of ExperLisp?
00:27duncanm(this is a new thing for me)
00:28duncanmyoklov: the unfortunate thing is that squeak is kinda hard to use for people used to using modern GUIs
00:28gf3dnolen: oh neat, is there a place I can read more about that?
00:28gf3dnolen: re: IB roots
00:28dnolenJean Marie Hullot & Steve Jobs & NeXT great read http://fds.oup.com/www.oup.com/pdf/13/9780192862075.pdf
00:28duncanmyoklov: so it's best that you find someone who knows their way around and have them show you
00:29duncanmin some sense, emacs is the same way, but a bit easier because it's still files and directories
00:29yoklovi see
00:29duncanmcool
00:29duncanmdnolen: nice find!
00:29dnolenHullot was at INRIA studied under Huet (zippers)
00:29duncanmoh coo
00:29duncanmdnolen: i always think of INRIA as this ML place, because they did OCAML there
00:29seancorfield_thanx for the feedback folks - reinforces my concerns - i was off reading that blog post (thanx for the link duncanm)
00:30duncanmbut i forget that there's also a scheme impl. done at INRIRA
00:30duncanmINRIA
00:30dnolenduncanm: it's easy to forget that ML was first programming in LISP :)
00:30dnolenprogrammed
00:30duncanmdnolen: wow, how did you find this Hullot story?
00:30duncanmdnolen: i've gone looking for this stuff in the past
00:31dnolenduncanm: I knew some fuzzy details and I got obsessed one night - went digging on the Internets
00:31duncanmdnolen: oh, now that we're trading stories - i wrote to the fonc list once about this
00:31duncanmdnolen: the story of swing is funny too
00:31duncanmjava swing
00:31duncanmdnolen: sun had access to *two* java implementations of NeXTStep AppKit (lighthouse and netscape's IFC)
00:32duncanmIFC even had a working IB
00:32duncanmdnolen: and they merged the team, tons of office politics, and the AWT team came ahead, and re-org'ed everyone
00:32duncanmand so they decided to throw that stuff away and start fresh, and they ended up with Swing ;-P
00:33duncanmimagine what java on the desktop would have been like if they went with a framework like IFC....
00:33technomancyseancorfield_: this makes me wonder if there isn't room for certain functionality that's specified as explicitly off-limits for libraries; allowed to be set by applications only
00:33duncanmit would be like Cocoa + GC in the late 90s
00:34technomancyseancorfield_: perhaps reading a system property at boot would be a way to enforce that
00:34technomancystuff that's not composable on purpose, somewhat parallel to the way people should be doing AOT
00:36dnolenduncanm: interesting, maybe we'd be further along :) though I doubt it - good ideas like IB eat their children. From what I can tell the essential idea remains unchanged since '84 or so.
00:38duncanmdnolen: i don't really know how IB works - the main thing that i got is that it persists the objects into NIB files, which is very different from what most GUI designers do, which is that they generate code
00:39dnolenduncanm: that's pretty much it and you can network message sends visually
00:39duncanmdnolen: hmm, i read the section on Hullot, too bad it doesn't say anything about lisp
00:39duncanmdnolen: the object persistance thing is just like smalltalk images ;-)
00:40dnolenduncanm: he published a couple of papers - sadly not available on the Internet far as I could tell.
00:40duncanmyoklov: ah, another thing that's a learning curve, in smalltalk, you don't save your code in files
00:40yoklovyeah i knew that
00:40yoklovalways sounded insane
00:41yoklovbut kind of cool
00:41duncanmyoklov: so you need to learn the discipline to not mess up the image, or if you do, learn how to fix it up
00:41dnolenyoklov: and then everything got virtualized anyway and it sounds pretty normal ;)
00:41duncanmusing the ChangeSorter and tools like that
00:42duncanmdnolen: did you ever play with genera?
00:42dnolenduncanm: I have not
00:42duncanmolin has it running on his laptop at some point, and i think he actually knows how to use it, but i never got him to show me
00:42dnolenduncanm: oh, was Olin Shivers your prof?
00:43duncanmdnolen: yeah, i was his summer intern for a while, we tried to write an emacs in scheme, but i failed
00:43dnolenduncanm: one day I'll try to understand his dissertation
00:43duncanmheh
00:43duncanmdnolen: if you're ever in Boston, i can make introductions
00:44duncanmsigh
00:44duncanmdnolen: alan is completely right about lisp/smalltalk eating their young
00:44duncanmi really need to stop reminising this history stuff, and get with the program! ;-P
00:45dnolenduncanm: speaking of Olin I came across this paper - http://www.cs.indiana.edu/~adamsmd/papers/fast_flow_sensitive_cfa/, seems neat
00:45dnolencfa fast enough for JITs
00:46duncanmdnolen: i didn't do any compiler work with him - i wrote a scheme implementation of termininfo in one summer, and i started on porting mit scheme's edwin to more modern scheme the next
00:46duncanmterminfo
00:46dnolenduncanm: I would be more depressed about the eating young part if the rest of the world had actually caught up.
00:48duncanmdnolen: yeah, that alan e-mail was good stuff (http://vpri.org/mailman/private/fonc/2012/003318.html)
00:50duncanmdnolen: i can't help but think that if there's a search algorithm between me and the function i want to call (maybe i've already lost the battle thinking in those terms), that the thing must be really fragile?
00:50duncanmwhat if it couldn't find it?
00:50dnolenduncanm: well Alan's is conservative about the idea. I'm assuming you've read up on Eurisko & CyC
00:51duncanmoh, no, not really, i saw the references, but that's it
00:51duncanmdnolen: also, i kinda wish i got alan to clearly write down why he thinks the architecture of the web is no good
00:51dnolenduncanm: http://www.newyorker.com/reporting/2009/05/11/090511fa_fact_gladwell about Eurisko, hilarious read
00:51duncanmthat conversation sorta drifted off
00:51duncanmnewyorker?
00:52dnolenduncanm: just skip down the Eurisko bit
00:53duncanmoh
00:53duncanmi read this article when it first came out, i remember this
00:55dnolenduncanm: I don't know where AK is going with those ideas, but it is interesting to ponder. Maybe someone will make a core.logic prototype :P
00:59duncanmdnolen: well, that posting is the first that made me feel like i understand his objections to things like ML
00:59duncanmdnolen: if what he's looking for is like what he said, then of course something like ML wouldn't fit the bill
01:00duncanmhmm
01:00dnolenduncanm: have you read any William Cook's stuff, a very good analysis of the kinds of issues you run into in ML
01:00dnolenduncanm: honestly I really take a closer look at Martin Ordersky's papers - I'm sure some of the same points arise.
01:01duncanmmaybe this is a stretch, but say, ST-80 is a way of not having ABI breakages anymore, because everything is late-bound
01:01duncanmi feel like he's trying to make a system where API-breakages are also impossible
01:02duncanmdnolen: you're talking about the Scala guy?
01:02dnolenduncanm: yeah
01:02marchtempduncanm: What's wrong with ML?
01:03duncanmmarchtemp: it's not that it's wrong, we're just talking about a discussion on the fonc list
01:03duncanmhttp://vpri.org/mailman/private/fonc/2012/003318.html
01:03dnolenmarchtemp: http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf
01:03duncanmdnolen: is that the ADT vs objects one? i re-read that over the weekend
01:04dnolenduncanm: yep
01:04duncanmdnolen: for a moment, i thought i got it - and i was trying to tell someone about it today, and i lost it again ;-P
01:04duncanmit's like, my 4th time reading this paper
01:06marchtempIt seems like a very old paper written by Backus decades ago.
01:07marchtempI meant it's similar to it.
01:08duncanmdnolen: that whole thing between wcook and that ML guy was really strange
01:08duncanmbob harper
01:08dnolenduncanm: well Bob Harper is a bit of SML zealot
01:08duncanmyeah
01:09duncanmdnolen: i liked the batches stuff that cook did, it'd be nice to see it in a production language
01:09dnolenduncanm: I haven't seen that.
01:09duncanmhe said that they might get it in java 8, or java 9
01:09duncanmdnolen: it's a simple idea - you come up with a bit of syntax that marks off a section to be executed remotely
01:10duncanmdnolen: and then make sure that results from remote execution doesn't get used on the right-hand side within the block
01:11duncanmthen you can use that to batch RPC calls
01:11duncanmhttp://research.microsoft.com/apps/video/dl.aspx?id=157246 -- it's a 30 min video
01:12duncanmBatches: Unified and Efficient Access to RPC, WS, and SQL Services
01:12dnolenduncanm: thx, will watch that later!
01:12duncanmboo, i didn't get that much coding done tonight
01:12duncanmdnolen: thanks for the link to the hullot story, i've been wanting to learn about that history for quite a while
01:13dnolenduncanm: heh, why code when you can nerd out on PL and history?!
01:13duncanmdnolen: you earned your right to nerd out, you implemented core.logic ;-)
01:13duncanmi need to implement something cool to get some brownie points too ;-P
01:17dnolenduncanm: I try not to take too much credit for core.logic - other people had already poured years of work into it - I spent like 6 months :P I was always surprised that Scheme folks weren't more interested in it.
01:17duncanmi really want to read reasoned schemer
01:17duncanmbut i have too many books
01:17duncanmi got this other AI book a while back, barely made a crack at it
01:18duncanmi did finish reading the Hunger Games this weekend
01:19duncanmdnolen: you might find this fun, http://www.amazon.com/gp/product/0262061570/ref=oh_o02_s01_i00_details
01:19duncanmdnolen: it's an AI book, with lisp code
01:19duncanmdnolen: i think it came up in a fonc thread
01:20duncanm"After working through Building Problem Solvers, readers should have a deep understanding of pattern directed inference systems, constraint languages, and truth maintenance systems."
01:20duncanmsounds like a good deal, right?
01:20dnolenduncanm: neat
02:35echo-areaHas anyone read Agent.java? Isn't it possible some send/send-off's will be dropped when executing an action?
02:37echo-areaW.r.t. the use of the thread local variable `nested'.
03:03wei_I'm trying to write a DSL for making about 15 different types of rpc calls (on top of clj-http). the rpcs differ by method(get/post), headers, etc. should I use a macros (say, defrpc or with-session) or can this be done with functions only?
03:11osa1where can I see list of clojure gsoc projects looking for students?
03:14osa1ok, found it
03:50muhoobaffling https://refheap.com/paste/1398
03:52Raynesmuhoo: Why?
03:52Raynesmuhoo: "baz" is not a keyword. It is a string.
03:52RaynesKeywords *are* functions of maps.
03:52RaynesStrings are not.
03:52RaynesThey don't magically gain that ability by being inside of a map.
03:53RaynesAlso, don't use clj-json. Use cheshire.
03:56muhooaha, thanks
03:57Raynesmuhoo: Cheshire (and surely clj-json) has an option for making the keys be keywords. You probably want that.
03:58muhoothat's what i thoguht it'd do by default, but i guess not
03:58muhooi'm using clj-json because it's built into noir
03:58RaynesNot in 1.3
03:58RaynesWe moved to Cheshire.
03:59muhoohmm, then my project is using an old noir then.
03:59muhoomust fix
03:59RaynesWell, it isn't released yet.
03:59RaynesIt's currently a beta release.
03:59muhoooh
03:59Rayneshttp://clojars.org/noir
03:59muhoomust wait
03:59RaynesHowever, I recommend using it.
03:59RaynesI use it in refheap and tryclojure and it is perfectly stable.
03:59RaynesThe difference is the official docs might not be completely up-to-date, but you can just ask ibdknox if something goes wrong.
04:12Lajla&(symbol? (symbol "I worship His Shadow"))
04:12lazybot⇒ true
04:13Lajla&(let [some-symbol (symbol "I worship His Shadow")] (print (list '+ some-symbol)))
04:13lazybot⇒ (+ I worship His Shadow)nil
04:13LajlaSeems legit
04:13LajlaIs that a bug by the way?
04:14LajlaSeems to me from the definitions on that page that symbol should barf on strings containing the characters of malformed symbols, and print should certainly not barf it out like that
04:15gf3??
04:15lazybotgf3: Definitely not.
04:16gf3Lajla: I don't see anything about characters of malformed symbols
04:17Lajlagf3, look at what it prints
04:17Lajla"(+ I worship His Shadow)" reading that with the reader
04:17LajlaWould most definitely not satisfy =
04:18Lajla&(read-string "(+ 1 2 3)")
04:18lazybot⇒ (+ 1 2 3)
04:18LajlaOkido, ehhh
04:18LajlaObserve the magic
04:20Lajla&print-string
04:20lazybotjava.lang.RuntimeException: Unable to resolve symbol: print-string in this context
04:20LajlaNahh, doesn't exist
04:22Lajla&print-str
04:22lazybot⇒ #<core$print_str clojure.core$print_str@1e35be2>
04:22Lajla&(print-str '(+ 1 2 3))
04:22lazybot⇒ "(+ 1 2 3)"
04:22LajlaOkido
04:22LajlaSo, where I was going at
04:23Lajla&(let [some-datum (list '+ (symbol "I worship His Shadow"))] (= some-datum (read-string (print-str some-datum))))
04:23lazybot⇒ false
04:23LajlaSee?
04:23Lajla&(let [some-datum (list '+ (symbol "iWorshipHisShadow")] (= some-datum (read-string (print-str some-datum))))
04:23lazybotjava.lang.RuntimeException: Unmatched delimiter: ]
04:23LajlaOhh
04:23Lajla&(let [some-datum (list '+ (symbol "iWorshipHisShadow"))] (= some-datum (read-string (print-str some-datum))))
04:23lazybot⇒ true
04:23LajlaLook, no spaces.
04:23LajlaSee
04:24Lajlagf3, pingeling
05:17echo-arearaek: ping
05:50raekecho-are`: pong
05:50echo-are`raek: Do you know the internal of Agent
05:51echo-are`raek: I think I find a fatal problem in Agent.java
05:51DerGuteMoritzhello everyone
05:51DerGuteMoritzI have a query!
05:52DerGuteMoritz,(seq? [])
05:52DerGuteMoritz&(seq? [])
05:52lazybot⇒ false
05:52DerGuteMoritz&(seq? '())
05:52lazybot⇒ true
05:52clojurebotfalse
05:52DerGuteMoritzclojurebot: knock knock, who's there?
05:52clojurebotPardon?
05:52DerGuteMoritzclojurebot: you mean "... very long pause ... Java"
05:52clojurebotexcusez-moi
05:52DerGuteMoritzthat's more like it!
05:53DerGuteMoritzanyway, what does the seq? predicate mean?
05:53DerGuteMoritz,(doc seq?)
05:53clojurebot"([x]); Return true if x implements ISeq"
05:53DerGuteMoritzdoes it want to tell me that vectors don't implement ISeq?
05:54DerGuteMoritzthis seems to be the case indeed
05:55DerGuteMoritzcan anyone shed light on why this is the case?
05:55DerGuteMoritzand what use seq? has?
05:59amalloyDerGuteMoritz: seq? checks for "listiness"
05:59amalloy&(map seq? [(range) '(1 2 3) [1 2 3]])
05:59lazybot⇒ (true true false)
06:00DerGuteMoritzso why don't vectors implement ISeq
06:00DerGuteMoritz?
06:00DerGuteMoritzhm
06:00DerGuteMoritzit's a bit surprising
06:00DerGuteMoritzbut if ISeq is the "listiness" interface, well ...
06:00DerGuteMoritzthen it makes sense, of course
06:00amalloybecause they're not seqs, they're seqable
06:00DerGuteMoritzaha!
06:01DerGuteMoritzwhat interface signifies seqability?
06:01DerGuteMoritzI know I can use seq to check
06:01DerGuteMoritzbut this does some implicit conversion, too
06:01amalloythat's not a question with a clean answer, unfortunately
06:01DerGuteMoritzok, so sticking to seq it is, then
06:02amalloythere's no single interface, because java-land things like strings and arrays have to be seqable but can't implement your interfaces
06:02DerGuteMoritzah, right
06:02DerGuteMoritzoh boy
06:02DerGuteMoritzwell, we could have a seqable? predicate
06:02amalloy$google dnolen seqable protocol
06:02lazybot[#clojure log - Dec 01 2009] http://clojure-log.n01se.net/date/2009-12-01.html
06:02amalloyhmph
06:03amalloyhttp://dosync.posterous.com/51626638
06:04DerGuteMoritzah, right, I even remember reading this post
06:05DerGuteMoritzperhaps this should be folded into clojure.core?
06:05DerGuteMoritzis there a ticket for that?
06:18raekecho-are`: I have looked through the code some time
06:19raekecho-are`: have you described the problem on the clojure-dev mailing list?
06:26tomojinteresting trick: since the clojure log search is google custom search, one can (among other things) sort and filter by date
06:28tomojI suppose I will have to scrape this and make pretty pictures
06:31tomojhttp://www.google.com/cse?cx=partner-pub-1237864095616304%3Ae7qm3gycp2b&amp;ie=UTF-8&amp;q=tomoj&amp;sort=date:a
06:48echo-are`raek: No, only clojure google group now
06:51fliebelhow would I convert 2 bytes to an integer? I got them from somewhere primitive, and they represent a word.
06:52clgvfliebel: shifting the higher one 8 times?
06:52clgvand then add them together^^
06:54fliebelclgv: hm.. lets try
06:55fliebel&(+ (byte 0) (bit-shift-left (byte 1) 8))
06:55lazybot⇒ 256
07:19echo-are`raek: It seems that `nested' is only seen as non-null value in the thread _that executes the action_, so there is no such problem I described.
07:20echo-are`Hmm, understanding such concurrent programs is a bit hard
07:49fliebelclgv: erm, java bytes are signed, right? :(
07:50clgvfliebel: their output via system.out.print is signed. but you know the mechanics of two-complement?
07:52fliebelclgv: two-complement? I kinda know how the bist should behave, I think...
07:52fliebelanyway, with your trick, I end up substracting up to 127 from my value.
07:53fliebel&(+ (byte -20) (bit-shift-left (byte 1) 8))
07:53lazybot⇒ 236
07:53clgvfliebel: well you can first cast it to int or long before shifting
07:53fliebel&(+ (int -20) (bit-shift-left (int 1) 8))
07:53lazybot⇒ 236
07:54clgvlooks about right
07:55fliebelclgv: well, depends on what you want. That -20 is actually a 148 or so.
07:56clgvfliebel: ah you have a signed byte value that hass actually an unsigned intepretatioN=
07:56fliebelclgv: Right. Maybe <<< would help?
07:58fliebel&(bit-and -20 0xFF)
07:58lazybot⇒ 236
08:00clgvfliebel: you could just add 128
08:01clgvuhm or I am confused now^^. have to make an example...
08:01fliebelclgv: I think you are.
08:02clgv0xFF = -1 as signed byte. ok adding would be wrong ^^
08:03clgvbit-and looks fine
08:06fliebelclgv: yay, works! I now have BASIC and JVM running on top of ARM and PIC chips talking to each other over I2C.
08:08clgvfliebel: a what? I guess you'll be blogging about it? ;)
08:09fliebelclgv: I'll at least post a video of it driving around.
08:09fliebelclgv: Not to much Clojure is involved though.
08:39_philwhat web server supports ajax out of the box?
08:40bradwrightAjax is just HTTP, so all of them?
08:40clgv_phil: everyone, since its only javascript html xml?
08:41clgvor json ;)
08:42vojd_phil: AJAX is basically just an HTTP-call made through an object called XML Http Request
08:43_philyes ofc :) the only thing i need the server to support is a custom timeout per http connection... is this easily done with noir, ring etc?
08:45vojd_phil: indeed so, jetty would probably be the actual webserver while noir is the framework :)
08:46_philah, sounds logical :) last question, what is the preferred web server framework right now? should be as lightweight as possible for my needs
08:47vojd_phil: think of it as: noir holds your code and ring passes data between your code and the webserver which is jetty
08:48vojd_phil: i would say Noir but then again i haven't examined the other clojure frameworks out there
08:48_philvojd: thanks a lot :)
08:49vojd_phil: you're welcome! :)
08:51antares__phil: http://webnoir.org/ is probably your best starting point. Compojure and a few others are also good (especially for API services) but lower level.
08:52_philantares_: im checking aleph right now, the event driven architecture seems cool
08:53antares__phil: aleph is not really a web framework
08:53_philantares_: but it does have http serving functionality?
08:54antares__phil: last time I tried it it was very rough around the edges (the HTTP server and client part). But it was a long time ago, maybe a bit over a year.
08:54gfredericksit's definitely been worked on since
08:54antares__phil: event-driven is oversold by node.js kids. I suggest that you start with "boring" Noir and Jetty and only go event-driven if you really need to.
08:55gfredericksI used aleph to do some proxy stuff
08:55antares_gfredericks: the networking part is solid, no doubt about it
08:55antares_I only was referring to the http bits
08:55gfredericksI did use the http bits
08:55_philantares_: what are the disadvantages of being event driven? i havent done much backend work so id like to know more :)
08:56_philharder to organize sequential logic?
08:57antares__phil: harder to manage state. In Clojure and Erlang it is a lot saner than in other languages but still fairly hard for any non-trivial logic
08:58antares__phil: plus, there are so many different approaches to concurrency on the JVM (including all kinds of async approaches) that you don't have to use tools like aleph to get most of the benefits
08:58antares_the most ridiculous part about event loops is that if something blockes them, you are completely screwed
08:58antares_*blocks
08:58fdaoud_phil: ring is the lowest-level framework; compojure builds on top of ring; and noir builds on top of compojure. if you're in for the long run, I think it's worth having at least a basic understanding of what each part does.
08:58antares_but aleph and clojure suffer from this a lot less, fortunately
09:00_philfdaoud: ill definately do more research before i chose a framework... but what im after is definitely something as low-level as possible
09:01_philantares_: so if a request handler writes to a database and the database takes forever all other requests are gonna have to wait for it?
09:02antares__phil: why? if requests are submitted to a thread pool, they will be executed concurrently
09:02fdaoud_phil: ring is the lowest-level, gives you control over everything. compojure is nice to add on for convenience, and you still have access to ring.
09:03antares__phil: typically app servers like Jetty take care of a lot of things like that for you, unless you are after Web Scale, you often won't have to think about it for a long time
09:03_philantares_: so what did you then mean by if something blocks the event loop youre screwed?
09:03fdaoudand then noir gives you even more convenience.
09:04antares__phil: event loop is basically a while(true) { poll for events; run callbacks if any } kind of thing
09:04_philfdaoud: yeah i like to have control and a good understanding of everything before "going up a step"
09:04_philantares_: so when a callback takes forever to write to a database all other callbacks are gonna have to wait, right?
09:04antares__phil: if your thread that does it is blocked by one of the callbacks and your runtime does not let you start new threads, you are completely screwed. if your network protocol has hearbeats, for example, they won't be delivered
09:05antares__phil: yes. But I was mostly referring to tools like twisted, eventmachine or node.bs
09:05antares_aleph has plenty of tools to work around it on the JVM and I am sure they use some of them
09:06antares_but in general, event-driven frameworks require so much ceremony that often I just don't see the point in using them
09:06antares_proxies are an exception
09:06antares_some systems are inherently event-driven, though
09:07fdaoudantares_: node.bs? :D
09:08antares_fdaoud: well it is bs, isn't it
09:08_philantares_: well im doing a little project on the side mainly in order to learn about the more tricky parts of writing a backend, and scalability is definitely one of them so maybe thats a plus in my case...
09:08fdaoudantares_: that's funny.. reminds me of when the .NOT platform came out..
09:08antares__phil: if your goal is to learn, then just start with anything that seems fun
09:09antares_fdaoud: .NOT has wide applicability and lots of languages, tools and so on. .bs has one approach to everything and applicability as wide as Web Scale websites
09:09clgvYo dawg, we herd you liek web scripting, so we put some JS into your PHP so you can script while you script! ;) :D
09:41edw09:07 *** solussd JOIN
09:41edwD'oh.
10:08ChironHi, would you please have a look at this question? http://stackoverflow.com/questions/9891155/how-to-share-a-dependency-that-isnt-in-clojars
10:10gtrakChiron, you can 'lein install' it
10:11rhcChiron: or you can add it to the project in the 'checkouts' directory
10:11rhcif you want to avoid 'lein install'ing it
10:13Chironthe team don't have a central repository, so I guess lein install won't help
10:13cemerickChiron: answer posted.
10:16ChironI see, thanks
10:17cemerickChiron: FWIW, the project looks pretty well fleshed out given its documentation, etc. You might be able to needle the maintainer to produce a proper release.
10:26Chironwhen I run lein repl inside a project, what this is going to offer to me?
10:26gtrakflowers
10:27m0smithmorning
10:29m0smithI am writing a noir app and want to do user authentication and authorization, any suggestions?
10:29gtrakChiron, just messing with you, but, what's the question? lein repl runs a repl, but it'll use your project.clj to configure the classpath, ie you'll have all your dependencies
10:30ChironOk, I see. sorry but I'm pretty new to Clojure / Lein world
10:31Chironm0smith: have you check apache shiro?
10:31m0smithchiron: nope, not yet
10:32cemerickm0smith: I'm in the process of fleshing out a Clojure library for exactly that
10:32m0smithcemerick: what are you basing it upon?
10:32fdaoudoh yeah
10:32fdaoudI remember cemerick you mentioned that yesterday
10:32m0smithno Google IO this year for me apparently
10:33Chironspeaking of Noir, doesn't it support templating system (like freemarker, thymeleaf)?
10:33cemerickm0smith: nothing; neither shiro or spring-security are suitable if you're building a mostly-Clojure webapp IMO.
10:33fdaoudChiron: yes, via hiccup
10:33Chironbut with hiccup I'm going to build the page by hand coding, right?
10:33cemerickChiron: right, hiccup is the default, but you can use anything you like
10:34Chiron(html: div: span:) for example
10:34m0smithchiron: I am using stencil for the markup
10:34fdaoudChiron: what do you mean? freemarker doesn't build templates for you, you still have to write them..
10:35ChironI was unclear, I saw a couple of hiccup examples. to build pages, they use hard-coded clojure forms
10:35m0smithcemerick: I am interested in what you are going to be doing then, security wise. that is a long row to hoe.
10:35cemerickm0smith: yes and no
10:36fdaoudChiron: you can do dynamic stuff of course!
10:36Chironyou mean with Noir, I can forward the request to a template page?
10:37fdaoudChiron, like [:ul (for [item items] [:li (item :name)])]
10:37Chironyes for example
10:38fdaoudChiron: well, your templates are in Clojure code, so you define functions to produce them, and call them from the place where you handle the request
10:38cemerickm0smith: with not too much trouble, I have a basis for a Clojure analogue to everyauth / warden. People that build the workflows for each authentication method (e.g. oauth, facebook, dropbox, etc etc) have the harder job.
10:39ChironThanks a lot, forgive my ignorance :)
10:39cemerickthe base library has simple form-based authentication, HTTP Basic, and role-based authentication middleware, macros, etc.
10:39m0smithcemerick: I gotta run but can you send me an email.
10:40fdaoudChiron: no problem, I understand it can be a bit to wrap your head around
10:40m0smithwhere I can see it, when you are ready
10:40cemerickm0smith: better to just follow http://twitter.com/cemerick
10:41m0smithwill do thinks
10:45edwI was pointed to an generic templating library recently, and I can't remember the damn name. It's an extremely simple, elegant library. But I forget the name.
10:47fdaoudedw: clojure or something else? was it stencil?
10:47gtrakedw, stringtemplate?
10:47gtrakthere are some things I don't like about it, but it's quite fast
10:48gtrakactually, I may use it to solve my current problem now that you've reminded me of it :-)
10:48babilenedw: What kind of "templates" are you talking about? enlive (html templating) comes to mind as well ...
10:48edwIt had a nice short name. Maybe four chars.
10:49cemerickedw: https://github.com/weavejester/comb ?
10:49edwYes!
10:49edwThank you!
10:49fdaoud*ding ding ding ding ding*
10:49edwI went through his list of projects but missed it.
10:51fdaoudno offense but that can get ugly fast.. and we're back to JSP 1.0 :P
10:52babilenedw: What do you plan to use it for?
11:01pandeiroanyone know what causes the SLF4J StaticLoggerBinder error when starting a Noir server? I had this problem before but forget what I did to fix it... lein clean didn't do it
11:04fdaoudpandeiro: maybe something along the lines of excluding commons-logging or other logging frameworks from another dependency?
11:08pandeirofdaoud: nice call i saw commons-logging in there somewhere
11:14fdaoudpandeiro: :)
11:38simardI have some java code running in its own thread that calls an exported static function of a clojure class (:gen-class). On some computer, this works fine, while on another that has more cores, this crashes with a "java.lang.ExceptionInInitializerError" caused by a "java.lang.NullPointerException". Running the program with java -verbose reveals clojure defs are still being loaded when this happens, and the actual function I'm trying to
11:38simardcall from java has NOT yet been loaded, resulting in the exception. Does this description of the problem ring a bell to anyone ? Note that this is my interpretation of what's happening, I could be wrong about it.
11:53patrikkarlinhttp://browserquest.mozilla.org/ :D
12:05dnolenpatrikkarlin: neat
12:07patrikkarlinkilled the final boss yet :D
12:09gfredericks(defmacro if [cond t f] `(({true (fn [] ~t) false (fn [] ~f)} (boolean ~cond))))
12:17jimdueydnolen: I got a version of core.logic working with fork/join. Only fresh, all and conde work, though.
12:17jimdueyTabling doesn't, though it could.
12:17_philis it possible to auto-reload some namespace in an aleph handler? so i dont have to start / stop the server all the time
12:17jimdueyconda and condu seem to me of limited use in a multi-threaded scheme.
12:18jimdueyAnd it searches the entire search space, so (run n ...) is irrelevant.
12:21dnolenjimduey: WHOA! is this all in your fork?
12:22jimdueynot yet. will push shortly.
12:23dnolenjimduey: excellent! I'll create a fork-join core.logic branch as soon as you do and take an extended look later.
12:24jimdueyBTW, your fj.clj gist made it a breeze. :)
12:24dnolenjimduey: heh, excellent I was trying to look for that for you the other day :)
12:28jimdueydnolen: Just pushed. It's on the master branch of my fork. Lots of polishing is needed. Deleting #_ code and the like.
12:29dnolenjimduey: mind creating a fork-join branch w/ the changes as well so I can track that?
12:30jimdueyPerformance on the zebra benchmark is on par with standard core.logic. Overhead of splitting work up, I suspect.
12:30jimdueyThere's now a 'fork-join' branch on my fork.
12:30jimdueyI guess I should do a blog post about it now. :)
12:32dnolenjimduey: whoa perf parity is incredible, can't wait to dive in and see if we can't optimize :)
12:33dnolenjimduey: a million thx for taking this on! :D
12:34jimdueymy pleasure. Leveled up on my grasp of the continuation monad.
12:34gtrakoh cool, it's implemented with continuations?
12:35jimdueyYeah, except I ended up removing the monad because I didn't need it anymore after I understood the semantics.
12:36gfredericksyou refactored away a monad?
12:36dnolenjimduey: hmm ... that's a good blog post - monad as tool for thought!
12:36jimdueydnolen: I'd be real interested in optimizations since I basically stripped out everything I could.
12:37jimdueygfredericks: Yep. Using the monad, I limited the complexity in the code to just a few places. Then, as an optimization I just inlined that code.
12:37romanandregIs "extend-protocol" supported on INamed, ISeqable, etc on Clojurescript? I'm getting a JS error saying their prototypes are undefined :-/
12:37dnolenjimduey: it would be absolutely lovely to hear the entire development process - starting with the monad, your insight and then it's removal :)
12:37gfredericksjimduey: that's cool
12:38jimdueyWell, I guess I know what I'm doing the afternoon. :)
12:40`fogusdnolen: or maybe monad as thought-exercise for tools. ;-)
12:40`fogus:-O
12:41`fogusjimduey: just kidding sir
12:41jimdueyLOL
12:47dnolenromanandreg: CLJS prototypes are not backed by anything like interfaces so that's not going to work.
12:48romanandregdnolen: meh :-/... so if I want to make a protocol extension for all seq-like types I have to write one by one right?
12:48dnolenromanandreg: if you absolutely need that feature you'll have to handle that in the default case - this is actually done in CLJS core.logic
12:48romanandregdnolen: what is the type you are using there? object?
12:48dnolen(extend-type default ...)
12:49romanandregdnolen: uhmm… and then you do (if (extend-protocol? X ob) …)?
12:49dnolensatisfies?
12:50dnolenromanandreg: https://github.com/clojure/core.logic/blob/master/src/main/cljs/cljs/core/logic.cljs#L390
12:50dnolenI use sequential? here, but really it's just a call to (satisfies? ISequential x)
12:51`fogusEvery time I want to dig deeply into core.logic it takes some massive leap forward!
12:51romanandregdnolen: exactly I meant that… well that should do it for now I guess, any plans in the future to emulate "interfaces" in cljs, is that even possible?
12:52romanandreg`fogus: I don't even try yet… I have to go through the reasoned schemer first hehe :-/
12:52`fogusI've done that part, but now I feel like I might need to read it again ;-)
12:52dnolenromanandreg: probably not possible, interface inheritance actually brings it's own bag o' works.
12:52dnolenromanandreg: that said, predicate dispatch can save us all :D
12:52dnolenbag 'o worms I meant
12:53`fogusI hope that Manning commissions a 2nd edition of JoC, I would love to add a chapter on core.logic
12:53dnolen`fogus: EPIC post
12:53`fogusdnolen: Thanks man
12:53`fogushttp://himera.herokuapp.com/index.html
12:53`fogusMany bugs, but useable
12:53romanandregdnolen: :-), how far are you from the presentation you had last Clojure Conj, I saw some real challenges there?
12:53muhooum, what post is epic?
12:54`fogusI hope this one http://blog.fogus.me/2012/03/27/compiling-clojure-to-javascript-pt-3-the-himera-model/
12:54pandeirolynaghk: any idea how i could debug geo->svg in c2? even with your vomnibus.geo.us/states (geo->svg (second (first us/states))) is returning nil... i notice it works as expected in vrepl but not in my server code or at the slime repl
12:54dnolenromanandreg: sadly, not very far I've been working on ClojureScript a lot lately as you can probably tell. But the major pieces really are there.
12:54antares_`fogus: I am curious why you spell Himera in Russian?
12:54dnolen`fogus: man, himera is PURD-EEE
12:55`fogusantares_: ?
12:55antares_`fogus: in the tweet
12:55`fogusJust for giggles
12:55gfredericks`fogus: is that heroku link supposed to work?
12:56muhoothat is indeed very cool!
12:56romanandregdnolen: yeah, CLJS has required some work, hehe
12:57romanandregdnolen: thanks for the feedback, I know now where I'm standing
12:57`fogusgfredericks: which link?
12:57gfredericks`fogus: second paragraph, "Himera on Heroku"
12:57gfrederickslinks to http://warm-wind-7890.herokuapp.com/index.html
12:58`fogusgfredericks: Thanks. Will fix
12:58gfredericksnp
12:58mkwhy is not-empty implemented as (when (seq coll) coll), when empty specifies that its opposite is (seq coll) ?
12:58`fogusgfredericks: http://himera.herokuapp.com/index.html is the sauce
12:59gfredericks`fogus: cool, thanks!
12:59mkI mean "empty?"
13:00pandeiro`fogus: is the right third of the console div being used for anything?
13:00fdaoudmk: empty? is implemented as (not (seq coll))
13:00`foguspandeiro: no. the console needs some love.
13:01fdaoudmk: you were right the first time, it is not-empty that is (when (seq coll)).
13:01mk,(doc empty?)
13:01clojurebot"([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
13:01mkso the documentation seems outdated, because there's a not-empty function that presumably should be used instead of (seq x), right?
13:02mkbut, strangely, that function is implemented using (when (seq coll) coll) - why?
13:02TimMcwelp
13:02TimMcI guess I don't need to work on TryCLJS anymore.
13:03muhooi can see this being turned into something like a jsfiddle
13:03pandeiro`fogus: i see the purpose is to introduce cljs, ergo the cheatsheet, but i still think a setup like jsfiddle where folks could actually throw html, css, and code together would be the best way to let people really try out cljs
13:03fdaoudI thought RH said in his talk that ClojureScript isn't for TryCLJS? ;)
13:03muhoopandeiro: jinx
13:03TimMcfdaoud: Too bad!
13:03pandeiromuhoo: i was on this rant 2 months ago at least! :)
13:04pandeirobut yeah, `fogus pardon me for the unsolicited suggestion... awesome work as it is
13:04fdaoudpandeiro: +1, with the optional availability of Google Closure or (yes, no sense in pretending it's not popular), jQuery
13:04muhoopandeiro: my guess is you'll be solicited for pull requests if you keep up the suggestions :-)
13:05`foguspandeiro: Agreed. A project for another day perhaps
13:05dnolen`fogus: Himera! just in time for my NYC.js and JSConf talks :)
13:05`fogusmuhoo: I solicit pull-requests with impunity
13:06muhooas well you should. this is great work, i'm sure it'll breed many forks.
13:06pandeiroyes it's an awesome base
13:06patrikkarlindnolen: anny talk i can watch streamed?
13:06`fogusmuhoo: I hope so!
13:06dnolenpatrikkarlin: JSConf for sure
13:07patrikkarlindnolen: you gonna talk about clojureScript?
13:08pandeirofdaoud: seems like he's already got jQuery in there... js/jQuery?
13:09dnolenpatrikkarlin: yes - but I only have 20 mins or so, so it'll be kind of high level about JS & Lisp with hopefully enough tasty tidbits to encourage people to play around with Himera :D
13:10jimdueyfogus: re. core.logic. It'd be great to see it in JoC. It's an awesome piece of code that does some amazing things. And it's really simple at the core of it.
13:10dnolenjimduey: speaking of which, glad you found the code approachable.
13:11jimdueyActually, I just deleted all the stuff I didn't understand. :)
13:11dnolenjimduey: haha, that works too :)
13:11fdaoudpandeiro: golly gee you're right.. try (-> (js/jQuery "div") (.remove))
13:11jimdueySeriously, it's great code and I need to go back and read Byrd's thesis.
13:11fdaoud*poof!*
13:13jimdueyI'm pretty sure tabling could be added back to the fork/join version. But I'm kind of burned out on that ATM. So I'll leave that to you. I'd be glad to talk about it later.
13:14dnolenjimduey: not a big deal - I ran into the same thing with CLJS core.logic, disequality, tabling still need to be done. All in good time.
13:14jimdueydisequality was actually easy to do with fork/join.
13:14jimdueyAt least all the unit tests pass.
13:14dnolenjimduey: that's good to hear.
13:15dnolenjimduey: Will Byrd is already very, very curious about your work ;)
13:17jimdueySeriously? It actually doesn't seem that big a deal.
13:18dnolenjimduey: well they tried with explicit threads and of course that didn't work - so this is a big deal for them.
13:19jimdueyI mean, the concept could be described pretty succinctly. The hard part was getting my head far enough into continuation to actually implement it.
13:19jimdueyWhich is what the monad really helped with.
13:20dnolenjimduey: I'll definitely direct Will & Dan to your post when it goes up, they'll be interested in your story.
13:21jimdueyOk. Working on it now. Hopefully in a couple of hours.
13:22mkis there any difference at all between (when (seq coll) coll) and (seq coll) ?
13:23Bronsa,(let [coll [1]] [coll (seq coll)])
13:23clojurebot[[1] (1)]
13:27mkI see, thanks
13:28fdaoudcljs question: I have a map that is the resource bundle for the web app, either in english or french. It is constructed on the server according to the user's language. Now, I want to use that on the client side in cljs.. how do I do this without getting into a mess?
13:29gfredericksinteresting himera error when I enter (/ 3 4)
13:29dnolenfdaoud: a Clojure map? just print it and send it to the client and use the cljs reader to read it.
13:30patrikkarlingfredericks: to much recursion?
13:30fdaouddnolen: ok..in the context of an ajax request?
13:30gfrederickspatrikkarlin: but what's so recursive about it?
13:31dnolenfdaoud: absolutely
13:31patrikkarlingfredericks: its in the compilation not the function call
13:31patrikkarlingfredericks: it says on github: ClojureScript's / function is not munged properly
13:32dnolenfdaod: (cljs.reader/read-string (.-responseText xhr))
13:32gfrederickspatrikkarlin: oh gotcha
13:32fdaouddnolen: I'm with you so far, but how do I now handle the synchronization of it all? I have to make sure no one tries to use the map before the ajax call has completed..
13:33dnolenfdaoud: CLJS doesn't ship out the box with tools to deal w/ async issues - you'll have to sort that out the same way you would in JS
13:34fdaouddnolen: I see. when I was in straight JS, I was just printing out the map (as json) into the page, so generating javascript code really.
13:35fdaouddnolen: I suppose I could use an atom..
13:35hhutchfdaoud: have you seen fetch?
13:36fdaoudhhutch: yes
13:37fdaoudhhutch: doing the ajax part is fine. it's the sync of it all that I'm worried about
13:38fdaoudhow do I make sure the call to get the language map has completed before the other calls try to use it, without getting into a callback mess
13:38gfredericksyou could go back to printing it to the page
13:38gfredericksas a sexp string
13:39fdaoudperhaps everyone could subscribe to an "i18n" event, and the ajax call fires it when the map has loaded
13:39fdaoudgfredericks: true, that is probably the simplest solution
13:42fdaouddnolen: thank you
13:42gfredericksfdaoud: you'll still have to use read-string of course
13:43dnolenfdaoud: np
13:46mkwhat are 'if and 'do style forms called?
13:47gfredericksoh no he did not just use the word "furcated"
13:47fdaoudgfredericks: right, thanks
13:47gfredericksmk: special forms? symbols?
13:48mkgfredericks: I'm looking at (list 'if true [1 2 3]) and am confused... for some reason
13:49gfredericksmk: sounds like you're looking at a macro?
13:49mkgfredericks: mystery solved - thanks :)
13:49gfredericksnp
13:54pandeiroonce you've defined a var (non-dynamic) at the SLIME repl that's it, no changing it?
13:55gfredericksyou can change it
13:55gfredericksbut only globally
13:55gfredericksyou can't use it with (binding)
13:55pandeiroi can't re def it, slime throws an error
13:55gfredericks(which has only thread-local effects)
13:55gfredericksthen I don't know what's going on
14:11solussdany korma users in the room? :)
14:12sorenmacbethtechnomancy: fixes for both of my major lein headaches in 1.7.1. thank you for that!
14:13technomancysorenmacbeth: great!
14:13technomancyhopefully that's the last release for the 1.x branch
14:14chouserInteresting that there's no deref-apply
14:14chouser(defn deref-apply [iref f & args] (apply f @iref args))
14:26eggsbywhen people say 'mapreduce' they mean to first map a function over a list and then reduce it to a single value by means of some other function?
14:28rhceggsby: sorta, they mean an algorithm that can be described by a series of map and reduce operations
14:31eggsbyah rhc so what I described was one possible (the simplest possible?) mapreduce?
14:31edwHey guys, I'm doing some tech recruiting for the start-up I'm working for. If you're in NYC and looking for an opportunity, please check out http://actionx.com/tech-jobs.html
14:32zakwilsonmongodb, eh? Where's my 11 foot pole?
14:32edwYeah, yeah, yeah.
14:32muhoohmm, i tried cheshire, got this: VerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)
14:33muhoouppon use
14:33fdaoudzakwilson: mongodb specifically or NoSQL in general?
14:33edwCassandra is the shit, yes, yes...
14:33muhoowhoops, nm. i imported the wrong ns
14:33zakwilsonfdaoud: mongodb ate my data.
14:33muhoothough i gives the same error if i do :-<
14:33edwzakwilson apparently missed the "right tool for the job" reference.
14:33juhu_chapaedw: nice site!
14:34edwThanks. So far every bit on it is mine.
14:34fdaoudzakwilson: so you don't have anything against NoSQL or documented-oriented or whatever persistence?
14:34edw(Trying to change that; I'm the product designer/manager who happens to be a fine art programmer.)
14:35zakwilsonfdaoud: no, not in principle. I have something against mongodb for losing data in a situation that should have been pretty low-stress for any data store.
14:36fdaoudzakwilson: ok, I was just curious. I have yet to try a NoSQL (if that is the right appelation) persistence solution.
14:36zakwilsonfdaoud: I hate the term NoSQL. The filesystem is a "NoSQL persistence solution". I have nothing against document stores though.
14:37cemerick"nonrelational database" seems like a much more sensible term to me.
14:37zakwilsonIn fact, something just like MongoDB that didn't lose my data would be a great fit for a lot of Clojure apps since the data types line up nicely.
14:37gfredericksso apparently "CoSQL" never took off
14:37zakwilsonDon't call it what it isn't. Call it what it is: document DB, column store, graph DB, etc...
14:38fdaoudzakwilson: so is "document store" a better term for CouchDB, MongoDB, etc.?
14:38zakwilsonfdaoud: Yes, I think so.
14:39fdaoudzakwilson: fair enough. I don't have anything against SQL so I don't particularly like "NoSQL" either, as if SQL was evil or something.
14:39juhu_chapaedw: you are the almighty.
14:39zakwilsonfdaoud: I have something against SQL. I think the language is *awful*. I don't have anything against relational databases though.
14:40fdaoudzakwilson: ok. I don't mind SQL but I'm not passionate about it so I won't argue. :)
14:41muhooit's sad when you google an error message, and the only reference you find is yourself answring the question.... and no answer
14:41zakwilsonfdaoud: fortunately, on Clojure we have Korma and don't have to do much actual SQL.
14:41muhoohttps://refheap.com/paste/1410
14:41RickInGAtechnomancy: thanks, that was very educational
14:42technomancyRickInGA: now you know all you need to know about non-relational data stores.
14:43RickInGAactually, I think all I need to know is when to use them instead of relational. I have read articles on the subject and am still not sure
14:43RickInGAseems like
14:43RickInGAseems like 'big stuff' is the general answer
14:44technomancydepends where you're deploying
14:44pandeirostrange bug: a fn returns nil given param a, then i re-evaluate the same fn (from the same jar) in slime and it returns non-nil given param a.
14:44technomancybig stuff is the only place where you can't use SQL, but there are smaller cases where something like couch would be more convenient, just probably not as well-supported by sysadmins etc.
14:45cemericktechnomancy: too bad 'leiningen' is so hard to lay down a rhyme for
14:45fdaoudzakwilson: on wikipedia they distinguish between "document store", "graph database", "key-value store", and "object database"
14:45pandeirocemerick: sighin' again
14:45pjstadigcemerick: fleiningen, zeiningen, shinengen
14:45muhoocemerick: oh, it could be worse: http://www.youtube.com/watch?v=NbTEVbQLC8s
14:45zakwilsonfdaoud: yes, those are common types of databases that aren't relational.
14:46zakwilsonThere are also column stores, which I briefly understood and now do not due to never having had to use that information.
14:46cemerickmuhoo: wow, you're right
14:48muhoowell, sadly, cheshire is a non-starter for me.
14:48muhoocan't get the damn thing to even load
14:50muhooRaynes: i tried though
14:51gtrakI'm trying to execute generic shell commands and having some trouble, is there a more right way to do what I'm trying to do? https://gist.github.com/2219080
14:51TimMcmuhoo: I had no trouble with Cheshire.
14:53zamateriancemerick, have you had time looking over my pr for pomegranate ?
14:54joegallogtrak: remove the str call.
14:54joegalloand i don't think you need escaped quotes
14:55gtrakah, (sh "sh" "-c" "\"ls -l\"") seems to work
14:56gtrakjoegallo, why wouldn't I need quotes? in a real shell, I do
14:56cemerickzamaterian: join me in #leiningen :-)
14:56joegallowfm
14:56fdaoudso what is the best "document store" for clojure?
14:56gtrakit works in clojure without them, but that seems odd
14:57joegalloin your shell, you need to be able to tell one argument from another.
14:57zakwilsonfdaoud: that may depend on what you're trying to do with it.
14:57TimMcgtrak: Quoting is only necessary when you are using a command line.
14:57joegalloin java, when you are runtime/exec'ing, you don't. 1 string = 1 arg.
14:57gtrakah
14:57TimMcsh takes pre-parsed args
14:57gtraklearn something every day :-)
14:58fdaoudzakwilson: point taken. say I am trying the simplest possible solution just to "try things out". as Sqlite3 is to a relational db.
15:00zakwilsonfdaoud: I hear couchdb is great for lazy people. I'm not sure about using it from Clojure.
15:01pandeirocouchdb is cool but you have to write some javascript (or set up the clojure view server) to query your data
15:01cemerickpandeiro: not true; see https://github.com/clojure-clutch/clutch-clojurescript
15:02pandeirocemerick: sorry, that's right, been meaning to check that out again
15:03pandeirofdaoud: and actually you could also use couch's _all_docs?include_docs=true in lieu of a design document with views and stuff
15:03dakronemuhoo: what issues are you seeing with cheshire?
15:03pandeiroif you're just testing it out i mean
15:04pandeirois it idiomatic to nest (defn ...)s?
15:04Bronsano
15:15emezeskeNoo! We're back to level zero on the "Don't Reply to the Alternative set literal syntax Thread" achievement!
15:15Zokapandeiro: nested (defn ..) is still vidible outside, can be bit misleading
15:15Zokas /vidible/visible/
15:16pandeiroZoka: huh b/c i'm seeing the weirdest behavior with the geo->svg fn here: https://github.com/lynaghk/c2/blob/master/src/clj/c2/geo/core.clj
15:17pandeirowhen i require the ns and call that fn, it only returns nil, but if i highlight and eval the fn explicitly, it works as expected
15:21beffbernardHow do you run an app from command-line from lein uberjar w/o using :gen-class
15:21beffbernard?
15:23TimMcbeffbernard: There's probably some way to use the clojure.core jar as your entry point and then tell it to call some main method over in your uberjar, but...
15:23TimMcbeffbernard: it may be easier to use lein-otf to make a mostly-non-AOT uberjar: https://github.com/timmc/lein-otf
15:24beffbernardTimMc: What's the canonical way to launch a clojure process?
15:24TimMcpandeiro: I'm not surprised, nested defns do weird shit.
15:25pandeiroTimMc: thank you for returning a tiny part of my sanity
15:25TimMcbeffbernard: On what code format? lein run for projects, java -jar for an uberjar
15:25beffbernardTimMc: From a line project
15:25TimMcbeffbernard: lein run
15:25beffbernards/line/lein
15:25beffbernardTimMc: Even in prod?
15:25TimMcbeffbernard: specify a :main in your project
15:29Zoka []
15:29Zoka (defn b
15:29Zoka []
15:29Zoka (println "I am b"))
15:29Zoka (println "I am a"))
15:29Zoka(a)
15:29Zoka(b)
15:29Zokanoirmon.server=>#'noirmon.server/a
15:29ZokaI am a
15:29Zokanoirmon.server=>nil
15:29ZokaI am b
15:29Zokanoirmon.server=>nil
15:30ZnudzonHi is there anyway to use enclojure with netbeans 7.1 ?
15:30TimMcZoka: Please use a pastebin for non-one-liners.
15:30beffbernardHow do you guys run clojure in prod? By using "lein run" or some other means?
15:30TimMcbeffbernard: uberjars
15:31TimMcor lein run, in some cases
15:31gfredericksbundle exec clojure go
15:31ZokaSorry
15:36ZnudzonSo any idea how to work with enclojure ant netbeans 7.1 ?
15:36beffbernardTimMc: Gotcha.. I might still be missing something I think. In order to use the uberjar, I have to use gen-class and define :main correct? Is there a way to to eval the .clj source w/o compiling it ahead of time?
15:37gfredericksbeffbernard: you could just compile a main ns and have the rest of your code uncompiled elsewhere
15:38beffbernardgfredericks: ahh, gotcha
15:39TimMcbeffbernard: Check out the link I gave you.
15:39SergeyDHi, how can I see the expansion of "definline"? The following does not work:
15:39SergeyD,(definline ti [x] `(+ ~x ~x))
15:40clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
15:40SergeyD,(macroexpand '(ti 4))
15:40clojurebot(ti 4)
15:40danielhow can i GET a url and assign the response to a variable?
15:41gfredericksenlive? clj-http?
15:41TimMcslurp
15:41TimMcwith a URL
15:42danielring?
15:42clojurebotring is http://github.com/mmcgrana/ring/tree/master
15:42beffbernardTimMc: I left a tab open to consume later, thanks.
15:42gfredericksTimMc: damn
15:42danielusing noir, so already have ring
15:42clojurebotNo entiendo
15:43TimMcclojurebot: botsmack
15:43clojurebotOwww!
15:43TimMcthat's for last night
15:43gfredericksTimMc: I'm disgusted that that works and I didn't know.
15:44TimMcslurp isn't a cure-all, but it's pretty great
15:44gfredericksslurp is no substitute for spit
15:45TimMcTechnically, that is correct.
15:52ibdknox`fogus: lol.. please stop "destroying programming" :p
15:52ibdknoxI <3 people
15:59`fogusidbknox: I can't stop myself! Send help!
16:00gtrakwhy does everything have to be so complicated!!
16:00ibdknoxhaha
16:01TimMcOh man, context?
16:01gtrakhttp://news.ycombinator.com/item?id=3762466
16:01TimMcwow
16:01gtrakhe created an account just for that..
16:01`fogusHe had a point to make dammit!
16:02Bronsalol
16:02`fogushttp://ancomment.com/
16:05alexyakushevCool, I like this one: http://ancomment.com/jbzbgl
16:05danielim getting VerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)
16:05gtrakhaha
16:05danielwhen trying to require clj-http in a noir project
16:05`fogusI want to add that to my README
16:06dakronedaniel: what version of clj-http and noir?
16:07Zokadaniel: This may be conflict related to JSON parsers
16:07danieli tried clj-http 0.3.0 and 0.3.3
16:07danielnoir 1.2.1
16:07danieli'm trying to do this https://gist.github.com/2219768
16:08danieli'm wondering if i can do it without the extra library, with something already packaged in noir?
16:09dakronedaniel: let me see if I can reproduce it
16:10ZokaNoir 1.2.1 uses clj-json that needs conflicting jacskon version
16:11dakroneyep, that's the issue, lemme see what version that was fixed in
16:11ZokaI had the same problem and ended taking the nits of cheshire directly in may code
16:11Zokas /nits/bits/
16:11dakronedaniel: try 1.3.0-beta2 for the noir version
16:11ibdknoxnoir 1.3.0-beta2 uses cheshire
16:12danielibdknox: does that mean it's also conflicting?
16:12ibdknoxdaniel: hm?
16:12danielwith clj-http
16:13danielchesire instead of clj-json?
16:13danieli dont know what these libraries are or do
16:13dakronedaniel: no, so clj-json and cheshire are incompatible, noir used clj-json in earlier versions and clj-http uses cheshire, switching to 1.3.0-beta2 for the noir version should fix it
16:13ibdknoxthe problem is the java dependency that underlies clj-json and cheshire are conflicting
16:13ibdknoxand noir use clj-json in 1.2.*
16:14danielit did indeed
16:14ibdknoxuses*
16:14danielthanks people
16:14TimMc`lein pom && mvn dependency:tree | less` is a standard incantation for debugging this stuff
16:14ibdknoxI'm not sure why that ended up so screwed up really
16:15ibdknoxgiven that the major versions are the same those two jacksons should be compatible
16:15technomancyTimMc: or now: lein2 deps :tree
16:15technomancythanks to xeqi
16:15Zokadaniel: you can untanfgle depedencies with lein pom folowed by mvn dependency:tree
16:15dakroneibdknox: jackson had some really breaking changes between 1.5.x and 1.9.x
16:15ibdknoxI see
16:16TimMctechnomancy: niiiice
16:17technomancyTimMc: should be in 2.0.0-preview3
16:17dakroneI need to figure out how to make cheshire an optional dependency for clj-http, instead of always pulling it in
16:17ibdknoxdaniel: one thing to note about the upgrade to 1.3.* is that it uses the new hiccup, which has reorganized a couple things
16:17ibdknoxdakrone: you can do what I did with jetty
16:18dakroneibdknox: that totally threw me for a loop while giving a presentation on noir
16:18technomancysomeone ought to spike how crazy it would be to isolate stuff like that in a classloader
16:18technomancysince these kinds of conflicts are only going to get more common with time
16:18ibdknoxtechnomancy: yeah, I'm worried
16:18ibdknoxdakrone: haha the way I included jetty?
16:18technomancyibdknox: just never break anything, ever.
16:18dakroneibdknox: do you have an example of the jetty one?
16:19ibdknoxdakrone: I just require it inline so that you can use :exclusions in project.clj to get rid of it
16:19ibdknoxdakrone: https://github.com/ibdknox/noir/blob/master/src/noir/server.clj#L70
16:19hiredmanimmutant gives each app it's own environment, so you could have 1.2 servies living with 1.3
16:20ibdknoxhiredman: I'm more worried about intra-app
16:22technomancyibdknox: even more scary is that "lein repl" now brings in clj-http and clojuredocs-client
16:22ibdknoxoh seriously?
16:22hiredmanibdknox: intra-app being library level?
16:22technomancyibdknox: yeah, but it should defer to the version in your project.clj if one is present
16:23ibdknoxthat jackson incompatibility is going to cause a lot of unintelligible errors there..
16:23technomancybetter teach it to clojurebot
16:24Zokatechnomancy: lein-wrepl & ringMOn has embedded cheshire because of this problem
16:24dakroneit's not really a problem, things just need to stop using clj-json :)
16:24ibdknoxhiredman: say all of the sudden I realize I need to use x lib which has some incompatibility, I now need to do that in a separate env or refactor all of my code to remove one of them
16:25technomancydakrone: was the cheshire bump to 3.0.0 around jackson incompatibilities?
16:25technomancyI noticed the changelog was a bit short on entries for such a major bump
16:26dakroneoh, it was a significant performance boost/refactorization
16:26technomancyoh, ok
16:26dakroneand I have even more perf stuff that's in but not released yet
16:28dakronetechnomancy: I will work on cheshire being an optional dep for clj-http, that should really help
16:28technomancydakrone: I think that's a good idea, but that's not enough on its own
16:28dakronealthough I guess clojuredocs-client will still need it
16:28dakronetechnomancy: yep
16:29technomancylooks like it gives you an error message without completely freaking out if the wrong cheshire is found
16:29ibdknoxwhat about clj-json?
16:30dakroneibdknox: what about it?
16:31ibdknoxI was curious what happened if that was included as a dependency (since technomancy was trying things in the new repl)
16:33technomancywhoa; it's pulling in contrib 1.1.0
16:33technomancyI get a VerifyError printed, but the repl still works
16:33ibdknoxhuh
16:33ibdknoxwell that's good :)
16:33technomancyhttps://github.com/technomancy/leiningen/issues/475
16:34ibdknoxdependencies are such a nightmare
16:34ibdknoxI worked on versioning for a bit at MSFT, it made me cry
16:34Zokacheshire seems to be better, for example clj-json can not convert project.clj to JSON
16:34ibdknoxcheshire is certainly better
16:34ibdknoxand what everyone should be using from here on out
16:34ibdknoxbuuuut there are things that still have the clj-json dep
16:35technomancyibdknox: I remain optimistic that most of the problems should be addressable with classloaders
16:35ibdknoxI don't know enough to comment :)
16:35ibdknoxbut I hope so, since that sounds like it might be "easy"
16:36dakronethat would be very nice, if it were
16:36dakroneI suppose I should add a disclaimer on the readme for cheshire/clj-http also, that may help
16:38technomancydakrone: a simple "getting a VerifyError? here's what to do!" would go a long way
16:38dakronetechnomancy: excellent idea
16:45ivanare fexprs hard to implement? I ask because I tried to use `definline` without the syntax quote and unquoting, and Axis of Eval tells me fexprs are great
16:48ivanhttp://axisofeval.blogspot.com/2012/03/should-i-really-take-time-to-learn.html
16:50ivanI guess I should look at Kernel
16:52dakronetechnomancy && ibdknox: I have changes for clj-http that make cheshire an optional dependency, now the only question is whether cheshire should default to being included or not
16:54technomancydakrone: what's it used for?
16:55dakronetechnomancy: json-encoding form-param bodies, and auto-decoding json responses
16:55jimdueydnolen: core.logic fork/join post is up: http://www.clojure.net/2012/03/26/Messin-with-core.logic/
16:55jimdueyhacker news: http://news.ycombinator.com/item?id=3763515
16:58technomancydakrone: synergistic!
16:58dakronetechnomancy: err...hooray?
16:59technomancydakrone: I think I'm too out of the loop on web APIs to make the call for the default; I defer to Mr. Ibd Knox.
16:59ibdknoxalways sensible defaults!
16:59ibdknoxoh, wrong question ;)
16:59ibdknoxumm
17:00ibdknoxdakrone: I'd include it by default, and add something to the readme about excluding it if you need to
17:00dakroneprobably pretty easy to just include it and tell people about :exclusions
17:00joegalloibdknox++
17:00dakroneso let it be written, so let it be done
17:00ibdknoxhaha
17:01aperiodicanyone have experience getting slimv set up? i installed it with pathogen, and i suspect that for some reason it's not getting loaded. does anyone know of an easy way to check?
17:10kurtharriger@dakrone I was just trying to use cheshire to data serialize to smile... however I have a joda date in my data structure, was looking to see if there is an alternative to pre/post processing data by extending multimethod or protocol or something but it seems closed.. anything I'm missing
17:10dakronekurtharriger: you can do pre-processing by specifying your own custom encoder for Joda datess
17:11dakronepost-processing is kind of out of scope for a json lib
17:11dnolenjimduey has an awesome write up on parallel core.logic - http://www.clojure.net/2012/03/26/Messin-with-core.logic/
17:12kurtharrigerwhere do I specify an encoder? currently have (generate-smile myobj)
17:16dakronekurtharriger: check the "Custom Encoders" part of the readme on https://github.com/dakrone/cheshire , or look it the cheshire.custom namespace for how it's implemented
17:18kurtharrigerah okay, that looks like might do what I need
17:24muhoodakrone: jackson explosion. looks like that version collijsion you guys were just talking about, serindipitously enough
17:24dakronemuhoo: were you using noir?
17:25muhoodakrone: yes, an old one. problem isolated
17:25dakronemuhoo: okay, let me know if you have more issues with it
17:25dakroneibdknox: when will noir 1.3.x be out so it becomes the default? :)
17:26muhoothanks! raynes hyped it pretty good, i'm looking forward to trying it
17:27ibdknoxdakrone: soon :)
17:29muhoolol, "martin sheen as a service" made my day
17:41aperiodicwill i run into any issues connecting to the same swank server from multiple editor instances?
17:42kurtharrigerdakrone: so custom encoding only does the obj -> json/smile, decoding is always standard.. dates are read back as strings correct? no custom decoding logic right?
17:42dakronekurtharriger: that is correct
17:42kurtharrigerok
17:43amalloyaperiodic: that should be fine
17:50dakroneokay, released clj-http 0.3.4, where cheshire is now an optional dependency (along with other things)
17:50dakroneand some documentation around that Verify issue
18:18kurtharrigeris there any way to :use a namespace and automatically import defrecord types defined in it? it seems like :use only refers the record factory functions not the records themselves? missing something? or is this just how it is for now?
18:20ordnungswidrigkurtharriger: for 1.3 this is so.
18:21kurtharrigerok, thought I was going crazy for a second
18:21dnolenkurtharriger: it's better to either use those factory fns or produce new ones. I doubt automatic importing of deftype/record will happen.
18:22dnolenordnungswidrig: I didn't think so, tho I could be wrong.
18:22ordnungswidrigdnolen: huh?
18:22kurtharrigerits when I want to do extend-protocol SomeProtocol RecordTypeHere that I run into issues
18:23dnolenordnungswidrig: I did not think records were automatically imported on :use
18:23ordnungswidrigkurtharriger: in this case, yes.
18:23ordnungswidrigdnolen: I did not either?!
18:23dnolenordnungswidrig: oh sorry confused :)
18:23ordnungswidrigdnolen: for pre 1.3 I do not know :)
18:23ordnungswidrigdnolen: if you where for this.
18:25kurtharrigerthat and I was bitten by the replace - in ns with _ in import
18:26ordnungswidrigkurtharriger: that's a hard one. it catches my every other time.
18:27kurtharrigerthis seems to work: in record namespace (def rtypes {:typea TypeA}) then I can just use (rtypes :typea) instead of importing the class
19:38Lajlais ##(let [some-datum (list (symbol "I worship His Shadow"))] (= some-datum (read-string (print-str some-datum)))) a bug or a feature?
19:38lazybot⇒ false
19:43eggsbylexx reference?
19:45eggsbytoday is jimduey day for me, reading his article on core.logic after watching his talk from strangeloop 11
19:45danlarkincareful you don't OD
19:46danlarkina jimduey hangover is brutal
19:46eggsbyD:
19:49eggsbydanlarkin: are you danlarkin the auther of the clojure lib clojuredongs
19:49danlarkinthe one and only
19:49eggsbywell, I never
19:50Frozenlo`O-M-G
19:50Frozenlo`Why?
19:50clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
19:55mkdoes infoq have any sort of rating/views/sorting system? Seems a bit hard to find the best talks
19:56Frozenlo`Is there a `mapconcat' equivalent in clojure?
19:56qbgmapcat
19:57Frozenlo`,(str (mapcat #(.toString %) [3 4 5]))
19:57clojurebot"clojure.lang.LazySeq@13a53"
19:58Frozenlo`I suppose it will be evaluated when I will use it?
19:58qbg&(apply str (mapcat #(str %) [3 4 5]))
19:58lazybot⇒ "345"
20:00mk,(mapcat #(.toString %) [3 4 5])
20:00clojurebot(\3 \4 \5)
20:00Frozenlo`Oh right.. str is already using .toString
20:01qbgThat is a terrible way to join strings though
20:02Frozenlo`,(str 4 5 6)
20:02clojurebot"456"
20:02Frozenlo`Hurray for me doing everything the worse possible way :)
20:02qbgAlso checkout #'clojure.string/join
20:05mkI'm not quite sure what mapcat is for. As far as I can tell, it's for messing with the inners of a 2d list, just prior to 2flattening/concatenating that list
20:06qbgmapcat is really useful for macros, among other things
20:06mkis there some obvious case where it's best to use it?
20:06mkI see
20:06qbgYou can mapcat together binding forms
20:06qbg(which I find useful)
20:09eggsbymapcat just maps a function over something then concatenates the result
20:11eggsbyor rather, applies the result of mapping over a sequence to concat
20:13eggsbysay your f takes in a value and returns a sequence of values, it would go from 1 -> (1 2), so if you mapped that function over (1 2 3 4) you would get ((1 2) (2 3) ...) but using mapcat you'd get (1 2 2 3 ..)
20:17kurtharrigerare there any clojure libraries for validating data structure schemas in a nice declarative way. I parse json from http post and I want to ensure it has certain required fields and such before doing to much more with it, currently I'm creating a validate method for each structure but its getting bit messy wondering if there might be something that does this already?
20:45bitpimpyo from the Chicago Clojure Meetup
20:45bitpimp:vsp
20:46bitpimparound 26 people here
20:46technomancywow, big group
20:47gfredericksdon't pass up the opportunity to biject the attendees with the alphabet
20:49greeneggsandspamdanlarkin: should clonjure.dongs really have a default of 8?
20:50greeneggsandspamThat seems a little self serving
20:50muhoodongs?
20:50danlarkinpull requests accepted
20:50greeneggsandspammuhoo: https://github.com/danlarkin/clojuredongs/blob/master/src/clojure/dongs.clj
20:50gfredericksman brehaut was just talking to me about that library
20:50gfredericks#clojure is going through the last hour of my life
20:51muhoooh ffs
20:51qbg"0 contributors"
20:51technomancydanlarkin: what, no CA required?
20:51muhooi guess it had to happen
20:51muhoothough i have to wonder
20:51muhoowith a spit function
20:51muhooif the "slurp" function was originally called "swallow"
20:52gfredericksmuhoo: add (def swallow slurp) and send a pull request
20:52muhoogfredericks: naw, i'll keep that one in my own private library
20:52gfrederickswell notify us if you obtain a patent
20:52muhooi'm going to take out a patent on chewing food
20:55TimMcmuhoo: No, but spit is often called barf.
20:55amalloykurtharriger: i recently wrote https://github.com/flatland/schematic - not a ton of documentation, but you can probably see how to use it from the tests
20:59greeneggsandspamIs there clean way to specific a minimum for rand[-int]?
20:59gfredericksgreeneggsandspam: add to the result
21:01greeneggsandspamyeah. I was hoping there was a more readable way. the + min to result seems too C for me :P
21:01greeneggsandspam(rand-nth (range 4 13)) works
21:01TimMcew
21:01gfredericksyou just made TimMc here go ew
21:01greeneggsandspamnot efficientely,, but..
21:02greeneggsandspamlol i'm just saying
21:02gfredericks(defn rand-eggs-and-spam [min max] (+ min (rand-int (- max min))))
21:02brehautmath saves the day
21:03gfredericks(inc math)
21:03lazybot⇒ 1
21:03greeneggsandspami'll submit the pull request for rang-eggs to clojure.core
21:04mkis there anything actually wrong with rand-nth (range...? It's lazy, after all
21:04gfredericksmk: it'll walk down the seq till it gets the result
21:04gfredericksrand-int will work in constant time
21:05greeneggsandspam"Will have
21:05greeneggsandspam the same performance characteristics as nth for the given
21:05greeneggsandspam collection."
21:05TimMc&(doc rand-int)
21:05lazybot⇒ "([n]); Returns a random integer between 0 (inclusive) and n (exclusive)."
21:05qbgrange is lazy
21:06TimMcgfredericks: Be careful with the upper bound in that defn.
21:06TimMc[min max] is misleading.
21:06mkgfredericks: hmm, you're right, I just did a (time on that, and it's not nice
21:06gfredericksTimMc: I think I intended it to be the way it is, but didn't bother giving intuitive names or docstrings
21:06kurtharrigeramalloy: thanks I'll check it out
21:06greeneggsandspamTimMc: You see? Such a everyday function should be included in the language :)
21:07mkgreeneggsandspam: what are you going to use it for? There might be an easier way
21:08greeneggsandspamimproving clojuredongs. it defaults to 8. i want to make that a random number within 4-13
21:08TimMcgreeneggsandspam: From the perspective of how easy it is to get wrong, yes.
21:08greeneggsandspam ([] (dong (rand-nth (range 4 13))))
21:08gfredericksgreeneggsandspam: you might also make it configurable via a dynamic var
21:09gfredericks(def ^:dynamic *dong-length* nil)
21:09TimMcThat should be *rand-nth*, which can be dynamically rebound for testing.
21:09TimMcand initialized to rand-nth
21:09gfredericksnot everybody is confortable with the nondeterminism
21:09gfredericksoh wait
21:09gfredericksyou can just use the arg'd version
21:09gfredericksnevermind
21:10muhoowhat's the simple (heh) solution for logging?
21:10greeneggsandspamI should have it detect your location and then check the wikipedia article on average size per country
21:10gfredericksis this on clojars?
21:10TimMcmuhoo: println :-)
21:10muhoono
21:10muhooi mean, i don't want spew in my repl
21:10gfredericksTimMc: prn
21:10muhooi want the error messages going to a file or some other facility
21:10mkit's going to be really embarrassing explaining that you wrote a probability-distribution library for the sake of drawing an ascii penis
21:10greeneggsandspamgfredericks: dunno
21:10mkdon't go down that road
21:11qbgShould multiply by (-> (rand-int 2) (* 2) (- 1))
21:11gfredericksmk: only if you're embarrassed by that sort of thing
21:11beffbernardmk: HA
21:11greeneggsandspammk: I have to contribute to the clojure community somehow
21:11beffbernardmk: what distributions?
21:12gfredericksgreeneggsandspam: have you asked on the clojuredongs mailing list if this changed is wanted?
21:13greeneggsandspamgfredericks: I went to the head-dong himself and he suggested i fork and pull
21:13TimMcWrite a Jirum.
21:14danlarkinI would rather not be called head-dong
21:14gfredericksas the only other contributor to clojuredongs I think I deserve the title of tail-dong
21:14mkbeffbernard: half of the time when I'm generating randoms, what I really want are various probability curves. I was simulating a file store for example, and that required long-tail style curves, and so on
21:14TimMcdanlarkin: Wait, how are you going to have an audit trail if you just accept pull requests willy (heh) nilly?
21:14TimMcNo corporation will feel safe using your software!
21:15danlarkinoh no! clojuredongs will be barred from inclusion in clojure-contrib!
21:15danlarkinhow will I, or my ego, survive!
21:15beffbernardmk: have you heard of uncommons-maths?
21:15beffbernardit's a java lib but I've used it in the past
21:15gfrederickstime to start an underground contrib
21:15TimMcgfredericks: Join the crowd.
21:16beffbernardmk: http://maths.uncommons.org/
21:19mkbeffbernard: I haven't. Looks interesting. I was using a bunch of functions in a single class from somewhere online.
21:20gfredericksTimMc: another advantange to the (format "lib-%04d" (rand-int 10000)) naming scheme is that you can probably obtain a matching domain name
21:22greeneggsandspam&(format "lib-%04d" (rand-int 10000))
21:22lazybot⇒ "lib-5468"
21:22greeneggsandspam&(format "lib-%04d.io" (rand-int 10000))
21:22lazybot⇒ "lib-4120.io"
21:25mkI'm a fan of the scheme. It can be used for people, too. We could all call each other by the first characters of our numeric hashes, and as the channel grows, we would simply disambiguate by adding more characters - like a long sequence of last names
21:25methodmissinHello!
21:27mkhi, methodmissin
21:27TimMcmk: We had The UUID Conversation sometime last year.
21:27muhoohmm, ok, i guess bufferedwriter is going to be my simple log solution
21:27TimMcIt wasn't pretty.
21:28greeneggsandspamdanlarkin: pull request send (i'm autodidakto on github)
21:29mkTimMc: uuid for what purpose?
21:29danlarkingreeneggsandspam: merged
21:30greeneggsandspamyay! My first contribution to clojure open source.
21:31TimMcmk: Why, everything, of course!
21:32gfredericksTimMc: we could use the uuid's hash to refer to it
21:33TimMcmk: http://clojure-log.n01se.net/date/2011-09-12.html#17:16c
21:34mkTimMc: using a uuid is silly, but using a hash isn't
21:35Lajlaeggsby, ahh, you worship His Divine Shadow too I see.
21:35methodmissinI'm pretty new to clojure, but having a pretty good time trying to learn it. Naturally, I came because I have a problem I can't figure out.
21:36mkmethodmissin: glad to see you're having fun :) ask away
21:37methodmissinI'm going through Land of Lisp and in the second chapter decided that while there are clojure core functions that accomplish the same, more or less, as CLISP functions, that I would learn and practice more by implementing those CLISP functions called for in the book in clojure, where I could see a solution.
21:37methodmissinThe first being ash
21:37Lajlamethodmissin,I'm not
21:38LajlaI much desire you to whither away in pain
21:38methodmissinI've already got bit-shift-left and bit-shift-right, which was easy, and stuck them in an if, got clojure.math.numeric-tower/abs, and seem to have a working implementation... sometimes.
21:39methodmissinBecause in my test (using expectations) (ash 11 1) returns 1.
21:39methodmissinAnd if I paste the defn into repl, it returns 22.
21:39methodmissin:|
21:40mkwhat does ash do?
21:40methodmissinArithmetic shift
21:40amalloymethodmissin: the number of people in here who know what ash does is very small
21:40methodmissinTakes a number, converts to binary, then moves it +-X number of bits, dropping off or adding 0's
21:40greeneggsandspam*tries to remember* it's a bit or... bit offest... bit something operator... *googles*
21:41methodmissinCan I paste the defn? You'll understand
21:41amalloy~gist
21:41clojurebotgist is https://refheap.com/
21:41amalloyvery funny
21:41methodmissinhttps://refheap.com/paste/1421
21:41mkmethodmissin: http://clojure.org/cheatsheet
21:42Frozenlo`Should I actively try to change strings into keyword? For example: {:name :Albert}
21:42gfredericks(defn bit-shift-north-west [...] ...)
21:42Frozenlo`Instead of {:name Albert}
21:42Frozenlo`er.. "Albert"
21:42amalloyusually not
21:43mkFrozenlo`: is a name like "albert" a keyword?
21:43muhooooh cool, (binding [*out* log] (println "fubar"))
21:43amalloykeywords are for things where all you ever want to do with them is (a) look them up as map keys, or (b) compare them for equality with other keywords
21:44ivanevery time I go into a Python REPL now the commas drive me crazy
21:44Frozenlo`In this case I will use it as a property and use it to filter from maps.
21:45ivanWarning sign: comma-free zone
21:45greeneggsandspammethodmissin: by the way, the author of land of lips translated the adventure game into clojure. It might give you clues. http://www.lisperati.com/clojure-spels/casting.html
21:46mkFrozenlo`: a human name? If you're talking about mappings to keywords (which perhaps you'll look up to get values), then sure, but most things that are strings are... strings
21:47methodmissingreeneggsandspam, Thanks, I just think I'm hung up on project management and testing and stuff right now. Having a hell of a time with requiring or using my other .clj files.
21:47gfredericksit's also unusual to make use of keywords that don't appear as literals in your code anywhere
21:47gfrederickssorta
21:48methodmissinFor the (guess-my-number) game I know I can just use bit-shift-right and forget about ash, but I'm determined to challenge myself where it makes sense and helps me learn.
21:48greeneggsandspammethodmissin: yeah. it's those little 'getting setup' things that are real roadblocks to getting started
21:48ivanit took me about 20 minutes today to figure out that java -jar clojure.jar was messing up my -cp
21:48ivan(if it was. who knows.)
21:49greeneggsandspammethodmissin: also where books help the least, being quickly outdated
21:49TEttingercan anyone explain the advantages ClojureScript has over Sibilant, at http://sibilantjs.info ? I know ClojureScript has better data structures, but Sibilant has clean macros...
21:50methodmissingreeneggsandspam, Tell me about it. :) Still this is a very fun book to work through.
21:50methodmissinI made another gist of the test output and the test file
21:50methodmissinhttps://refheap.com/paste/1422
21:50ibdknoxTEttinger: clean macros?
21:50mkTEttinger: clojurescript is more popular
21:50greeneggsandspammethodmissin: some of the practicalities of clojure are talked about in this guide: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/toc.html
21:50TEttingeribdknox, sibilant just has really simple and convenient macros. you get to control how a macro translates to JS
21:51methodmissingreeneggsandspam, Looks awesome, thanks. :)
21:51TEttingermk, good point
21:51ibdknoxTEttinger: you can do the same if you really need to in CLJS too
21:51TEttingerare there any good IDE plugins for CLJS?
21:51ibdknoxbut I'm not sure I understand why you'd *want* to control the JS. Seems like operating at the wrong level to me
21:51mkTEttinger: js readability (if that's your concern) might become irrelevant soon, with... I've forgotten the name (maps js to original source)
21:51ibdknoxSource Maps
21:52mk^
21:52ibdknoxTEttinger: no, it's far too new
21:52TEttingerI thought CCW had some support
21:52ivantettinger: I tell IDEA that .cljs is Clojure, but I guess most people use Emacs
21:52ibdknoxluckily though, anything that works for CLJ basically works for cljs
21:52TEttingernice
21:54gfredericksisn't cljs code read in with the normal clojure reader?
21:54ibdknoxye
21:54ibdknoxs
21:54gfredericksthat's so cool.
21:55ibdknoxit's just clojure :)
21:55ibdknoxthat happens to emit JS instead of java bytecode
21:55TEttingerI thought that Clojure macros weren't supported in CLJS?
21:56cemerickwhat is the language/framework that allows you to use pipes to specify the left margin of docstrings so lines of documentation aren't ragged?
21:56cemerick…groovy?
21:56TEttingergroovy is a scripting language...?
21:56gfrederickssibilant looks like lisp and coffeescript had a baby
21:56TEttingergfredericks, yep
21:57TEttingerthat's basically the idea :-)
21:57TEttingerbut I like Clojure data structures more than I like JS translation control
21:58gfredericksyeah I wouldn't want to go back to mutable arrays
21:58TEttingeris there a good way to do something like Vaadin/GWT with Clojure?
21:58gfredericksit's really weird that most of the sibilant lib is macros
21:59muhooif i need to keep a *gasp* global, for like the file descriptor of a log, should i make it a ^:dynamic *var* or an atom?
21:59TEttingermostly I am looking for a way to use my halfway-OK server, and even though it is running Windows server (poor hardware support when I tried linux), I would rather not use C#
22:00ivanheh, clojure-spels goes into much hairier stuff than I would have expected
22:00mkTEttinger: when I first asked about macros here, I ended up finding out that they were only part of the reason to use clojure, and that I wouldn't need to use them that much. That seems accurate.
22:01TEttingerthanks mk, will keep that in mind
22:01methodmissinI just wish I knew what I was doing wrong with this test, so I could stop doing it. :P coming from a ruby background it's so crazy to me that what happens in the test doesn't match what happens in the repl.
22:01methodmissinCompiled my various gists into one that hopefully has all the pertinent info in one chunk. https://refheap.com/paste/1423
22:03ibdknoxTEttinger: macros exist in CLJS
22:04ibdknoxTEttinger: rather, macros exist for clojure, which since CLJS is just clojure, means macros exist for CLJS
22:04muhooah, of course. if macros are compile time, and compiling happens on the host, which is the jvm, ok.
22:04ibdknoxexactly
22:05methodmissinActually... the same thing is happening in the repl.
22:05methodmissinAfter pasting in everything from the pastebin
22:05methodmissiner, gist
22:05ibdknoxmacros just take one form and turn it into another - that happens before emitting, so the fact that what it's spitting out is "ClojureScript" is irrelevant at that stage :)
22:06trptcolincemerick: i was thinking it was scala, and this seems to corroborate: http://stackoverflow.com/questions/2013709/scala-raw-strings-extra-tabs-at-the-start-of-each-line
22:06trptcolinbut i can't repro in a scala repl
22:06methodmissin...
22:06muhooso, what is the idiomatic, best-pracice way to keep a global var, for something like the fd of a log?
22:06methodmissinIf I paste just from my core file, it works. If I include the test, it doesn't.
22:07muhooi'm thinking either ^:dynamic or atom, but can't decide.
22:07ibdknoxmuhoo: an atom most likely
22:07muhoothanks
22:07gfredericksmuhoo: if you're going to set it more than once, use an atom
22:07cemericktrptcolin: there's that .stripMargin call, which probably ropes in some implicit somewhere to do the munging
22:07trptcolincemerick: doh, of course i missed that, yeah
22:07cemerick<scary>
22:07cemerickthanks for the pointer
22:08trptcolincemerick: sure thing
22:08cemerickSeems like a pretty sane way to indicate the left margin in general though. Worth writing a doc+ macro that does that or something.
22:09cemerickeh, I suppose the margin could be inferred as long as there's at least one line that's not intended to be indented.
22:10ibdknoxcemerick: I hear people who write lots of documentation and care about its presentation cater to noobs.
22:10ibdknox;)
22:10trptcolindefinitely agreed that docstring indentation needs *something*
22:11trptcolini'm always waffling between having the code look good or the output of doc look good
22:11beffbernardmuhoo: any reason why you aren't using lo4j or slf4j for logging? there is a convenience logging wrapper in clojure/tools.logging
22:11trptcolinsolution: 1-line docstrings. done.
22:11beffbernardlog4j
22:11muhoobeffbernard: oh cool, thanks, i'll try that. i ooked at log4j and went "aagggh! too complicated!"
22:11ibdknoxtrptcolin: those shouldn't have to compete
22:11cemerickibdknox: assholes, all of 'em!
22:11muhoobut if there's a nice wrapper in clojure/tools.logging i'll look there
22:12ibdknoxcemerick: haha :D
22:12muhoowithout noobs, all things are just ways to keep your computer warm
22:14cemerickmuhoo: don't mind us. We love noobs, 133t hax0rs, and everyone in between. :-)
22:14muhoooh i know, and i appreaciate it. a lot.
22:14ibdknoxyeah, twas a joke from ClojureWest :)
22:14muhoospeaking as a died-in-the-wool noob
22:14trptcolinibdknox: hmm, yeah, i guess i should just go w/ the 2-space convention that seems to be the norm in core, now that i look more closely
22:14gfredericks"veteran noob"...
22:15muhooi guess a dilletantte, or a DIY fanatic, is a perpatual noob, and i'm guilty as charged.
22:15ivanwrite a markup language similar to reStructuredText but sane, display formatted text in HTML docs
22:21TEttingerivan: MultiMarkDown?
22:21TEttingerPanDoc supports practically every format, take a look at the existing stuff
22:22ivanI dunno. I kind of like some rST features like text roles
22:22ivanthough they should be nestable
22:22TEttingerhttp://johnmacfarlane.net/pandoc/
22:23methodmissinI guess nobody knows what's going on with my tests? https://refheap.com/paste/1423
22:25qbgmethodmissin: Looks like this: ((quote lol/ash) 11 1)
22:25qbg&('lulz 11 1)
22:25lazybot⇒ 1
22:26qbgDon't quote your symbol!
22:26TEttinger&('(lulz 11 1))
22:26lazybotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
22:27TEttinger&(print '(lulz 11 1))
22:27lazybot⇒ (lulz 11 1)nil
22:33autodidaktoAny vimclojure users? Does the repl (\sr) connect to the nailgun server? I'm trying to get it to see what I've previously evaluated (\ef, etc)
22:37emezeskeautodidakto: Yeah, it is definitely supposed to.
22:39methodmissinqbg: !
22:40methodmissinqbg, Thanks! I kept quoting stuff because it was complaing about classpath and can't find this or that. I suppose i have to learn where to quote, and where not to.
22:40qbgIf you want it evaluated, don't quote it :p
22:41nsxt"Write a function that returns a personalized greeting:" (= (__ "Dave") "Hello, Dave!")
22:41nsxtI can't for the life of me figure out how to do this. str "Hello " works fine, but what about the exclamation point?
22:42methodmissinnsxt, str to construct the string and insert the arg?
22:42qbgmethodmissin: Symbols are actually functions that look themselves up in maps, with the (optional) second argument being the value to return when the key is not found. If the first arg is not a map, the key is never found
22:44qbg&(#(str "Hello, " % "!") "Dave")
22:44lazybot⇒ "Hello, Dave!"
22:44qbgBut there has to be a cooler way
22:44nsxtmethodmissing: I think I follow? (Total noob here.) It involves something with the %, right?
22:44autodidaktoemezeske: So I'm supposed to be able to evaluate a function (i.e. \ep to evaluate paragaph), the start a repl (\sr) and start playing with that function and pass it arguments, correct?
22:45nsxtqbg: thanks... still learning syntax here.
22:45methodmissinqbg, Thanks for the explanation. nsxt, We're all learning the syntax. :)
22:48gfredericks&((partial format "Hello, %s!") "Dave")
22:48lazybot⇒ "Hello, Dave!"
22:48qbgQuick, pull in cl-format!
22:52autodidaktoemezeske: Ah. I see what I did wrong. I needed to load the namespace while in the repl
23:03amalloyi'd skip the #(... %) syntax sugar for now, nsxt, and look more at something like (fn [name] (str "Hello, " name "!"))
23:03emezeskeautodidakto: I usually just use \ef, which loads the whole file, thereby picking up the namespace for you
23:03amalloywhich is more explicit
23:06autodidaktoemezeske: Hmm. Then I shouldn't have to switch namespaces when starting to reply (\sr)? I just did a \ef and my repl always opens with user=>
23:08autodidaktoemezeske: maybe i should just not close the repl buffer
23:36nsxtamalloy, thanks. the example is from 4clojure, which is a great resource, but a little too heavy for a complete beginner.
23:37amalloy*chuckle* i know, i recognize it
23:37nsxt:) you must get a handful of people who come in here with 4clojure questions.
23:38echo-areaA newbie question: How do I specify the dependency to commons-logging api in project.clj?
23:39qbgecho-area: Just add it as a dependency
23:39echo-areaLike this? [commons-logging/commons-logging "1.0.4"]
23:39qbgYeah
23:40mknsxt: what sort of function takes a string on the left, and puts the stuff on the right into that string?
23:41echo-areaqbg: But compiling my java sources still fails with message "package org.apache.commons.logging does not exist"
23:41qbgDid you do lein deps?
23:41qbgAnd restart your repl?
23:41echo-areaOh, I don't do that.
23:41echo-areaLet me try, thanks
23:42echo-areaqbg: Yeah it works. Thank you!
23:42simardamalloy: I'm using clojail, I have a java.policy file with AllPermission, and this works fine when running through a uberjar. However, when I build a jar instead and place it on the class path to use it from some java code (RT.loadResourceScript, clojure.lang.RT.var some func, func.invoke), I get security exceptions: https://gist.github.com/2223372
23:42mknsxt: in 4clojure, you can follow a bunch of the people who've solved all of the problems. Once you solve a question, have a look at other solutions.
23:43simardwould you have any hint for that ?
23:43amalloyi dunno, man
23:44amalloyit looks kinda like your java code is being loaded (not just run) inside the clojail sandbox, but i don't really know much about that area
23:45simardwhat I really don't get is that I'm getting security exceptions when I do provide full access.
23:45simardand I don't have this error when running a standalone uberjar.
23:50nsxtmk: yup, i followed all the guys who completed all 141 problems.
23:52mknsxt: it's interesting how some questions have very diverse answers, and some have just one
23:58nsxtmk: How can a beginner best identify which are idiomatic and which aren't?
23:59mkthe short ones :)
23:59ibdknoxare often not idiomatic :p