#clojure logs

2013-11-19

00:03abaranoskydo any of you all have your emacs setup to click through to Java? I want to at least be able to make tags for clojure.core if I Can
00:03coventryabaranosky: Do you mean getting etags to work with java files? I did that.
00:04abaranoskycoventry: yeah. Do you have any sample code I could look at?
00:04abaranoskycoventry: hi, are you the gentleman I met at the conference, Alex Coventry?
00:05coventryabaranosky: Yes.
00:06coventryHello again. :-)
00:07technomancyamalloy: interesting. I wonder if it was considered to support both behaviours.
00:07technomancysharing-subs vs copy-subs
00:10coventryabaranosky: There's not much code to it. "find . -name \*.java | etags -" creates the TAGS file, then (setq) tags-table-list to point to the directory containing the TAGS, or just specify it on the first call to find-tag.
00:11coventryabaranosky: Or did you mean getting M-. to DTRT with java in .clj files? That I haven't done.
00:11hiredmantechnomancy: it would be difficult to get both from the same class
00:12hiredmanwithout wasting fields
00:12abaranoskycoventry: so to create tags you need access to the .java files right? So if all I have are jars I'd need to open them and build a TAGS file from that?
00:12hiredmanand String is final
00:13technomancyhiredman: ah right; one of the reasons cited was to save space per string
00:13abaranoskycoventry: yeah... Ideally I can access any java code that some .clj file is using
00:14coventryabaranosky: Yes, I was working with the clojure source code at the time. Getting nrepl to use reflection to find the source code for java objects by reflection would be cool.
00:14technomancycoventry: you'd need a plugin to fetch :classifier "source" versions and put them on the classpath too
00:16hiredmantechnomancy: that analysis brought to you by my ergodox
00:16technomancyhiredman: how's your wpm?
00:16hiredmanmidteens
00:17technomancyhiredman: have you considered that now is probably the best time in your life to learn dvorak
00:17bitemyapptechnomancy: in case you cared, the PlayStation 4 is now the best controller to get for emulators.
00:17bitemyapptechnomancy: works out of the box on Linux with every emulator I've tried so far.
00:17bitemyappOut. of. the. box. No drivers, no installs, no config.
00:17bitemyappJust goes/
00:17amalloytechnomancy: dvorak is so old-hat. the cool kids are using colemak now (future readers, please fill in with latest fad)
00:18Raynesamalloy: Workman.
00:18RaynesNoob.
00:18amalloyyeah yeah. not so excited about workman
00:18technomancybitemyapp: is it hard to get good emulator controllers?
00:18bitemyappBuying a PS4 controller is the most brilliant thing I've done all month.
00:18technomancyI got a $20 in college that worked perfectly
00:18bitemyapptechnomancy: that have a good d-pad and "just work" out of the box on Linux? yes, it's damn near impossible.
00:18amalloywell, neither about colemak or dvorak
00:18hiredmanworking with this reduced key layout so I have an extra third shift layer
00:18bitemyapptechnomancy: no no, I'm picky about d-pads. Most vanilla PC gamepads have *terrible* d-pads.
00:18Raynestechnomancy: I like the Logitech f10.
00:19Raynesf310
00:19technomancybitemyapp: I don't even remember what it was; the first one I tried was great
00:19RaynesWorks out of the box on every machine I've ever used.
00:20bitemyappLogitech controllers don't have good d-pads though.
00:20VFeThe trials and tribulations of fighting gamers...my life for a d-pad that works.
00:20Raynesbitemyapp: My favorite controller is the xbox 360 controller, but I sure bet the PS4 controller is better.
00:21bitemyappVFe: hear hear! The PS4 controller d-pad is great so far :)
00:21VFeyeah, DS4 is first time I've considered switching from PS2 for fighting games.
00:21bitemyappRaynes: the 360 controller is okay, I've used it happily before, but the PS4 is better.
00:22bitemyappI only found out the PS4 controller supported DirectInput by pure luck, a friend mentioned buying the controller for emulators on Facebook.
00:22bitemyappI immediately left the house and got one just now.
00:22Raynesbitemyapp: It also supports xinput presumably, right?
00:22bitemyappnaw, that's Microsoft specific.
00:23bitemyappdoesn't need to anyway, DirectInput works everywhere.
00:23RaynesNot exactly.
00:23bitemyappwell, it's *more* Microsoft specific that is.
00:23technomancymaybe they're like laptop keyboards and they just mysteriously stopped making good ones a few years ago
00:23hiredmanworking with dvorak would be hopeless, at least this way only control keys are different
00:23bitemyapptechnomancy: well kind of, the only company still making good d-pads since the PS2 has been Sony.
00:24RaynesSome games are designed specifically for xbox 360 controllers (and thus xinput), so having a controller that can emulate that helps.
00:24bitemyapptechnomancy: but the PS3 controller was a huge pain to get working on a PC, they rectified this with the PS4.
00:24RaynesMy logitech f310 can.
00:24bitemyappRaynes: I see, I don't think I play any games like that.
00:25Raynesbitemyapp: Try to play Trine with anything short of a 360 controller.
00:25RaynesYour life is going to be really, really bad.
00:25bitemyappI did play it, with a keyboard and mouse.
00:25bitemyappquite happily :P
00:25amalloyyeah, trine is better with a keyboard and mouse
00:25RaynesLies.
00:25RaynesTrine rocked hard with my 360 controller.
00:25Raynesamalloy: We should play through Trine 2 together.
00:26RaynesBro.
00:26bitemyappTrine 2 was hilarious for me and a friend to play through
00:26RaynesI played through it alone.
00:26bitemyappprobably the hardest I'd laughed in years and years
00:26RaynesBut my mother was watching at the time.
00:26bitemyappnow that I have a real controller, I should beat Ninja Gaiden II
00:27RaynesMy mother never once played Amnesia, but it's her favorite game.
00:27technomancythat's one of the few programs I actually sorta wanted to run on my computer but couldn't due to it being too old
00:27RaynesShe took deep satisfaction in watching me urinate on myself every 34 seconds.
00:27hiredmantechnomancy: I have yet to get a dedicated parenthesis key working
00:27technomancyhiredman: still hacking the layout configurator?
00:27amalloyno doubt flashbacks to your time as a five-year-old, Raynes
00:27VFeLooked it up, DS4 doesn't use input, but it's apparently a very easy(as in, file swap) software mod to make it detect as a 360 controller in windows.
00:27VFedoesn't use xinput*
00:28RaynesVFe: Well, then it is the best controller ever then
00:28RaynesHands down.
00:28Raynesbitemyapp: You win, my sir.
00:28bitemyappRaynes: I actually beat the first Ninja Gaiden for NES if you can believe it. I've always wanted to beat 2 and 3.
00:29bitemyappVFe: DS4?
00:29VFeDualShock4
00:29bitemyappI'm pretty sure beating NG for the NES puts me somewhere in the elite echelon of "people that beat Nintendo-hard games"
00:30hiredmantechnomancy: there is a dedicated paren key in the extended numeric keypad stuff, but nothing seems to recognize it
00:31bitemyappohhhh yeeeaahhh. this controller is *buttery* smooth for Ninja Gaiden/
00:31hiredmanor maybe I need to re-solder something
00:36Raynesbitemyapp: We can certainly agree that the Ouya controllers suck. :P
00:37RaynesThey're lightweight and feel cheap, and don't work half the time because of https://support.ouya.tv/entries/24496858-Controller-Lag
00:37marcopolo2I'm trying to write an nth equivalent in core.logic, is there anyway I can use a number as an index, or do I have to use a list to represent the number?
00:37RaynesIt's really sad, actually, They put out a console with atrocious controller lag that they did not catch.
00:37bitemyappRaynes: wow, there's a bullet dodged. That would be a deal-breaker for me.
00:37bitemyappRaynes: inputs have to be perfect for me to be happy.
00:37Raynesbitemyapp: I've got one with 4 controllers sitting in front of me that I can't even play.
00:37RaynesIt has to be perfect for anyone.
00:38RaynesNot just you. Any noticeable controller lag is too much for certain (in fact, most) games
00:38bitemyappthat's terrible :(
00:38bitemyappeven a frame or two of lag would make games like Ninja Gaiden unplayable
00:38bitemyappand I know this...because I've tried to play NG with lag.
00:39bitemyappbloody impossible.
00:39Raynesbitemyapp: Ever play the Devil May Cry series?
00:39benkaynight
00:39Raynesbenkay: Goodnight sir.
00:39benkaysorry wrong chan :)
00:39RaynesIt's okay.
00:39RaynesWe wish you a goodnight, my friend.
00:39Raynes:)
00:40bitemyappRaynes: never played any of the DMCs
00:40RaynesMy favorite series of games right there.
00:40RaynesMaybe. Bioshock is up there too.
00:41technomancyRaynes: ever played System Shock 2?
00:41bitemyapptechnomancy: he doesn't need the nightmares.
00:41technomancymuahaha
00:42bitemyappI think anybody that like Bioshock would probably like SS2 if they can get over how idiosyncratic the game is.
00:42Raynestechnomancy: I tried to play the first system shock and realized I wasn't cut out for games that came out less than a year after I was born.
00:42bitemyappRaynes: not cut out how?
00:42technomancyRaynes: the second one is totally different
00:42RaynesI can't work dos games.
00:42RaynesI just can't.
00:42RaynesMy fingers can't handle the controls.
00:42technomancyit wasn't even originally developed as a sequel; they decided that half way through
00:42bitemyappRaynes: yeah SS2 is way more modern.
00:43Raynestechnomancy: Noted, I will definitely play it then.
00:43technomancyI want to play the first one though
00:43technomancyI got my start in stuff like Marathon and Descent, so not having a mouse isn't crippling like it is for kids these days
00:44RaynesI try to play retro games when I can, it's just that they're usually console games.
00:44bitemyapptechnomancy: yeah I grew up with Doom, Duke Nukem 3d, ROTT, Descent, etc...
00:45technomancymarathon 2 is still my favourite, just for the atmosphere coming from the copious amounts of text-driven (and character-driven) plot
00:45bitemyappso I can handle a game that doesn't have a mouse even if I really cut my teeth on mouse-controlled FPSes like Unreal, Unreal Tournament '99, etc.
00:45joshnzDescent 2 co-op FTW! That was awesome.
00:47bitemyappRaynes: okay case in point for Ninja Gaiden 2, the game is already a difficult 2d action platformer and the *second* level already has crazy wind physics throwing me around making it harder to make the jumps *while* getting attacked on all sides.
00:47bitemyappthis is aweeessssoooome
00:49logic_progcan I :require :refer macros the same way I :require :refer functions?
00:49technomancy~tias
00:50clojurebottias is try it and see
00:52bitemyapptechnomancy: I like that.
00:52bitemyappI like it a lot.
00:52bitemyappI need to use that :)
00:52logic_progwait
00:52bitemyappddellacosta: how are you doing?
00:52logic_progwhat is this special trick that I missed
00:52technomancybitemyapp: 50% of the clojurebot factoids I invoke come from #emacs
00:52bitemyapptechnomancy: good theft.
00:52ddellacostabitemyapp: fair. Feeling kinda under-the-weather. Yourself?
00:52bitemyapplogic_prog: the ~tias macro.
00:53technomancy~botstack
00:53clojurebot/me puts lazybot on his head and gropes blindly for a third bot to complete the stack.
00:53technomancy^ case in point
00:53bitemyappddellacosta: found out the new PS4 controller, unlike the PS3, works on PC. Bought one tonight and am using it play old NES games.
00:53logic_progwhat is the tias macro?
00:53bitemyapp~tias
00:53clojurebottias is try it and see
00:53technomancyDude, the preferred nomenclature is factoid.
00:53ddellacostabitemyapp: :-O
00:54bitemyappddellacosta: it's fantastic, works perfectly on Linux. Also, tackled an annoying problem at work today, so pleased with that.
00:54technomancy</butchered-lebowski>
00:54bitemyapptoday's work was 100% open source, feel really good about that.
00:54bitemyappddellacosta: any emulator on Mac OS X should work, I can't speak to specific games. I can try it and let you know.
00:54bitemyappI have a Mac with steam installed that I can try it on.
00:55ddellacostabitemyapp: yeah, Steam is exactly why I want to play games on my Mac
00:55technomancyalso in #emacs they have a ,apropos-dude command for looking up lebowski quotes when you only remember a word or two
00:55bitemyappddellacosta: I'll give it a whirl and let you know.
00:55ddellacostaalthough, considering the amount of time I have available...BWAHAHAHAA
00:55technomancyextra convenient!
00:55bitemyapptechnomancy: *snorts* that's great :)
00:55ddellacostabitemyapp: k, thanks. Will be interested to know.
00:56logic_prog~tias
00:56clojurebotTry it and see! You'll get results faster than asking someone in #clojure to evaluate it for you, and you'll get that warm, fuzzy feeling of self-reliance.
00:58ddellacostabitemyapp: what work problem, btw?
00:58bitemyappddellacosta: I made datomic migrations incremental/lazy: https://github.com/bitemyapp/brambling/
00:58bitemyappyou can see my fear, pain, and hate in the commit log.
00:58ddellacostanice!
00:59bitemyapphttps://github.com/bitemyapp/brambling/commit/21012fb91e24c59aa75a23350a83d0aa0f2f4aa1 dat type error.
00:59bitemyappgotta love it.
01:00bitemyappddellacosta: next step, differential migrations!
01:00bitemyappddellacosta: Some favorite music of mine when I'm feeling sick or down: http://www.youtube.com/watch?v=SFY0hYEqQQw
01:01ddellacostawhat is a differential migration?
01:01bitemyappddellacosta: well when your database isn't mutability based, you can continually replicate transactions.
01:01bitemyappso I just do a diff of origin and dest and ship the transactions over :)
01:01ddellacostabitemyapp: morphine! It's been a while. Used to dig these folks. Tragedy about the main guy passing away so young.
01:01bitemyappddellacosta: god, I know right?
01:02bitemyappMorphine <3
01:02ddellacostayeah. :-(
01:02bitemyapp210mb update? seriously Steam?
01:02bitemyappoh, must be for SteamOS
01:02bitemyappI forgot that existed
01:03ddellacostawowsers
01:06bitemyapphrm, weird. Steam is faster on my slower Linux machine than on my faster Mac.
01:07technomancyleiningen 2.3.4 is out
01:07technomancywill do a proper announcement tomorrow
01:07bitemyappyisss early adopter
01:08technomancyhttp://j.mp/leinnews
01:08technomancynothing terribly exciting
01:13bitemyappRaynes: XInput + PS4 controller: http://www.hardcoreware.net/how-to-ps4-controller-windows/
01:14sm0keany vim users interested in integrating kibit to fireplace?
01:15bitemyappsm0ke: in Emacs-land, that would be a vanilla plugin to be used with flycheck.
01:15bitemyappsm0ke: does vim have a flycheck equivalent?
01:15RaynesNope.
01:15bitemyapplolwut.
01:15RaynesNot nope to bitemyapp. Nope to sm0ke. :p
01:16sm0kewhats flycheck?
01:17ddellacostaRaynes, a thank you while you are here for conch: thank you.
01:17sm0kewhats the big deal in integration? its just a "lein kibit filepath" away
01:18Raynesddellacosta: Happy you like it!
01:18ddellacostaRaynes: been super useful for a side project.
01:20bitemyappsm0ke: well then go for it, nobody's stopping you :P
01:21sm0keemacs users think highly of themselves i see
01:30sm0kelooks like flycheck is similar to syntastic in vim
01:39bitemyappRaynes: http://www.youtube.com/watch?v=zUtnwcv-quE
01:40sm0kehmm weird lein kibit doesnt give me anything
01:40Raynessm0ke: Your code must really rock!
01:40sm0kemy code cannot be awesome
01:40sm0kei am serious
01:41Raynesbitemyapp: Why am I listening to this?
01:43sm0kefinally something
01:43sm0kein a different project
01:43sm0kewow my code is awesome!
01:43sm0keI ROCKKK
01:43marcopolo2(inc sm0ke )
01:43lazybot⇒ 1
01:43bitemyappRaynes: 90s!
01:44sm0kefuck yeah
01:44bitemyappRaynes: because...ALL AROUND THE WOORRRRLD, STATUES CRUMBLE BEFORE MEEEE
01:44sm0kesorry gor carried away
01:44andyfbitemyapp: 1790s or 1690s?
02:19abaranoskybitemyapp: hey what's the deal with the type theory meetup?
02:19abaranoskywhat do they usually talk about at those?
02:21bitemyappabaranosky: category theory, type theory, practical application (how to make their toys work in Haskell)
02:21bitemyappabaranosky: this particular meetup I called out because 1. I'm going to it 2. It's explicitly for noobies.
02:21bitemyappabaranosky: if you look at the description for the meetup, you'll see that they're beginning some introductory material and linked some homework.
02:22abaranoskybitemyapp: cool. I'll take a look at the link
02:23bitemyappabaranosky: I know not everyone shares this opinion, but I'm of the thought that the category and type theory the Haskellers are working on are the "next step" for anybody comfortable with the basics of higher order functional programming
02:25abaranoskybitemyapp: I've worked in Scala and have done *1* 100 line program in Haskell... so my views are colored by those experiences
02:26bitemyappabaranosky: it doesn't really matter, this is the foundational material for anything you'd want to do in any functional language.
02:26abaranoskybitemyapp: I don't know the tradeoffs of using a purely functional system in production
02:26bitemyappnone of that matters in this case.
02:26bitemyappit's just that Clojure doesn't lend itself as well to scaling up the abstractions the way a typed FP language does.
02:26bitemyappminor cultural difference.
02:27akurilinbitemyapp, sounds like an interesting meetup
02:27akurilinwhat time is it? meetup.com won't load for me
02:28bitemyappakurilin: it'd be great if you came too.
02:28bitemyappI should bug seangrove about it as well.
02:28abaranoskyakurilin: I thought that was just my terrible internt conenction :\
02:29akurilinabaranosky, they're probably doing "seamless" updating :P
02:29akurilinhope it's not a thursday
02:29akurilinor you guys better film it
02:29akurilinnot even kidding.
02:29bitemyappakurilin: I think it's Thursday.
02:30bitemyappbecause I'm pretty sure it's set for the 21st.
02:31lgs32acoventry: I am hardly trying to get troncle working
02:31bitemyappmeetup.com isn't loading for me either, lame.
02:32bitemyapplgs32a: hardly as in not at all?
02:32lgs32abitemyapp: excuse my english. i wanted to say it's not easy.
02:33bitemyapplgs32a: not that I'm terribly familiar with Troncle beyond being an admirer, early-stage libraries often aren't meant for consumption by people not comfortable hacking around.
02:33lgs32acoventry: when i run troncle-trace-region nothing happens.
02:34lgs32acoventry: if i try to select a region like in your example i get "sexp ends prematurley"
02:35lgs32acoventry: but aside from that no error message is available in no buffer
02:35bitemyapplgs32a: when you say "nothing happens", you're trying to run the code after setting the trace right?
02:35lgs32abitemyapp: well i do it as described in the readme
02:37coventrylgs32a: I was just pushing changes to the repo, so it might have been in a skewed state when you downloaded it. Looks like I'll have to stop doing that.
02:37lgs32acoventry: nevermind i saw that and i don't expect anything to work at such an early stage
02:37coventrylgs32a: Before you run troncle-trace-region, have you run troncle-set-exec-var or tronce.traces/st?
02:37lgs32acoventry: but i thought before i go down the hard road to debug without any error message, i'd ask you
02:38lgs32acoventry: yes, with c-c t E
02:38bitemyappcoventry: in case you're wondering what I wanted troncle for, I use Emacs macros for local dev, but for tracing code in production, troncle will/would be nice for dumping executing state to a log.
02:38coventrylgs32a: Can you put up an example where you get the "sexp ends prematurley"?
02:38lgs32awell i have defined this silly fn:
02:39lgs32a(defn test-fn
02:39lgs32a [val]
02:39lgs32a (let [v (* 3 val)
02:39lgs32a x (inc val)]
02:39lgs32a [v x]))
02:39lgs32acoventry: if for example i select the let-clause, i get the err-msg
02:39lgs32acoventry: forward-sexp: Scan error: "Containing expression ends prematurely", 16668, 16669
02:39lgs32acoventry: let-form i wanted to say
02:40lgs32acoventry: selecting the whole fn doesnt give me any error msg
02:42coventrylgs32a: Hmm, it's working for me. The logic for choosing the top-level forms to send back for recompilation is one of the last things I changed, so it may well be skew.
02:43lgs32acoventry: hmm. i don't have your patch from 7minutes ago. i will try that now. is the elisp from install-package troncle still up-to-date?
02:43coventrylgs32a: I'm selecting from the paren just before the let to the one just after [v x].
02:43coventrylgs32a: No, you should re-eval the version in the repo.
02:44lgs32acoventry: i will, ty. regarding the selection from the let-form i did the same.
02:44coventrylgs32a: This is a problem with marmalade, actually, it will be hard to get people to update to the latest version, and it's going to change quickly. I can see the reason for melpa, now.
02:45coventrybitemyapp: Thanks for the feedback.
02:47bitemyappcoventry: I keep an embedded nRepl server in our staging and production Clojure instances and tunnel in to do maintenance and debugging periodically.
02:47bitemyappso the notion is that I'd use troncle to slap a trace on something problematic, trigger the behavior or wait for it to trigger, then turn the trace back off.
02:47lgs32acoventry: maybe we should write something that determines in runtime whether the elisp is up to date and comlains if it isn't?
02:48coventrylgs32a: Thanks, that is a great idea. I will do that.
02:48bitemyapphot-spot detailed logging :)
02:48bitemyappcoventry: do you support or plan to support conditional trace logging?
02:48bitemyappcoventry: where one can run a conditional against the arguments and return a boolean?
02:48lgs32acoventry: i'd like to do that if that is not on your priority list #1
02:49coventrybitemyapp: Yes, that is next on the list, actually. Still not sure about the design, but it's definitely needed.
02:49coventrylgs32a: That would be awesome, thank you.
02:49bitemyappabaranosky: http://www.meetup.com/SF-Types-Theorems-and-Programming-Languages/events/149329292/ 7 pm Thursday
02:49pmdehi. can anyone tell me how to do a "field is null" where clause using korma?
02:50bitemyappcoventry: that one feature would make it complete and perfectly awesome for my use-case.
02:50bitemyappcoventry: because then the trace log output would be even more precise.
02:50bitemyappless soup to wade through.
02:50bitemyappwish I could do stuff like this in Haskell :)
02:51coventrybitemyapp: Yes, configuration of the trace output destination is important anyway because you can easily hang emacs by dumping too much to the nrepl buffer.
02:52coventrybitemyapp: Haskell actually has way better tracing facilities. I think the library which really impressed me was hat.
02:53bitemyappcoventry: hum, hat is really good, but I was actually thinking of my ability to tunnel a REPL into a production instance.
02:54coventrybitemyapp: Oh, I see. Yeah, that is very nice.
02:54coventrybitemyapp: BTW, please don't use it in production without checking with me first. I would want to make sure the specific tracing instrumentation you'll be using is general enough first by testing it on a large codebase.
02:55bitemyappcoventry: haha, I won't.
02:55bitemyappI'm brave, but I'll wait for a "stable" stamp to get slapped on it.
02:55bitemyappI'll alter-var-root my own tracing facilities if they're direly needed.
02:55bitemyappor hotpatch a couple log lines
02:56abaranoskybitemyapp: alter-var-:(
02:56abaranoskyI'm going to alter-var-root my alter-var-root to that ^^^
02:57bitemyappabaranosky: I use AOP pretty often, comes with the CL heritage. I don't mind it much.
02:57coventryAnyway, I'm off to bed. I really appreciate the you guys' interest in this. lgs32a: Please file an issue if it still doesn't work.
02:58bitemyappabaranosky: I don't do it in typical production code as a first order pattern, I only use it when I have to. Like in blackwater.
02:58bitemyappAnd you're not supposed to deploy blackwater to production.
02:58bitemyappNot really.
02:58bitemyappUnless you really are too lazy to do your own query logging.
03:39bitemyappRaynes: juuuuust now got to level 3.
03:39ucbbitemyapp: good song
03:40bitemyappucb: Morphine is great :)
03:40bitemyappucb: got a PS4 controller today, best controller for emulators I've ever used. Works perfectly on Linux.
03:40bitemyapphaving a ball with some classic NES Ninja Gaiden 2 :)
03:40bitemyappgoing to bed...now though.
03:40ucbnice
03:40ucbg'night
03:40bitemyappdon't even own the console, just got the controller ^_^
03:40bitemyappucb: g'night!
03:41ucbheh
03:45Raynesbitemyapp: https://www.youtube.com/watch?v=llBEfIfBOvk
03:48andyfIs there some compiler flag that makes def/defn issue a warning if the same var is def'd more than once? Or some modified version of def/defn that do such a thing?
03:49andyfMaybe defonce is close to what I want.
04:07nonubyi was going to ask this as a clojure style guide question, https://www.refheap.com/21047 but there's probably more problematic issues to enlighten me.. thoughts?
04:08nonubyi guess >! should be >!! since it wont be run in go block
04:17broquaintGiven you're blocking on the result of the insert what does the async buy there?
04:22nonubybroquaint, go point, i guess i dont to deref then, but will be realized if i dont deref.. goes back to docs
04:22nonubygo point --> good point
04:23cYmen_amalloy: How does 4clojure generate those "you can now move on to X" suggestions? Have these been added manually?
04:33amalloycYmen_: no, iirc it's the lowest-numbered unsolved problem of the lowest difficulty remaining
04:34cYmen_amalloy: I expected something like that but it doesn't seem that way.
04:34amalloyit might also just be wrong
04:34cYmen_amalloy: Maybe I missed something or have my list sorted weirdly?
04:35amalloythe list is sorted not by problem number, but by number of times solved
04:35amalloy(on the theory that most-solved problems are easiest)
04:35amalloywe should use that sorting for recommendations too, but nobody ever bothered
04:36cYmen_ah...so basically conflicting notions of easiness
04:36cYmen_thanks for clearing that up
04:36cYmen_was bugging me not to know :)
04:37cYmen_amalloy: I take it back I still don't think it's right. :)
04:38amalloyhaha
04:38cYmen_It just suggested a hard problem but I am still working through the elementaries. :)
04:42cYmen_amalloy: I'll try to fix it later. Need to get started with some real projects anyway.
04:44amalloymight not even do the difficulty filtering, i dunno
04:49Jens_DHi
05:24`rand`I'm having trouble with cider 0.3.1 in emacs 24; I'm sure it's my inexperiece. I created a leiningen project to play with macros, so I have (ns macros.core) with a few functions and simple macros. When I load the namespace with C-c M-n, all of clojure.core is inaccessible. I can fix it by adding (:use (clojure.core)), but I thought clojure.core was automatically required?
05:39amalloy`rand`: C-c M-n doesn't load the namespace, it just puts the repl into the already-existing namespace. C-c C-k compiles the current file, so you'll want to do that first
05:44`rand`amalloy: ah, ty. So I can remove the use clause from my ns definition if I compile with C- C-k?
05:44amalloyi wouldn't expect that :use to make a difference either way, really. surprised you've determined it does
05:46`rand`it's probably my setup.
05:59ucbbitemyapp: http://www.youtube.com/watch?v=fq1gb50iobU
08:08bordatouecould any give me a hint on how to create a lazy vector
08:09bordatouecould anyone give me a hint on how to create a lazy vector
08:09tbaldridgebordatoue: there isn't a way to do it with built in Clojure constructs. You can create a lazy seq however and turn int into a vector with vec
08:09tbaldridge,(vec (range 3))
08:09clojurebot[0 1 2]
08:10bordatouetbaldridge: can you write someting tlike (take 1 (vec(range)))
08:11tbaldridgebordatoue: no, since the call to vec will run out of memory. Lazy + indexing (what vectors are) doesn't really work well.
08:12bordatouetbaldridge: programically is it possible to create lazy vectors
08:12hyPiRionyes, but you have to define it yourself
08:13tbaldridgebordatoue: sure, anything is possible.
08:14bordatoueis there any othere construct in clojure that will introduce delay in trival of an element from the list, apart from lazy seq
08:17solussdcore.async question- how do you check if a channel is open?
08:28tbaldridgesolussd: currently the only way is to take from the channel and see if you get nil. We can provide a predicate for this, and I'm going to try to get this added to the api, but I need to talk with Rich about it first.
08:51CookedGryphonbordatoue: have you looked at delay?
08:52CookedGryphonjust wrap every element of the vector in (delay) and then deref it
08:52CookedGryphonit'll only evaluate when it's read
08:52CookedGryphonfor the first time, then cache
08:53tbaldridgeCookedGryphon: I don't think that's what he's looking for. He wants lazy created vectors. At least thats what I would think when I heard "lazy vector"
08:54CookedGryphoni was going off introduce delay in an element from the list
08:55bordatoueCookedGryphon: concept of using a delayed stream is equivalent to a lazy-seq isn't it
08:57bordatoueCan anyone explain how is lazy-seq implemented and how is it different from delay and force
08:58tbaldridgebordatoue: one can think of a lazy seq as a cons list, where the "rest" is defined as a delay and force.
08:59CookedGryphonbordatoue: well lazy seq you assume each element depends in some way on the previous elements and they are calculated in order
08:59tbaldridgethe contents of the cells aren't defined in the delay, the entire tail of the cons cell is defined in the delay
08:59tbaldridgehence the problem with this
08:59tbaldridge,(range)
08:59clojurebot(0 1 2 3 4 ...)
08:59tbaldridge,(vec (range))
08:59clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
09:00bordatouetbaldridge: thanks for the explanation
09:00CookedGryphonvectors tend to be used for random access, so a vector of delays would be a different thing, allowing you to reference things later in the list without having to evaluate everything leading up to it
09:00CookedGryphonbut i don't think i quite know what problem you're actually trying to solve so that may be entirely irrelevant
09:02bordatoueCookedGryphon: I am not trying to solve any problem, I just wanted to understand if it was possible to have an implemenation of lazy-seq using delay and force
09:05vpakHi, can anyone help me? I'm writing unit tests for my first clojure program and need to find out a way to verify the number of invocations of mock function. What is the feasible way to do it? Thanks in advance
09:05tbaldridgevpak: pass the mock function in as an argument to the thing you are testing, then have that function call (swap! some-atom inc)
09:07vpaktbaldridge: thanks for the advice... I thought about such variant, but it looks a bit clumsy. May be there are more elegant ways?
09:07tbaldridgevpak: clumsy, how so?
09:08vpaktbaldridge: the preferred variant would be something like it is done in mockito "vefiry(mock, never()).method(args)"
09:09vpakotherwise I need to declare another atom, do this in (let ...) form, which means more levels of parentheses nesting
09:10tbaldridgevpak: if you are worried about reducing the number of lets in your code...I'm not sure you are approaching the problem the right way.
09:11tbaldridgeanother option, is to have the function you are testing return something that can be tested. The fact that you want to count the number of calls to a function, implies it is performing some sort of side-effect. Perhaps making the tested function pure may simplify testing.
09:12tbaldridgehave one function that does the calculations, and one that performs side effects, and test them individually.
09:12vpaktbaldridge: yes, mocked function saves some entities to repository
09:13vpakwe do not use the result that it returns, so I can't check returned value
09:15tbaldridgevpak: that's what I'm saying, refactor your code and test the processing of the function by testing the data returned. No mock is needed.
09:15tbaldridgeif you don't mix processing with side-effects, things are much simpler to test.
09:31CookedGryphonvpak: you can do what you want in midje, but i agree with tbaldridge that your life will be easier if you test pure functions in the main
09:32CookedGryphonvpak: with midje you can do (fact (thing 1 2) => :whatever (provided (db-call "stuff") => :whatever :times 1))
09:35tbaldridgeCookedGryphon: some would argue if that should be done, even if it can be done :-P
09:44myguidingstarHi all, will the value hold by atom `foo` in this code be garbage collected right after it is executed? (let [foo (atom 0)] (do-something ...))
09:44mikerodWhat is a good way to build a map of map entries, where many of the entries will conflict on keys, so you just want to conj them together into a list when that happens. Example:
09:44mikerod,(into {} [[:a 1] [:b 2] [:a 3] [:a 5]])
09:44clojurebot{:a 5, :b 2}
09:44mikerod=> no good, that just overwrites key collisions
09:45mikerod,(apply merge-with concat (map (fn [[k v]] {k [v]}) [[:a 1] [:b 2] [:a 3] [:a 5]]))
09:45clojurebot{:b [2], :a (1 3 5)}
09:45mikerodsort of works... a little weird
09:45mikerodalso, stack overflows if it is too big I have learned
09:46mikerod,(apply merge-with concat (for [i (range 4000)] {:a [i]}))
09:46clojurebot#<StackOverflowError java.lang.StackOverflowError>
09:46mikerod:)
09:46clgvmikerod: what is the exact problem description? how should you output look like ideally?
09:46mikerod(comp doall concat) works there I suppose...
09:47mikerodkeys -> vectors is fine
09:47mikerodso when there is a collision, I'd like to conjoin
09:47mikerodconj
09:47mikerodbut, initially there is no value
09:47mikerodso, this can be done with reduce
09:48mikerodI'm just wondering if there is a "higher level" way to do it
09:49BobSchackmyguidingstar: so long as you don't have any thing holding onto to it I believe that is the case
09:49myguidingstarBobSchack, thanks
09:50mikerod,(reduce (fn [m [k v]] (update-in m [k] (fn [e] (if (seq e) (conj e v) [v])))) {} (for [i (range 10)] [:a i]))
09:50clojurebot{:a [0 1 2 3 4 ...]}
09:50BobSchacknp
09:50mikerodThat is the most straight-forward way I know to do it
09:50gfredericksmikerod: btw, I think s/concat/into/ solves the stack problem
09:51gfredericksmikerod: and maybe your update function could be replaced with (fnil conj [])
09:51gfredericksor just conj if you don't mind it being a list
09:52gfredericks,(type (conj nil 42))
09:52clojurebotclojure.lang.PersistentList
09:52mikerod,(reduce (fn [m [k v]] (update-in m [k] conj {} (for [i (range 10)] [:a i]))
09:52clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:53mikerod,(reduce (fn [m [k v]] (update-in m [k] conj v)) {} (for [i (range 10)] [:a i]))
09:53clojurebot{:a (9 8 7 6 5 ...)}
09:54mikerod,(reduce (fn [m [k v]] (update-in m [k] (fnil conj []) v)) {} (for [i (range 10)] [:a i]))
09:54clojurebot{:a [0 1 2 3 4 ...]}
09:54mikerodgfredericks: pretty good, I haven't thought of that
09:55mikerodand s/concat/into/ does solve the stack issue. Good point. I guess I like the reduce approach more since it seems more straight-forward instead of making a bunch of mini-maps to merge (if I didn't have maps to start with).
09:55gfredericksyeah definitely
09:55gfredericksconcat vs into is good to know about though
09:56gfredericksthe concat issue is one of the main gotchas with lazy seqs
09:56mikerodthat is good to know. I had to think about it a minute. I've never used into in that way before.
09:56mikerodyeah, the lazy seq problem bit me once now with concat. it was fairly difficult to track down.
10:00prioTrying to recreate a flapjax example in cljs using core.async and was wondering if anyone had any suggestions on how I could do it better? https://gist.github.com/prio/7546572. Atm I am using alt! and two similar but different recur calls as I want it to unblock if a value is out on either channel.
10:05nDuffcoventry: ...well, the most immediate use case is figuring out when a code change will break an interface anyone else (among our >100 active projects) depends on.
10:06coventry2Ah, I get it. Very cool.
10:06coventry2gfredericks: Is there a jira bug for the concat stack overflow problem? I'd like to see how people have tried to solve it.
10:08danneuprio: i think your recurs only looks redundant because you shadow x and y.
10:09danneuprio: even [x'] and [y'] would be more clear
10:11priodanneu: Ok, thanks. I guess there is no function that returns the latest value from an updated channel and the last from every other channel then?
10:11danneuprio: well, your go-loop binding already acts as a ratchet for the last value of other channels
10:12clgvcoventry2: the stackoverflows when using `concat` are due to stacking one lazyseq on another repeatedly until there are as much to overflow the stack
10:12danneuso passing unchanged x and y back into recur is pretty clear there unless i'm missing the mark
10:12clgvcoventry2: usually, do not use `concat` recursively.
10:12danneuprio: or are you saying the code doesn't actually do what you're trying to do?
10:13priodanneu: No code works fine, just wondering if there was a better way to do it
10:13coventry2clgv: There's no obvious recursion in mikerod's example, though.
10:14clgvcoventry2: ah right, in this case it is sequential stacking concats
10:14danneuprio: dunno but that `start` function is pretty clear to me, especially if you changed it to (recur x' y) and (recur x y')
10:14gfrederickscoventry2: yeah I agree with clgv that there's not an obvious problem; the only thing I could imagine doing is having lazy seqs keep track of how nested they are and do some auto-realization if they get too nested; which sounds sketchy
10:15priodanneu: Ok, thanks, good to get another opinion on it.
10:16gfrederickscoventry2: usually when this comes up people are using laziness when they don't need it
10:17coventry2OK. Interesting.
10:18gfredericksI'm starting to realize the `this` arg is often useful with records
10:18gfredericksfor doing updates via assoc/update-in instead of calling the constructor directly
10:18danneui often find myself bike-shedding my own code. -- i have no clue how to refactor some of the truly hard to read clusterfuck, but i'll spend an hour playing with ways to compress the only function i'll understand in 3 days
10:19danneutake those 5 tokens down to 3
10:19danneua maverick
10:34priodanneu: Yeah, know what you mean :)
10:35seangrovebitemyapp: What's the meetup?
10:35seangroveNevermind, found it
10:36seangroveOh, it's at Mixrank? How interesting. Scott is a wizardly fellow, wonder if they've changed their stack in the past few years.
10:41silasdavisI am logging with Timbre. Should I be wrapping a logging statement and the function body in a (do ...) block or is it ok just to put (debug "blah") before the rest of the function?
10:42justin_smiththe body of a function is an implicit do, if that is what you mean
10:43justin_smith,((fn [] 1 2 3 4))
10:43clojurebot4
10:43seangroveWhich is sometimes annoying.
10:44seangroveWould be nice to get a warning, "WARNING: forms 1, 2, 3 in ((fn [] 1 2 3 4)) are dead code"
10:45danneuseangrove: then i couldnt pretend `def` actually has a docstring arg in peace
10:45justin_smithbut it does have a docstring arg
10:45justin_smithdef does not have an implicit do
10:45danneuit does?
10:45danneuoh wait, def is not what i meant
10:46danneudefmethod or something
10:46coventry2seangrove: Sounds hard in general. You would basically need a way to detect pure functions whose results aren't used.
10:46justin_smithdanneu: http://sprunge.us/SMfC?clojure
10:47seangrovecoventry2: Maybe - if primitives/uninvoked-functions, in a list like that passed in a fully macro-expanded form, you could tell it won't be used, right?
10:48danneujustin_smith: i pretend defmethods have docstrings tho
10:48danneuafter the params
10:48justin_smithahh
10:49coventry2seangrove: You could definitely detect unused primitives that way
10:49danneugot no time for ^{:doc _}
10:49justin_smithsounds like a feature request for lein kibit
10:56gfredericksdanneu: that wouldn't work anyways
11:03noncomwhat is the best way to check if a vector is a map entry?
11:04noncomlike ,(vector? [:a 1])
11:04noncom,(vector? [:a 1])
11:04clojurebottrue
11:04noncom,(map-entry? [:a 1])
11:04clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: map-entry? in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:07noncom,(mapv #(= (type %) clojure.lang.MapEntry) {:a 1})
11:07clojurebot[true]
11:07danneugfredericks: haha yeah, youre right
11:07noncomis the only way i can think og
11:08danneugfredericks: so we're left to comments to document defmethods
11:08noncomor
11:08noncom,(mapv #(instance? clojure.lang.MapEntry %) {:a 1})
11:08clojurebot[true]
11:19poppingtonic,(mapv #(instance? clojure.lang.MapEntry %) [:a 1])
11:19clojurebot[false false]
11:21clgvI want to implement a REST service where the calculations might consume some considerable amount of time. It needs to be able to maintain around 4000 such calls. the weberver should not run out of threads that accept those requests. is this possible with ring?
11:21clgvto simplify the description: the REST service is synchronous whereas the calculation the requests trigger are asynchronous
11:22swarthyIf any of the Caribou guys are on now I would love help with this issue I'm having: https://github.com/Kodowa/Light-Table-Playground/issues/907
11:26justin_smithhey swarthy I'm a caribou guy
11:26justin_smithalso we have #antler and try to hang out there (hopefully eventually we will acquire #caribou)
11:27gfredericksdanneu: it's not really clear what the effect of docstrings on defmethods would be; how would they be accessible? where would you see them?
11:28justin_smithswarthy: is the issue that we are requiring too old a version of fs?
11:28justin_smithindirectly I am sure
11:28swarthyjustin_smith: that is what Chris Granger implies in his response
11:28justin_smithI don't even know what fs is, I think it is an indirect dependency
11:29justin_smithfor a workaround you could use an :exclude clause in your project.clj to force the right version to come in
11:29justin_smithI find the lein-pedantic plugin is very helpful for this sort of thing
11:29swarthyIt is a filesystem utility. Caribou.core states that it uses me.raynes/fs, but he had an old version called simply 'fs'
11:29swarthyjustin_smith: I will look into lein-pedantic
11:30justin_smithahh, now I see that, yeah, me.raynes/fs
11:30swarthyhere is the old one on clojars
11:30justin_smithif there is a newer version of fs that does not break our code we should definitely upgrade
11:30swarthyhttps://clojars.org/fs
11:31swarthyi think you have the new one
11:31swarthybut i'm getting that old one instead
11:31swarthysomehow
11:31justin_smithahh
11:31justin_smithso it is not our fault, and here I was ready to be helpful :)
11:31justin_smithlein pedantic will tell you where that version conflict is
11:32justin_smithalong with a bunch of other annoying version conflicts you don't care about, likely
11:32justin_smithalso, it may be easier to just explicitly depend on [me.raynes/fs "1.4.5"]
11:32justin_smiththen do a clean
11:33justin_smithI think lein should do the right thing in that case?
11:35swarthybut isn't caribou.core doing that explicit declaration already? when I do 'lein deps :tree' I don't even see 'fs' in the list, but I do see the me.raynes/fs there.
11:36sjl-anyone know if there's a way to use korma with postgres UUID columns? right now I get https://www.refheap.com/21054 when I try to insert
11:37justin_smithswarthy: I think something else is pulled in first that is getting a different version
11:38justin_smiththat is where explicit deps or :exclusions can help
11:38justin_smithworst case: some dep is :aot compiled with the wrong version
11:38iyouni! fast
11:39iyouni!
11:41solussdanyone using core.async production?
11:41solussdi mean, what could possibly go wrong, right? :)
11:42justin_smithwe have it in clojure and clojurescript code in prod, it's less janky than some of our other deps :)
11:43marcopolo2solussd: I am!
11:43solussdexcellent!
11:43ToBeReplacedi've had the clojure version in production for a few months, but no stream ops
11:43seangroveWe use it in our cljs production code
11:43marcopolo2solussd: using it with my servant library for webworkers https://github.com/marcopolo/servant
11:44marcopolo2which is being used to parrallelize encryption at cryptic.io
11:44solussdoh cool, a webworker lib. *adding to my toolbox
11:45marcopolo2I talked to a couple people at the conj on how we are using clojure at my startup, Cryptic. We just launched our kickstarter campaign today, let me know what you guys think! http://kck.st/I1hFCHon ion
11:45marcopolo2~//kk
11:45clojurebotexcusez-moi
11:45justin_smithI'm using it for an async task pool that resizes images as requested by the template in parallel with template rendering (so response to the client doesn't need to wait on the resize process to finish). This is experimental in a client site now, but should show up in a future version of lichen.
11:51mikerod,(read-string "^{:m true} (assoc {} :a 1)")
11:51clojurebot(assoc {} :a 1)
11:53mikerodwhy do I not see this coming back as (with-meta (assoc {} :a 1) {:m true})?
11:53mikerodI thought this was a reader macro
11:54trptcolin,(meta (read-string "^{:m true} (assoc {} :a 1)"))
11:54clojurebot{:m true}
11:54clgvI plan a `ring` application where approx 4000 request will be made that block for 6-20 seconds. will that work?
11:54mikerod,(read-string "@a")
11:54clojurebot(clojure.core/deref a)
11:55mikerodI expected to see it just return code
11:55mikerodlike @ => deref
11:55mikerod,(read-string "#'a")
11:55clojurebot(var a)
11:55mikerod,(read-string "^:m a")
11:55clojurebota
11:55clgvmikerod: reader literals are expanded by read-string
11:56mikerod^:m is not a reader literal then?
11:56mikerodI thougth it was short hand for `with-meta`
11:56mikerodguess I misinterpret
11:56clgvmikerod: yeah, it is a with-meta at macro expansion time
11:57clgvso the code gets the meta
11:58gfredericksmikerod: reader macros don't always just expand to something else
11:58mikerodso do the values of the metadata map have to be able to be determined at macroexpansion time?
11:58gfredericksyes
11:58gfredericksin fact they're not eval'd at all I don't think
11:59gfredericks,(-> "^{:foo (I am not eval'd)} {}" read-string meta)
11:59clojurebot{:foo (I am not eval'd)}
11:59mikerodI don't think I've ever read that before on the topic
11:59mikerodinteresting
12:02stompyjAnyone here have experience building a REST Api server in clojure, who's brain I could pick for a couple mins?
12:04gfredericksstompyj: probably a lot of people
12:05gfredericks~anyone
12:05clojurebotanyone is anybody
12:05gfredericks~anybody
12:05clojurebotanybody is anyone
12:05gfredericksaaargh
12:05clgvclojurebot: muhahaha you played him! botsnack
12:05clojurebotPardon?
12:05stompyjhahahahahahahahaha
12:11stompyjI'm curious if people have experience with either using compojure/ring + liberator vs using something heavier like luminus and then adding in liberator
12:12hiredmanI would be surprised if liberator is used a lot currently
12:13clgvstompyj: isnt luminus just a big meta dependency to pull in compojure, ring and other libs?
12:13hiredmanI would guess most apis are just ring and compojure
12:13stompyjclgv: pretty much. Half the libs I wouldn't need at all (templating for example), but other things like auth I would need.
12:14stompyjMeh, I should just do ring/compojure/liberator
12:14clgvstompyj: then just start with the dependencies you know you need
12:14gfredericksif my root namespace is "public" that would mean that compojure would (by default) serve my source code (via the resources route) amirite?
12:15stompyjyeah, I'm focused more on speed of dev then anything else
12:15stompyjthanks clgv
12:17zachallauncemerick: Finally gave Austin a fair shot. Great work! Finally a clojurescript repl I can actually recommend to people.
12:18divyansrAny one aware of issue (I am not sure it's issue) why :pre in function definition is not working in lein. I am using version 2.3.2 and clojure version is 1.5?
12:18cemerickzachallaun: hey, thanks, glad it worked out for you. More ease to come. :-)
12:19hiredmandivyansr: most likely you have it in the wrong place, it goes right after the argument vector
12:20gfredericksyes indeed; compojure servers your source code if your namespaces are public.* :)
12:20gfredericksthis will be more of a problem once somebody buys and popularizes the ".public" TLD
12:21stompyjOne other question. Are there any good auth libraries for web services? Is friend still the leader?
12:21hiredmangfredericks: good thing there is already a work around
12:21divyansrI think I have in right place. I typed same thing in clojure REPL it's working but not in lein repl , https://www.refheap.com/21058
12:21hiredmangfredericks: "configure the software"
12:21hiredmandivyansr: you do not
12:21hiredmanthe docstring is in the wrong place too
12:22gfrederickshiredman: that didn't stop people from getting upset about *read-eval* :P
12:22hiredmanas I said the pre/post goes right after the arg vector
12:22hiredmanand the docstring goes right after the name
12:23hiredmangfredericks: *shrug* people
12:23ToBeReplacedstompyj: someone just released a new one for pedestal -- check the mailing list
12:24clgvstompyj: I am using `friend` for authentication in a server ui
12:24gfredericksdo java web frameworks make the same assumption?
12:24stompyjclgv: how have you found it?
12:24gfredericksor does the war spec separate static files from the classpath?
12:25clgvstompyj: after understanding how ring handlers work and finding the right place in the handler chain it works like a charm
12:25clgvstompyj: but I only use the form login workflow
12:28stompyjclgv: ok cool, I'll look into it! thanks! What other libs are you using for your server?
12:29stompyjAlso, lots of clojure libs have German names
12:29stompyjinteresting
12:29gfredericks"clojure" itself is german for "perl"
12:29dee5Hey, could anyone explaint the difference between emacs' clojure-mode, cider, and nrepl packages?
12:30stompyjhahahahahahahahahahahah
12:30clgvgfredericks: that's wrong :P
12:30stompyjgfredericks: that would be amazng
12:30stompyjdee5: I don't know, but I know rom the "state of clojure" thing that most people are using cider
12:30gfredericksdee5: cider is the new name of nrepl.el
12:31technomancydee5: clojure-mode is for static functionality; indentation and syntax highlighting etc
12:32dee5awesome, my understanding is that nrepl is outdated, and cider and clojure-mode can be used together
12:32dee5thanks everyone
12:32technomancydee5: it's not outdated; it still works fine
12:33dee5I didn't mean it in a negative way. I just assumed that cider would have a superset of functionality
12:33stompyjwhats the port of emacs people use on os x?
12:33technomancydee5: it has a few more features but less stability
12:33technomancystompyj: emacsformacosx.com
12:34stompyjLOL
12:34stompyjawesome
12:34dee5technomancy: would you recommend one over the other?
12:35technomancydee5: I'm still using nrepl.el myself; haven't seen a reason to upgrade yet
12:37dee5technomancy: Thanks! Good to know!
12:39technomancybitemyapp: https://mobile.twitter.com/ericnormand/status/402851111066796032 o_O
12:40solussdcore-async question: how can you check if a channel is open (e.g., if I wanted to use a channel being closed as a stopping condition)
12:42seangrovetechnomancy: Similarly confused. Accidental nils and the havoc they wreak cause my jaws to clench.
12:42stompyjOther other very stupid question. If I do a "lein new <template>" command, is there the opposite of that? meaning, a command to delete those same files?
12:42dnolenwowzers https://github.com/aamedina/cljs.core.logic
12:42clojurebotexcusez-moi
12:42hiredman]\
12:43llasramstompyj: Like, rm -rf ?
12:44stompyjllasram: well, yes, that's the "use extreme force" way to do it, I was wondering if there was a gentler solution. :)
12:46justin_smithmove the directory that the template created into the trash bin?
12:48stompyjcool, so manual pruning is the answer
12:48justin_smithI think. I don't know of any lein template defining it inverse
12:48justin_smithso maybe lein new should just return an error if it finds the directory already existing
12:49justin_smithto prevent the one failure case where you fill a pre-existing directory with a bunch of stuff from a template
12:49stompyjyeah, that's fine, I didn't see it in the docs, and wondered if it was a hidden option or something
12:49trptcolinit already does, i'm pretty sure
12:49trptcolin"Could not create directory /tmp/foobar. Maybe it already exists?"
13:01upwardindexWhat could cause (get @a 0) and (get-in @a [0]) to behave differently in cljs?
13:07noncomis there a way to specify exclusions to :refer :all ?
13:07dnolenupwardindex: gist please
13:07joegallononcom: i don't think so
13:08llasramnoncom: No, but if you add an explicit `:refer` form then you can specify `:exclude` for it
13:08noncomwhat you mean "explicit"?
13:10llasramnoncom: Like (ns example.ns (:require ...) (:refer ...))
13:10llasram&(doc refer)
13:10lazybot⇒ "([ns-sym & filters]); refers to all public vars of ns, subject to filters. filters can include at most one each of: :exclude list-of-symbols :only list-of-symbols :rename map-of-fromsymbol-tosymbol For each public interned var in the namespace named by the symbol, a... https://www.refheap.com/21060
13:10noncomi see!
13:12coventry2marcopolo2: Your kickstarter link 404s for me.
13:14BobSchackcoventry2: I think this is the link http://www.kickstarter.com/projects/cryptic-io/cryptic-encrypted-online-storage
13:14podviaznikovstompyj: have you seen https://github.com/clojure-liberator/liberator?
13:19coventry2BobSchack: Thanks.
13:19BobSchackNP
13:29upwardindexdnolen: here is the gist: https://gist.github.com/jsab/7550088
13:33danneuregistered at oracle and this is their country selector: http://i.imgur.com/d8Avbtp.png
13:35dnolenupwardindex: get on JS objects isn't going to work
13:37upwardindexdnolen: In this case, get seems to work, get-in is the one that does not
13:39dnolenupwardindex: get doesn't work on JS objects plain and simple, it does work on JS arrays to maintain parity with CLJ
13:40upwardindexdnolen: ok, i just saw one of your answers on SO, I guess in this case I should use aget?
13:40dnolenupwardindex: or you can extend-type object to ILookup
13:54seangrovebitemyapp: Did the ps4 controller work with the osx emulators?
14:04ToBeReplacedanyone have a general-purpose routing recommendation? i'm looking to dispatch messages coming off of a channel to different functions depending on the content
14:05ToBeReplacedi'd like it if the routing information was data as well
14:07pbostromToBeReplaced: multimethod?
14:11marcopolo2coventry2: darn
14:11marcopolo2how about this: http://kck.st/I1hFCH
14:14coventrymarcopolo2: Thanks.
14:16ToBeReplacedpbostrom: yeah. :). silly me
14:22stompyjpodviaznikov: yeah, this is what I'm going to be using
14:26gfredericksTIL you can use get with arrays
14:47TimMchuh
14:47TimMc&(get (into-array (range 10 20)) 3)
14:47lazybot⇒ 13
15:05stompyj&(get (into-array (range 10 20)) 3)
15:05lazybot⇒ 13
15:06stompyj&(take 1 '(1 2 3 4))
15:06lazybot⇒ (1)
15:06stompyjinnnnteresting
15:28oli`(+ 1 1)
15:28clojurebot2
15:31gfredericks,(* 2 3 7)
15:31clojurebot42
15:33sritchiecemerick: around?
15:34cemericksritchie: off for a run shortly, but shoot :-)
15:34sritchieI'm doing a json auth workflow,
15:34sritchieslightly different than the one floating around the internet;
15:34sritchieand finding that if I return redirect false, I'm not getting any Set-Cookie goodness in the response
15:34cemericksritchie: gist, pls?
15:35sritchiesure, one sec
15:36sritchiehttps://gist.github.com/sritchie/7552129
15:38sritchiecemerick: actually, even setting redirect-on-auth false for the interactive login form gets the cookie
15:38cemericksritchie: oh, you mean twiddling :redirect-on-auth? to false produces no cookie?
15:38sritchiemust be something about the way I'm returning the auth map..
15:39sritchiecemerick: in the json workflow, yes
15:39sritchiein the interactive-form-workflow, on change
15:39sritchieno change*
15:39sritchielet me stare at it again...
15:40sritchiecemerick: friend authentication routing as a function of route, request type and content-type can get pretty messy
15:40sritchiecemerick: would love to see some best practices
15:41cemericksritchie: I think you may be inventing them :-P Not a lot of requirements for / experience with content-neg on auth floating around.
15:41sritchiegotcha
15:41sritchiedoing a JSON version for an iOS app now
15:42cemericksritchie: OK, pretty certain that's a bug. Can you file a ticket?
15:42seangroveOk, I think I might have some ideas for sane cljs ui templating
15:43sritchiecemerick: sure, will do
15:43seangroveReally, we can copy some of the ideas from html/xaml, and just extend the hiccup format with standard controls. [:dropdown [:menu-button "One"]], etc.
15:43sritchiemaking sure I have it all understood, though...
15:44seangroveAnd then libraries can provide implementations of transformations for the :dropdown, :menu-button, etc. primitives and compound objects
15:44cemericksritchie: the basic problem is that setting that false will end up never touching the :session, thus no cookie. You're needing a 200 response to keep e.g. XHR from failing on an initial login req?
15:44sritchieyeah, I just don't want to redirect on the JSON api version of these routes
15:44sritchieso hitting unauthorized gives you a 401
15:44cemericksure
15:45seangroveAssuming some subset of widgets are common across all libraries, it allows abstracting some of the frameworks (bootstrap, clojure ui, etc.), but still providing specialized transforms for specific libraries
15:45cemericksritchie: def. a bug, should be a quick fix. I'll look at it tonight. Still open the ticket though so I remember. :-)
15:45sritchieokay, thanks man
15:46seangroveThen, UI's are declarative data structures. At least to get started.
15:46seangroveI suppose then the challenge is behavior and mutability. But I'll come to that later. Liking this initial idea.
15:49seangroveWould love to hear thoughts from people experienced with xaml and (especially) IB
15:49seangroveI don't think there's a huge overlap in here, sadly
15:50ibdknoxseangrove: you're basically talking about web components, take a look at polymer
15:51seangroveibdknox: I suppose I am, actually.
15:51seangroveGood point, thanks.
15:57tbaldridgeseangrove: I've worked longer than I would have liked with XAML. I agree the declarative portions of it are awesome. Doing it without mutability is the hard part. The whole databinding part of it is a major pain in large projects.
15:58seangrovetbaldridge: Just thinking about at least getting the ui as a clojure data structure and transforming it like any other data structure.
15:58seangroveI haven't worked with xaml almost at all though, just heard that it had some good idaes
15:59tomcWould anyone mind helping me out with some leiningen troubles?
16:00tbaldridgeyeah, it's pretty sweet. One of the core ideas though is that you can do stuff like bind a list box to a mutable list. Add something to the list and it magically appears on the screen. Declarative UI, FTW! However now you have mutability in your ui, and its easy to have race conditions and the like.
16:01tbaldridgeseangrove: YMMV however, I was dealing with a very complex set of rules.
16:02tbaldridgeseangrove: keep an eye on pedestal as well, I've seen some people do stuff like this with pedestal. Also, QT's declarative language does stuff a lot like this.
16:02seangrovetbaldridge: I'm thinking a lower-level, declarative ui layout with composable widgets, and generic, extensible behavior with callback+channel apis
16:02seangroveBut yeah, the elephant in the room is always how you make mutability explicit and handled
16:03seangroveNot super interested in data-binding as much as channels-based api, something data-binding could be built on top of
16:05hyPiRiontomc: just ask them, if someone knows it they usually reply if they are on
16:05seangroveI'll admit it's pretty fuzzy and hand-wavey though. I'm just hating all this client-side ui work, and pretty eager to move it all up a layer or two
16:09tomcThanks hypirion. I'm having problems with cljx, and not sure where to look for a solution. If I try to run lein cljx once to 'compile' my cljx files to clj + cljs, I get a compilation error - FileNotFound. It appears as though lein is trying to compile my clj before cljx has had a chance to write the file. Is that the way lein works? Compile the project, then run the current task?
16:09handojinanybody know why you can't add nil values to a datomic database?
16:10tbaldridgehandojin: because then you couldn't tell if an attribute exists or not. and also because its that way by design
16:10marcopolo2dnolen: ping
16:12handojinhmmm - not sure i understand
16:13handojinthe attribute exists (e.g. user/age)
16:13TimMctbaldridge: "because its that way by design" ...
16:13handojinbut the value is unknown (null/nil)
16:13hyPiRiontomc: no, that shouldn't be the case if I know right. Unfortunately I don't know how cljx works, but I would attempt to look at the documentation (if it's good enough)
16:14hyPiRiontomc: maybe this may help you? https://github.com/emezeske/lein-cljsbuild/tree/1.0.0/example-projects/simple
16:16tbaldridgehandojin: the problem is basically that datomic treats these as the same {:some/attr nil} {}
16:17tbaldridgehandojin: it's a design decision, if you want an attribute as nil, just don't save the attribute in the first place. In datomic, all attributes (except :db/id) are optional. So if a value is nil, just don't assert the attribute
16:17tomchypirion: thanks for the example. I actually had a working project.clj, but then I ran lein clean, and then my trouble began. My hacky solution was to remove references to the cljx namespace, compile, then add those references back in... good enough for now.
16:17dnolenmarcopolo2: pong
16:17bitemyap1tbaldridge: I agree with that decision by the by, I explained it to my coworkers recently.
16:18bitemyap1tbaldridge: I don't think having a distinct "attribute exists but is nil" state between "attribute is not asserted" and "attribute is asserted and has this value" is a good thing.
16:18bitemyap1it eliminates ambiguity and keeps people from doing something insanely stupid in terms of embedding some kind of implicit intermediate state to their data model.
16:18tomchey @piranha, are you the same piranha behind pump?
16:18hyPiRiontomc: whoops, sorry. I realized that that one was cljsbuild, not cljx. Anyway, good to know that you found a workaround. If the problem persists, I would suggest creating an issue at github
16:20tbaldridgebitemyap1: agreed, if I saw Clojure code that made a difference between (nil? (:foo {})) and (contains? :foo {}), I'd call it a major code smell.
16:20handojin@tbaldridge ok - more or less Chris Date's position re: null in dbs then?
16:20tomchypirion: I was actually seeing the issue w/ cljsbuild as well, which leads me to suspect its a lein issue. I don't necessarily think its an issue in the 'bug' sense, just something must be wonky with my setup. I'll ask for help from the lein folks if the problem persists. Thanks for the help.
16:21hyPiRiontomc: if you ask the question in #leiningen and is on IRC for some time, I may have time to look at it
16:21bitemyap1tbaldridge: ditto. I've seen people do stuff like that in Python and I took a flamethrower to that code.
16:21hyPiRionnot right now though, but later today
16:22tomchypirion: great, i'll do that.
16:22tbaldridgehandojin: I'm not familiar with Chris Date. But from what I just read via google, I'd probably agree.
16:22hyPiRiontomc: you could also ask on the Leiningen mailing list
16:24handojinso the appropriate way of dealing with a large dataset containing null values would be to filter them out (or replace them with some sensible value) prior to transacting?
16:25marcopolo2dnolen: I know that kid @taoeffect, he goes to my school. He's pretty annoying, I'll make sure to slap him for you :P
16:25dnolenmarcopolo2: haha :)
16:25dnolenmarcopolo2: his point about externs is actually a good one
16:25dnolenhttp://dev.clojure.org/jira/browse/CLJS-686
16:25dnolenfor anyone who wants to contribute to some low hanging fruit
16:25marcopolo2dnolen: well that's surprising...
16:25technomancyI think he's one of the guys who posted a "let's do a paren-free clojure syntax" proposal a few years ago
16:26dnolentechnomancy: same guy
16:26marcopolo2really?
16:26marcopolo2wow
16:26mybuddymichaelDoes anyone know if the address at http://clojure.org/contributing is still valid?
16:26marcopolo2Now I'll have to beat him up ;)
16:26dnolenmybuddymichael: it is
16:26s_kilkhi all, i've just come across a strange issue with the selmer library while running a compojure app on fedora. everything works ok, except for one <img> tag being completely missing from the rendered page. it's simply not present in the output html. works fine on ubuntu though. anyone heard of an issue like this before?
16:26mybuddymichaeldnolen: Great, thanks.
16:27justin_smiths_kilk: that sounds weird - if you make an uberjar on one, does it keep the same behavior when you run it with java -jar on the other?
16:28bitemyap1s_kilk: version of Selmer?
16:28s_kilkah, will try an uberjar. also just spotted that i was using selmer 1.4 , will also try updating to 1.5
16:28bitemyap1s_kilk: there is no Selmer 1.4 or 1.5
16:28bitemyap1s_kilk: the current version is 0.5.2
16:28s_kilksorry, 0.4 and 0.5 :)
16:29bitemyap1s_kilk: upgrade first, *then* try the uberjar.
16:29s_kilkwill try it with 0.5.2
16:29bitemyap1why do people always leave? weirdos.
16:30TimMcShort-timers, man.
16:31TimMcIt's even worse in low-traffic channels; "Anyone here?" and then 30 seconds later they're gone.
16:33bitemyap1TimMc: anti-cancer of IRC.
16:36TimMcNah, they're teachable.
16:37TimMcA lot of these folks are perfectly intelligent and reasonable, they just don't understand the communcication model of IRC.
16:38bitemyap1TimMc: oh, I didn't mean in a permanent sense.
16:38bitemyap1TimMc: I think people in general have a really hard time with asynchronous communication models. Email was nice in part because it forced people to accept the async.
16:41shane_khi all, I've upgraded to selmer 0.5.2 and still have the problem with the missing img tag. also tried building an uberjar and it has the same problem.
16:41bitemyap1shane_k: time to paste examples. use refheap.
16:42justin_smithshane_k: my suggestion was to see if, since server a and serve b have different behaviors, if an uberjar built on a changes behavior when run on b
16:43shane_kwell the specific problem is in this file here : https://github.com/ShaneKilkelly/warbl/blob/master/src/warbl/views/templates/profile.html , the img tag on line 6 is simply not present in the output. i've tried just putting in any old url in there and that works ok. the exact same project also works fine on ubuntu linux.
16:43shane_kjustin, good call on building on one server and testing on another. will give that a try.
16:43shane_kit's a dual-boot laptop with ubuntu and fedora, so it's a bit awkward going back and forth :)
16:44justin_smithahh
16:44justin_smithare they using the same directory and just different jvms?
16:44justin_smithdo they share the same ~/.m2 directory?
16:45TimMcbitemyap1: http://clojure-log.n01se.net/date/2011-03-24.html#15:34
16:45shane_kit's the same project checked out from git. i had been developing on ubuntu, then today i got the urge to try out fedora, and hit this problem. no, the two partitions don't share any common resources. they're two separate disks
16:45shane_kand i tried blowing away the .m2 directory too
16:45justin_smithhow about lein clean?
16:46shane_kwill give it a go
16:46justin_smithsometimes it caches compiled stuff inapropriately
16:47akurilinIs there an interpolated alternative to pprint/println ? I'm wondering if everybody just does manual concatenation with str or if people use something like cl-format pretty actively.
16:48shane_knope, still nothing. it seems to be only image tags which have some value interpolation involved which are affected. i can hard-link to an image and it works ok. any attempt to dynamically insert a src value fails to render the img tag at all.
16:48llasramakurilin: printf / format ?
16:50handojini've decided to just suck up learning cl-format - more efficient in the long run
16:50akurilinllasram, cool, so these are basically wrappers around java's system.out functions with same name?
16:50llasramLet's ask the bots!
16:50llasram,(source printf)
16:50clojurebotSource not found\n
16:50llasramhaha
16:50llasram&(source printf)
16:50lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
16:50llasramWelp
16:50gfredericksakurilin: not quite, they go through *out*
16:50llasramSome other time then
16:51gfredericks,(str "foo" (with-out-str (println :bar))) ;; which enables this and other stuff
16:51clojurebot"foo:bar\n"
16:51justin_smithprintf calls String/format and sends it to print
16:51hyPiRion$source printf
16:51lazybotprintf is http://is.gd/YWGnui
16:51llasramAh
16:51gfredericks,(->> :bar println with-out-str (str "foo"))
16:51clojurebot"foo:bar\n"
16:52akurilinok cool, so printf seems pretty good for the job
16:52akurilinthere are just so many ways of printing something :)
16:53akurilinActually, printf for the generic interpolated string. pprint for nicely formatted data structures. What else should I be really comfy with?
16:53rasmustoakurilin: this is a bit more niche, but I like print-table
16:54bitemyap1my twitter account is currently proof that I am not the grumpiest person on the planet
16:54bitemyap1that honour belongs to Mr. Zed Shaw
16:54TimMc+1
16:56hyPiRionakurilin: learning clojure.pprint/cl-format is worth it, imo.
16:56technomancyyou never know when you'll need to output roman numerals =)
16:56akurilinhyPiRion, I figured that was what true believers used :P
16:56hyPiRion,(require '[clojure.pprint :refer [cl-format]])
16:56bitemyappI haven't missed it much.
16:56clojurebotnil
16:57rasmustotechnomancy: is that where those 4clojure problems come from? :o
16:57technomancyheh
16:57hiredmanI seem to have forgotten to include underscore in this keyboard layout
16:57hyPiRion,(cl-format nil "~{~@R~^, ~}" (range 2 30 3)) ; most useful thing in the world
16:57clojurebot"II, V, VIII, XI, XIV, XVII, XX, XXIII, XXVI, XXIX"
16:58technomancyhiredman: that should save your from writing ruby
16:58technomancyok, so
16:58technomancythe clojure compiler not even bothering to *check* to see if your ns not found error was due to a dashes vs underscore problem
16:59technomancyhorrible disregard for time spent by humans or egregious slap in the face?
16:59gunswhy not both?
16:59hiredmanor rich just trying to get a feature done, and no one ever opening a ticket afterwards?
16:59technomancyguns good point
16:59poppingtonicI'm getting the feeling that the creation of closures is related to currying in some sense...
16:59TimMcHah, open a ticket for that?
17:00TimMcHe'd slap that down as a waste of time in 2 seconds flat.
17:00technomancyhiredman: I'll open a pull request
17:00hyPiRiontechnomancy: print it on a paper and mail it with you CA
17:00hyPiRionyour*
17:00rasmustopprint*
17:01hiredmanTimMc: there is one way to know for sure
17:01technomancyhyPiRion: I've already sent mine in, so I'll let you take it
17:01hyPiRiontechnomancy: but I've also sent my in
17:01jballanctechnomancy: I, for one, would have been saved at least 4-5 hours of my life if that check happened
17:02hiredmanjballanc: has some one opened a ticket in the clojure jira for you?
17:02jballanctbh, I never really considered it ticket-able
17:03jballancI guess I just figured "well, it's still not as bad as Java's abuse of the FS"
17:03hiredmanjballanc: would you like me to open a ticket?
17:03jballancsure :)
17:03hiredmanif not too bad, I am doing it anyway
17:03jballancI can vote at least
17:03jballanc(still need to send in my CA...one of these days)
17:05technomancythe crazy thing is iirc openjdk+oracle work fine with dashes; it's just technically not in the spec
17:07jballancDoes Rack not have an equivalent of Rack's config.ru or WSGI's wsgi.py file?
17:07hiredmanhttp://dev.clojure.org/jira/browse/CLJ-1297
17:07handojinhttp://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node200.html
17:07jballancs/Rack/Ring/
17:07handojinsee table 28-8
17:07hiredmanpriority "Major" as always
17:09gfrederickshiredman: as somebody who hasn't read the entire IRC discussion, I can't tell from the ticket what the use case is here. Is it (require 'foo.bar_baz) for ns foo.bar-baz?
17:09technomancygfredericks: it's for creating foo/bar-baz.clj files
17:09gfredericksah right
17:09technomancyhuman failing to work around stupid limitations in the JVM
17:09gfrederickssurely that would have been my second guess
17:09gfredericksthe "in filenames" part of the ticket title is a bit ambiguous I guess
17:10technomancyI really wish the disconnect was between .clj files and .class files instead of between the ns name and the .clj file name =\
17:10technomancyjust feels like the line was drawn at the wrong point
17:10jballanchiredman: voted :)
17:10technomancyprobably too late to do anything about it though
17:11jballanctechnomancy: but honestly, how often does ns loading happen in the running of a production app?
17:11jballancwhat would be the *real* cost of just checking for both underscore and dash versions?
17:11jballanc:-/
17:12technomancyyeap
17:12TimMc(inc hiredman)
17:12lazybot⇒ 27
17:13bitemyapphttps://github.com/edn-format/edn#symbols seems to forget things like < and >
17:14gfredericks bitemyapp: yeah I asked about that the other day; I convinced myself it was intentional
17:14bitemyappgfredericks: impossible, you need < and > for use in Datomic with edn queries
17:14gfredericksI noticed it because the haskell edn parser won't take those chars
17:14gfredericksbitemyapp: that's an interesting point
17:14bitemyappwe're adding it to the Python parser and PR'ing
17:18gfredericksdoes the edn spec have its own jira?
17:19gfredericksif it's not code are there still licensing concerns?
17:19bitemyappit needs PR'd
17:19bitemyappI found an example of usage of < on the Datomic main tutorial page
17:20bitemyappso it's clearly an oversight
17:20gunsAnother ambiguity is "alphanumeric" characters in symbols; LispReader basically accepts anything,
17:20gunsJava identifiers can be any Unicode character
17:20gunsbut I've been told that Clojure symbols are ASCII only
17:20hiredmantold by who?
17:20gunsmeikel brandmeyer
17:20hiredmanfeh
17:21hiredmanso, like, some guy on the internet said it
17:21gunshe says Rich said this in this chat room years ago
17:21gunsbut he certainly isn't enforcing it
17:21technomancywell there's a big difference between the "spec" vs what happens in practice
17:22TimMcEspecially when there isn't a spec.
17:22bitemyapp,(let [да-аскии-онли 1] (println да-аскии-онли))
17:22clojurebot1\n
17:22technomancyyeah, would be surprised if it suddenly started throwing on those
17:22bitemyapptotes ascii only bro.
17:22gfredericksand that recent ML discussion about what-it-was suggests the spec eventually loosens
17:22gfredericksnumeric keywords
17:22technomancygfredericks: yeah, better to commit to a narrower scope and broaden it later than the other way around
17:24indigobitemyapp: Lol, love your symbol name
17:24hiredmanmy #clojure log which starts in december of 08 has no relevant hits grepping for rich and alpha
17:25hiredmanwhich is not to say he didn't say that, but it start to look unlikely
17:25technomancyhiredman: well, plenty of synonyms he could have used
17:25bitemyapplike...ASCII
17:25hiredmanoh, of course, I used the wrong nick
17:25hiredmanrhickey
17:25technomancyhiredman: it's been so long =)
17:26technomancyI like how chouser's log has his words in red
17:26bitemyapptechnomancy: LOL
17:27gunshiredman: https://groups.google.com/forum/#!msg/vimclojure/OWSZWioTU6E/gE2z7HKXBoAJ
17:27indigoAnd His words shall be highlighted in red
17:27gunsI guess he didn't mention the chat room
17:31hiredmanhttps://gist.github.com/hiredman/7553770/raw/cbcb9b394d02d823d64391bcf4c47cd532603afa/gistfile1.txt
17:32gunsagain, "alphanumeric" :)
17:33hiredmanhttp://clojure-log.n01se.net/date/2009-01-11.html#08:50a
17:34hiredmanguns: again, but not even clojure.core follows what he says there
17:34technomancyclojure.core: above the law
17:34technomancyjust like Batman
17:34bitemyappindigo: glad you liked it.
17:34hiredman> and < abound in common usage
17:35pjstadigalso the snowmen ☃
17:35gunsit's true; for my part, I will continue to happily use τ, λ, Σ, etc in private code
17:36justin_smiththe real trouble is zalgo identifiers, so you can't even tell what line number they are on
17:37technomancyyou'll never take my page breaks away
17:37technomancywhitespace be whitespace, mon
17:38gunsbah emacs
17:38gunsjk
17:38rasmustoheh
17:38technomancypage breaks love you no matter your editor
17:39gunsdo you write GNU info pages for your unix programs, technomancy?
17:40bitemyappI really like GNU info pages.
17:40bitemyappman pages are fine too.
17:40technomancyguns: haha; I don't got that far
17:40guns:) just curious
17:40technomancybut texinfo is nicer than troff for authorship
17:41technomancyI am generally in favour of hyperlinks, as it is
17:41bitemyapptechnomancy: who isn't?
17:41technomancybitemyapp: people who hate info?\
17:42bitemyappthey are silly people and not to be taken seriously.
17:42technomancyyeah, I prefer `foo --help` for quick non-hyperlinked reference
17:44gunsWhen people ask me about the last novel I've read, I tell them the bash man page.
17:45jjidodon't they look at you with pity at this point?
17:45gunsConfusion; I do feel pitiful however
17:45technomancyhehe
17:46jballancoh god...I once had to write a full, very detailed man page by hand
17:46technomancyI like the twist ending in `man sh`
17:46jballanc...sometimes I still get flashbacks
17:46technomancyit's actually dash!!!
17:46technomancy^ spoiler alert; sorry
17:46jjido:-)
17:47hyPiRiontwist ending? That's the first word in the man page
17:47pjstadigtechnomancy: ugh
17:47pjstadigi used to have to install oracle on linux
17:47pjstadigand that was a problem
17:48pjstadigbecause the oracle install script used bash features even though it started with #!/bin/sh
17:48pjstadigwhich of course actually used dash
17:48technomancypjstadig: my condolances
17:48pjstadigwhich wasn't bash
17:48rasmustoI did `man /bin/bash`, there's actually useful info in there :P
17:48jjidopjstadig: to my recollection even Solaris didn't use bash for /bin/sh
17:49heizHello! I'm new with clojure sequences. I need to iterate over bit vector in lexical order. I mean I need to generate seq like [[0], [1], [0 0], [0 1], [1 0], [1 1], [0 0 0], .... How can I do it with clojure?
17:52jjidoheiz haz gone
18:03Raynestechnomancy: https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/17896d446b18eaab9fd4c07d1b0e1ea8/tumblr_mtj3oz164M1rephako1_500.jpg
18:04technomancyRaynes: augh
18:13rasmustoRaynes: a travesty
18:15rasmustooh whoa, how do I deal with passing anonymous functions into a memoized function? Will they just miss the cache?
18:17hiredmanunless you pass in the same one
18:17rasmustohiredman: I tried passing in the same one and it took a while :s
18:17rasmustoLet me drop in a side-effect and make sure
18:17hiredmanrasmusto: same as in the same instance?
18:18hiredmannot the same as in, alpha equiv, or whatever
18:18rasmustohiredman: same instance afaik
18:18hiredmanliterally the same object in memeory, fns have pointer equality
18:18rasmustoyeah, same pointer
18:20rasmustohiredman: I can eval the symbol for my function and its the same thing every time
18:20rasmustoand I pass in that symbol to my memoized function
18:20rasmustoand it'll print side-effects each time (miss the cache)
18:21hiredmanhard say, because functions don't have symbols
18:21hiredmandid you have a gist?
18:21rasmustohiredman: let me scrub one up really quickly
18:25rasmustohiredman: https://www.refheap.com/21066
18:25amalloy&(let [f #(inc %), m (memoize #(println (% 1)))] (m f) (m f))
18:25lazybot⇒ 2 nil
18:25rasmustoI figured out my mistake, I had an anonymous function (as a separate arg)
18:27rasmustoamalloy: gotcha, my "f" was being created each time, so the pointer disappeared (obviously)
18:27podviaznikovstompyj: I also feel that it is good way to go. I never used it by I'm planning to use it. Do you have some particular questions about REST API development?
18:28amalloyright, rasmusto, that's what hiredman was warning you about
18:29rasmustoamalloy, hiredman: thanks :). I ran my self in a few circles before I saw that my function took two functions as arguments
18:30rasmustoso are functions only comparable by their pointers?
18:32amalloyyes
18:33hiredmanunless you want to write a core.logic program using noms to compare the source
18:33rasmustois that a JVM-specific thing?
18:33rasmustohiredman: I was thinking of something along those lines
18:33rasmustoit'd have to do a reduction/normalization on the function
18:33rasmusto(source that is)
18:33hiredmanrasmusto: what equivilance is there for functions that isn't horrible?
18:34hiredmanthe answer is none, so they get reference equality
18:34rasmustohiredman: well, in my specific case I had functions that compared two numbers, so I could reason about it
18:34rasmustohiredman: point taken though :)
18:34mtphiredman, we can just simulate both functions in separate sandboxes, and tell if one halts!!
18:34mtp(heavy sarcasm implied)
18:35amalloyrasmusto: what, by running each of them on all existing numbers, and seeing if they return the same thing every time? that's probably going to put a dent in your memoization speedup
18:35rasmustoamalloy: well, what if I limited the domain?
18:36rasmusto(just bouncing ideas around)
18:36hiredmanamalloy: obviouslly you precompute a table
18:36hiredmanstore it in s3
18:36amalloyrasmusto: i think if you're limiting the domain to anything small enough that comparing for equality is plausible, you should replace the functions with maps
18:36rasmustohere's one of the mission-critical functions that I used #(< % 3)
18:36technomancyhiredman: just because clojure doesn't attempt to compute function equivalence doesn't mean it can't be done in many cases
18:36rasmustoamalloy: maps in s3?
18:36amalloylike, f is just {[0 0] true, [1 0] false, ...}
18:37hiredmanhttps://github.com/clojure/core.logic/wiki/core.logic.nominal
18:37amalloyhiredman: now he's taking your crazy ideas seriously, what have you done
18:37rasmustoah yeah, this was a good presentation at the minikanren conf :)
18:37dnolenhaha
18:40hiredmanrasmusto: oh yeah?
18:40hiredmanrasmusto: was that the conf attached to clojure/west
18:41rasmustohiredman: yeah, it was a few hours one evening of it
18:41rasmusto(and was originally a twitter joke)
18:41hiredmanI didn't see a video covering the nominal stuff on infoq for it
18:42rasmustohiredman: I'm not sure if any of it was filmed
18:42hiredmanwell, I seem some stuff like, uh, whatever that haskell minikanren
18:43hiredmanhttp://www.infoq.com/presentations/molog
18:43rasmustocool, I'll check it out :)
18:44rasmustohiredman: https://github.com/namin/minikanren-confo
18:44hiredmanAh
18:44hiredmanthanks
18:45rasmustopulled the link from the minikanren.org clojure/west section
18:46glosoliAre there some other micro alternatives to compojure ?
18:47technomancyglosoli: there's moustache (not the templating lib), but it doesn't really offer anything that's not in compojure
18:48benediktlein-droid fails at building my project when i add [clj-http "0.7.7"] to the dependencies-map in project.clj. The error is Compiling cheshire.jsonp: Exception in thread "main" java.lang.ClassNotFoundException: javax.json.Json, compiling:(jsonp.clj:1:1)"
18:48benediktbuilding a vanilla lein projet with clj-http works fine
18:49glosolitechnomancy ah not worth checking probably then
18:51benedikthttp://stackoverflow.com/questions/11346180/servlet-java-lang-classnotfoundexception-org-json-simple-parser-parseexception # i found this, added the jar to a dir in the project and the dir in the external-classes-paths in project.clj
18:53hiredmanbenedikt: most likely the android runtime is missing that class, while it is included in a real jdk
19:06benedikthiredman: is there anything i can do about it?
19:07hiredmanbenedikt: dunno, I am just guessing
19:09hiredmanI am guessing that the error is because in the translation process from jvm bytecode to dalvik bytecode the class goes missing
19:09benedikti figured the same thing and found the jar for it, references with external-classes-path but no luck
19:09benedikti might have the wrong jar though
19:17scott__can anyone kindly recommend an example github repo that is essentially a 'wrapper' around a 3rd party Java library? fairly new to clojure; looking for references to learn from...
19:21newblue scott__: if you count Swing as a 3rd party library then https://github.com/daveray/seesaw
19:23scott__@newblue: thanks. I have a 'simple' java library (few files; 3 classes) I'd like to wrap
19:24scott__looking for good examples as to how to go about htat
19:25scott__seesaw looks a bit overkill as a 'learning reference' but I'll figure it out..
19:26Raynesscott__: https://github.com/Raynes/cegdown
19:26RaynesDoesn't get a whole lot similar than cegdown.
19:29scott__thanks Raynes. perfect.
19:31amalloyscott__: why bother wrapping it? like, three classes is really fine to Just Use from clojure
19:32amalloyobviously it depends a bit on how unpleasant the API is
19:33bitemyappucb: http://anautumnforcrippledchildren.bandcamp.com/album/try-not-to-destroy-everything-you-love
19:35dbsrhey all, i have never used windows before to run python scripts, now i am and im getting a lot of zerio lenght field name errors
19:35ucbbitemyapp: enqueued for tomorrow
19:35dbsreg, i need to use '{1}'.format('foo')
19:35dbsrinstead of {}
19:35dbsris this windows? or an old python version
19:35rasmustodbsr: check out #python :)
19:35dbsrow
19:35dbsrmy bad
19:35dbsrthought it was :d
19:35scott__amalloy: been playing with calling classes directly via Interop; partly its an exercise for me to learn to use idiomatic clojure.
19:36bitemyappucb: <3
19:36scott__partly the API has interfaces to implement ... just 'learning' the best way to implement, really.
20:15lgs32acoventry: have you had a chance to review my pull request?
20:54SegFaultAXbitemyapp: Somehow, I think you'll really appreciate this: http://www.youtube.com/watch?v=ScgFIKXKFkc
21:10bitemyappSegFaultAX: I need to get out of California.
21:11bitemyappSegFaultAX: we could make things machine make it for us the community the city the san francisco put them in the stores they have slaves made in china but on the west coast new west coast we believe small business owners every fruit and vegetable trees
21:11bitemyappbecause it's free
21:13Raynesbitemyapp: Did you suddenly just become a markov chain?
21:13bitemyappRaynes: watch the video.
21:18SegFaultAXRaynes: Seriously, watch it. You're close by.
21:26bitemyappSegFaultAX: type theory meetup Thursday, you down?
21:27bitemyappSegFaultAX: intended to be introductory material, I think they're starting with untyped lambda calculus.
21:28bitemyapp`cbp: I think Brambling has incremental migrations. I'm poking at config stuff in Selmer. What's new with you?
21:29`cbpbitemyapp: learning haskell, racket, figuring out how to implement heckle. Also got my copy of the little schemer after 2 months wait :-O
21:29bitemyapp`cbp: Haskell <3
21:29bitemyappoh I have something for you
21:30`cbpo.o
21:30bitemyapp`cbp: http://blog.ezyang.com/category/haskell/ http://blog.ezyang.com/2012/08/applicative-functors/ http://blog.ezyang.com/2011/08/8-ways-to-report-errors-in-haskell-revisited/ http://www.randomhacks.net/articles/2007/03/10/haskell-8-ways-to-report-errors/
21:31bitemyappreading material!
21:31`cbpyay
21:31bitemyapp`cbp: DotA2 after I finish mangling Selmer with a rake?
21:31`cbpbitemyapp: ok
21:32lgs32ais coventry asleep?
21:41hiredman /win 22
21:59Apage43...
21:59Apage43wow
22:00S11001001μ
22:01lenageλ
22:01Apage43¬
22:01bitemyappApage43: what?
22:01Apage43video above =P
22:02lenagevideo?
22:02Apage43i .. am just going to go.. make a thing. maybe put it in a store.
22:16Apage43fewer things seem like terrible ideas now that I'm over my stomachache, time to get stuff done
22:18bitemyapp`cbp: log into Steam plz.
22:58coventrylgs32a: I was away from the internet for a while. Will probably be sleeping soon though. (Last night was an outlier.)
23:01coventrylgs32a: I've looked at one of your commits. Will have it sorted out by tomorrow.
23:31m0smithHi all: Looking for some wisdom regarding the Clojure compiler
23:32m0smithSpecifically, is there a wait to "listen" for classes it emits?
23:32dnolenm0smith: not directly no, you'd probably have to fork it and modify it to do something like that
23:34m0smithtoo bad. I am trying to get a list of classes without using javaagent
23:36m0smithDifferent subject: I am using emacs and cider. Has anyone gotten a debugger working?
23:39technomancythere have been reports of successful ritz usage
23:39technomancywith nrepl.el
23:39justin_smithm0smith: schmetterling is a standalone that connects to your clojure process, and gives you a repl and shows source at each level of the stack trace, and shows source for each level of the stack trace
23:40justin_smithruns in a browser
23:40justin_smithI saw all these features today, I'll double check that they have been pushed (it's a caribou project)
23:41justin_smithhttps://github.com/prismofeverything/schmetterling
23:41justin_smithdownload, lein ring server, go to the page it pops up and enter the dt-socket port for a clojure process, make a stacktrace
23:41justin_smithit will just work
23:42justin_smithhell, it will even debug java code
23:42justin_smithless likely to show locals though :)
23:42m0smithThanks. I will give it a try. How is it better than jswat?
23:42justin_smithclojure code runs in the context of the stack frame
23:43justin_smiththough I don't really know jswat, I don't think jswat is a clojure oriented tool
23:43justin_smithI would be surprised if it gave you a clojure repl
23:44justin_smithbut hey, if jswat is better let me know, and I will use it instead
23:44m0smith:)
23:48justin_smithhttps://groups.google.com/forum/#!topic/clojure/R7JzcYRFAfg
23:48justin_smiththis makes me think the main difference is likely maturity (jswat more mature) and tool assumptions (schmetterling assumes you are interacting with clojure)
23:49m0smithI have used jswat with clojure but found it a bit cumbersome
23:49justin_smithalso I think it may be harder to run code in the context of a selected stack frame in jswat
23:49m0smithmaybe I am just spoiled
23:49justin_smithheh, what debugger are you used to?
23:49m0smithI use eclipse a lot
23:49m0smithit is nice to debug in the editor
23:49m0smithnot with clojure
23:49m0smithjust java
23:49justin_smithmaybe the better question would have been: what was missing from jswat that made it clunky
23:50seangroveI thought it was js-wat
23:50seangroveMaybe a gary bernhardt thing
23:50m0smithhaving to switch between the debugger and the editor, which implies keep two sets of configuratioins
23:50justin_smithseangrove: which is an amusing little presentation :)
23:50technomancythere can be occasions where you need a debugger in clojure, but if you're lucky and end up working primarily with well-factored referentially-transparent code a debugger doesn't help at all
23:51technomancydon't go looking for it unless you're stuck on a really hairy problem involving badly-factored code and nasty stateful objects
23:51justin_smithm0smith: we avoided editor integration, because we don't want to force all our coworkers to use emacs, and we don't want to support 4 different frontends
23:51seangrovetechnomancy: Not at all? I haven't had occasion to need a debugger much, but I would think it's probably generally a nice thing.
23:51m0smithWorking mostly with my own code which is none of those things (apparently)
23:51technomancyseangrove: if you need one, things have gone terribly wrong
23:51technomancy(which does happen at times and can be unavoidable)
23:52seangrovetechnomancy: Maybe. I think it's an interesting assertion. Not personally sure though. Certainly would like to think so.
23:53danielglauser+1 to what technomancy said
23:53technomancywell it's like using a weapon in self-defense. makes you feel better, but you hope you never have to do it.
23:55danielglauserI'ved work on a large Clojure codebase for the past nine months. It has its issues. I have rarely felt the need for a debugger.
23:55m0smithWhich probably begs the question: How do you keep track of complex data structures
23:55m0smith?
23:55technomancyI used cdt once to debug something
23:55technomancyturns out it was a bug in clojure
23:55danielglauserI'ved -> I've. English is hard.
23:56technomancydanielglauser: English is hard; let's go lojban?
23:56bitemyapptechnomancy: Klingon, IMO
23:56danielglausertechnomancy: Nice http://en.wikipedia.org/wiki/Lojban
23:57bitemyappbecause I want to spit on people when I talk.
23:57m0smithjustin_smith: https://groups.google.com/forum/#!topic/clojure/R7JzcYRFAfg
23:57technomancybitemyapp: I've heard linguists consider Klingon to be the PHP of conlangs
23:57m0smithno
23:57m0smithjustin_smith: ClassNotFoundException: com.sun.jdi.Bootstrap
23:58danielglauserm0smith: the most "complex" data structures in the app are nested maps. Usually not that many levels deep.
23:58justin_smithm0smith: ugh, I'll pass the bug report along
23:58m0smithUbuntu
23:58m0smiththanks
23:58danielglauserm0smith: instead of maintaining abstractions on the data structures most of the structure is in functions
23:59m0smithI am parsing GEDCOM files which are arbitrarily complex so I am having a hard time keeping the daa straight (hence the debugger)