2013-02-10
| 00:01 | yedi | nvm |
| 00:50 | yedi | how would i get the whole request map in compojure? do i _have_ to destructure? |
| 00:58 | yedi | nvm, i was misunderstanding the compojure api |
| 01:19 | loliveira | hi, do I insert multiple records using cloure.jdbc? clojure.java.jdbc/insert-records, but it generates one insert command per row. How to avoid that? |
| 01:50 | callenbot | I am having a bizarre problem with Monger |
| 01:51 | callenbot | the goddamn find-map-by-id isn't working |
| 01:51 | yedi | callenbot: i decided on clabango v_v |
| 01:51 | yedi | it's just too familiar |
| 01:51 | callenbot | Raynes: VICTORY IS MINE |
| 01:52 | callenbot | yedi: s'all good. Learn one new thing at a time. |
| 01:52 | callenbot | yedi: you can be hipster-hardcore with your HTML later. |
| 01:53 | Raynes | yedi: You're dead to me. |
| 01:53 | clojurebot | Cool story bro. |
| 01:53 | Raynes | ;) |
| 01:53 | Raynes | (It's okay actually) |
| 02:21 | callenbot | alright, I need to lockdown routes |
| 02:21 | callenbot | sandbar and friend look like boondoggles. |
| 02:21 | callenbot | What are my options? |
| 02:26 | callenbot | ah fuck it I'll write a wrapper. |
| 02:42 | michaelr525 | heu |
| 02:42 | michaelr525 | hey |
| 02:43 | michaelr525 | idea+laclojure is actually pretty nice.. |
| 02:48 | callenbot | michaelr525: oh yeah? cool. |
| 02:49 | michaelr525 | callenbot: yup.. are you related to la clojure somehow? |
| 03:03 | michaelr525 | re |
| 03:04 | michaelr525 | callenbot: did you write something when I was fighting with the train wifi? :) |
| 03:29 | callenbot | https://www.refheap.com/paste/11138 this is clearly a dysfunctional pattern. Any advice? |
| 03:31 | amalloy | callenbot: https://github.com/flatland/useful/blob/develop/src/flatland/useful/debug.clj#L26 |
| 03:34 | callenbot | amalloy: I don't mean the print, I mean the dysfunctional arg passing and stuff. |
| 03:34 | callenbot | amalloy: thanks though. |
| 03:35 | amalloy | the only thing that jumped out at me as dysfunctional was your printing |
| 03:35 | callenbot | amalloy: it's not proper mate. |
| 03:35 | callenbot | (posts 51173c4a3004b7cebbd09ea9) |
| 03:35 | callenbot | *** call handler *** |
| 03:35 | callenbot | #<admin$edit neubite.routes.admin$edit@77749c47> |
| 03:35 | callenbot | ((posts 51173c4a3004b7cebbd09ea9)) |
| 03:36 | callenbot | see how it's doubly-wrapped in a list? |
| 03:36 | callenbot | it's because it gets kicked through an & args twice. |
| 03:36 | callenbot | amalloy: see the problem now? |
| 03:36 | callenbot | I need to splice the argument list without using a macro. |
| 03:37 | callenbot | I feel like I've run into before and I'm missing something critical. |
| 03:39 | amalloy | you...just need to call (apply call-handler fn args)? |
| 03:39 | amalloy | also, the if clause in call-handler can just go away |
| 03:41 | callenbot | amalloy: thanks for the pointer on getting rid of the if clause. I take it apply takes care of it. |
| 03:42 | callenbot | hrm yes. This cleared up a few things for me. |
| 03:42 | callenbot | amalloy: danke! |
| 03:55 | Raynes | callenbot: What nationality are you, sir? |
| 03:55 | Raynes | If you don't mind my asking. |
| 03:55 | Raynes | Your dankes confuse me. |
| 04:05 | callenbot | Raynes: disgruntled midwestern German-American (native born to the US). |
| 07:48 | svedubois | How I can convert this for statement in java to clojure? https://www.refheap.com/paste/11141 |
| 08:14 | AimHere | svedubois, there's a lot of ways of doing it - you could do it with map/reduce/for/loop + recur. This one should return a vector with min/max in it, respectively: https://www.refheap.com/paste/11145 |
| 08:17 | AimHere | svedubois, modulo missing parentheses |
| 08:22 | svedubois | AimHere: I have changed (image/dimension d) to (.dimension img d), and I obtain: clojure.lang.ArityException: Wrong number of args (1) passed to: core$reduce |
| 08:23 | AimHere | I missed a parentheses at the end of the function |
| 08:23 | AimHere | There should be one at the end of the line that starts (conj maxes ... |
| 08:26 | svedubois | AimHere: With https://www.refheap.com/paste/11147 I obtain java.lang.UnsupportedOperationException: nth not supported on this type: Long |
| 08:28 | AimHere | Isn't that because you put the closing parentheses on the wrong line. There should be one at the end of the line with (conj maxes on it |
| 08:28 | AimHere | '[[][]]' isn't part of the function |
| 08:31 | tgoossens | Hi. From now on i want to leave sublime behind me for clojure development and learn to work with emacs (hurray!) |
| 08:31 | tgoossens | emacs or xemacs |
| 08:31 | tgoossens | ? |
| 08:31 | tgoossens | or doesn't it matter |
| 08:31 | pimeys | emacs24 package at least in ubuntu uses gtk and therefore x |
| 08:33 | AimHere | xemacs is a fork of emacs by some people who were pissed off about copyright attribution or something |
| 08:35 | tgoossens | whats a good resource to start clojure development with emacs |
| 08:35 | svedubois | AimHere: it works |
| 08:43 | deg | Is it a bug that clojure.pprint/cl-format does not format objects the same as java format? |
| 08:43 | deg | ,(let [f (clojure.java.io/as-file "foo")] [(format "%s" f) (clojure.pprint/cl-format nil "~A" f)]) |
| 08:43 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint> |
| 08:43 | deg | (oops???) |
| 08:44 | deg | Looks like the robot doesn't handle pprint, I guess because of the eval escapes it has. |
| 08:44 | deg | Anyway, that expression returns ["foo" "#<File foo>"] |
| 08:47 | svedubois | AimHere: I would like to use the vector of mins and maxes to create and interval, like (FinalInterval. mins maxes) |
| 08:47 | svedubois | But I obtain this error: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [J |
| 08:47 | svedubois | The value of mins and maxes are [[-890 -458] [889 457]] |
| 09:07 | mdeboard | Anyone here dealt with "JNI wrapper classes" in Clojure? I'm trying to use a 3d-party library's SDK (Callas's pdfEngine lib), which exposes its C API in Java via the PDFEngine JNI wrapper class. I've proxied the class but when I invoke I get unhelpful exceptions. I was hoping someone might have general words of advice about this topic. |
| 09:08 | pepijndevos | can core.loic do interesting things to sets? Like, contrain one set to e the suset of another and stuff like that. |
| 09:08 | mdeboard | It's actually not even critical I succeed, it was more an experimentation to see if it would be useful to write our own software using the SDK or continue shelling out to use the CLI provided |
| 10:55 | keugaerg | ,(do (println "test") (for [x '(1 2 3)] (prn x))) |
| 10:55 | clojurebot | test\n(1\n2\nnil 3\nnil nil) |
| 10:55 | keugaerg | Hi |
| 10:56 | keugaerg | Sorry if it seems a newbie question ( I didn't wrote a line of Clojure since last summer .. ) |
| 10:56 | hyPiRion | keugaerg: hello, ask away, we won't bite :) |
| 10:57 | keugaerg | huh ... no ok sorry I just get it |
| 10:57 | keugaerg | No I was wondering why the output in the `for' was .. returned in the list |
| 10:57 | keugaerg | I am just understanding it is actually well printed out |
| 10:58 | keugaerg | but it is just mixed with the return value output .. |
| 10:58 | keugaerg | no it's ok I get it :-) Don't bother ! :-) |
| 10:58 | keugaerg | hyPiRion: thnx :) |
| 10:59 | hyPiRion | keugaerg: I didn't do anything, but you're welcome I suppose. It's because the for loop is lazy |
| 11:00 | abp` | hyPiRion: loop? :P |
| 11:01 | hyPiRion | abp`: dangit, I'm writing about while and for loops. |
| 11:01 | hyPiRion | for comprehension |
| 11:01 | abp` | hyPiRion: I see |
| 11:47 | enquora | new to clojure ecosystem, trying to install https://github.com/fmw/vix results in lein deps error: Error: cannot resolve leiningen.cljsbuild/activate hook |
| 11:48 | enquora | can anyone explain error and solution? |
| 11:52 | ln22 | I tried to get Vix working too. Got an error during the user setup process. Where are you stuck enquora? |
| 11:53 | enquora | I'm following the repo instructions. first time thru, starting the lein repl failed because of the hooks error |
| 11:53 | enquora | just ran again and the repl seems to be running though |
| 11:53 | enquora | dunno |
| 11:54 | ln22 | Did you change directories to the vix folder? |
| 11:55 | enquora | yes |
| 11:55 | enquora | I'm in the repl now, making first user |
| 11:55 | enquora | will see if that works |
| 11:57 | ln22 | If it does work let me know what you did! |
| 11:57 | ln22 | I got an error during this step. |
| 11:57 | ln22 | (add-user "vix" "my-username" "my-password" {:* [:GET :PUT :DELETE :POST]}) |
| 11:57 | enquora | ln22: well, there's a user doc in couch now. seems to be working |
| 11:57 | ln22 | The add-user function worked for you? |
| 11:57 | enquora | ln22: I ran lein deps again, several times |
| 11:57 | enquora | yes, indeed |
| 11:58 | ln22 | Interesting. Well at least I know its my system now. |
| 11:58 | enquora | oh, I also gave it my worst !@*()^& jvm dirty look. perhaps that put the fear into it |
| 11:58 | ln22 | I'm going to wait a little bit anyways I'm really interested in the webshop capabilities. |
| 11:58 | ln22 | Haha |
| 12:00 | enquora | I'm rewriting an ancient docs-sharing system. this isn't quite what I need, but I'm looking for an example of a real clojurescript application, and need to use both couch and elasticsearch on backend, so it seems like it's worth a look |
| 12:01 | ln22 | Ah I see. |
| 12:01 | enquora | ln22: completely new to the clojure ecosystem, but not lisp - so this will be a bit of an adventure |
| 12:01 | ln22 | I'm trying to learn Clojure at the moment (it's my first attempt at programming). I really want to contribute to projects like Vix. |
| 12:02 | enquora | lein is both a dependancy and general project management tool, correct? |
| 12:02 | enquora | for task execution, etc? |
| 12:02 | enquora | what is Soy, and why doesn't lein handle installing this? |
| 12:03 | ln22 | I have no idea what Soy is but from what I've seen Lein is for dependencies and Git is still a really popular tool for version handling ect. |
| 12:03 | ln22 | Keep in mind that I've been a programmer for 8 days.... |
| 12:04 | abp` | enquora: "neo.res.rr.com) has joined channel |
| 12:04 | abp` | #clojure [02:54] |
| 12:04 | abp` | *** ecmendenhall (~connormen@wsip-70-184-81-11.ph.ph.cox.net) has joined |
| 12:04 | abp` | channel #clojure |
| 12:04 | abp` | <Raynes> callenbot: hey [03:00] |
| 12:04 | abp` | <Raynes> callenbot: Walk off a balcony. |
| 12:04 | abp` | <callenbot> Raynes: bots can't walk [03:01] |
| 12:04 | abp` | <callenbot> Raynes: I'll take a flying leap with you in LA though :D |
| 12:04 | abp` | <Raynes> :p [03:03] |
| 12:04 | abp` | *** bkearns (~bkearns@75-101-54-23.dsl.static.sonic.net) has quit: Quit: |
| 12:04 | abp` | Leaving. [03:06] |
| 12:04 | abp` | *** h0bbit (~h0bbit@59.95.15.235) has joined channel #clojure |
| 12:04 | abp` | <amalloy> yedi: presumably Raynes's tutorial is assuming that you haven't |
| 12:04 | abp` | written non-p elements with class=meow [03:07] |
| 12:04 | abp` | *** tbaldridge (~tbaldridg@c-67-190-114-220.hsd1.co.comcast.net) has joined |
| 12:04 | abp` | channel #clojure |
| 12:04 | abp` | <Raynes> yedi: amalloy is correct. [03:08] |
| 12:04 | enquora | ln22: what's your usage case for something like vix? |
| 12:04 | abp` | <yedi> ok [03:10] |
| 12:04 | abp` | <cshell> If I have a vector that has alternating key and value (ie. [:a "a" :b |
| 12:05 | abp` | "b]) what would be the right function to use to update the :b key? |
| 12:05 | abp` | So I'd return [:a "a" :b "c"] [03:11] |
| 12:05 | abp` | <cshell> ? |
| 12:05 | abp` | *** tbaldridge (~tbaldridg@c-67-190-114-220.hsd1.co.comcast.net) has quit: |
| 12:05 | abp` | Ping timeout: 246 seconds [03:13] |
| 12:05 | abp` | *** hammer (~hammer@99-20-245-250.lightspeed.mssnks.sbcglobal.net) has joined |
| 12:05 | abp` | channel #clojure [03:14] |
| 12:05 | abp` | *** hammer (~hammer@99-20-245-250.lightspeed.mssnks.sbcglobal.net) has quit: |
| 12:05 | abp` | Client Quit |
| 12:05 | abp` | <callenbot> when does Clojure 1.5 go stable? [03:15] |
| 12:05 | abp` | <callenbot> I'd like to stop using my dissoc-in shim. |
| 12:05 | abp` | *** whamied (~whamied@24.30.125.73) has joined channel #clojure [03:17] |
| 12:05 | abp` | *** yogthos (~yogthos@li231-96.members.linode.com) is now known as |
| 12:05 | abp` | yogthos|away |
| 12:05 | abp` | *** craigbro (~craigbro@pool-64-222-126-127.burl.east.myfairpoint.net) has |
| 12:05 | abp` | quit: Ping timeout: 260 seconds |
| 12:05 | abp` | <amalloy> cshell: use a better data structure than that :P |
| 12:05 | abp` | *** loganlinn (~Adium@c-98-210-140-30.hsd1.ca.comcast.net) has joined channel |
| 12:05 | abp` | #clojure [03:18] |
| 12:05 | abp` | <cshell> amalloy: that's actually a good idea |
| 12:06 | abp` | <cshell> amalloy: I must be tired |
| 12:06 | abp` | <cshell> amalloy: thanks :) |
| 12:06 | abp` | *** francisl (~anonymous@69.157.143.178) has joined channel #clojure [03:19] |
| 12:06 | abp` | *** bosie (~bosie@91-119-78-115.dynamic.xdsl-line.inode.at) has quit: Ping |
| 12:06 | abp` | timeout: 245 seconds |
| 12:06 | abp` | *** bmaddy (~bmaddy@72.21.231.26) has joined channel #clojure [03:21] |
| 12:06 | abp` | *** hive-mind (pranq@unaffiliated/contempt) has joined channel #clojure |
| 12:06 | abp` | *** d2dchat (~d2dchat@c-68-61-5-136.hsd1.mi.comcast.net) has joined channel |
| 12:06 | abp` | #clojure [03:22] |
| 12:06 | abp` | *** hughfdjackson (~hughfdjac@unaffiliated/hughfdjackson) has quit: Quit: Lost |
| 12:06 | abp` | terminal [03:24] |
| 12:06 | abp` | *** ahokaomaeha (~suckmy@unaffiliated/dijkstragroupie) has quit: Quit: When I |
| 12:06 | abp` | come back, please tell me in what new ways you have decided to be |
| 12:06 | abp` | completely wrong. [03:25] |
| 12:06 | abp` | *** S11001001 (~sirian@fsf/member/S11001001) has joined channel #clojure |
| 12:06 | abp` | *** ahokaomaeha (~suckmy@unaffiliated/dijkstragroupie) has joined channel |
| 12:06 | abp` | #clojure |
| 12:06 | abp` | *** normanrichards (~normanric@70.114.215.220) has quit: [03:28] |
| 12:06 | keugaerg | abp`: I think you're flooding the channel .. |
| 12:06 | abp` | *** h0bbit (~h0bbit@59.95.15.235) has quit: Quit: Computer has gone to sleep. |
| 12:06 | abp` | *** ecmendenhall (~connormen@wsip-70-184-81-11.ph.ph.cox.net) has quit: Quit: |
| 12:07 | abp` | ecmendenhall |
| 12:07 | abp` | *** infynyxx (~infynyxx@cpe-24-90-84-91.nyc.res.rr.com) has joined channel |
| 12:07 | abp` | #clojure [03:29] |
| 12:07 | abp` | *** sritchie (~sritchie@c-67-180-210-142.hsd1.ca.comcast.net) has quit: Quit: |
| 12:07 | abp` | sritchie [03:31] |
| 12:07 | abp` | <gfredericks> clojure.java.jdbc/with-connection is deprecated? [03:33] |
| 12:07 | abp` | *** freakazoid (~seanl@c-67-164-106-36.hsd1.ca.comcast.net) has joined channel |
| 12:07 | abp` | #clojure |
| 12:07 | S11001001 | abp`: please kill your client instead of waiting for the paste to finish |
| 12:07 | abp` | *** looper (~looper@p5B323F93.dip.t-dialin.net) has quit: Ping timeout: 245 |
| 12:07 | abp` | seconds [03:34] |
| 12:07 | abp` | * gfredericks huhs to himself |
| 12:07 | abp` | <amalloy> callenbot: your statement seems to imply that clojure 1.5 contains |
| 12:08 | abp | S11001001: It was still pasting? |
| 12:08 | keugaerg | It stoped when you disconnected |
| 12:08 | S11001001 | abp: yeah, it buffered, ironically to avoid being killed for flood. Good now |
| 12:08 | enquora | ln22: just noticed that the vix readme instructions assume use of a debian OS |
| 12:08 | abp | S11001001: Didnt't even see that.. keugaerg: Yeah when S11001001 said it was still pasting.. |
| 12:09 | S11001001 | abp: your client probably showed the messages being all written right away |
| 12:09 | abp | Ok, sorry again. Screwed me with emacs keychords. Still a noob.. |
| 12:10 | ln22 | I'm using Ubuntu 12.10. That's probably why it failed. |
| 12:10 | abp | S11001001: Some but not all. |
| 12:14 | enquora | ln22: ubuntu 12.10 should be just fine |
| 12:15 | enquora | Soy is a templating system. have another failure following instructions to install it and compile templates |
| 12:15 | ln22 | In theory. I'm going to put Arch on this system Monday and try Vix again. I'm sure it will work. |
| 12:15 | ln22 | A failure involving Vix or Soy? |
| 12:15 | enquora | Soy |
| 12:15 | enquora | this line: java -jar SoyToJsSrcCompiler.jar --shouldProvideRequireSoyNamespaces --shouldGenerateJsdoc --outputPathFormat resources/public/js/soy/{INPUT_FILE_NAME_NO_EXT}.soy.js soy/editor.soy soy/feed.soy |
| 12:16 | enquora | it's complaining about what looks to be an invalid template |
| 12:23 | enquora | ln22: did manage to at least launch the server and see web pages. Lots of warnings and errors though, and I don't see any functionality when I use the admin login. Need to browse the code a bit to see what it is supposed to do, and probably ping the author |
| 12:31 | ln22 | Interesting. Like I said I will probably be waiting until either there are WebShop capabilities or until I'm capable of actually contributing (which me be awhile. Haha). |
| 12:31 | ln22 | *might |
| 12:41 | enquora | ln22: just sent an email to the author. will browse the code a bit now, but mostly that's it for the day. |
| 12:42 | enquora | interesting that you should pick clojure as a first programming language, if I understood you correctly |
| 12:42 | ln22 | I did. It has been interesting... xD |
| 12:44 | enquora | I don't disagree with the choice, but that wouldn't be the conventional wisdom |
| 12:44 | enquora | but then, there were far fewer languages available to choose from when I learned ;-) |
| 12:44 | ln22 | Lets hope that being unconventional pays off. Haha |
| 12:45 | enquora | Well, you're less likely to learn bad habits this way! |
| 12:45 | ln22 | I'm starting to see that now. Like never using loops for example. |
| 12:45 | enquora | and it certainly is more productive than many other languages, once you get the hang of it |
| 12:46 | enquora | one of the interesting things about programming is that naming things (consistently and clearly) is one of the hardest things in programming |
| 12:46 | enquora | In procedural/imperative programming, that's a problem |
| 12:47 | enquora | here, not so much, because so many intermediate states that are exposed in imperative programming, and thus need to be named, don't exist here |
| 12:48 | ln22 | Hopefully I never even have to worry about those things! Haha |
| 12:49 | Hodapp | enquora: I've noticed this too. |
| 12:49 | Hodapp | enquora: so much of it is bookkeeping for ephemeral state. |
| 12:49 | ln22 | One thing that I am really struggling with is the lack of "beginner" books / courses for Clojure. |
| 12:49 | ln22 | There are books but none are truly "for dummies". |
| 12:49 | enquora | don't know the answer to that, unfortunately |
| 12:50 | enquora | the community here is active - that helps |
| 12:51 | ln22 | The community has helped me massively! |
| 12:51 | enquora | I've been looking for examples of non-trivial web apps using both clojurescript and clojure, and haven't had much success |
| 12:51 | ln22 | I am probably the least skilled programmer in the entire channel too. xD |
| 12:52 | arrdem | enquora: the noir sample blog is out of date (noir is depricated) but it's a decent example |
| 12:53 | enquora | arrdem: of clojurescript combined with clojure on the server? |
| 12:53 | arrdem | enquora: clojure/ring server... |
| 12:53 | arrdem | no clojurescript tho |
| 12:54 | enquora | that's were my problem domain is - complex web-browser apps that interact with the server |
| 12:54 | enquora | a distributed system |
| 12:54 | enquora | have fully discounted node.js, but the sort of thing the meteor project appears to be attempting |
| 12:55 | enquora | will have a look, though |
| 12:55 | enquora | thks |
| 13:22 | gfredericks | somehow I've mostly missed the fact that defn and defmacro have explicit support for adding metadata via a map |
| 13:36 | TimMc | In several different places! |
| 13:44 | gfredericks | TimMc: yeah that part quite surprised me |
| 14:12 | Sgeo | I just realized that in my blog post I __________HAVE__________ to talk about flatten |
| 14:12 | Sgeo | flatten? |
| 14:12 | clojurebot | flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with. |
| 14:14 | gfredericks | (def unflatten #(map vector %)) |
| 14:14 | Sgeo | flatten is the devil |
| 14:14 | Sgeo | It doesn't exist in Haskell, and for good reason |
| 14:15 | gfredericks | because it can't be typed? |
| 14:16 | Sgeo | Pretty much, yeah. Although, I guess you could make a type that you could define a flatten operation on |
| 14:16 | gfredericks | I don't think this could work |
| 14:16 | gfredericks | I think you can only flatten a fixed number of levels |
| 14:17 | gfredericks | so you'd have a flatten1, flatten2, flatten3, etc |
| 14:17 | Sgeo | data Thing = One String | Many [Thing] |
| 14:18 | Sgeo | flatten :: [Thing] -> [Thing |
| 14:18 | Sgeo | erm |
| 14:18 | Sgeo | flatten :: [Thing] -> [Thing] |
| 14:18 | Sgeo | flatten' :: Thing -> Thing |
| 14:18 | gfredericks | I think I might be going crazy. |
| 14:19 | gfredericks | yeah totes crazy |
| 14:19 | Sgeo | flatten' (One string) = One string |
| 14:19 | gfredericks | I have only regrets. |
| 14:19 | Sgeo | flatten' ... hmm |
| 14:19 | Sgeo | Wait, I don't know if that's actually working |
| 14:21 | gfredericks | I think it does |
| 14:22 | gfredericks | I was confusing the fact that you can't do runtime polymorphism with typeclasses with the fact that you _can_ do runtime polymorphism with case classes |
| 14:30 | ticking | I wonder why regex don't implement the fn protocol to do a re-matches by default. |
| 14:40 | atyz | hey guys, a little confused by an error i'm getting when typing "lein test" - could someone suggest what i'm doing wrong: |
| 14:40 | atyz | Exception in thread "main" java.io.FileNotFoundException: Could not locate rainbowtickets/test/handler__init.class or rainbowtickets/test/handler.clj on classpath: |
| 14:41 | deg | Is it a bug that clojure.pprint/cl-format does not format objects the same as java format? |
| 14:41 | lynaghk | atyz: it sounds like the namespace/filename don't match up |
| 14:41 | deg | (let [f (clojure.java.io/as-file "foo")] [(format "%s" f) (clojure.pprint/cl-format nil "~A" f)]) |
| 14:41 | atyz | ok great - i'll look into it |
| 14:41 | atyz | thank you |
| 14:41 | lynaghk | atyz: no worries. |
| 14:41 | deg | returns ["foo" "#<File foo>"] |
| 14:41 | deg | Sun 15:45: *** snake-john JOIN |
| 14:41 | deg | Sun 15:46: *** loliveira QUIT Quit: loliveira |
| 14:41 | deg | Sun 15:47: *** Snaffu JOIN |
| 14:42 | deg | (oops, excuse cut-n-paste gubbish) |
| 14:42 | ticking | atyz: your folder/file hierarhy needs to match up the napespace hierarhy same should go for tests |
| 14:42 | atyz | ticking ahh that makes sense. i thought it would be able to infer it from the namespace |
| 14:43 | loliveira | how do I make a multi row insert using clojure.java.jdbc? |
| 14:56 | raxelo | Hi all, I am playing with seesaw and for some reason exceptions that happen don't fall into my REPL |
| 15:01 | thalassios_xelon | hello room :)) |
| 15:04 | thalassios_xelon | in a clojure program the garbage collector has much more work to do than in standar java program? |
| 15:04 | thalassios_xelon | i get a gc overhead limit ... error |
| 15:06 | raxelo | thalassios_xelon, how this error looks like ? |
| 15:09 | thalassios_xelon | i have a toy program |
| 15:10 | raxelo | ok, but the error, stacktrace itself. |
| 15:10 | raxelo | how does it look like ? |
| 15:10 | thalassios_xelon | ok wait a minute |
| 15:12 | thalassios_xelon | is it true that in clojure we need the garbage collector much much more |
| 15:12 | thalassios_xelon | ? |
| 15:13 | bawr | as usual with such questions, it depends ;) |
| 15:14 | amalloy | thalassios_xelon: generally yes, but gc overhead errors are much more severe than that |
| 15:14 | raxelo | thalassios_xelon, I think it is more yes than no =) due to immutability in the core |
| 15:15 | amalloy | they basically mean "you have a memory leak, but it's slow" |
| 15:15 | clojurebot | what the hell, just crash it |
| 15:15 | atyz | is there a way to run a specific test only with lein test? |
| 15:15 | amalloy | (inc clojurebot) |
| 15:15 | lazybot | ⇒ 19 |
| 15:16 | [1]thalassios_xe | OutOfMemoryError GC overhead limit exceeded |
| 15:16 | [1]thalassios_xe | clojure.lang.RT.cons (RT.java:559) |
| 15:16 | [1]thalassios_xe | clojure.core/cons (core.clj:29) |
| 15:16 | [1]thalassios_xe | clojure.core/list* (core.clj:590) |
| 15:16 | [1]thalassios_xe | clojure.core/apply (core.clj:603) |
| 15:16 | dxeh | "Sets are collections of unique values. (= __ (clojure.set/union #{:a :b :c} #{:b :c :d}))" how can i fill in this blank and can someone explain how they got the answer? Trying to pick up clojure but im not familiar with any lisps :p |
| 15:16 | [1]thalassios_xe | clojure.core/partial/fn--4070 (core.clj:2343) |
| 15:16 | [1]thalassios_xe | testing.parse/parse-filter (parse.clj:25) |
| 15:16 | [1]thalassios_xe | testing.parse/parse-filter (parse.clj:25) |
| 15:16 | [1]thalassios_xe | testing.parse/parse-filter (parse.clj:25) |
| 15:16 | [1]thalassios_xe | testing.parse/parse-filter (parse.clj:25) |
| 15:17 | xeqi | atyz: lein test :only some.namepace/test-name |
| 15:17 | atyz | oh my thank you |
| 15:17 | ivan | dxeh: https://en.wikipedia.org/wiki/Set_union |
| 15:17 | [1]thalassios_xe | dxen you put in __ the value to make the (= .. ..) true |
| 15:18 | dxeh | [1]thalassios_xe, yes i know lol im not stupid, i just dont know clojure well enough to make the expression evaluate to true |
| 15:19 | ivan | much easier than you are imagining |
| 15:19 | [1]thalassios_xe | you put the value down in the answers box |
| 15:20 | [1]thalassios_xe | and press run... |
| 15:21 | dxeh | [1]thalassios_xe, do you not understand that i just said i _don't_ know clojure enough to even make it work and thats why i am asking how it could be solved |
| 15:22 | ivan | &(clojure.set/union #{:a :b :c} #{:b :c :d}) |
| 15:22 | dxeh | and ivan thanks i will read |
| 15:22 | lazybot | ⇒ #{:a :c :b :d} |
| 15:22 | WuHoUnited | #{:a :b :c} is a set containing :a, :b and :c #{:b :c :d} is the set containing :b :c :d. You need to write down the set containing :a :b :c :d |
| 15:24 | raxelo | this community is very patient, I'll stay here ) |
| 15:24 | Pure_Loulou | (= #{:a :b :c :d} (clojure.set/union #{:a :b :c} #{:b :c :d})) thats true |
| 15:26 | Pure_Loulou | do you know what arguments to put to vm arguments in eclipse,so i dont get memory errors? |
| 15:27 | Pure_Loulou | i get OutOfMemoryError GC overhead limit exceeded |
| 15:29 | raxelo | Pure_Loulou, -XX:-UseGCOverheadLimit |
| 15:29 | raxelo | but this won't solve your problem in the root as you understand |
| 15:29 | amalloy | Pure_Loulou: write programs without memory leaks |
| 15:29 | raxelo | mentioned option for java 6th version |
| 15:30 | Pure_Loulou | what do you mean memory leaks? |
| 15:30 | Pure_Loulou | in clojure? |
| 15:31 | dxeh | Pure_Loulou, he's basically implying your code has a bug which needs fixing (its allocating more memory than its deallocating) |
| 15:32 | dxeh | _severe_ bug |
| 15:32 | ordnungswidrig | it's about eclipse oom'ing! |
| 15:32 | ordnungswidrig | Pure_Loulou: -Xmx2G |
| 15:33 | raxelo | ordnungswidrig, I am not sure Eclipse usually launches application in separate process if it is not about REPL |
| 15:33 | amalloy | ordnungswidrig: -Xmx∞G for a long-term fix |
| 15:35 | ordnungswidrig | raxelo: it launches in a separate vm |
| 15:35 | raxelo | ordnungswidrig, right - separate vm/process |
| 15:36 | dxeh | lol infinity |
| 15:36 | raxelo | I just mean that it is not related to eclipse configuration itself but configuration of this particular run-configuration |
| 15:36 | ordnungswidrig | I understand Pure_Loulou that eclipse is oo'ing |
| 15:36 | ordnungswidrig | but seems I'm wrong |
| 15:36 | Pure_Loulou | dxeh can someone program in clojure and control memory deallocating? |
| 15:37 | ordnungswidrig | Pure_Loulou: you can delay deallocation |
| 15:37 | ivan | amalloy: funny how that actually works |
| 15:38 | dxeh | Pure_Loulou, probably not but that doesnt mean you cant stop memory leaks |
| 15:38 | amalloy | does it? |
| 15:38 | Pure_Loulou | dxeh are there memory leaks in clojure? |
| 15:38 | ivan | -XX:+PrintFlagsFinal indicates that it sets MaxHeapSize to 0 |
| 15:38 | dxeh | no there are memory leaks in your code |
| 15:39 | Pure_Loulou | my code is in clojure not c,c++ |
| 15:39 | dxeh | ok |
| 15:39 | metellus | Pure_Loulou: your problem is that the system is spending so much time trying to do garbage collection that it can't do other stuff |
| 15:39 | brehaut | http://blog.ezyang.com/2011/05/space-leak-zoo/ |
| 15:39 | Pure_Loulou | i know thats my problem.... |
| 15:39 | dxeh | Pure_Loulou, http://en.wikipedia.org/wiki/Memory_leak |
| 15:40 | metellus | which means that you're creating so many objects that something bad is probably happening |
| 15:40 | dxeh | read up on what a memory leak is maybe that will help you understand |
| 15:40 | Pure_Loulou | ok thx guys :) good night i am newbie |
| 15:40 | brehaut | Pure_Loulou, dxeh: i like the haskell peoples definition of a memory leak as a specific type of space leak |
| 15:40 | raxelo | Pure_Loulou, maybe you can share your code somewhere, if it is possible to glance what can be the problem |
| 15:41 | dxeh | brehaut, i dislike seeing any definition of memory leak anywhere in my code :) annoying to fix xd |
| 15:43 | dxeh | &(hash-map :a 10, :b 20, :c 30) :b) |
| 15:43 | lazybot | ⇒ {:a 10, :c 30, :b 20} |
| 15:44 | ivan | &((hash-map :a 10, :b 20, :c 30) :b) |
| 15:44 | lazybot | ⇒ 20 |
| 15:44 | dxeh | o |
| 15:44 | dxeh | lol |
| 15:44 | metellus | &(+ 1 2) lazybot doesn't care about the rest of the line? |
| 15:44 | lazybot | ⇒ 3 |
| 15:44 | dxeh | ivan, why 20 |
| 15:45 | ivan | that's the value for the :b key |
| 15:45 | dxeh | because :b is 20 in the map and it wants the value of :b |
| 15:45 | dxeh | yeah ok |
| 15:45 | thalassios_xelon | dexh that memory leak you said,comfused me,when you program in clojure you take care for "memory leaks"? |
| 15:45 | dxeh | thalassios_xelon, to be blunt if you dont write bad code you dont get memory leaks |
| 15:45 | dxeh | just be careful |
| 15:46 | dxeh | the problem is not with clojure, but with something you've written and you have to now go back and debug to find out what the problem is :p |
| 15:46 | thalassios_xelon | maybe i wrote bad code that consumes much memory... |
| 15:46 | amalloy | if you don't write bad code you're also a heffalump |
| 15:46 | amalloy | everyone writes bad code |
| 15:47 | thalassios_xelon | it is my first clojure program... |
| 15:47 | metellus | what makes you think it has a memory leak? |
| 15:47 | dxeh | oom exception sums it up |
| 15:48 | raxelo | thalassios_xelon, maybe you use 3rd party library that may leak too |
| 15:48 | thalassios_xelon | i dont think it has memory leak,i think that it allocates memorie faster than it is release it |
| 15:48 | dxeh | ... thats what a memory leak is |
| 15:48 | WuHoUnited | can you show us the program? |
| 15:48 | metellus | oh, the nick change threw me off |
| 15:48 | thalassios_xelon | WuHoUnited, its copyright:P |
| 15:48 | thalassios_xelon | its a toy program |
| 15:49 | thalassios_xelon | anyway i will read more thx guys goodnight :) |
| 16:02 | Frozenlo` | Is there an emacs add-on to get the docs from clojuredocs? |
| 16:08 | ivan | typing " inside a string in paredit -> conversion experience |
| 16:08 | Frozenlock | ivan: does it escape it automagically? |
| 16:08 | ivan | yep. and when you backspace, it deletes both \ and " |
| 16:09 | bawr | ivan: *_* |
| 16:09 | ivan | Frozenlock: I use cdoc from (require '[cd-client.core :refer [cdoc cdir]]) |
| 16:09 | ivan | Frozenlock: your REPL may already have it |
| 16:18 | Frozenlock | ivan: looks promising! I'll add it to my leiningen profile, thanks! |
| 16:27 | raxelo | Frozenlock, I am playing with seesaw now and using https://github.com/franks42/clj-ns-browser intensively |
| 16:27 | raxelo | it is out of emacs but good for investigation |
| 16:31 | ivan | I would use that more if it were not for https://github.com/franks42/clj-ns-browser/issues/51 |
| 16:31 | ivan | I suppose I should just fix that |
| 16:35 | Frozenlock | Is there a way to make my repl refer a namespace everytime I switch to a new one? |
| 16:36 | Frozenlock | In this case I would like the clojuredocs-client to be always available. |
| 16:36 | ivan | when I asked a month ago, the best suggestion was to bind some Emacs key to insert the right symbol, e.g. cd-client.core/cdoc |
| 16:37 | raxelo | ivan, I see... it is not relevant for me so far, linux user |
| 16:37 | ivan | there was also talk of a weird REPLy feature that expands just one symbol, no matter what namespace you're in |
| 16:38 | Frozenlock | Well the `repl' namespace seems to always be available (the `doc' macro) |
| 16:42 | ivan | in a vanilla nREPL, clojure.core> (doc +) |
| 16:42 | ivan | CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc in this context, compiling:(NO_SOURCE_PATH:1:1) |
| 16:42 | ivan | I've lost track of all the extra stuff lein and reply do |
| 16:45 | ivan | http://dev.clojure.org/jira/browse/NREPL-31 ah, maybe because you're on Clojure 1.4? |
| 16:45 | ivan | anyway, the helpful behavior you are experiencing is a bug |
| 16:46 | Frozenlock | Isn't it a feature? :P |
| 16:46 | ivan | until you paste in some code where `doc` is referring to something else |
| 16:47 | black_joe | I have consulted documentation and can't find anything. How do you apply a variable function to some parameters? |
| 16:47 | black_joe | https://www.refheap.com/paste/fc8e3586eb7977e86bedb71af Like this. |
| 16:47 | black_joe | Here I am trying to use spit as a default function, but allowing a new function in the &rest |
| 16:48 | amalloy | black_joe: that looks like the right way to do it |
| 16:48 | black_joe | I thought so too, but it throws a NullPointerException. |
| 16:49 | amalloy | black_joe: you're coming from...what, common lisp? |
| 16:49 | amalloy | () is not nil |
| 16:49 | ivan | (rest list) when rest is a function argument? |
| 16:49 | amalloy | your &rest argument is not (), it is nil |
| 16:50 | black_joe | Isn't it both, since the variable arguements in &rest is a list? |
| 16:50 | amalloy | nothing can ever be both () and nil. they are different things |
| 16:50 | amalloy | ivan's point is good as well; if that hasn't caused problems yet, it will |
| 16:50 | black_joe | Okay, I'll change that. Nil is more readable anyway. |
| 16:50 | amalloy | black_joe: no, change it to something better |
| 16:51 | amalloy | (if (seq list) (...list is not empty...) (...list is empty...)) |
| 16:51 | amalloy | clojure-flavored nil punning |
| 16:52 | black_joe | Okay. I had seen seq before, but never knew it was a predicate. They usually have ?'s. |
| 16:52 | dnolen | black_joe: seq is not a predicate |
| 16:52 | dnolen | black_joe: it will however return nil on empty list making it useful as a predicate since nil is false-y |
| 16:52 | abp | ,(seq '()) |
| 16:52 | clojurebot | nil |
| 16:52 | abp | ,(seq nil) |
| 16:52 | clojurebot | nil |
| 16:53 | abp | ,(seq '(1 2 3)) |
| 16:53 | clojurebot | (1 2 3) |
| 16:53 | black_joe | So it's kind of like using "touch" to create a file. |
| 16:53 | WuHoUnited | also, it appears you're mapping something across lisp, so you could use map |
| 16:53 | abp | (doc seq) |
| 16:53 | clojurebot | "([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable." |
| 16:54 | black_joe | I was originally going to use that, yeah, but I was getting an error I couldn't correct. This works for my intended purposes, but I was just trying to add variable functions. |
| 16:54 | black_joe | For now I'll just leave that out. |
| 16:55 | WuHoUnited | yeah, i guess you're not done with it anyway, since you aren't using rest as a vararg anyway |
| 16:57 | abp | black_joe: Probably you want to have a look at: https://github.com/bbatsov/clojure-style-guide |
| 16:58 | black_joe | Thank you! I've been kind of melding together C++ and Lisp standards for Clojure. |
| 16:59 | abp | black_joe: np, hope it helps you |
| 17:12 | VladimirFromUa | have a good day/night to all |
| 17:40 | tgoossens | wow paredit is great |
| 17:40 | abp | tgoossens: Yea. Emacs? |
| 17:44 | tgoossens | abp: first time i'm using emacs |
| 17:44 | tgoossens | still screwing everything up after a while |
| 17:44 | tgoossens | its not that important (but still) |
| 17:44 | tgoossens | i'm trying to figure out how i can get clojure syntaxhighlighting |
| 17:44 | tgoossens | the same way as in sublimetext2 |
| 17:45 | hyPiRion | M-x package-list-packages |
| 17:45 | hyPiRion | Oh wait, you need marmalade. |
| 17:45 | tgoossens | i have |
| 17:45 | tgoossens | that |
| 17:45 | abp | tgoossens: Hrhr, I'm using Emacs for a week now. Just pasted part of the irc log due to a awfully wrong gone keychrod in ERC this afternoon. :D |
| 17:45 | tgoossens | abp: cheers! |
| 17:46 | abp | tgoossens: I just grabbed emacs live after reading the tutorial and looking through a few .emacs.d repos on github. |
| 17:46 | tgoossens | emacs live? |
| 17:47 | abp | tgoossens: Sam Aarons Emacs-package bundle. https://github.com/overtone/emacs-live |
| 17:48 | abp | tgoossens: Look through the key-rebindings if you use that.. |
| 17:49 | tgoossens | looks flashy :p |
| 17:49 | abp | tgoossens: But despite those it's pretty great. You could even disable the rebindings, but they are ok for me. |
| 17:49 | tgoossens | hmm |
| 17:50 | abp | tgoossens: Probably, but quite some cool packages in there and I don't need to configure anything. :x |
| 17:50 | tgoossens | abp: i'll take a look at it. first i'm going to play a bit |
| 17:51 | tgoossens | i don't want to make the same error as with sublime |
| 17:51 | ivan | heh, -noverify is really good at reducing startup times from tens of seconds to seconds |
| 17:51 | abp | tgoossens: Sure, but if you don't install that you want to get ace-jump mode for sure. |
| 17:51 | abp | tgoossens: three keystrokes to every symbol on screen. |
| 17:52 | abp | tgoossens: ST got slow through plugins? |
| 17:52 | tgoossens | i had been using it for a few months. and I never really explored its possibilities etc. Now I really want an editor I understand, control completely |
| 17:52 | tgoossens | so it has been my own laziness |
| 17:52 | tgoossens | also |
| 17:53 | tgoossens | i never had some real projects with clojure |
| 17:53 | tgoossens | so it didn't really matter |
| 17:53 | tgoossens | but a month ago. i started a small projects (strips planning) in clojure and i felt the pain badly |
| 17:53 | abp | tgoossens: Oh ok. Yeah I've been reading through Emacs modes and packages relentlessly. |
| 17:54 | tgoossens | productivity nihil (compared to what it could be) |
| 17:54 | abp | tgoossens: I was using CCW, but Emacs just blows it out of the water. |
| 17:54 | tgoossens | and after reading the chapter "power editing" in "the pragmatic programmer". I realized I really had to do something about it |
| 17:55 | tgoossens | abp: but it's hard (perhaps even boring) to just read about a tool if you are not using it a lot |
| 17:55 | brehaut | abp: that depends a little on how much javaland you are doing |
| 17:55 | amalloy | agreed, eclipse blows emacs out of the water for java |
| 17:56 | abp | tgoossens: I did the tutorial and started reading through modes etc. Then picked up Emacs Live and got going, reading on about installed modes. |
| 17:57 | tgoossens | abp: i might just do the same |
| 17:57 | abp | brehaut: amalloy: Sure. For Java I used NetBeans. So CCW was a real painspot. Last time I used Eclipse was for Android dev quite some time ago.. |
| 17:58 | abp | No one cares about doing Java in Emacs? |
| 17:58 | callenbot | abp: java programmers aren't people |
| 17:59 | abp | callenbot: What if they evolve? |
| 18:00 | abp | callenbot: I were doing Java mostly, while stumbling through Scala to Clojure. :P |
| 18:01 | powr-toc | Does anyone know how project works in core.logic? |
| 18:14 | Frozenlock | I must use a datastructure for a keyword and an integer. Is there some obvious advantages to either use maps or vectors? [[:some-key 10][:some-other-key 20]] vs [{:some-key 10} {:some-other-key 20}]. |
| 18:15 | danlarkin | this is an impossible question to answer in the abstract |
| 18:26 | callenbot | danlarkin: dude, I beg of you. |
| 18:26 | callenbot | danlarkin: hack on clabango more. I use it a ton and love it. |
| 18:27 | callenbot | danlarkin: do you still use it? |
| 18:27 | danlarkin | I do |
| 18:27 | callenbot | danlarkin: thank the gods |
| 18:27 | danlarkin | but it does everything I need right now |
| 18:27 | danlarkin | patches welcome! |
| 18:27 | callenbot | danlarkin: so you're open to PRs? Sweet. |
| 18:27 | danlarkin | yeah just follow the style I've establish as best you can and I'd be very happy to accept PRs |
| 18:28 | danlarkin | s/establish/established |
| 18:31 | danlarkin | I'm pleased you like it |
| 18:31 | powr-toc | Frozenlock, The main trade offs are probably in readability and extendability... maps aren't positional, vectors are... so if you're sure there will always be two values then pick a vector if you favour brevity... otherwise a hash-map |
| 18:32 | callenbot | danlarkin: it's saved me and my frontend guy's productivity in Clojure |
| 18:33 | callenbot | danlarkin: we're extremely fond of it. Except for pathing and some form helper macros, we were able to 1:1 port old templates from Flask over |
| 18:34 | danlarkin | cool |
| 18:34 | callenbot | danlarkin: is there a way to perform a get on a map in a {{ }}? |
| 18:34 | callenbot | danlarkin: I've got a config map I need to kick down and the . syntax isn't working. |
| 18:35 | danlarkin | {{foo.bar}} should do it |
| 18:35 | callenbot | I don't think it works if you treat it like a map |
| 18:35 | callenbot | I think I have to pass it the keyword like a function arg |
| 18:35 | callenbot | it's carica's config magic. |
| 18:36 | callenbot | I basically want to do: {{(config :stripe_pk)}} |
| 18:36 | callenbot | yeah it's an fn. |
| 18:36 | danlarkin | carica.core/config is not a map |
| 18:36 | callenbot | yeah it's an fn |
| 18:36 | callenbot | can I call a function in {{ }} |
| 18:36 | callenbot | ? |
| 18:36 | danlarkin | nope |
| 18:36 | callenbot | also registering template filters has never worked for me. |
| 18:37 | callenbot | it ends up saying the name of the template filter doesn't exist. |
| 18:37 | danlarkin | that's odd, it's worked for me |
| 18:37 | callenbot | danlarkin: I figured it had. I'll see if I can snag a repro for you. |
| 18:45 | hiredman | powr-toc: project is not something you want to use |
| 18:48 | amalloy | devth: it can take any object at all |
| 18:48 | hyPiRion | ,(get-in {#"foo" :bar} [#"foo"]) |
| 18:48 | clojurebot | nil |
| 18:49 | hyPiRion | ,(= #"foo" #"foo") |
| 18:49 | clojurebot | false |
| 18:49 | hyPiRion | Ah! |
| 18:49 | amalloy | &(let [k #"foo"] (get-in {k :bar} [k])) |
| 18:49 | lazybot | ⇒ :bar |
| 18:49 | devth | amalloy: right, i meant something like: (get-in {:foo {"plain iso/12345" "this is the body"}} [:foo #"plain"]) => "this is the body" |
| 18:50 | ivan | what would [:foo #"plain" :child] do if there are multiple `plain` matches? |
| 18:51 | amalloy | i figured. that's really a disastrous feature that goes against what maps are for |
| 18:52 | devth | i supposed that too. i guess it deserves a custom fn |
| 18:53 | devth | specifically, i want to parse out the "TEXT/PLAIN" from something like: {:from #<IMAPAddress foo@gmail.com>, :subject "Re: A friendly message", :sender #<IMAPAddress foo.com>, :multipart? true, :content-type "multipart/ALTERNATIVE; boundary=bcaec5524106840d9e04d4ee1246", :body [{"TEXT/PLAIN; charset=ISO-8859-1" "Lol.\r\n\r\n\r\nOn"} {"TEXT/HTML; charset=ISO-8859-1" "<div dir=\"ltr\">Lol.</div>"}]} |
| 18:54 | devth | ivan: take the first is what i need, but good question |
| 18:54 | ivan | you may find that returning unpredictable results, given that maps lack order |
| 18:55 | devth | ivan: i'd never expect it to contain multiple keys with "TEXT/PLAIN" |
| 18:59 | devth | gross https://gist.github.com/devth/4751606 |
| 19:04 | ivan | perhaps (val (first (filter #(re-find #"e" (key %)) your-map))) |
| 19:14 | devth | ivan: better. let me try that |
| 19:29 | yedi | callenbot: does clabango not support else? |
| 19:29 | yedi | java.lang.Exception: unknown tag: {:type :tag, :body {:token " else ", :offset 10, :line 15, :file #<URL file:/Users/yedianyansi/Documents/dev/skateproj/resources/templates/dress-page.html>}} |
| 19:33 | yedi | for some reason git add . is taking forever (i have less than 10 changed files), does anyone know what might be happening? |
| 19:33 | yedi | nvm |
| 19:35 | ivan | what was it? was going to suggest dtruss -f git add . or similar |
| 19:37 | callenbot | yedi: no, it doesn't. |
| 19:37 | callenbot | danlarkin: why doesn't clabango support else? |
| 19:37 | callenbot | yedi: I've already factored it out of my templates (else, that is) |
| 19:38 | Raynes | Support it, or else! |
| 19:40 | callenbot | Raynes: you can't say that, there is no else. |
| 19:56 | tomoj | hmm, there's no unmunge? |
| 19:56 | tomoj | guess I don't need it |
| 20:00 | Frozenlock | Two java methods with the same name, in the same library... but they don't take the same arguments because they are not in the same object. This is madness! |
| 20:01 | amalloy | tomoj: by any sensible definition of munge (eg http://en.wikipedia.org/wiki/Mung_(computer_term)), an unmunge operation cannot exist :P |
| 20:01 | amalloy | Frozenlock: (conj [] 1) works and (conj {} 1) doesn't. madness? no; {} just requires different arguments for its conj |
| 20:04 | Frozenlock | MADNESS!! |
| 20:05 | Frozenlock | amalloy: but in this case I can at least understand: conj requires an element that composes the target. |
| 20:05 | hiredman | https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm |
| 20:05 | Frozenlock | [:a 1] would be an 'element' of a map. |
| 20:05 | bbloom | Frozenlock: I think it's called an "Entry" |
| 20:08 | amalloy | hiredman: i'm getting a connection timeout on that page, sadly |
| 20:08 | hiredman | huh, I am looking at it right now |
| 20:09 | tmciver | amalloy: that page worked for me. |
| 20:09 | amalloy | well, close the tab! you must be consuming all their server resources, you greedy jerk |
| 20:09 | amalloy | seriously though, weird. i consistently get a timeout. wonder why, if it works for everyone else |
| 20:26 | tomoj | amalloy: was the namer of clojure.core/munge using a sensible definition? |
| 20:26 | tomoj | I guess the problem is obvious |
| 20:26 | amalloy | tomoj: i think they've done what that wikipedia article describes. clojure's name munger is certainly a one-way operation |
| 20:28 | tomoj | does it work if you restrict the domain of unmunge to things returned by munge, and the domain of munge to reasonable namespace names? |
| 20:30 | tomoj | hmm, is c.c/munge even used for namespace name -> filename? |
| 20:31 | tomoj | no, it's just https://www.refheap.com/paste/57902e60c69e10e805d8e3240 |
| 20:43 | ivan | Raynes: "Older" on https://www.refheap.com/pastes?page=2 links to the same page |
| 20:43 | Raynes | ivan: I know. |
| 20:43 | Raynes | Thanks for letting me know though. |
| 20:43 | ivan | np! |
| 20:43 | Raynes | I'm in the middle of moving to laser for the templates and I need to finish that before I can fix the bug. |
| 20:44 | Raynes | I mean, I could hotpatch the existing stuff, but given that you're the first person to notice it in at least 3 months of being broken… : |
| 20:44 | Raynes | :P |
| 20:44 | Raynes | s/hotpatch/hotfix |
| 20:44 | Raynes | Whatever the buzzword for that is |
| 20:45 | Frozenlock | Raynes: it's probably faster to just tell you instead of making a pull request... it would be great if refheap.el had clojurescript associated with clojure. |
| 20:46 | Frozenlock | clojurescript-mode that is. |
| 20:49 | Raynes | Frozenlock: Released 0.0.3 |
| 20:49 | Frozenlock | /90s on |
| 20:49 | Frozenlock | wicked! |
| 20:49 | Frozenlock | /90s off |
| 20:50 | rplaca | Raynes: don't get too aggressive with those version numbers! |
| 20:52 | Hodapp | don't get Donald E. Knuth syndrome either |
| 20:52 | rplaca | I think that my next project will just start with v1e-22 |
| 20:53 | rplaca | just to get out ahead of the trend |
| 21:01 | tomoj | you could digest edn reliably assuming no funky tagged literals, right? |
| 21:02 | tomoj | I guess you have to invent some comparator for map keys and set elements of different types |
| 21:02 | callenbot | Raynes: does wrap-force-ssl work on Heroku? |
| 21:11 | Raynes | callenbot: I wrote it specifically for that purpose, so I hope so. |
| 21:13 | dxeh | any of you guys use elein emacs package |
| 21:13 | dxeh | if so, worth it? |
| 21:14 | danlarkin | callenbot because I never got around to it |
| 21:14 | danlarkin | it'd be a good contribution though! |
| 21:21 | gfredericks | tomoj: I wouldn't think that would be a problem |
| 21:21 | gfredericks | tomoj: total ordering over all types isn't that tricky; couchdb does it for json |
| 21:22 | tomoj | not so easy for edn |
| 21:22 | tomoj | well |
| 21:22 | tomoj | I guess you can sort by tag for tagged literals |
| 21:23 | tomoj | so maybe :) |
| 21:23 | gfredericks | sure |
| 21:23 | gfredericks | you don't have to care what the data-readers are |
| 21:23 | gfredericks | hell just assume everything is a tagged literal where the tag might be nil :) |
| 21:23 | gfredericks | maybe that's weird |
| 21:24 | gfredericks | what happens if you do nested literals? |
| 21:24 | gfredericks | read-string allows it |
| 21:26 | tomoj | shouldn't be a problem, you have to digest the tagged form too |
| 21:26 | gfredericks | sure |
| 21:26 | gfredericks | I wonder if the spec mentions that possibility |
| 21:26 | tomoj | db/fn is a good example |
| 21:27 | tomoj | I feel there should be a print-edn |
| 21:27 | tomoj | er, edn/pr or something |
| 21:28 | tomoj | or fipp should have an ugly mode |
| 21:29 | gfredericks | tomoj: sort by (juxt (comp str class) identity) :) |
| 21:29 | gfredericks | that ignores data readers I guess |
| 21:29 | gfredericks | man your use case kind of demands an intermediate form where you have the tags and the unprocessed literals O_O |
| 21:29 | tomoj | that's easy |
| 21:30 | tomoj | just (read-edn {:readers {} :default identity} ..) or whatever |
| 21:30 | gfredericks | I was just wondering that |
| 21:30 | tomoj | er, not identity |
| 21:30 | gfredericks | you'd probably want a defrecord for the tagged things |
| 21:30 | tomoj | yeah |
| 21:30 | gfredericks | wait does the function get the tag as well? |
| 21:30 | tomoj | s#read-edn#edn/read# |
| 21:31 | tomoj | it gets the tag and the unprocessed value |
| 21:31 | tomoj | so :default ->TaggedElement |
| 21:31 | gfredericks | okay then we're set |
| 21:33 | tomoj | I wonder why no 'uri in default-data-readers |
| 21:35 | gfredericks | or 'bytes |
| 21:35 | gfredericks | does edn have ratios? |
| 21:36 | tomoj | clojure.edn/read-string accepts it |
| 21:36 | gfredericks | which might be unrelated to whether the spec mentions them :) |
| 21:37 | tomoj | I don't see it in the spec |
| 21:40 | gfredericks | if I were a crochety old man I'd say that deserves a jira ticket |
| 21:40 | gfredericks | but I am a crochety young man, so I won't. |
| 21:48 | gfredericks | I knew core.logic would deliver me an example of a macro-writing macro :D |
| 21:54 | Raynes | gfredericks: heh |
| 21:55 | alex_baranosky | does anyone have a tool to reformat all the CLJ files in a project folder? |
| 21:56 | alex_baranosky | seems like you could hijack Emacs' clojure-mode formatting to do it, but I'm not very knowledgable in ELisp |
| 22:34 | ivan | how would you solve this: https://twitter.com/isaach/status/299595370760130561/photo/1 ? implement a subset of regex in core.logic? |
| 22:35 | Raynes | I'd start by telling MIT to eat a bag of phalluses. |
| 22:47 | SegFaultAX | Raynes: Not just suck, but eat? |
| 22:50 | gfredericks | explaining macros is hard. |
| 22:52 | gfredericks | ivan: these regexes look like proper CS regexes, no? |
| 22:52 | gfredericks | oh nevermind I see backreferences |
| 22:56 | gfredericks | the backrefs shouldn't be hard for core.logic though |
| 23:18 | alex_baranosky | I'm trying to fix a bug in Slamhound that loses the second half of large files, but I am not knowledgable enough to pinpoint what could be causing it |
| 23:19 | alex_baranosky | anyone up for debugging it? It'd be nice to get a release out to fix kind of an egregious bug |
| 23:20 | alex_baranosky | I've even got a failing test case :) |
| 23:32 | tomoj | presumably the file doesn't have a :slam.hound.asplode/done sitting at the top-level half-way down |
| 23:33 | alex_baranosky | tomoj: nope :) |
| 23:34 | tomoj | well |
| 23:34 | tomoj | it looks like it's copying and writing to the same file at the same time? |
| 23:34 | tomoj | that can't be good |
| 23:34 | tomoj | I'd try using a temp file |
| 23:35 | tomoj | or.. the whole file really should be able to fit in memory, yes? |
| 23:35 | tomoj | s/copying/reading/ |
| 23:35 | alex_baranosky | there's something I don't understand about how read on a PushBAckerREader works |
| 23:35 | tomoj | io/reader is a BufferedReader, so presumably you lose whatever comes after the first buffered bit |
| 23:37 | alex_baranosky | will try the temp file approach |
| 23:40 | tomoj | hmm, if that were the explanation, I'd expect it to more likely blow up than truncate |
| 23:43 | alex_baranosky | tomoj: the files aren't really that big |
| 23:43 | alex_baranosky | just say 600 lines of Clojure |
| 23:45 | tomoj | apparently the default buffer size is 8192 bytes |
| 23:45 | tomoj | is that about how big the truncated files are? |
| 23:46 | tomoj | I don't have any sense for lines <-> bytes |
| 23:51 | technomancy | don't you hate it when you come to your senses in front of a jar of pistachios and have no idea how long you've been standing there eating them? |
| 23:52 | alex_baranosky | tomoj: the temp file fixed it!!! |
| 23:53 | xeqi | technomancy: at least they're somewhat healthy, not a bag of potato chips |
| 23:53 | alex_baranosky | technomancy: Fixed a bug in slam hound, would love to see the recent three features released. LEt me finish up the pull request though |
| 23:53 | technomancy | xeqi: plus the shells act as built-in rate limiters |
| 23:53 | technomancy | alex_baranosky: cool; sure thing |
| 23:54 | noncom | i'm reading cojure the clojure documentation. and it says, for refs: "Refs are bound to a single storage location for their lifetime", and then, for agents, it says: "Where Refs support coordinated, synchronous change of multiple locations, Agents provide independent, asynchronous change of individual locations" |
| 23:54 | noncom | so are refs bound to a single or multiple locations? |
| 23:55 | technomancy | noncom: a ref is a single location, but refs support multiple refs being changed in a synchronous way |
| 23:55 | alex_baranosky | tomoj: the fix - https://github.com/technomancy/slamhound/pull/30/files#L2L16 |
| 23:56 | noncom | ummm.... i don't get it. is it about using plural? |
| 23:57 | technomancy | noncom: read up on dosync |
| 23:57 | noncom | ok i wil! |