2009-12-14
| 00:50 | tolstoy | how do you get Ant to print out the classpath it thinks it has? |
| 00:50 | tolstoy | Oops! Nevermind! Getting a useful error message! Yay! |
| 02:44 | ordnungswidrig | g'morning, all |
| 03:24 | LauJensen | Morning team :) |
| 03:55 | LauJensen | Where are the results for the Wide Finder 2 runs ? For all languages? |
| 03:58 | LauJensen | Ah got it |
| 04:14 | LauJensen | Is Danny from Dannynet present here today? |
| 04:30 | G0SUB | hey |
| 04:30 | G0SUB | I am facing some problems in downloading compojure using lein + clojars |
| 04:31 | G0SUB | compojure depends on clojure-1.1.0-alpha |
| 04:31 | G0SUB | there is nothing called clojure-1.1.0-alpha |
| 04:31 | G0SUB | it's either 1.1.0-master or 1.1.0-new |
| 04:32 | hiredman | well, you might be able to go into lein's cache (~/.m2/ maybe?) and just change the name of a jar file |
| 04:36 | G0SUB | hiredman: hmm, but why does compojure depend on a non-existent jar? |
| 04:39 | hiredman | G0SUB: the name of the jars built was changed to include the name of the branch |
| 04:40 | hiredman | happened a few days ago |
| 04:40 | G0SUB | hmm |
| 04:41 | G0SUB | hiredman: any idea when compojure will get fixed? |
| 04:41 | hiredman | nope |
| 04:42 | hiredman | I think I might have heard something about a recent version of lein that somehow works around this, but I could be wrong |
| 04:42 | G0SUB | hmm |
| 05:06 | G0SUB | hiredman: where can I get the project.clj file used for compojure? |
| 05:08 | hiredman | no idea |
| 05:08 | G0SUB | ok |
| 06:02 | G0SUB | which is the best FTP client for Java? |
| 06:14 | cark | i'm using apache commons ftp |
| 06:15 | G0SUB | cark: any nice Clojure wrappers around it? |
| 06:15 | cark | not that i know |
| 06:15 | G0SUB | ok |
| 06:15 | cark | it wouldn't be that usefull anyways |
| 06:17 | G0SUB | cark: found one http://github.com/kyleburton/sandbox/blob/master/clojure-utils/kburton-clojure-utils/src/main/clj/com/github/kyleburton/sandbox/ftp.clj :) |
| 06:18 | cark | nice =) |
| 07:17 | fliebel | Woha! This morning I woke up thinking about an application as fluid going though a set of pipelines and filters from input to output. Like… streaming data instead of calling functions. I invented flow programming, looked it up on google, found this: http://en.wikipedia.org/wiki/Flow-based_programming This actually fits quite nicely in the lazy functional style of clojure, doesn't it? |
| 07:21 | fliebel | actually more like this maybe: http://en.wikipedia.org/wiki/Dataflow_programming |
| 07:27 | karmazilla | I wonder how common it is to have this experience where you reinvent dataflow programming. I've tried it too. |
| 07:32 | lpetit | ,(doc promise) |
| 07:32 | clojurebot | "([]); Experimental. Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to delivery will block. All subsequent derefs will return the same delivered value without blocking." |
| 07:37 | fliebel | karmazilla: I'm not sure about that… anyone else had the same? |
| 07:38 | fliebel | lpetit: that is something like a lazy var, right? I'm not sure if I understand that... |
| 07:39 | lpetit | fliebel: it enables threads to synchronize on the availability of data. Sort of "dataflow" building block |
| 07:39 | fliebel | ,(doc deliver) |
| 07:39 | clojurebot | "([promise val]); Experimental. Delivers the supplied value to the promise, releasing any pending derefs. A subsequent call to deliver on a promise will throw an exception." |
| 07:40 | fliebel | lpetit: So I set up a whole train of functions to use that object, and the 'release' it with the input source? |
| 07:42 | lpetit | fliebel: something like that, but I'm not expert. Just remembered this having been mentioned in the ml. I guess if there are several functions waiting for the delivery of the value, they must be in different threads. |
| 07:42 | karmazilla | lpetit: Neat. I've been annoyed that Java doesn't have a standard Promise class. |
| 07:43 | fliebel | lpetit: yea, you'd need treads… or you'd need to be able to return something and then happily continue computations. |
| 07:43 | lpetit | fliebel: there is this :http://richhickey.github.com/clojure-contrib/dataflow-api.html , I don't know it much, though. |
| 07:44 | fliebel | lpetit: sounds cool |
| 07:45 | fliebel | I've found another Wikipedia page about something like this: http://en.wikipedia.org/wiki/Functional_reactive_programming I think it might be more appropriate for a functional language… |
| 07:55 | lpetit | fliebel: yes, there so much interesting stuff to read. this one is close in my todo, also :) |
| 07:57 | fliebel | lpetit: agreed! :D |
| 08:08 | fliebel | It seems like such a powerful paradigm, yet I can find out so little about it. Some obscure languages doing it and some packages adding it to existing languages, most likely not designed with this paradigm in mind. |
| 08:13 | lpetit | fliebel: there's an introductory book on haskell which as a comprehensive example using this (if I remember correctly), but I didn't manage to get through the book past this example, since: 1./ I had little time to read the book, and 2./ I rediscovered clojure in the mean time :-) |
| 08:14 | lpetit | fliebel : there it is : http://www.haskell.org/soe/ |
| 08:16 | fliebel | lpetit: thanks |
| 08:32 | LauJensen | I apologize for the OT question, but Google is let me down. Does anyone know of a time-tracker with similar functionality as org-mode, which just sits in a little linux desktop app instead of Emacs? (not Hamster) |
| 08:37 | ohpauleez | LauJensen: I know of a Java-based time tracker app I thought looked real nice, but I never ended up using |
| 08:37 | ohpauleez | let me see if I can dig it up |
| 08:37 | LauJensen | ohpauleez: Makagiga? I'm looking at it right now |
| 08:37 | ohpauleez | LauJensen: http://rachota.sourceforge.net/en/index.html |
| 08:37 | LauJensen | ah ok, thanks |
| 08:38 | ohpauleez | totally welcome |
| 08:50 | LauJensen | Is there a way to pass the working directory as a command-line-arg to Java? java -jar /myproj/start.jar -wp /myproj ? |
| 08:57 | fliebel | I think you're supposed to cd there. If you only need the classes you can of course add it to cp. |
| 08:57 | LauJensen | k |
| 09:10 | fliebel | lpetit: I found a new language! http://www.mozart-oz.org/ Not nearly as cute and clean as Clojure and Python, but it looks powerful. |
| 09:15 | lpetit | fliebel: yes, it's the language the "CTM" book is based upon |
| 09:15 | lpetit | fliebel: "Concepts, Techniques and Models" of programming. Great book, bought it, 940 pages, read ~ 50 at the moment :-) |
| 09:16 | lpetit | fliebel: http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/0262220695/ref=sr_1_1?ie=UTF8&s=books&qid=1260800058&sr=8-1 |
| 09:16 | fliebel | cool |
| 09:18 | lpetit | fliebel: honestly, I find it a little bit hard to follow. But certainly worth reading it because it does not impose a certain vision (object oriented, purely functional, imperative, declarative, etc) on you, but rather seems to present all those alternatives and compares them |
| 09:19 | lpetit | fliebel: by "compares", I don't mean with the goal of having some final word such as "which one is the best", but rather "which one works the best for which kind of situation" |
| 09:20 | fliebel | lpetit: so you know oz? |
| 09:20 | lpetit | fliebel: just by name, and because it's the language used for the examples in the CTM book. |
| 09:23 | lpetit | fliebel: they use the notion of a "kernel language", with just enough primitives to allow write other primitives on top of it. They present the programming paradigms one by one, showing adding the missing primitives to the kernel language as they go, showing which notion is missing to be able to introduce each new paradigm. |
| 09:23 | lpetit | fliebel: sometimes I which I had not a job and could just sit at home in front of my laptop and with the dozen or so books I've bought but not yet read :-) |
| 09:24 | LauJensen | lpetit: sounds like an interesting comparison :) |
| 09:25 | lpetit | LauJensen: talking about my desire to have more time to study, or the previous post describing CTM ? :-) |
| 09:26 | LauJensen | "You'd want Objects when you need complexity which is unmanageable and no real tool for handling time. On the other hand, go with Functional paradigms for the cases where you dont want bugs and need a smaller codebase." |
| 09:26 | LauJensen | Your 'book review' |
| 09:28 | lpetit | LauJensen: where did you see this citation ? |
| 09:28 | LauJensen | I was just imagining what 'compares in terms of what to use when and not which is better' looks like written out in a book |
| 09:29 | lpetit | LauJensen: when I eventually finish the book (hopefully in 10 months, more certainly in 10 years) I promise I give you the answer :-) |
| 09:30 | LauJensen | I'll look forward to it :) |
| 09:57 | Tommock | hello |
| 09:57 | Tommock | can anyone figure out what is wrong with this http://pastebin.org/64723 ? |
| 09:59 | chouser | ((if ...)) will try to execute the return value of the 'if' |
| 09:59 | chouser | perhaps you want (if ...), this is only a single pair of parens |
| 10:03 | Tommock | chouser: oh so easy, thanks a lot! |
| 10:04 | chouser | np |
| 10:04 | Tommock | been trying to figure out what whas wrong for an hour or so now :) |
| 10:04 | chouser | out of curiousity, where'd the extra parens come from in the first place? |
| 10:05 | Tommock | my reasoning probably whent something like "the body of the function should be inclosed by something |
| 10:05 | chouser | ok |
| 10:05 | chouser | it jumped out at me because (( is pretty rare in Clojure code |
| 10:05 | Tommock | chouser: how is my indent style? looks ok? |
| 10:05 | Tommock | not sure how things should look |
| 10:07 | chouser | The body of 'do' should be indented another level |
| 10:07 | chouser | that way the 'then' and 'else' parts of 'if' stand out as the only two things at the same level under 'if'. |
| 10:08 | chouser | other than that it's ok, though I'd recommend spaces instead of tabs -- 2 spaces per level is most common, though 4 is probably ok. |
| 10:09 | Tommock | chouser: my personal preference is tabs but thanks for the advice :D |
| 10:10 | Tommock | well I |
| 10:10 | Tommock | 'm off then |
| 10:10 | chouser | bye |
| 10:21 | rhickey | http://clojure.org/funding |
| 10:22 | chouser | rhickey: might be good to have a donate button (or link to one) on that page. |
| 10:22 | rhickey | I added a link back to the home page |
| 10:22 | chouser | oh ok, I see that now. |
| 10:22 | rhickey | could put it right there... |
| 10:25 | LauJensen | rhickey: I think that a public indication of how much support you raise would be motivational for private contributors, how would you feel about that? |
| 10:25 | rhickey | ok, Donate button right on funding page now |
| 10:26 | rhickey | LauJensen: I am asking people if they want to be listed on a Donors page, will set that up soon |
| 10:27 | LauJensen | rhickey: Not quite was I was thinking, but something like Wikipedias progressbars. |
| 10:27 | rhickey | LauJensen: no |
| 10:27 | lpetit | LauJensen: you mean a progress bar towards a full year of work from Rich funding ? |
| 10:28 | LauJensen | Yes something like that |
| 10:28 | LauJensen | I always find that stuff motivational |
| 10:38 | cemerick | rhickey: A donors page would be good. Mix that with the opportunity to list job openings from sponsors, perhaps. |
| 10:42 | rhickey | cemerick: you've mentioned that before - what's the idea there? |
| 10:44 | cemerick | rhickey: well, from the perspective of larger sponsors (whatever that means), being able to highlight that connection and therefore perhaps attract highly self-screened candidates (programmers already looking at the clojure.org site) would be an obvious advantage compared to existing recruitment paths |
| 10:44 | icey | Python uses "sponsor members" for corporate donors: http://python.org/psf/#id2 |
| 10:44 | icey | maybe something like that? |
| 10:45 | cemerick | for you and the broader clojure community, being able to show that there is an active job market lends to the language's credibility in all sorts of ways |
| 10:46 | cemerick | rhickey: I think it would be totally reasonable for you to host a clojure-centric job board, charge some nominal amount to submit listings (which obviously helps with the funding), and then sponsors' listings are always at the top, or highlighted, or whatever. |
| 10:47 | cemerick | icey: yeah, something like that, although the presentation there is...lacking |
| 10:47 | rhickey | cemerick: I'm all for job listings, I guess my initial pang is that limiting it to sponsors might be excluding. OTOH, once you are hiring Clojure devs, sponsoring is a good idea. This would be for Clojure-related jobs only, right? |
| 10:48 | icey | cemerick: well I'm not suggesting using their design ;) However, I do know that the donors page has turned into a good recruitment tool for companies that want to show that they support the language |
| 10:48 | chouser | well. Clojure and PHP of course. |
| 10:48 | rhickey | :) |
| 10:48 | angerman | phew ... I can continue to use clojure. |
| 10:48 | cemerick | rhickey: oh, I would never say that listings should be limited to sponsors. I would say that a sponsorship of $X or more would get the organization in question N "free" job listings for the following year or whatever. |
| 10:48 | angerman | ;;) |
| 10:49 | cemerick | rhickey: "clojure-centric" is a reasonable phrase, although the meaning is obviously flexible. |
| 10:49 | chouser | :-) |
| 10:49 | cemerick | heh |
| 10:50 | angerman | ~t-test (:ns incanter.stats) |
| 10:50 | clojurebot | I don't understand. |
| 10:50 | angerman | :/ |
| 10:51 | cemerick | rhickey: it's obviously going to be a little thin for some time, so until there's a regular deal flow, as it were, just keeping a list of available jobs on a static page would be fine :-) |
| 10:51 | chouser | angerman: I'm curious about your comment about continuing to use clojure. |
| 10:51 | icey | You could always threaten people with adoption of a bizarre Franz-like licensing model for forward versions ;) |
| 10:51 | angerman | chouser: I'm student at TU Munich |
| 10:51 | cemerick | ouch |
| 10:51 | angerman | money is quite shallow |
| 10:51 | chouser | angerman: ah, ok. That was my guess. |
| 10:52 | angerman | My stupid questions reveal my identity I guess, he |
| 10:53 | chouser | angerman: oh, nonsense. |
| 10:54 | angerman | well, Google Talk on YouTube in 10 minutes. bye |
| 10:55 | the-kenny | Google Talk on Youtube? |
| 10:55 | maddis | perhaps a talk at Google live on YouTube? |
| 10:55 | angerman | yes. They host it in our biggest lecture hall at the Mathematics and Computerscience Bldg. Campus Garching. |
| 10:57 | the-kenny | Oh, Google holds a talk about Youtube? I read it "Google Talk (the Xmpp-Service) on Youtube" |
| 10:57 | angerman | yes |
| 11:02 | chouser | it might be fun to add "I paid for Clojure" to your signature on google group posts. |
| 11:03 | cemerick | ah, good idea |
| 11:03 | icey | have you considered forming a nonprofit (501(c)3) for the Clojure finances? |
| 11:03 | cemerick | if licensing won't do it, if entreaties won't do it, then shame will! :-) |
| 11:03 | esj | cemerick: you must be Catholic :p |
| 11:03 | cemerick | heh, hardly |
| 11:04 | cemerick | but shame is a *wonderful* motivator. |
| 11:04 | cemerick | internet anonymity makes it slightly harder to pull off, but it's worth a shot |
| 11:09 | rhickey | chouser: Yes, "I paid for Clojure" is a fine idea |
| 11:09 | shoover | As distinct from a "Clojure was my idea" marketing campaign |
| 11:10 | rhickey | :) |
| 11:10 | shoover | Only authors of books and langs on the Clojure reading list can put that |
| 11:11 | the-kenny | Maybe everyone who donates can get a handwritten closing-parenthesis from rhickey, xkcd does something like this with scans from their comics. |
| 11:12 | chouser | haha! a closing paren. |
| 11:12 | _fogus_ | If you donate above a certain amount you can get a matching opening paren |
| 11:13 | Chousuke | what about the other data structures? :/ |
| 11:13 | icey | I wonder how much effort it would take to create one of those laminated 1-page "cheatsheets" you see out there, and sell them from the website. The language is small enough that the pertinent information should fit |
| 11:15 | cemerick | little chotchkies are nice, but I'll wager making them would be a huge PITA for rhickey *shrug* |
| 11:16 | icey | cemerick: yeah, that's what i was concerned about |
| 11:16 | stuartsierra | You'd want to outsource all the printing/delivery to something like cafepress. |
| 11:16 | devlinsf | cemerick: So do what PBS does, and "sell" them for $50 each |
| 11:17 | stuartsierra | devlinsf: Yes! |
| 11:17 | icey | although, along the cafepress route, i'd certainly buy a clojure logo coffee cup. but that's probably just the caffiene addict in me speaking |
| 11:17 | devlinsf | icey: :) |
| 11:17 | chouser | there are already clojure T-shirts |
| 11:17 | icey | chouser: they don't hold my coffee well :( |
| 11:18 | chouser | to date they've brought in about enough money to pay for about 30mins of rhickey clojure development time. :-) |
| 11:19 | chouser | which granted is long enough to fully develop a feature like 'trampoline', but still... |
| 11:19 | the-kenny | icey: But you can drain them in coffee and absorb the coffeine with your skin |
| 11:19 | icey | I definitely agree that straight donations are the most efficient way to go; but there will always be a number of people who won't donate straight cash but will buy little toys or whatever. no idea why, but i know they're out there |
| 11:20 | _fogus_ | chouser: Are those the "State: YDiW" shirts? |
| 11:20 | chouser | _fogus_: there are a few styles. |
| 11:21 | chouser | http://www.zazzle.com/clojure |
| 11:21 | chouser | "don't be so eager" |
| 11:21 | chouser | "lisp is not dead. The url is now clojure.org" |
| 11:21 | chouser | "I get more done when I'm lazy" |
| 11:22 | _fogus_ | Ahhh. I got the state shirt a long time ago but didn't know there were more to choose from. Looks like I will never again need to wear non-Clojure clothing. |
| 11:23 | chouser | heh. |
| 11:23 | chouser | oh, you bought it from zazzle? How was the print quality? I haven't seen one yet. |
| 11:24 | _fogus_ | Very nice actually. Good quality fabric also. I've had it since perhaps day 2 and it's still in great shape. |
| 11:26 | maravillas | certainly there must be a threads pun appropriate for a tshirt |
| 11:26 | hiredman | ping? |
| 11:26 | clojurebot | PONG! |
| 11:27 | hiredman | aww, come on |
| 11:27 | hiredman | there we go |
| 11:29 | esj | is it idiomatic to put your tests in .clj where the target functions are defined ? |
| 11:30 | devlinsf | esj: how are you testing? |
| 11:30 | esj | clojure.test |
| 11:30 | devlinsf | My opinion is no |
| 11:30 | devlinsf | If you were using the meta, I'd say yes |
| 11:31 | devlinsf | You're talking about putting it all in the same ns, right? |
| 11:31 | esj | Thanks. I tend to agree. I want to put them in a seperate file and then (use it. I'm missing something though, because then I run into ns issues. |
| 11:31 | esj | aaah, devlinsf, read my mind |
| 11:32 | devlinsf | Well, I do the following w/ my code |
| 11:32 | devlinsf | I have (ns a.long.ns ... and I define a test lib. Usually (ns test.a.long.ns |
| 11:32 | devlinsf | Also depends one the code |
| 11:32 | esj | ok |
| 11:33 | devlinsf | A lot of my stuff has a lib prefix in the ns |
| 11:33 | stuartsierra | esj: It's tempting to try to put tests and fns in the same file, I even tried to support it with clojure.test. But it ends up being messy in practice. |
| 11:33 | esj | then test.a.a.long.ns uses a.long.ns and badda bind ? |
| 11:33 | devlinsf | badda? |
| 11:33 | esj | s/badda bind/badda-bing/ |
| 11:33 | devlinsf | Oh, badda nibg |
| 11:33 | devlinsf | bing |
| 11:33 | devlinsf | Yes |
| 11:33 | esj | :) |
| 11:34 | esj | ok, thanks gents. This time I'm reall, REALLY, going to write the tests for my code... |
| 11:34 | devlinsf | check out contrib's structure |
| 11:34 | devlinsf | there's clojure.contrib.a-ns |
| 11:34 | esj | devlinsf: great idea, shoulda thought of that. |
| 11:34 | devlinsf | and usually clojure.contrib.test.a-ns |
| 11:35 | devlinsf | Some libs are different, though |
| 11:35 | esj | will do. |
| 11:35 | patrkris | I'm reviewing some of the articles that are critical of STM, and wondered if there is a fundamental difference between the transaction systems found in database systems that makes transactions viable in those and not in programming languages? |
| 11:35 | devlinsf | esj: Good luck |
| 11:36 | chouser | patrkris: STM is a very broad category of functionality. Don't assume that critisizm of one STM implementation applies to another. |
| 11:37 | esj | devlinsf: thanks. |
| 11:37 | arohner | patrkris: and even between programming languages, the functionality in one language STM is very different from another |
| 11:38 | arohner | most of the "STM is a failure" articles you see talk about cramming STM into Java / C#, with little to no change in syntax or semantics |
| 11:39 | patrkris | chouser, arohner: yes, but reading "STM: Why is it only a research toy?" gives the impression, that there is something fundamentally wrong with STM - but I see so many things in that article that doesn't apply to Clojure's implementation |
| 11:39 | arohner | STM in java with lots of mutable state everywhere and no change in language semantics is a very different beast that building STM in at the start to a functional language with immutable data |
| 11:40 | patrkris | arohner: yes you are right |
| 11:40 | arohner | the proof is still in the pudding. their articles really just say "*we* couldn't get STM to work". Look at clojure yourself, and decide if clojure got STM to work. :-) |
| 11:41 | patrkris | yes... their focus is also on performance, it appears. Doesn't matter whether your programs are correct, I suppose :) |
| 11:41 | chouser | for one, because of the immutable collections and other reference types, you can actually do quite a lot of even multithreaded work in Clojure without ever using the STM. |
| 11:41 | dabd | where is the macro 'defprotocol' defined? |
| 11:42 | chouser | dabd: in the 'new' branch |
| 11:42 | patrkris | chouser: yes, that is one of the things I am going to mention in what I'm writing |
| 11:42 | dabd | chouser: I'm trying to compile the enclojure plugin and it fails because it uses this macro |
| 11:45 | liwp | dabd: defprotocol is defined only in the 'new' branch of the clojure github repository, so if you're using the 'master' branch or the 1.0 version of clojure you won't have the defprotocol macro |
| 11:46 | liwp | dabd: you'll have to move to the 'new' branch to be able to use the compojure plugin if it depends on defprotocol |
| 11:46 | hiredman | liwp: enclojure |
| 11:46 | liwp | uhh, sorry |
| 11:47 | hiredman | it's odd that enclojure would depend on the new branch |
| 11:47 | chouser | that's what I was thinking. |
| 11:47 | chouser | dabd: maybe you should try a slightly older version of enclojure? |
| 11:48 | dabd | chouser: yes currently I'm unable to use enclojure because it fails to start a project REPL |
| 11:48 | dabd | so I was trying to build it from source to see what is happening |
| 11:49 | cemerick | rhickey: to what degree are you going to report on fundraising efforts? I know that's getting very close to your personal finances, but being able to say "X has been raised across N contributions averaging K per contribution" would be interesting/encouraging. |
| 11:50 | dabd | hiredman: you can see defprotocol being used here in the enclojure source http://github.com/EricThorsen/enclojure/blob/master/src/protocols/src/org/enclojure/protocols.clj |
| 11:51 | rhickey | cemerick: maybe X% of a year of funding? and a graph/chart? |
| 11:52 | cemerick | rhickey: sure. A normalized distribution of contribution amounts would be decent. |
| 11:53 | cemerick | People could infer a lot from something like that, so I wouldn't blame you for not sharing to that degree. |
| 11:53 | icey | rhickey: the only real problem with stating a goal like that is that I think you'll end up less likely to recieve donations as you near your goal |
| 11:54 | icey | although it's not bad for the time you're under 50% of your goal |
| 11:54 | rhickey | icey: true |
| 11:54 | cemerick | someone mentioned a progress bar before though, which can be motivating for some |
| 11:55 | Chousuke | what's the minimum donation that benefits you, by the way? |
| 11:56 | icey | hmmm... if you made the progress bar the goal for 2 years instead of one, it'd probably be less of an issue - even if you exceeded the goal for 1 year, it would give you the chance to start raising for the next year |
| 11:56 | icey | and if you could raise 2 years worth of funding inside of a 1 year window, you could change the verbiage |
| 12:01 | icey | I am curious if today's push will pay for at least a month of development when all is said & done. |
| 12:21 | reify | time to ebay all my non-essential computer equipment =) |
| 12:21 | reify | clojure, the "cloud", is all i need |
| 12:23 | _fogus_ | Hacker News seems to think that Clojure was created by some guy named Rick. |
| 12:31 | maddis | i have a remote REPL running through leiningen ('lein swank') and connected to it through M-x slime-connect, but I can't figure out how to compile/run local code I have open in another buffer through C-c C-k (or the slime-compile* commands). and tips on that? |
| 12:32 | the-kenny | maddis: Maybe with M-x slime-connection-list? |
| 12:32 | the-kenny | It should be possible to make a connection the "default" one in that buffer. |
| 12:41 | maddis | hmm, on C-c C-k it tires to find the local file on the remote location, which is not there. |
| 12:41 | maddis | 1 compiler notes: Unknown location: error: java.io.FileNotFoundException: /home/matthias/da/code/garec/src/garec.clj (No such file or directory). Compilation failed. |
| 12:42 | maddis | or am I completely wrong here and this all works different? :) |
| 12:46 | the-kenny | maddis: Hm.. then try M-x eval-region |
| 12:46 | the-kenny | uhm |
| 12:47 | the-kenny | slime-eval-region or slime-eval-buffer |
| 12:49 | maddis | ok, that works. thanks |
| 13:00 | the-kenny | What are the naming-conventions for the defproject from leiningen, if I want to push it to clojars> |
| 13:01 | patrkris | are there any case studies available of large applications with a high degree of concurrency using Clojure (and especially the STM) succesfully? |
| 13:03 | maddis | patrkris, perhaps this will help you: http://portal.acm.org/citation.cfm?id=1562870 |
| 13:04 | patrkris | maddis: thanks |
| 13:49 | qed | where can we donate to clojure? |
| 13:49 | hiredman | clojure.org |
| 13:49 | qed | oh, right :) |
| 13:49 | qed | thanks |
| 13:50 | KirinDave | I hope Rich will disclose how much he makes in a day from this campaign. ;) |
| 13:54 | qed | KirinDave: heh |
| 14:09 | headius | technomancy: ping |
| 14:15 | djork | if I spent as much on Clojure as my wife did on her hair rhickey would be better off |
| 14:15 | djork | or at least his wife could get her hair done |
| 14:16 | LauJensen | Is Matt of Conjure fame here tonight? |
| 14:20 | technomancy | headius: ICMP_ECHO_REPLY |
| 14:20 | headius | hi there! |
| 14:21 | headius | I was going to suggest we should bundle up a gem that's just clojure and release it |
| 14:21 | headius | so other gems could depend on that one |
| 14:21 | SergeyDidenko | Hi, could anyone advise the workaround for the absent "byte-array"? - (byte-array [1 2 3]) |
| 14:21 | headius | I want to do a pass at wrapping the collections with some Ruby stuff |
| 14:21 | technomancy | headius: oh yeah, sure. I don't think my gem ever made it out to any servers outside github, so there shouldn't be any overlap issues. |
| 14:21 | headius | ok |
| 14:21 | SergeyDidenko | Is "make-array" + "aset" the only way? |
| 14:22 | cemerick | SergeyDidenko: (into-array Byte/TYPE [1 2 3]) |
| 14:22 | technomancy | I never quite got that exception-wrapping problem solved for transaction retries. |
| 14:22 | cemerick | ,(into-array Byte/TYPE [1 2 3]) |
| 14:22 | clojurebot | java.lang.IllegalArgumentException: argument type mismatch |
| 14:22 | cemerick | hrm |
| 14:23 | cemerick | yuck |
| 14:23 | cemerick | ,(into-array Integer/TYPE [1 2 3]) |
| 14:23 | clojurebot | #<int[] [I@1a8de42> |
| 14:23 | cemerick | ,(into-array Byte/TYPE (map byte [1 2 3])) |
| 14:23 | clojurebot | #<byte[] [B@2b9edc> |
| 14:23 | cemerick | SergeyDidenko: Looks like ^^ is the best you can get right now |
| 14:24 | chouser | ,byte-array |
| 14:24 | clojurebot | java.lang.Exception: Unable to resolve symbol: byte-array in this context |
| 14:25 | SergeyDidenko | cemerick, strange it does not work on my computer. Probably I need to get the latest sources |
| 14:25 | hiredman | SergeyDidenko: that should work |
| 14:25 | hiredman | what exception are you seeing? |
| 14:25 | cemerick | ,(into-array Integer/TYPE (map byte [1 2 3])) |
| 14:25 | clojurebot | #<int[] [I@1994498> |
| 14:25 | SergeyDidenko | cemerick, do you use the recent Clojure version ? |
| 14:26 | cemerick | SergeyDidenko: I'm generally on 1.1-new, although that should work fine even in 1.0 (I think) |
| 14:27 | SergeyDidenko | (into-array Byte/TYPE [1 2 3]) throws java.lang.IllegalArgumentException: argument type mismatch (NO_SOURCE_FILE:0) |
| 14:27 | lghtng | I started out wanting to just contribute a few sparql wrappers as a learning project and now im sitting here reading Marvin Minsky's "Semantic Information Processing" c.1968: Is there a word for that? |
| 14:27 | danm_ | SergeyDidenko: missed the map byte part |
| 14:27 | chouser | 1.1-alpha and 1.1-new should have byte-array now. |
| 14:27 | cemerick | ah, (into-array Byte/TYPE [1 2 3]) would work if a type.cast() call were made in RT.seqToTypedArray |
| 14:27 | SergeyDidenko | thank you guys :) |
| 14:27 | chouser | lghtng: enlightenment? |
| 14:28 | cemerick | although I suppose we wouldn't want the overhead |
| 14:28 | lghtng | works for me |
| 14:34 | KirinDave | I think I may have a functioning webapp using compojure. Whee. |
| 14:34 | KirinDave | What compojure needs, what every webapp framework needs, is a generator. |
| 14:35 | chouser | nonono |
| 14:35 | cemerick | ooh, this'll be fun :-) |
| 14:35 | KirinDave | ? |
| 14:35 | Chousuke | generator? :/ |
| 14:35 | lghtng | transformer |
| 14:35 | KirinDave | Like, lein new. |
| 14:36 | Chousuke | aha. |
| 14:36 | KirinDave | Something that does mundane shit like drop a shell script that can help target public and things like that. |
| 14:36 | Chousuke | write a lein plugin! |
| 14:36 | cemerick | KirinDave: don't mind me, I've just always enjoyed the dynamic vs. static site debate. |
| 14:36 | the-kenny | Should be easy to write a leiningen plugin for this :) |
| 14:36 | Chousuke | nein new-compojure :P |
| 14:36 | KirinDave | Sure. |
| 14:36 | Chousuke | lein* too |
| 14:38 | hiredman | http://github.com/hiredman/appengine-helper |
| 14:41 | the-kenny | Google should allow Threads for clojure :( |
| 14:41 | stuartsierra | My take on datatypes/protocols: http://stuartsierra.com/2009/12/14/objects-are-not-adts |
| 14:44 | KirinDave | Man, the power of SSDs |
| 14:44 | KirinDave | it takes less time to start my app in -server on my laptop than on this big server. |
| 14:44 | maacl | Does anyone know of any Crane usgae examples ? |
| 14:54 | jgracin | I see that add-classpath has been deprecated. Is there some new way of modifying classpath at runtime? |
| 14:56 | the-kenny | jgracin: IIRC, changing the classpath just causes problems, I wouldn't do it. |
| 14:56 | danm_ | all I've read is that you can't |
| 14:57 | danm_ | so if you want to change the classpath, restart clojure |
| 14:57 | the-kenny | danm_: There *was* add-classpath in clojure, but it just caused problems, so it's deprecated now. |
| 14:57 | danm_ | yeah |
| 14:57 | danm_ | it never seemed to work for me anyway |
| 14:57 | stuartsierra | It's a problem with how classpaths are usually implemented in Java. |
| 14:58 | stuartsierra | The root classpath is created when the JVM starts and cannot be changed. |
| 14:59 | hiredman | stuartsierra: would replacing the system classpath fix that? |
| 14:59 | hiredman | er |
| 14:59 | stuartsierra | hiredman: You can't replace the system classpath without hacking the JVM, I think. |
| 14:59 | hiredman | system classloader |
| 14:59 | stuartsierra | You can replace the system classloader I think. |
| 14:59 | hiredman | -Djava.system.class.path |
| 14:59 | stuartsierra | Yes. But that's real JVM voodoo right there. |
| 15:00 | hiredman | http://gist.github.com/255766 |
| 15:01 | hiredman | danm_: I'd like to see people who had trouble with add-classpath try this out |
| 15:01 | rhickey | java.system.class.loader |
| 15:01 | stuartsierra | Like I said, voodoo. |
| 15:01 | hiredman | rhickey: right! |
| 15:02 | hiredman | rhickey: would that fix the visibility problems from add-classpath? |
| 15:02 | jgracin | I have a standalone application which needs to contact a configuration registry system and find out which plugins to load. |
| 15:02 | rhickey | I think it would be generally useful for someone to make a solution based upon that, just for development |
| 15:02 | rhickey | the big problem is that people will build runtime dependencies on it, and that can't be satisfied in all runtime environments |
| 15:03 | hiredman | :| like the above mentioned plugin system |
| 15:03 | rhickey | hiredman: yes, it would not have those problems, but it can't be used in all situations, i.e. when you don't control startup |
| 15:03 | hiredman | right |
| 15:04 | hiredman | I was thinking along the lines of lien |
| 15:04 | hiredman | lein? |
| 15:04 | stuartsierra | See? No one can spell it! |
| 15:04 | hiredman | :P |
| 15:05 | lghtng | tangential question: can the classpath be modified via emacs/slime? |
| 15:05 | hiredman | anyway, that gist above generates a cl.jar (that contains a classloader class) and prints out (cryptic) usage instructions |
| 15:05 | stuartsierra | lghtng: no, same problem |
| 15:08 | fanatico | ,seen technomancy |
| 15:08 | clojurebot | java.lang.Exception: Unable to resolve symbol: seen in this context |
| 15:08 | lghtng | .seen technomancy |
| 15:08 | hiredman | clojurebot: seen technomancy? |
| 15:08 | clojurebot | technomancy was last seen quiting IRC, 18 minutes ago |
| 15:09 | fanatico | thanks. |
| 15:11 | qed | Just sent my relatives an email asking they donate to clojure instead of buying me presents or gift certificates. |
| 15:11 | qed | Hopefully they haven't gotten me anything yet. :) |
| 15:15 | lghtng | http://en.wikipedia.org/wiki/GNU_Classpath |
| 15:16 | hiredman | :| |
| 15:22 | maddis | qed, that is a really good idea! don't think my parents/relatives understand that, but it's worth a try :) |
| 15:23 | qed | my mom wont have a clue, but my dad actually asked me if clojure was like dylan |
| 15:23 | qed | i was pretty surprised he knew about dylan :) |
| 15:24 | the-kenny | qed: Bob Dylan? :P |
| 15:24 | qed | haha |
| 15:24 | qed | nah, you know, the programming language |
| 15:25 | qed | he's an old mac nerd, worked w/ Kai Krause and Eric Wenger once upon a time |
| 15:25 | maddis | i thought of Dylan from 90210, the tv series ;P |
| 15:25 | qed | hahaha |
| 15:26 | the-kenny | My father asks me every two days if and how he can copy a folder into another folder. |
| 15:26 | qed | do you tell him `cp -R` |
| 15:26 | qed | as in "you'll need `cp -R` if you ask me that again" |
| 15:26 | the-kenny | ...he is using windows |
| 15:26 | qed | get him on ubuntu and show him how to google |
| 15:27 | the-kenny | I told him if he want me to keep supporting him with computer related things, he should either buy a mac or let me install linux. |
| 15:27 | qed | i really think that there needs to be some google instruction for people |
| 15:27 | the-kenny | We agreed to do this when his current laptop dies |
| 15:27 | qed | nice |
| 15:27 | the-kenny | (Which should happen in the next months :)) |
| 15:28 | the-kenny | He's also using an old pc with a pentium 2 in his office |
| 15:28 | the-kenny | windows 2000 |
| 15:33 | qed | That is..old |
| 15:33 | the-kenny | Yes |
| 15:33 | qed | There are still some machines we support that run Win2k unfortunately |
| 15:34 | the-kenny | and full of viruses ;) |
| 15:34 | the-kenny | It's time to replace it. |
| 15:39 | the-kenny | I had a dream last night about a cool project in clojure and something with tagsoup.... But I forgot what it was :( |
| 15:50 | lghtng | would be interesting to see clojure running inside jnode or looking glass |
| 15:50 | lghtng | or as an appliance in jnode |
| 15:51 | hiredman | maxine! |
| 15:51 | hiredman | guestos vm! |
| 15:51 | qed | looking glass? |
| 15:52 | qed | is that a way to view router configs? |
| 15:53 | lghtng | http://research.sun.com/projects/maxine/max.html |
| 15:53 | lghtng | lg3d has been pronounced dead by its founder |
| 15:54 | lghtng | the deb repositories dont work but there is still an .iso built on pclinuxos |
| 15:57 | lisppaste8 | the-kenny pasted "lein deps problems" at http://paste.lisp.org/display/92100 |
| 15:57 | the-kenny | Can someone tell me where's the problem there? |
| 15:58 | hiredman | stuff got renamed a few days ago yadda yadda yadda |
| 15:58 | qed | someone was talking about this the other day |
| 15:58 | qed | yeah |
| 15:58 | qed | i think chouser is the guy who renamed some stuff |
| 15:58 | cemerick | darn that chouser :-P |
| 15:58 | qed | the-kenny: your best bet is to just download them and put them in ~/.m2 |
| 15:59 | hiredman | clojurebot: rename? |
| 15:59 | clojurebot | Huh? |
| 15:59 | hiredman | clojurebot: rename is <reply>clojure-alpha was renamed clojure-master, and this broke most of the projects on Clojars |
| 15:59 | clojurebot | Ik begrijp |
| 16:00 | qed | clojurebot: rename? |
| 16:00 | clojurebot | clojure-alpha was renamed clojure-master, and this broke most of the projects on Clojars |
| 16:00 | qed | clojurebot: @markov chouser |
| 16:00 | clojurebot | Who?? |
| 16:00 | qed | heh, worth a shot... |
| 16:02 | the-kenny | hm.. how long will it take clojars to normalize again? |
| 16:03 | hiredman | I imagine it is up to the projects to update their config and push |
| 16:04 | the-kenny | Yeah, got that.. maybe someone should write about this in the mailing list? |
| 16:05 | hiredman | has been |
| 16:05 | hiredman | like a week ago, or something, when the rename came up |
| 16:06 | the-kenny | So [org.clojure/clojure "1.1.0-master-SNAPSHOT"] is the right thing to include in project.clj now? |
| 16:06 | hiredman | I suppose |
| 16:10 | the-kenny | _ato: Is that your compojure-jar on clojars? |
| 16:17 | qed | with file-seq, I get a coll of Files, im trying to break them up into a structure like xml |
| 16:20 | Intertricity | Is there a clojure equivalent to python's pickle? |
| 16:22 | maravillas | c.c.duck-streams/spit and /slurp maybe? |
| 16:22 | stuartsierra | No. |
| 16:23 | arohner | pr is closer, but still not comprehensive |
| 16:23 | stuartsierra | Intertricity: read/pr gets you 9/10 of the way there |
| 16:23 | Intertricity | stuartsierra, ahh thanks :) |
| 16:24 | qed | No matching method found: parse for class com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl |
| 16:26 | hiredman | qed: read the docs on parse and pass it one of the specified classes |
| 16:28 | drewr | chouser: I'm happy to fix that *-seq issue |
| 16:29 | drewr | the buggy patch is from me :-/ |
| 16:33 | qed | hiredman: I have something like (file-seq (java.io.File. "/path/to/dir")) -- parse looks like it takes Files, so why can't I parse that? |
| 16:33 | hiredman | ,(doc clojure.xml/parse) |
| 16:33 | clojurebot | "([s] [s startparse]); Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/element struct-map, which has the keys :tag, :attrs, and :content. and accessor fns tag, attrs, and content. Other parsers can be supplied by passing startparse, a fn taking a source and a ContentHandler and returning a parser" |
| 16:34 | hiredman | ,(doc file-seq) |
| 16:34 | clojurebot | "([dir]); A tree seq on java.io.Files" |
| 16:34 | qed | how would i turn what I have into an InputStream? |
| 16:34 | hiredman | hmmm |
| 16:34 | hiredman | ~def file-seq |
| 16:35 | lghtng | ,(doc element) |
| 16:35 | clojurebot | No entiendo |
| 16:35 | qed | how could I turn it into an InputStream? |
| 16:35 | lghtng | ,(doc :tag) |
| 16:35 | clojurebot | java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to clojure.lang.Symbol |
| 16:35 | lghtng | right |
| 16:35 | lghtng | ,(doc InputStream) |
| 16:35 | hiredman | what does the output of file-seq look like? |
| 16:35 | clojurebot | Excuse me? |
| 16:36 | qed | (#<File /Users/defn/foo> #<File /Users/defn/foo/bar> #<File /Users/defn/foo/bar/bar.txt> #<File /Users/defn/foo/baz> #<File /Users/defn/foo/baz/baz.txt> #<File /Users/defn/foo/foo.txt>) |
| 16:36 | lghtng | ,(doc startparse) |
| 16:36 | clojurebot | Gabh mo leithscéal? |
| 16:36 | qed | (doc clojure.xml/startparse) |
| 16:36 | clojurebot | Titim gan éirí ort. |
| 16:37 | lghtng | ,(doc clojure.xml/startparse) |
| 16:37 | clojurebot | excusez-moi |
| 16:37 | qed | (doc clojure.xml/startparse-sax) |
| 16:37 | clojurebot | "([s ch]); " |
| 16:37 | hiredman | and how are you calling parse? |
| 16:37 | lghtng | ,(doc ddt) |
| 16:37 | clojurebot | Excuse me? |
| 16:37 | hiredman | lghtng: knock it off |
| 16:37 | lghtng | eep |
| 16:38 | qed | hiredman: i tried to just run (parse (file-seq...)), also tried to map it to see if that worked but got an exception about content and prolog |
| 16:40 | hiredman | a. file-seq does not return one of the types mentioned by xml/parse b. the other error most likely means you don't have a well formed xml file (the default parser is a stickler) |
| 16:40 | hiredman | ignoring exceptions like that is a bad habit to get into |
| 16:40 | hiredman | just the fact that you are getting a different exception is useful information |
| 16:41 | qed | i guess my question is, can i turn that file-seq output into an inputstream |
| 16:41 | hiredman | it won't matter if your xml is not well formed |
| 16:41 | hiredman | which is most likely what that exception was trying to tell you |
| 16:41 | qed | ah, okay -- ill mess with it and try to figure out what's up with it |
| 16:45 | lghtng | does clojure do natural inheritance? like native OO? |
| 16:45 | Chousuke | Clojure is not very object-oriented. |
| 16:46 | lghtng | or does it rely on backdoor methods like CLOS did? |
| 16:46 | Chousuke | backdoor? |
| 16:46 | Chousuke | I'm not sure what you mean. |
| 16:46 | lghtng | we've got object orientation, only its all extentions |
| 16:47 | lghtng | so inheritance is something you build, not included |
| 16:47 | Chousuke | the closest to a native OO construct in Clojure (not interop) would be defprotocol and deftype I guess. |
| 16:47 | the-kenny | _ato: ping |
| 16:47 | Chousuke | but even those emphasise *decoupling* objects from methods |
| 16:47 | chouser | also 'derive' and multimethods |
| 16:48 | hiredman | dispatch hierarchies are reified |
| 16:48 | lghtng | i know it can do all those things and alot more, im just wondering how much has already been done |
| 16:48 | chouser | multimethod dispatch has type inheritence built in. |
| 16:49 | lghtng | since this is all library building stuff going on here, there is a SHITLOAD of undocumented stuff thats available but unlisted |
| 16:49 | hiredman | not true |
| 16:49 | hiredman | clojure.org |
| 16:49 | lghtng | we dont want any unnecessary duplication, right? |
| 16:49 | Chousuke | I'm not sure what you mean. |
| 16:49 | Chousuke | What are you looking for, exactly? |
| 16:50 | lghtng | just knowledge |
| 16:50 | hiredman | lghtng: I would avoid righting a oop library for clojure |
| 16:50 | hiredman | I doubt anyone will use it |
| 16:50 | lghtng | i have no plan to, im just interested in the state of it's emergence |
| 16:51 | lghtng | as it will emerge, just at what rate and how dominant it will be |
| 16:51 | chouser | what feature are you looking for that such a library would provide? |
| 16:51 | lghtng | its funny about that |
| 16:51 | Chousuke | I mean, if you really want to do the "traditional" kind of OOP, maybe Clojure isn't the best language. However, many things you would do using OOP in other languages are perfectly doable using non-OOP methods in Clojure. |
| 16:51 | lghtng | nothing in particular |
| 16:51 | lghtng | not me, in general |
| 16:51 | hiredman | there is at least one oop library that has already been abandoned |
| 16:52 | hiredman | ~rationale |
| 16:52 | clojurebot | rationale is http://clojure.org/rationale |
| 16:52 | Chousuke | OOP in clojure that is not completely whacked is essentially equivalent to having functions that take some "special" value as their first argument, anyway. |
| 16:53 | hiredman | "for Functional Programming" |
| 16:53 | hiredman | clojurebot: oo? |
| 16:53 | clojurebot | OO is to programming what astrology is to astronomy |
| 16:53 | Chousuke | heh :P |
| 16:53 | hiredman | clojurebot: why oo sucks? |
| 16:53 | Chousuke | but I think protocols and deftype will satisfy most people's "OO" needs. |
| 16:53 | clojurebot | OO is to programming what astrology is to astronomy |
| 16:53 | lghtng | i've recommended clojure to developers as an alternative to java, so far the answers have ranged from 'what about side effects' to 'what about side effects' |
| 16:53 | hiredman | clojurebot: why oo sucks is <reply>http://www.sics.se/~joe/bluetail/vol1/v1_oo.html |
| 16:53 | clojurebot | Ik begrijp |
| 16:54 | hiredman | lghtng: you mean the questions |
| 16:54 | lghtng | 'ignore side effects at your peril' seems to be the moral that java programmers are offering |
| 16:54 | dnolen | lghtng: it might be helpful to look at some of the long threads discussing this stuff on the mailing list, there a couple actually. |
| 16:54 | Chousuke | lghtng: Clojure is not purely functional, so just write side-effecting functions. |
| 16:54 | drewr | does Sean Devlin hang out on here? |
| 16:55 | chouser | drewr: at times |
| 16:55 | lghtng | i should see if the guy will come here to speak with you himself |
| 16:55 | dnolen | lghtng: also don't understand the "what about side effects"? Clojure is firmly in the anti-side effects camp. |
| 16:55 | chouser | Did someone recommend ignoring side-effects? seems unlikely |
| 16:55 | hiredman | dnolen: but not purely functional |
| 16:56 | Chousuke | lghtng: clojure even provides time constructs for managing a real process (which has side-effects, in the form of changing state). :) |
| 16:56 | dnolen | hiredman: yes, of course. |
| 16:57 | lghtng | state transactional memory, right? |
| 16:57 | lghtng | and if you want side effects you use 'do' |
| 16:57 | chouser | it's not nearly that magical |
| 16:57 | Chousuke | lghtng: software transactional memory |
| 16:58 | lghtng | ah, that |
| 16:58 | hiredman | lghtng: you don't have to use do |
| 16:58 | Chousuke | lghtng: it's just a bunch of mutable reference types with well-defined concurrency semantics. |
| 16:58 | hiredman | clojure seemlessly calls java |
| 16:58 | hiredman | java is full of side effects |
| 17:00 | lghtng | a side effect is basically just something a function does that isnt part of its return value but affects something outside it's scope? |
| 17:00 | Chousuke | I guess so. |
| 17:00 | Chousuke | That's probably not a rigorous definition, but anyway :P |
| 17:01 | lghtng | it turns the knob 1 quarter turn to the right, igniting the flame on the burner |
| 17:02 | lghtng | it places the teapot onto the burner |
| 17:02 | hiredman | http://en.wikipedia.org/wiki/Side_effect_%28computer_science%29 |
| 17:02 | Chousuke | lghtng: rather, it activates the machinery that does those thins :) |
| 17:02 | Chousuke | things* |
| 17:02 | chouser | the future is a function of the past |
| 17:02 | hiredman | lghtng: if your world is map, then a function can return an updated map with the new position of the teapot |
| 17:03 | chouser | history is its domain |
| 17:03 | Chousuke | hiredman: but you also need a side-effecting procedure to activate the machinery. |
| 17:03 | chouser | right, it depends on if you're simulating the world or actually interacting with it. |
| 17:03 | Chousuke | hiredman: but as long as you isolate the side-effecting procedure from the "pure" world-map model, you're golden. |
| 17:05 | hiredman | Chousuke: he never mentioned machinery, so to assume he isn't just doing world modeling is a mistake |
| 17:05 | Chousuke | I'm pretty sure the pure model always exists, too, since software of course needs some values to work with. :) |
| 17:07 | hiredman | anyway, clojure is targeted squarly at java, and as such can do anything java can do (except annotations, at this point) |
| 17:11 | Chousuke | I guess in automation terms, the "pure model" would be your transfer functions, and the things that integrate them with the real world are the DA or AD transformers. |
| 17:12 | Chousuke | and the clojure stm models the fact that inputs are functions of t. |
| 17:13 | Chousuke | (hey, at least it's not a car analogy) |
| 17:13 | lghtng | which fits nicely with the concept that the program is the data |
| 17:15 | lghtng | that clojure goes ahead and takes the next step of collapsing alot of byzantine verbiage is really helpful in learninr |
| 17:15 | lghtng | it should be the exception that proves the rule, not the rules that prove the exception |
| 17:17 | lghtng | that the author has to explicetly take alot of time in the videos to explain, well, this is a that and that is a this and they are pretty much the same thing and frankly irrelevant shows that there are so Original Ideas(tm) operating here, which is really cool and innovative-like |
| 17:20 | Chousuke | If you dig deep enough, I'm sure few of the ideas in Clojure are truly original |
| 17:20 | Chousuke | but it's the combination of them that makes it interesting :) |
| 17:22 | lghtng | sometime we all need to learn to ignore that missile-radar warning in our ears and go ahead and accept a new paradigm with grace |
| 17:23 | lghtng | we are not all equally blessed in that regard, so it's fortunate for me that clojure appears to embrace that spirit |
| 17:23 | lghtng | maybe i can finally learn how to program :D |
| 17:24 | Chousuke | You don't have to forget the old paradigms either. But chances are that once you learn new things, you realise that you *should* forget some things you learned previously |
| 17:25 | Chousuke | Like when learning about complex numbers... Addition and substraction still work pretty intuitively, but what, you suddenly can calculate the square root of a negative number? shocking! |
| 17:26 | lghtng | what previous knowledge must be forgotten there? |
| 17:27 | lghtng | perhaps you mean the example of 1C+1C=1C where C=light-speed? |
| 17:29 | Chousuke | hm, I haven't seen that example. |
| 17:32 | Chousuke | but you might have learnt that it's not possible to take the square root of a negative number, and complex numbers give you a way to meaningfully do that, opening up new possibilities. Then, when you examine the properties of complex numbers, many assumptions you previously had about numbers will likely need to be revised :) |
| 17:32 | lghtng | granted. |
| 17:47 | hiredman | clojurebot: big o? |
| 17:47 | clojurebot | Huh? |
| 17:47 | hiredman | clojurebot: big o is <reply>http://twitter.com/cgoldberg/status/6340157473 |
| 17:47 | clojurebot | Ik begrijp |
| 17:58 | qed | hiredman: haha |
| 18:00 | ohpauleez | haha, that's awesome |
| 18:02 | arohner | does defmacro support let-destructuring its arguments? |
| 18:02 | hiredman | yes |
| 18:03 | arohner | thanks |
| 18:04 | maddis | i am using this (http://wiki.github.com/technomancy/leiningen/emacs-integration) method from technomancy to connect to a remote repl. is there any way to open only a local port on the server side and tunnel everything through ssh? I am not very comfortable with opening my repl to everybody on the internet. |
| 18:04 | arohner | ssh -L localport:localhost:remote-repl-port user@remote |
| 18:05 | ohpauleez | that way or socat |
| 18:06 | arohner | that will connect to the remote box, and tunnel traffic from localhost:remote-repl port to localport on your box |
| 18:06 | maddis | ok, that's a ssh tunnel. but isn't the port on the server side still open to everyone? |
| 18:06 | arohner | no |
| 18:06 | maddis | with open I mean, everybody could connect? |
| 18:06 | arohner | it tunnels traffic from localhost:remote-repl-port to localport on your box |
| 18:07 | arohner | anyone on your box can connect to localport |
| 18:07 | arohner | if your firewall is set up properly, the repl port is closed to outsiders |
| 18:08 | arohner | then you ssh in via the SSH port, and tunnel is created on your side. the only remotely accessible open ports are 1) ssh on the remote box, 2) localport on your box. I assume the firewall on your local box is set up properly :-) |
| 18:08 | maddis | you mean the firewall on the server side? that is not the case here...that's why I ask this question :) |
| 18:09 | maddis | hmm, ok |
| 18:09 | maddis | i guess I have to thing about this again :) |
| 18:09 | arohner | this will work, even if your box allows no open connections, and the remote box only allows SSH connections |
| 18:09 | esbena | installing clojure-mode (using ELPA) results in: 'clojure-slime-config: Cannot open load file: swank-clojure-autoload' - known problem? |
| 18:09 | esbena | |
| 18:11 | hiredman | I think you have to pass an argument to ssh to let connections not originating from localhost traverse the tunnel |
| 18:14 | mabes | is the fn rest lazy? I have a lazy collection which I want to map all of the elements except the first one... |
| 18:15 | arohner | mabes: rest will evaluate the first item, and not evaluate the rest of the list |
| 18:15 | mabes | arohner: ok, great, thanks |
| 18:18 | polypus | how to get a function's arity? |
| 18:19 | the-kenny | polypus: (:arglists (meta (var +))) |
| 18:19 | the-kenny | ,(:arglists (meta (var +))) |
| 18:19 | clojurebot | ([] [x] [x y] [x y & more]) |
| 18:20 | polypus | ty, is this also for user defined functions? i thought not |
| 18:21 | the-kenny | Works with user-defined funcions too. |
| 18:21 | technomancy | esbena: yep; it's been deprecated. see the readme for swank-clojure. |
| 18:21 | maddis | arohner, i think you got me wrong. i am talking about the port 4005 opened by the swank server on the server side. when I start the server with 'lein swank', one could connect to that port simply with slime-connect in emacs |
| 18:21 | the-kenny | But you have to know the symbol, as far as I know, there is no way to get the arity of functions itself. |
| 18:22 | arohner | maddis: yes, swank-server will open port 4005 on the server side. If you don't want that to be accessible to anyone, firewall it off. Block everything on the box except port 22 |
| 18:22 | polypus | the-kenny: right its metadata on the var really |
| 18:23 | arohner | maddis: the ssh command I wrote above will open a port 4006 on your box, which all traffic on your side will go through ssh to the remote box, and then to localhost:4005, from the perspective of the remote box |
| 18:23 | maddis | ok, so there is no option to let it accept only local connections. thanks :) will block it through the firewall |
| 18:23 | maddis | arohner, yes, I got the ssh part. |
| 18:24 | maddis | my issue was only the open port 4005 on thr server side. that's all |
| 18:24 | polypus | ,(:arglists (meta (fn [x] x))) |
| 18:24 | clojurebot | nil |
| 18:25 | hiredman | the arglist metadata is not on the function, but on the var |
| 18:25 | the-kenny | polypus: Functions don't have metadata. Only the vars |
| 18:25 | the-kenny | That's what I was trying to say |
| 18:25 | the-kenny | Sorry, English isn't my native language. |
| 18:26 | arohner | maddis: I haven't heard of an option to make swank only listen on localhost. It might be possible |
| 18:26 | technomancy | maddis: it should be added in swank-clojure, but it doesn't exist yet afaict. |
| 18:26 | arohner | I'm sure the patch would be easy |
| 18:28 | maddis | i was just wondering because I read this page http://common-lisp.net/project/slime/doc/html/Setting-up-the-lisp-image.html#Setting-up-the-lisp-image |
| 18:28 | maddis | see footnote 2 |
| 18:28 | hiredman | *snort* |
| 18:29 | polypus | is that a thread local snort? |
| 18:30 | the-kenny | ,*snort* |
| 18:30 | clojurebot | java.lang.Exception: Unable to resolve symbol: *snort* in this context |
| 18:51 | jeremyevans | Is there a Clojure function similar to Ruby/Perl/Python pack/unpack, such that (unpack "V" "\0\1\0\0") returns 256 |
| 18:52 | jeremyevans | Or any other facility to pack/unpack integers to/from strings? |
| 18:52 | djork | no but it sounds like fun to write |
| 18:53 | djork | seems like a clojurey kind thing to have |
| 18:53 | djork | http://www.perlmonks.org/?node_id=211105 |
| 18:53 | jeremyevans | djork: Thanks. Shouldn't be difficult, just didn't want to recreate the wheel |
| 18:54 | hiredman | ,(Integer/parseInt "0100" 16) |
| 18:54 | clojurebot | 256 |
| 18:54 | jeremyevans | hiredman: That's "0100", not "\0\1\0 |
| 18:54 | jeremyevans | 0" |
| 18:55 | hiredman | I understand, but what is the poing of the slashes to begin with? |
| 18:55 | hiredman | ,(Integer/toString 256 16) |
| 18:55 | clojurebot | "100" |
| 18:55 | jeremyevans | hiredman: "\0" is ascii 0x0, "0" is ascii 0x30 |
| 18:56 | jeremyevans | hiredman: "0100" and "\0\1\0\0" are two very different things |
| 18:57 | jeremyevans | ,(= "\0" "0") |
| 18:57 | clojurebot | false |
| 18:58 | hiredman | ping? |
| 18:58 | hiredman | clojurebot: ping? |
| 18:58 | hiredman | nuts |
| 18:58 | clojurebot | PONG! |
| 18:58 | clojurebot | PONG! |
| 18:59 | hiredman | clojurebot: why? |
| 18:59 | clojurebot | http://clojure.org/rationale |
| 19:14 | fawxtin | anyone running swank-clojure, doing a remote REPL with lastest slime? |
| 19:15 | dnolen | fawxtin: I'm not sure that you can use latest slime, there were some breaking changes a while back. |
| 19:16 | Raynes | I really wish they would change the name. |
| 19:17 | Raynes | You can't tell someone you're running Slime without extra explanation. |
| 19:17 | fawxtin | dnolen: oh, I see, it seens to work with old versions (using the simple swank.swank/start-server ...) |
| 19:18 | fawxtin | but now when I eval "list" expression (with parenthesis), it hangs up |
| 19:19 | dnolen | fawxtin: I use slime from the git mirror, I note that I'm on commit 74a4b66bf85f55e878df2974ab3d713f87c1a42f. |
| 19:19 | fawxtin | dnolen: nice! |
| 19:19 | fawxtin | let me see |
| 19:20 | dnolen | git mirror -> github mirror |
| 19:20 | fawxtin | yeah, sure |
| 19:27 | Raynes | dnolen: I've seen some of your SO posts. Nice ones. ,3 |
| 19:27 | Raynes | <3* |
| 19:28 | dnolen | Raynes: SO posts? |
| 19:30 | fawxtin | dnolen: worked really fine, thanks |
| 19:30 | dnolen | fawxtin: great! |
| 19:31 | Raynes | dnolen: Stackoverflow |
| 19:31 | dnolen | fawxtin: there was some effort to try to keep the slime devs from breaking Clojure support, hopefully something comes of it. It was really great for a year or so. |
| 19:31 | dnolen | Raynes: oh yes, thx. |
| 19:35 | fawxtin | dnolen: I see, it must be hard as hell to keep sync on everything |
| 19:35 | fawxtin | for slime devs |
| 19:43 | fawxtin | or not.. dnolen, that commit seens to be one of the lastest (if not *the*) to work |
| 19:44 | dnolen | fawxtin: yes, I used to always stay at slime tip, I believe it's only a 2 or 3 commits before it broke at most. |
| 19:48 | tomoj | what's the breakage look like? |
| 19:49 | fawxtin | the eval hangs up |
| 19:50 | fawxtin | Im brute forcing to see what commit broke it |
| 19:50 | fawxtin | eval I mean repl |
| 19:53 | fawxtin | found the bad guy: 22dba9f590a55977f41cb9a333012e9cb6619505 |
| 19:54 | _ato | WTF? https://gist.github.com/ffc64fc2a18382dbfaf6 |
| 19:54 | _ato | using a non-direct buffer and looping over the underlying array with aget is also slower than the infinite loop with a underflow catch |
| 19:54 | _ato | NIO is weird |
| 19:58 | _ato | and it's not that (.remaining) is O(n), even if I call it above the loop it still doesn't slow down the second one |
| 19:59 | _ato | maybe the JIT does more magical inlining in the second case or something |
| 20:00 | alexyk | I want to parse twits like "hey @man there's a #clojure blog at http://bot.ly/xyz" into: @names, #hashtags, URLs, and remaining words. Questions: how do folks tag token types, and is there a library to simplify this? |
| 20:00 | dnolen | _ato: you going to publish your blog post soon, or are you still fine tuning wf2-optimized? :) |
| 20:04 | alexyk | I I mean I can boringly scan and add characters to a StringBuilder... should I then place into a map, {:token blah :kind :url } or something? |
| 20:05 | alexyk | is this how algebraic types are simulated? :) |
| 20:06 | _ato | dnolen: still fine tuning my extremely optimised version. I had an idea that might make it (shock!) competitive with C++, but NIO is proving troublesome. It can be *really* fast in certain cases, but it seems to be really easy to slow it down, like that weird example I just posted |
| 20:06 | dysinger | rhickey: are around ? |
| 20:07 | dnolen | _ato: wow, head to head with C++. I'm impressed you got it close to Ocaml, that's a feat. Those are respectable numbers already. |
| 20:47 | arohner | is there a way to specify that a #() should take any number of arguments, but only use the first one? |
| 20:48 | arohner | I have a #(foo %1) that is unhappy about being called with more than one argument |
| 20:49 | timothypratley | (fn [x & ignore] ...) :) |
| 20:50 | arohner | timothypratley: yeah ;-), I was hoping for a #() form |
| 21:25 | harrison | ,(floats (into-array [1 2 3])) |
| 21:26 | aldebrn | I need to do FFTs in Clojure (really need to :D), are there any gold-standard Java FFT libraries? or wrappers to FFTW? |
| 21:34 | harrison | ,(floats (into-array [1 2 3])) |
| 21:34 | harrison | clojurebot seems to be slacking |
| 21:39 | tomoj | clojurebot: botsnack |
| 21:46 | harrison | is there any way to make a float array from clojure? (not a Float array. i'm using java.nio.FloatBuffer, and it wants a float array) |
| 21:46 | chouser | (floats (float-array [1 2 3])) |
| 21:47 | chouser | you don't need 'floats' |
| 21:47 | tomoj | huh, how long has floats been there? |
| 21:47 | tomoj | and ints, never noticed them |
| 21:48 | chouser | if your version of Clojure doesn't have float-array, you can use (into-array Float/TYPE [1 2 3]) |
| 21:49 | harrison | chouser: excellent. float-array was all it needed. i wasn't aware that existed. also, floats is redundant there. |
| 21:50 | liebke | aldebrn: I've never used it, but checkout jtransforms (which is included in the Incanter distribution): http://sites.google.com/site/piotrwendykier/software/jtransforms |
| 21:57 | chouser | tomoj: a while now. booleans, bytes, chars and shorts are newer. |
| 22:02 | hamza | guys, i don't know if this is one of those FAQ questions but why does |
| 22:02 | hamza | , (seq? [1 2 3]) |
| 22:02 | hamza | equals false? |
| 22:03 | laughingboy | Newbie Q: Is it possible to change the current working dir used by load-file? |
| 22:03 | tomoj | hamza: vectors aren't seqs |
| 22:03 | harrison | these nio buffers are a pain in the ass. |
| 22:03 | tomoj | ,(seq? (seq [1 2 3])) |
| 22:04 | tomoj | clojurebot would say "true" if she were not dead |
| 22:04 | hamza | tomoj: is there a pred for testing vectos? |
| 22:04 | hamza | he he |
| 22:04 | hamza | *vectors |
| 22:04 | hamza | or should i use (seq? (seq ..)) |
| 22:05 | tomoj | well, there's vector? |
| 22:05 | tomoj | but is that what you really want to know? that what you were given was a vector? |
| 22:05 | clojurebot | false |
| 22:05 | clojurebot | true |
| 22:06 | tomoj | oh hello there clojurebot |
| 22:06 | hamza | lol, i assumed it vas vec? i am iterating a vector using recursion i want to use this for stopping contition |
| 22:06 | tomoj | then, no, I don't think you're looking for vector? |
| 22:06 | laughingboy | Newbie Q: Is it possible to change the current working dir used by load-file? |
| 22:07 | tomoj | well, what will the value be when you want to stop? |
| 22:08 | hamza | i am going rest rest so i can use nil? then right? |
| 22:08 | tomoj | if you're using rest, you're not getting a vector anyway |
| 22:08 | tomoj | ,(vector? (rest [1 2 3])) |
| 22:08 | clojurebot | false |
| 22:08 | tomoj | unless I misunderstand you |
| 22:09 | hamza | laughingboy: (System/setProperty "user.dir" "mydirectoryPath") works in java but i never used it in clojure. |
| 22:09 | hamza | ohh ok there is my mistake.. |
| 22:09 | tomoj | if you're using rest, you're getting seqs |
| 22:09 | laughingboy | hamza: thx, I will try |
| 22:10 | tomoj | the idiomatic stopping condition is (if (seq ...) ...) |
| 22:10 | hamza | ok so seq? then should work so i got another logic problem. |
| 22:10 | tomoj | if you use next instead you will get nil when you're done |
| 22:11 | hamza | ok thanks.. |
| 22:11 | tomoj | might be better to use seq anyway, depends I guess |
| 22:42 | interferon | does clojure have support for annotations? |
| 22:42 | arohner | interferon: no |
| 22:47 | interferon | are there ways to work around that? |
| 22:49 | arohner | not that I know of |
| 22:54 | KirinDave1 | Is there a way to react to a ref or atom changing? |
| 22:54 | arohner | ,(doc add-watcher) |
| 22:55 | arohner | oh, no clojurebot |
| 22:55 | arohner | anyways, add-watch and add-watcher |
| 23:04 | drewr | any slime users have issues with namespaces not being recognized when there's metadata present? |