#clojure logs

2013-06-28

18:14dobry-denIs there a Clojure surrogate for (.getBytes "hello")
18:15dobry-denah, (byte-array (map byte "hello"))
18:15technomancywhat's wrong with .getBytes?
18:21dobry-dennothing
18:22magnarsIdiomatic way of doing this? Map a function over a seq, but instead of returning a seq of results, return a map of the original values -> results ?
18:23technomancymagnars: (into {} (map (juxt identity f) s))
18:23technomancyor reduce
18:23technomancyjuxt is cooler though
18:23technomancyclojurebot: juxt?
18:23clojurebotjuxt is a little hard to grok but it's the best thing ever
18:23magnarsthat is cool. thanks! :)
18:24technomancyoh... (zipmap s (map f s)) is shorter
18:24eggheadbut then you don't get to use juxt
18:24hyPiRiontechnomancy: don't be silly, the juxt version must surely be more efficient.
18:25magnarsthe juxt version was too awesome to pass over
18:25technomancyhyPiRion: more effective at being cool
18:25magnars^^ think I'll have to make a juxt for dash.el
18:25hyPiRiontechnomancy: yeah, I was not talking about any specific measure of efficient
18:25technomancymagnars: yes please! =D
18:26seangroveHey guys, I think I may be onto something with my "greater hair theory" https://dl.dropboxusercontent.com/u/412963/greater_hair_theory.png
18:26seangroveThe evidence is really starting to stack up
18:27magnars:D
18:27seangroveWe thought it was the beard, turns out we were wrong
18:27technomancynice
18:32dnolen_haha
18:37hyPiRionI'm not sure whether the "greater hair theory" or the "facial hair theory" is correct, so I'm trying to get into both.
18:37hyPiRionbetter be safe than sorry
18:40gt`hi what is the quickest way to connect to ms sql database if i am using clojure on ubuntu
18:50technomancyany heroku users want to test out uberjar-based deploys before I merge it to mainline?
18:51dobry-den,(map int (seq (String. (byte-array [(byte -1)]))))
18:51clojurebot(65533)
18:52seangrovehyPiRion: quite a wise approach, I'd say
18:52dobry-denHow come it's 65533?
18:53hiredmancharacters are not bytes
18:54dobry-denrigiht, but why not 2^16?
18:55hiredmanwhy should it be that?
18:56dobry-denoh, 65533 is a special "replacement character"
18:59phildiazHey, everyone. I come from Ruby programming for the web, and I'm just starting with Clojure. I seem to be having a problem that I suspect is really newb-ish, but I can't figure it out for the life of me.
19:01phildiazI started my first lien project, and when I run my REPL server, everything works fine. I can use defn for methods and get normal resutls.
19:01hiredmanfunctions
19:01hiredmandefn defines functions
19:02dobry-dentechnically they are methods in java behind the scenes aren't they
19:03phildiazAh, yes. Thank you, I need to get my head into functional programming zone.
19:03technomancydobry-den: each function becomes its own class
19:03dobry-denah
19:04dobry-densorry phildiaz. tried to get you a clutch technical-victory.
19:04technomancyiirc each arity is compiled into its own method
19:04phildiazHaha, no problem.
19:05phildiazThe issue I'm having is switching namespaces. If I do "(in-ns 'first-try.core)" and attempt to run any sort of function, even "(+ 1 1)", I get a CompilerException.
19:06technomancyphildiaz: in-ns only works for namespaces that already exist; try using ns for new namespaces
19:06hiredmanin-ns just changes what namespaces forms will be compiled in, it doesn't load any code
19:06hiredmanif you have an existing namespace you'll want to require it
19:07technomancy(doto 'my.ns require in-ns) works too
19:07hiredmanif you in-ns in to a not previously defined namespace you get an empty namespace
19:08dobry-denphildiaz: are you just trying to load your first-try.core code so you can test it in the repl?
19:09phildiazYes, I tried technomancy's suggestion, and it worked out. Thank you so much!
19:09dobry-denwhat editor/ide are you using?
19:10phildiazSublime Text 2. I installed the REPL package.
19:12dobry-denphildiaz: cool. see if there's a hotkey or something you can press that automatically loads your current file namespace into the repl for you.
19:14phildiazWill do. Thank you all so much. I'm really excited to get started with this stuff. Like I said, I've been using Ruby for web stuff, and Clojure looks like a giant step up in development methodology.
19:15phildiazAlso, I'm a huge AngularJS fan, and this piqued my interest: http://keminglabs.com/blog/angular-cljs-mobile-weather-app/
19:26dobry-denphildiaz: cool, i came from Ruby as well.
19:27dobry-denSinatra is clunky and awkward after working with Compojure and company.
19:27trinarysame, except I haven't really dug too far into clojure yet, too busy writing weird stuff in javascript. Need to swap to cljs. :)
19:28dobry-denRuby of course is clunky as well. consider the clojure versions of animals.map(&:name) and animals.map { |a| a.name.upcase }
19:29dobry-den(map name animals), (map (comp upcase name) animals)
19:32holoanyone is able to use new relic deploying to heroku with an uberjar? for the life of me, I can't make this work
19:37technomancyholo: currently that can only be done by checking in the newrelic agent jar unfortunately
19:37technomancyI can add that before it gets merged though
19:37technomancyholo: the behaviour we discussed previously is now on the uberjar-name branch of the buildpack if you want to try it out
19:38holotechnomancy, what do you mean by checking in the newrelic agent?
19:38technomancyholo: git add =(
19:41holotechnomancy, oh.. I did add the .jar agent, and "pointed" to it in the environment JVM_OPTS. which behaviour? I don't remember
19:41technomancyholo: I mean checking for :uberjar-name instead of looking for lein in the procfile
19:41technomancy(from a few days ago)
19:43holotechnomancy, hehe sure, I thought it was related to new relic. yes, I'm using that behaviour already, even though there is no need since I'm not using lein in Procfile
19:44technomancycool
19:44technomancyyeah, sorry, the java-agent stuff still needs a bit more work in the buildpack
19:48holotechnomancy, hey that's great, at least I know it's useless to spend more time with this stuff for the time being. thanks. where will you publish when it's solved in the buildpack?
19:48holook, just follow the buildpack commits, forgot about that one :)
19:52holotechnomancy, a correction. I'm using :uberjar-name, which is the reason why I also don't need lein invocation anymore, because the naming is static
19:54technomancyholo: it will show up on the heroku changelog once it's merged as default behaviour, but keeping an eye on the github repo is your best bet until then
19:54technomancyhappy to answer questions on irc too of course =)
20:01holoyou're great. thanks. I try always not to abuse much of it. I imagine how busy you are
20:02dnolen_my god, I love it! http://gist.github.com/swannodette/5888989
20:14technomancyholo: to tell the truth, I can't really think of a good way to support this nicely
20:14SorellaBetter than Microsoft, as far as consoles go
20:15SorellaHm, wrong channel.
20:18technomancythe whole point of uberjar is "collapse the project and its dependencies down into one file"
20:18technomancywhich doesn't work with java-agents at all; it has to be a separate file
20:18holoi see
20:18technomancyso you either have to shoehorn it into the uberjar task or provide an additional task to copy the agent jars into target/ or something
20:25yogthostechnomancy: can we do another quick purge on clojars at some point? :)
20:26technomancyyogthos: yeah, for users of pre-2.2 lein?
20:26technomancyit's not a problem on the latest, right?
20:26yogthostechnomancy: oh I haven't checked :)
20:26yogthostechnomancy: if it's not then I wouldn't bother
20:27technomancyok, cool
20:27yogthostechnomancy: incentive for people to upgrade :)
20:27yogthosyou did the magic to parse the versions out after all? :)
20:27technomancyyogthos: there's another magic way to specify "latest" without triggering that stupid aether bug
20:28yogthosoooh
20:28yogthosthat is very awesome!
20:28technomancyyou're probably the only person who is that excited about it, but yes; it's a good improvement =)
20:29yogthoslol I like to push out builds often :)
20:56dnolen_I don't even ... https://gist.github.com/swannodette/5888989
21:55g06|inwhy doesn't 'ctrl y' inside a 'lein repl' paste from clipboard? instead it pushes the REPL to background
22:10mmarczykdnolen_: ping
22:10dnolen_mmarczyk: pong!
23:24technomancyg06|in: that's a known bug; there's a thread on the clojure mailing list about it
23:24g06|intechnomancy: thanks!
23:25g06|intechnomancy: I also can't seem to access clojuredocs via lein repl -- that a bug too?
23:26technomancyg06|in: that's intentional; the clojuredocs client was causing a lot of dependency conflicts
23:26technomancyyou can add it back in yourself, but I think we haven't documented that right yet
23:26g06|inok
23:27g06|intechnomancy: I was trying to learn clojure and the first thing I came across was the setup with lein and it mentioned a couple of examples including the one using clojure-docs; that's why I asked
23:27technomancyah, yeah bummer
23:27technomancyit was a little-used feature that caused lots of headaches
23:27technomancybut we should document how to re-enable it
23:28g06|intechnomancy: thanks!
23:41bbloomdnolen_: so what did you find out about large functions in JS… no big deal?
23:59derek_cDoes Leiningen support all maven repos?