#clojure logs

2014-03-20

00:08SegFaultAXHas anyone here ever tried to embed elasticsearch in their application?
00:11technomancySegFaultAX: as I understand it, elasticsearch is a distributed dynamo-style cluster; not sure how that would work.
00:12SegFaultAXtechnomancy: Just like running it stand alone, but embedded in your application (eg the nodes life cycle is tied to your application's)
00:12SegFaultAXhttp://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html
00:13technomancynot sure what the point of ES is if you don't have clustering though?
00:14technomancyjust use lucene
00:14SegFaultAXIt still connects to the cluster.
00:14SegFaultAXIt works exactly the same way, just embedded.
00:14SegFaultAX"When you start a Node, it joins an elasticsearch cluster." - that page I linked
00:14technomancyI guess you would gain faster access for whatever data happens to be on the local node?
00:15technomancymight make sense for smaller corpuses
00:15hiredmantechnomancy: it isn't a data node
00:15SegFaultAXtechnomancy: Actually in this case I'm wondering if it would ease deployment if I want to use elastic beanstalk or something.
00:15hiredmantechnomancy: what we did before we switched to the rest api
00:16SegFaultAXI guess I could deploy ES directly to EB.
00:16technomancyhiredman: oh, you mean like so it has access to all the ring data so it can go directly to the node that contains a given shard?
00:16technomancyskip a hop or whatever
00:17hiredmantechnomancy: if I recall, yeah
00:18SegFaultAXAnyway, it doesn't seem like it'd be that hard to do. Maybe not worth it though.
00:19SegFaultAXI was thinking it might be neat to have a local read-only index. Writes will fan out from the master to the local instance on each app server.
00:20hiredmanSegFaultAX: that is not really how es works
00:20SegFaultAXhiredman: In what way do you mean?
00:21SegFaultAXI had a ~5 node cluster at my last company so I'm familiar running it as a silo'd service.
00:21hiredmanSegFaultAX: es nodes don't have a copy of all the data, and I would definitely *not* recommend making your app a data node on elasticbeanstalk, you will have a bad time as the cluster rebalances when you scale up or down
00:23SegFaultAXYea that was my main concern, too.
00:23SegFaultAXhiredman: But I got the idea from reading this: http://www.colinsteele.org/post/27929539434/60-000-growth-in-7-months-using-clojure-and-aws
00:23SegFaultAXBasically they had an embedded solr instance in each app node (also Clojure)
00:24SegFaultAXAnd I've heard of a similar architecture at Guardian (one of the tech leads gave a talk about it)
00:25hiredmanSegFaultAX: sure, that is a common thing to do with lucene based things that are not elasticsearch, you have some offline process that generates indices, and each process gets a copy
00:26SegFaultAX(Relevant guardian talk: http://www.infoq.com/presentations/guardian-content-api)
00:26SegFaultAXhiredman: Why do you think that won't work for ES?
00:26hiredmanSegFaultAX: es is clustered
00:27hiredmanSegFaultAX: they are talking about non-clustered completely indepedent solr instances
00:27hiredmanthe clustering will not respond well to many and rapid changes in cluster membership
00:27SegFaultAXWell it's not like instances come up and down every couple minutes.
00:28SegFaultAXBut I see your point anyway.
00:28hiredmanif your data set is small enough for one machine, just build and ship lucene indices, no need for solr or es
00:30SegFaultAXhiredman: Yea, totally. I might still play around with it anyway just to see how bad it is. Just thought it was an interesting architectural choice.
00:37dakronehiredman: it's still nice to have solr or ES instead of plain Lucene though, Lucene by itself is a much more complex API to deal with
00:37dakrone(sometimes)
00:58jph-dakrone, btw, thanks for cheshire
00:59dakronejph-: you're welcome!
01:12jph-is it ok to put bigger functions in your (extend-type or should call functions defined elsewhere?
01:12jph-i kinda feel like the latter is the better approach
01:12jph-they otherwise feel hidden away in (extend-type
01:22vertupf/clear
01:23jph-accidentally left a () in my code, the stack trace was less than helpful
01:32turbofailit always is
01:56mr-foobarlein cljsbuild auto is compiling my changes, but python -m SimpleHTTPServer in resources/public is not picking up the changes. Not sure why :/
02:11michel_slmhi everyone
02:11michel_slmwhat's the best practice for dealing with dependencies pulling multiple versions of some components like clojure?
02:27stormeecho ,(println "&(+ 1 2)")
02:27lazybot,(println "&(+ 1 2)")
02:27clojurebot&(+ 1 2)\n
02:27stormeecho ,(println "(+ 1 2)")
02:27lazybot,(println "(+ 1 2)")
02:27clojurebot(+ 1 2)\n
02:27katratxomichel_slm: perhaps using `:exclusions` ? https://github.com/search?l=Clojure&q=%3Aexclusions&ref=advsearch&type=Code
02:28katratxohttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L48
02:31michel_slmkatratxo: aha, thanks.
02:31michel_slmam trying out hoplon, and when I tried one of its dependencies using lein try, it pulls in clojure 1.3.0 -- will try and make sure that doesn't make its way into production code
03:05akhudekdoes anyone have any idea how I can access these weird static final classes? https://github.com/knowitall/openregex/blob/master/src/main/java/edu/washington/cs/knowitall/regex/RegularExpressionParsers.java
03:13opqdonutakhudek: you import edu.washington.cs.knowitall.regex.RegularExpressionParser, you refer to them with RegularExpressionParser/character and RegularExpressionParser/word
03:13opqdonutakhudek: as you can see they're not really classes, but fields
03:14akhudekopqdonut: that's what I thought too, but it's giving me illegal access errors
03:14opqdonutmm, sorry, I typoed
03:14opqdonutshould be RegularExpressionParser_s_ and RegularExpressionParser_s_/character
03:14opqdonutakhudek: weird, could you paste the error somewhere?=
03:15dbaschis there a way to know if a compojure route would match a path without calling it?
03:15akhudekhttps://www.refheap.com/3b078fda1a1cb483a50207b32
03:19akhudekthere is serious magic going on in this library
03:19akhudekhttps://github.com/knowitall/openregex/blob/master/src/main/java/edu/washington/cs/knowitall/regex/RegularExpression.java
03:19akhudekat the bottom you can see it use RegularExpressionParsers
03:19akhudekbut it never imports it
03:19akhudekO.o
03:20opqdonutakhudek: it's in the same package, no need to import
03:21opqdonutakhudek: I just checked and I can access "public static final" fields ok
03:22akhudekopqdonut: yeah, I've done it before too. Not sure why this one isn't working.
03:27ArchPyI was told to come here to learn more.
03:27SegFaultAXWhat do you want to know?
03:28ArchPyWhy is clojure worth paying attention to?
03:29SegFaultAXAre you primarily a Python hacker?
03:31jack_rabbitClojure is probably one of the easier functional languages to write significant applications in. And lisp is great.
03:34tsdhAren't there functions like head-set/tail-set for sorted sets that return the set of elements smaller/larger than a given element?
03:35tsdhI know I can use take-while/drop-while, but those are linear whereas special sorted-set aware functions could be logarithmic.
03:37ArchPySegFaultAX I work primarily with python and powershell
03:37ArchPyMy day-to-day is powershell because I am a Windows Server Administrator and my personal projects have always been python. I've dabbled in other languages but nothing significant.
03:38akhudekopqdonut: I think the reason is that RegularExpressionParsers itself is not marked public
03:40SegFaultAXArchPy: Well other people have spent a lot of time and effort describing the wonderful and attractive aspects of clojure.
03:41SegFaultAXThey do it more justice than I can off the cuff here. Try googling "why clojure" or something.
03:42scottjhere's one http://clojure.org/rationale
03:42opqdonutakhudek: riiiight, yeah
03:42opqdonutakhudek: so it has only package visibility
03:43SegFaultAXOr here: http://www.quora.com/Clojure/Why-would-someone-learn-Clojure
03:44SegFaultAXOr here: http://michaelochurch.wordpress.com/2013/08/07/why-clojure-will-win/
03:52jph-how might i thread-first this... (merge (get {:a 1} :b) (get {:a 1 :b 2} :b)) ?
03:53jph-i know how to thread-first (-> {:a 1} (get :b) (merge))
03:53jph-woops, its the second get im not sure how to represent
03:58scottjjph-: I don't think there's a reason to thread that. (merge (map :b [{:a 1} {:a 1 :b 2}]
03:59tsdhHow can I get the namespace prefix of a symbol? E.g., (gimme-ns `foo) would return user if I'm in the user namespace.
03:59jph-scottj, i havent seen it written that way, cheers
03:59beamsoisn't a :: symbol the symbol for the current namespace
04:00jph-*ns*
04:00jph-,*ns*
04:00clojurebot#<Namespace sandbox>
04:00scottjbeamso: that's for keywords, which I think are called symbols in other languages
04:00beamso,(symbol "foo")
04:00jph-learnt that when playing with macros
04:00clojurebotfoo
04:03tsdhJust to make my point clear: how can I distinguish `foo and 'foo?
04:03tsdh,[(name 'foo) (name `foo) (= 'foo `foo)]
04:03clojurebot["foo" "foo" false]
04:03jph-user=> (symbol (str *ns*) "help")
04:03jph-user/help
04:03jph-then you can (resolve ..)
04:03jph-and (deref (resolve ..))
04:04tsdhjph-: That requires that foo is an existing var which it is not in my case.
04:06tsdhBasically, I'm trying to write a function that given a form picks out all local variables it uses. Those are the symbols that are not in funcall position and are not namespace qualified.
04:07tsdh(Plus some extra logic for let, loop, and fn, etc.)
04:10tsdhArgh, that was way too obvious: ,(namespace `foo)
04:10tsdh,(namespace `foo)
04:10clojurebot"sandbox"
04:10tsdh:-)
04:10jph-hah
04:10jph-nice
04:34jph-silly question, whats the purpose of including type in a functions parameter list
04:34jph-it's not casting is it?
04:35jph-(def x [^java.math.BigDecimal y] y)
04:35TEttingerthat's a type hint
04:35jph-for when you are (doc x) ?
04:35jph-ie, is it more for self-documenting code
04:35beamsothe type hint is to prevent using reflection when executing methods/functions
04:36scottjjph-: clojurebook.com or read all the docs on clojure.org
04:36beamsolein check tells you the methods in your project that are using reflection
04:36jph-beamso, ahh, got it
04:36beamsoi think *warn-on-reflection* is the setting in the repl
04:36TEttingertype hints are important for making clojure run faster, and the doc thing is nice too
04:37jph-oh so it also allows optimization when JITing
04:37jph-ok
05:40ivan-kaniswhat's the equivalent of CL progn in clojure?
05:40clgvivan-kanis: `do`
05:41ivan-kanisok
05:41clgv,(do (println 1) (println 2) 3)
05:41clgv&(do (println 1) (println 2) 3)
05:41lazybot⇒ 1 2 3
05:41clojurebot1\n2\n3
05:41clgvhm ok not that illustrative with the bots
05:42clgv&(+ 5 (do (println 1) (println 2) 3))
05:42lazybot⇒ 1 2 8
05:42ivan-kanisno worry
05:42ivan-kanisHow do I close the cider repl?
05:43ArchPyClojure for sys admin projects? yea or nay?
05:44pyrArchPy: what type specifically
05:44ArchPypyr: Mostly task automation. But of every kind really.
05:44ivan-kanisnm it's C-c C-q
05:44ArchPyIn a mixed enviroment windows and linux
05:45mskoudIf startup time is not an issue, i dont see why not.
05:45ArchPymskoud: How is Clojure with .NET?
05:45pyrArchPy: there are really good libs for this in clojure. if you're working with traditional ops persons you're gonna get a bit of pushback
05:48ArchPypyr: I'm curious as to what that would be?
05:48clgvArchPy: probably "nay" when you need fast startup times
05:48pyrArchPy: because clojure doesn't even remotely look like bash
05:49pyrArchPy: mostly :-)
05:50clgvArchPy: Clojure CLR is tracking Clojure JVM closely afair
05:50ArchPypyr: Well, I dont really use bash. My day to day automation is powershell in windows. And when I need to do most of my basic stuff in linux its python / puppet.
05:51ArchPyI mean, I guess I do use bash. But not really in the toolmaking category.
05:52clgvArchPy: powershell has a tight .NET integration right?
05:52ArchPyI guess I was wondering if there are any unique advantage to using Clojure for toolmaking
05:52ArchPyclgv: It's ridiculously good. Super-fast and easy.
05:53ArchPyclgv: Powershell has kind of revolutionized my job. It's not ugly and painful like vbscript. With just object-piping and a ForEach loop half of what I need is done.
05:53clgvArchPy: well if Clojure's .NET interop is as good as the on for Java then you should try how far you come
05:54ArchPyclgv: Could you rephrase that? I dont think I totally understood you.
05:59rocknrollMarcpowershell is windows only right?
05:59rocknrollMarchave you tryed the fish shell? that one realy kicks as
05:59rocknrollMarcs
06:00xsynzsh ?
06:00rocknrollMarchttp://fishshell.com/
06:01rocknrollMarcI usualy use zsh but this new one is realy better but im switching slowly maybe I wont but Im using bolth as fish has realy nice completion
06:01rocknrollMarcis you have a mac and use vim like me have a look at this please https://github.com/skwp/dotfiles
06:35dsrxwho needs fish or zsh when you have eshell? ;)
06:39xsynor cshell
06:39xsyn(on the sea shore)
06:53sm0kehello all
06:53sm0kewhat clojure datastructure should i use which is composite and comparable aprt from lists vectors
06:54sm0ke,(sort [{:a 1} {:a 3}])
06:54clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Comparable>
07:11CookedGryphonsm0ke: what are you trying to achieve there?
07:11CookedGryphon,(sort-by key [{:a 1} {:a 3}])
07:11clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry>
07:11CookedGryphonoh, oops
07:11sm0ke,(sort-by :a [{:a 1} {:a 3}])
07:11clojurebot({:a 1} {:a 3})
07:11CookedGryphon,(sort-by :a [{:a 1} {:a 3}])
07:11clojurebot({:a 1} {:a 3})
07:12sm0keyea i dont want to sort, i want data abstraction which can have multiple components and be comparable
07:13sm0keso for instance ##(sort [[:a 1] [:a 2] [:a -1] [:z 0]])
07:13lazybot⇒ ([:a -1] [:a 1] [:a 2] [:z 0])
07:13sm0kemakes sense right?
07:14sm0kebut only that i am not allowed to use list
07:15sm0keathough weird requirement, i think one way would be to have a Record which implments Comparable
07:17sm0keits weird though that maps have equality but are not comparable
07:17sm0ke,(= {:a 1} {:a 1})
07:17clojurebottrue
07:17sm0ke,(compare {:a 1} {:a 1})
07:17clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.Comparable>
07:22pyrtsasm0ke: Unlike equality comparison, there is no cheap inequality comparison for maps.
07:23pyrtsaSo that's, AFAICT, the reason there is no such thing defined by default.
07:23sm0ketrue
07:24pyrtsa(The keys of a map aren't sorted, so you need to iterate over all the keys of both maps before you know what to compare.)
07:26sm0keunless its a sorted map
07:26sm0ke,(compare (sorted-map :a 1) (sorted-map :a 1))
07:26clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentTreeMap cannot be cast to java.lang.Comparable>
07:27pyrtsaWhy don't you just create your own comparator for that?
07:27sm0keyea doing that
07:35clgvArchPy: my guess is that Clojure CLR interop with .NET is probably as good as Clojure JVM interop with the JVM/Java
07:35clgvArchPy: I did not tray it yet though
07:38CookedGryphondoes anybody know of any libraries which nicely wrap safe posixy atomic file operations?
07:39CookedGryphonI can't seem to find anything
07:40sm0keCookedGryphon: wouldnt anything over jvm be already posixy?
07:41CookedGryphondifferent part of posix :P I mean the safe atomic read/write conventions
07:41CookedGryphonso for example if your process crashes half way through a save, you don't have a corrupt file left on disk and the previous version completely lost
07:42BartAdvclgv> ArchPy: my guess is that Clojure CLR interop with .NET is probably as good as Clojure JVM interop with the JVM/Java <- there are some inconveniences with generics, as there are differences in that regard etween jvm and .net
07:44clgvBartAdv: ah ok. yeah in .NET genrics are at vm-level right?
07:45BartAdvyes
07:46sm0keanyone working with nippy had problem with de/se of Records?
08:32abcdwAre any GSoC mentors here?
08:48clgvabcdw: more likely in a few hours (2-3)
09:05abcdwwhy this channel is so silent?)
09:05teslanickPeople are busy working on great stuff?
09:06clgvbecause the vast number of US people is not here, yet
09:06fu86Is there a function to prepend a string to another which I can use in a (-> ...) form?
09:06cemerick+1 to irc channels that aren't busy just to be busy :-)
09:07clgvfu86: I guess you are not threading the prefix, right?
09:07clgvfu86: in that case you probably need a custom function to do that
09:07fu86clgv: ok, thanks
09:09hyPiRionfu86: ##(-> "foobar" ((partial str "p:")))
09:09lazybot⇒ "p:foobar"
09:10hyPiRioneventually just use ##(-> "foobar" (->> (str "p:")) (str "-postfix))
09:10cemerickthere's always ##(-> "foobar" (->> (str "p:")))
09:10lazybot⇒ "p:foobar"
09:10cemerickmy irc game has gone stale :-P
09:11hyPiRioncemerick: well, you didn't forget to end the string :)
09:12fu86is ->> inside a -> okay?
09:13cemerickit's probably overly-clever, but yes
09:13hyPiRionI tend to use as-> inside -> in small doses, so I guess it is okay
09:13cemerickas-> is perhaps a better option
09:14fu86thanks a lot!
09:14hyPiRionfu86: I think it just boils down to preference at that point. As long as it is readable and consistent in a project, you should be fine :)
09:15clgvhyPiRion: yeah but this form defeats the point of the threading somehow
09:15fu86okay. I still having some trouble finding "the clojure way"^TM
09:40jjl` /win 42
09:40fu86http://hastebin.com/jupapeyixe.lisp
09:40fu86is there a better way to write this?
09:40devnso weird and "magic" that midje has "typo tolerance" just 'cause
09:41devn"Experience has shown that it's easy to type ..mc... when you meant to type ...mc.... As of Midje 1.3-alpha5, the two are resolved to the same metaconstant. The same is true of --mc--- and ---mc---. It is not the case, however, that ..mc.. is the same metaconstant as --mc--."
09:41devnblech.
09:43shep-werkdevn: metaconstant is close enough to magicconstant anyway ;-)
09:43devni have no idea why anyone would litter their codebase with something to do that. it's tantamount to saying: "experience has shown that people regularly mis-spell and, so from this point on in clojure, "adn" will also resolve to and"
09:44devnthat's where you just go:
09:46jjl`they do this in npm
09:48mikerod,(let [or #'clojure.core/or] (or 1 2))
09:48clojurebotnil
09:49mikerod,(let [or #'clojure.core/or] (or 1 2))
09:49clojurebotnil
09:49mikerodWhy?
09:49clojurebothttp://clojure.org/rationale
09:50clgvmikerod: first of all `or` is a macro so that did not have any chance to work at all
09:55shep-werkclgv: the macroexpand for it looks reasonable though...
09:55shep-werk,(let* [or #'clojure.core/or] (let* [or__3943__auto__ 1] (if or__3943__auto__ or__3943__auto__ 2)))
09:55clojurebot1
09:56berdarioI just noticed a weird thing, if I have nested `send`s (that is, I send a function to an agent, and inside that function another function is sent to the same agent) the agent loses part of its state
09:57berdario(the agent contains a vector, logging the value before the inner send it is a 2 element vector, logging the value inside the function that was "inner-sent" it's a 1 element-vector)
09:57berdarioI guess that the execution order of functions sent in this way isn't well defined... is this expected behavior?
09:58Bronsamikerod: you need to take into account &form and &env
09:59Bronsa,(#'or nil nil 1 2)
09:59clojurebot(clojure.core/let [or__3947__auto__ 1] (if or__3947__auto__ or__3947__auto__ (clojure.core/or 2)))
10:00clgvshep-werk: I think macroexpand makes an error there and deviates from the compiler behavior
10:01shep-werkclgv: combined with Bronsa's point about form/env, that would make sense
10:01Bronsaclgv: an error?
10:01clgvshep-werk: ah so you think his point was to get the macroexpandion with that let form?
10:04shep-werkclgv: you mean mikerod's original goal? I don't dare wager a guess :-)
10:07clgvshep-werk: yeah I focussed on the original ;)
10:08shep-werkclgv: so, what do you think is up with macroexpand in this case?
10:10mikerodclgv: so I'm still confused by this behavior :)
10:10mikerodI have a chunk of unevaluated code. I want to qualify all of the unqualified symbols in it, if they can be.
10:10mikerodbut I want to respect local shadowing.
10:10mikerodSo I had this good idea, of just shadowing all the symbols
10:10mikerodIn an outer-let
10:11mikerodthat wraps the original form
10:11mikerod...
10:11clgvshep-werk: nothing. as Bronsa pointed out there are the two "hidden" parameters to every macro
10:12clgvmikerod: maybe you want macro-symbol-let from tools.macros
10:12mikerod_I was knocked out of the channel
10:12clgvmikerod_: maybe you want macro-symbol-let from tools.macros
10:12mikerod_I will look at that
10:12mikerod_I think I've heard of it before.
10:13mikerod_I am curious about this behavior though. I guess I could dig into the evaluation to understand it.
10:13mikerod_,(let [or #'clojure.core/or] (or 1 2 3))
10:13clojurebot3
10:13quizdrcemerick hyperion what is the double hash symbol for? ##
10:13mikerod_(let [or #'clojure.core/or] (or 1))
10:13Bronsamikerodor is a macro
10:13mikerod_,(let [or #'clojure.core/or] (or 1))
10:13clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/or>
10:13mikerod_Very strange
10:13Bronsaif you get the var of a macro you can invoke that as a function
10:13mikerod_Bronsa: it seems to work on 3 arity?
10:13mikerod_,(let [or #'clojure.core/or] (or 1 2 3))
10:13clojurebot3
10:14mikerod_,(let [or #'clojure.core/or] (or 1 2 3 4))
10:14clojurebot(clojure.core/let [or__3947__auto__ 3] (if or__3947__auto__ or__3947__auto__ (clojure.core/or 4)))
10:14mikerod_oh
10:14Bronsamikerod_ every macro has 2 implicit args
10:14Bronsa&form and &env
10:14lazybotjava.lang.RuntimeException: Unable to resolve symbol: form in this context
10:14mikerod_ah
10:14mikerod_Bronsa: I see what you mean now.
10:14mikerod_tricky
10:16honzahttp://honza.ca/2014/03/how-to-use-piggieback-in-vim-fireplace-to-hack-cljs
10:24clgvhonza: a lot of text for 2 relevant lines ;)
10:25honzaword :)
10:51matthavenerdoes clojure's PersistentHashMap handle avoiding collision DoS attacks?
10:57TimMcmatthavener: I don't believe so.
10:58stuartsierraHow could it?
10:58TimMcHmm, maybe in 1.6 it will.
10:59TimMcIn master, it uses Util/hasheq, which for String uses the Murmur3 hash.
11:01TimMc,*clojure-version*
11:01clojurebot{:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}
11:01clgvmatthavener: you'll need a cryptographic hash function to do that (i.e. a hash function for which it is computationally hard to find collisions)
11:07matthavenerclgv: yeah, agreed, if you need the cryptographic collision prevention.. but i'm just referring to the problem that ruby had:
11:08matthavenerclgv: where the hashcode was the same for given data on every proecess, so it was trivial to generate collisions that worked against every ruby instance
11:08matthaveneraccording to this: http://vaskoz.wordpress.com/2013/04/06/java-7-hashing-drastically-better-than-java-6/ , hashCode and murmur use some kind of seed entropy
11:10tbaldridgeI'd have to search the ML but there was a discussion about this about a year or so ago
11:10tbaldridgesome languages like Lua and Ruby IIRC had some serious issues with this, but it wasn't so bad in Clojure.
11:10felherHey folks. I very often would like to use 'type' or 'key' as names for my arguments of some functions. Those names are taken, though, and IIRC it is considered to be bad style shadowing those names. Is there a convention that adresses this problem? Prefixing with '_' for example?
11:13tbaldridgepart of the problem in Lua was that it only hashed the first 32 characters of the string
11:15TimMchah, nice
11:15TimMc,(map #(clojure.lang.Util/hasheq %) ["Aa" "BB"])
11:15clojurebot(2112 2112)
11:16cbpo_O
11:17TimMc,(map #(clojure.lang.Util/hasheq %) ["AaAaAaAa" "BBBBBBBB"])
11:17clojurebot(-540425984 -540425984)
11:18TimMchiredman: How recent is clojurebot's clojure.core?
11:18xeqi,*clojure-version*
11:18clojurebot{:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}
11:19xeqihmm, that doesn't help with the hash changes :/
11:22TimMcOh, wait...
11:22TimMcreturn Murmur3.hashInt(o.hashCode());
11:22TimMchttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Util.java#L172
11:22tbaldridgeYeah, that was put in yesterday
11:22tbaldridgeto handle perf problems with re-hashing large strings.
11:23TimMcfail
11:23tbaldridgehow so?
11:24TimMcWell, if the output of hashCode is alreayd a collision, how will running it through Murmur3 do any good?
11:26TimMc,clojure.lang.Murmur3
11:26BronsaTimMc: I've wondered that too
11:26clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.lang.Murmur3, compiling:(NO_SOURCE_PATH:0:0)>
11:28BronsaTimMc: that collision still happens in clojure HEAD btw
11:30TimMcof course
11:32tbaldridgedid those strings hash differently before this latest patch?
11:33TimMcNo, that's a known problem with java.lang.String/hashCode
11:34TimMc&(map #(clojure.lang.Util/hasheq %) ["AaAaAaAa" "BBBBBBBB"])
11:34lazybot⇒ (-540425984 -540425984)
11:34tbaldridgeSo the problem is this. Switching to pure Murmur3 causes perf problems when people use large strings as keys (see ML thread on 1.6)
11:34TimMcYeah, I don't have an answer. :-(
11:34tbaldridgeSwitching to the way it is now restores perf at the loss of better hashing for strings.
11:35Bronsatbaldridge: in RC1 they hashed differently, yes
11:35Bronsauser=> ,(map #(clojure.lang.Murmur3/hashUnencodedChars %) ["Aa" "BB"])
11:35Bronsa(208255379 -1956385023)
11:35TimMctbaldridge: Oh, misunderstood your question, sorry.
11:36tbaldridgeAnd I pinged rich off channel for comments about hashing the hashCode of string, reply: "those hashcodes incorporate arithmetic relationships between the values of characters that reemerge when you combine them, rehashing scrambles so that doesn't happen"
11:36tbaldridge"hashcodes get combined in collection hashes"
11:37TimMcwhat
11:38TimMcOK, brainstorm: Murmur3(o.hashCode() + Murmur3(head(o)))
11:39TimMcThat feels icky and I don't know jack about hashing algorithms, but it is probably strictly better than what we have now, in both perf and collision resistance.
11:39TimMc(where head(o) is like Lua's approach(
11:39tbaldridgeSadly I don't know much more about any of this to comment, if there are concerns try a ML post. Alex reads those and responds quite quickly.
11:40TimMcok
11:40tbaldridgeAnd these days he's kindof the Clojure curator
11:43clgvTimMc: I think you are right, that "murmuring" the hashcode java provides defeats the purpuse of using murmur at all in the string case
11:45clgvhumm is string hashing fixed in java 8? there was some talk that hashing was improved in that release
11:46shep-werkTimMc: Why murmur the sum of codes?
11:47shep-werkWhy not just combine them; like o.hashCode *combine* murmur(head(o))
11:47TimMcshep-werk: (Not necessarily sum, just some combining function.) Because Murmur is better at hashing strings, but hashCode takes into account the whole string.
11:47shep-werkright, that's why you want to combine them; I think we are on the same page
11:47TimMcso s/+/⊕/
11:47shep-werkheh, is this #APL now
11:47tbaldridgeThe problem wasn't that Murmur wasn't hashing the entire string, the problem is that .hashCode caches the hash. Can't do that if you switch up the hashing method
11:48TimMcAlex Miller says that Murmur on String/hashCode is still valuable for the collection hashing characteristics: https://github.com/clojure/clojure/commit/50c9095b3e72b2d7a9a9f93838b147c3d99c6dd0#commitcomment-5744987
11:48katoxdnolen_: I gave a almost 2.5h talk at Prague Lambda yesterday on om and react, http://www.slideshare.net/katoxidl/om-react-1
11:48katoxdnolen_: react attracted many newcomers (mostly js devs), Om received more quite a few nods and boomarks, I think you made a few converts yesterday, well done ;)
11:49dnolen_katox: that's awesome!
11:50katoxdnolen_: the coolest part was watching js devs eyeballs rolling when showing them map identity comparison in om source ;)
11:53dnolen_katox: heh
11:58katoxdnolen_: I don't even know when they updated React Dev tools, but when I opened the console the new display names were there, also quite nice
11:58katoxdnolen_: It might be handy to update om/component to include it by default
11:58dnolen_katox: yep, there's no way to include it by default - but there's a ticket for om/component to take an additional parameter for this
11:58katoxdnolen_: that's what I meant
11:59CookedGryphonIn core async, is there a neat way to wait on a mult closing?
12:00CookedGryphonOther than consuming and throwing away everything until I get a nil
12:01tbaldridgeCookedGryphon: nope
12:01tbaldridgebesides a separate "close" channel that you close after the mult closes
12:02CookedGryphontbaldridge: Fair enough, I'll just make a separate close channel for things to listen to rather than consuming it in multiple places
12:06puredangerhello gentle Clojure friends
12:06puredangermatthavener: your original question about PHM and collision DoS attacks is a good one
12:07puredangerand something that could be addressed in the Murmur3 class by creating a seed like Java 7 does (or using theirs) instead of seeding to 0
12:07matthavenerpuredanger: thanks :)
12:08matthaveneraccording to this, http://java-performance.info/changes-to-string-java-1-7-0_06/ , in java 7 String has a hash32() method which is cached and seeded via time
12:10TimMcOh huh, I didn't know that Java 7 made String/substring linear.
12:10puredangerthx - that's interesting.
12:10puredangerI knew about some but not all of those changes
12:10puredangerI also was not aware that sun.misc.Hashing has a murmur3 impl which we might be able to use directly
12:11puredangerwhen we require java 7+ that is :)
12:14puredangeryou can just mail clojure@googlegroups.com if you're in the group
12:14TimMcI was trying to find a/the existing discussion to reply to.
12:15puredangerhttps://groups.google.com/forum/#!topic/clojure/K6W7DbxV0Cw
12:15mercwithamouthhmmm so i'm going through web development in clojure. I've just started the picture gallery app and I'm running into a little issue https://gist.github.com/anonymous/9667479
12:16TimMcOh! Thanks.
12:16mercwithamouthhere's an updated version with my project.clj and handler.clj files https://gist.github.com/anonymous/9667520
12:16puredangerTimMc: although, I think it would be perfectly reasonable to raise the cryptographic DoS issue specifically on clojure-dev instead
12:17cbpmercwithamouth: need the .repl namespace too
12:17cbpfile i mean
12:17trptcolinmercwithamouth: first guess, probably need to (require 'picture-gallery.repl). in-ns doesn't require anything
12:18mercwithamouthahh
12:20TimMc(I have a particularly slow internet connection this week, which is making things difficult.)
12:20clgvpuredanger: you dont want cryptographic hashing in Clojure's datastructuers since you want fast hashing with a good scattering
12:20clgvbut real cryptographic ones are much slower than e.g. murmur
12:21puredangeryeah, I'm not suggesting that
12:22puredangerI'm suggesting that creating a per-VM unique seed would be useful as in http://vaskoz.wordpress.com/2013/04/06/java-7-hashing-drastically-better-than-java-6/
12:22puredangerand then using Murmur3 as we do now
12:23mercwithamouthhmm still no bueno.
12:23mercwithamouthi'll take a few more minutes to see where my ignorance lies...
12:25mercwithamouthok
12:29sandwichmakermercwithamouth: from your last gist link I can't see where is the start-server defined. For development, I tipically defined as: (defonce server (run-jetty #'handler/app-handler {:port 8080 :join? false}))
12:31sandwichmakermercwithamouth: and then (.start server)
12:35mercwithamouthahh i did lein new compojure [blah]... compojure-app gives me the setup i'm familiar with
12:35sandwichmakermerchwithamouth: and if you want to know about the different parameters present in that run-jetty map you can go to http://ring-clojure.github.io/ring/ring.adapter.jetty.html
12:35mercwithamouthsandwichmaker: yeah, i noticed that when i went back to look at a previous web app i toyed with and realized no project.repl existed in the first place. wrong template =P
12:36sandwichmakermercwithamouth: :)
12:38mercwithamouthcan't squeeze blood from a turnip...
12:45TimMcHmm, another approach for hashDoS would be to avoid eagerly parsing the querystring and postbody, and instead asking for all params with keys in a known set or matching a pattern.
12:46TimMcYou could even use a destructuring syntax, I htink.
12:46puredangerTimMc: I notice that they undid a lot of that hashing stuff in Java 8
12:47puredangerlooks like they moved it down into hotspot itself for Strings
12:48puredangerhttp://docs.oracle.com/javase/8/docs/technotes/guides/collections/changes8.html
12:48puredangerthey changed hash map impl such that collisions are held as a tree, not a list and address that root problem
12:49BronsaI just realized that in {:AaAa 1 :BBBB 2} the keys will collide because of the last commit
12:51Bronsathe collision propagates to keywords and symbols since they use the string hash
12:51TimMcBronsa: But as someone noted on the ML, symbols and keywords have the opportunity to cache their own fancier hashes.
12:51puredangerwe have a fix for that issue in the queue already (on keywords and symbols)
12:51Bronsapuredanger: oh ok
12:52hyPiRionhuh
12:52puredangerwe will murmur3 the name and ns parts
12:52Bronsaseems reasonable
12:53puredangerspecifically Util.hashCombine(Murmur3.hashUnencodedChars(name), ns==null?0:Murmur3.hashUnencodedChars(ns))
12:53TimMcI'm not a huge fan of converting strings to keywords everywhere (I don't like that they're non-roundtrippable in the general case) but it works out nicely here.
12:53hlshipHaveing an issue with namespaces and meta-data
12:53hlshipI have a namespace with meta:
12:54hlshiphttps://gist.github.com/anonymous/cd5db37da6bed1da9a15
12:54hlshipBut (-> 'io.aviso.rook-test5 find-ns meta) is nil
12:55Bronsahlship: are you AOT compiling that namesapce?
12:55hlshipNope, this is all at the REPL
12:56tomjackhashDoS?
12:56Bronsahlship: what version of clojure? this works on my repl
12:56TimMctomjack: http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf (PDF)
12:56hlship1.5.1
12:56tomjackTimMc: this is a problem we already had in 1.5.1?
12:57hlshipIt looks like its an artifact of re-loading a namespace.
12:57cbphlship: maybe you havent required that namespace?
12:57tomjackI got scared that a 1.6 RC had a "hashDoS" problem :)
12:57TimMcYeah..
12:57tomjackok, cool
12:57hlshipIt looks like when you re-load a namespace, any meta for it is not changed
12:57Bronsahlship: right
12:57hlshipis that intentional or a bug?
12:58Bronsahonestly I don't know. metadata on namespaces is a bit weird
12:59hlshipI do get correct results using ns-remove before reloading the namespace
13:00hlshipI know reloading a namespace can be a bit odd
13:00Bronsathat's to be expected. right now the behaviour is that the ns gets the metadata of the symbol naming the namespace when the namespace is first created
13:00hlshipyes, that's not ideal for me
13:01BronsaAFAIK this is what causes problems with metadata on AOT compiled namespaces
13:01BronsaI tried debugging it in the past but got bored before finding a solution.
13:01hlshipIs this a known issue or should I go add one?
13:02hlshipthis is extra wierd in that I'm provding an attribute map for the namespace (as opposed to meta-data on the symbol)
13:02hlshipthat should either take precedence or be merged
13:02hlshipI think I'd prefer precendence
13:02Bronsahlship: I don't see a bug in JIRA for this, I'd say go open one
13:03mmitchellQuestion... I have a set of functions, that talk with an http service. In order to facilitate simpler testing, I’d like to pass these functions as an argument to my app code - not reference a namespace. I have this setup as a protocol now, but because I don’t envision ever having alternative implementations (except for tests), but I am considering a map of functions instead. So I guess the question is… is using a protoc
13:03mmitchellol to achieve cleaner testing a valid approach? Or, would using the map of functions be a better way?
13:06nooniandoes anyone know if you can configure light table to recognize certain files that don't have extensions to use a particular language editor?
13:07nooniani.e. Gemfile or Vagrantfile to use ruby; :lt.objs.files/file-types works great but only seems to be configurable by extension
13:09hlshiphttp://dev.clojure.org/jira/browse/CLJ-1389
13:12mindbender1,(dissoc {:a {:b {:c 1}}} [:a :b] :c)
13:12clojurebot{:a {:b {:c 1}}}
13:12TimMcmindbender1: It's not dissoc-in
13:12mindbender1,(dissoc-in {:a {:b {:c 1}}} [:a :b] :c)
13:12clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: dissoc-in in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:12TimMcYeha. :-(
13:13mindbender1,(defn dissoc-in [m ks k]
13:13mindbender1 (update-in m ks #(dissoc % k)))
13:13clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
13:13TimMc*yeah
13:13TimMcmindbender1: And update-in doesn't do the right thing in the base case.
13:13hyPiRionIt's not evident what dissoc-in would do iirc
13:14TimMcmindbender1: And update-in doesn't do the right thing in the base case.
13:14TimMcugh
13:14TimMc&(update-in {} [] assoc 1 2)
13:14lazybot⇒ {nil {1 2}}
13:14mindbender1I think it should be patched then?
13:14mindbender1TimMc:
13:17TimMcI agree. I don't remember if there's a Jira ticket open for it.
13:18puredangerthere are at least 2 tickets for this already
13:19puredangercoming at it from different angles
13:19puredangerhttp://dev.clojure.org/jira/browse/CLJ-373
13:19mindbender1puredanger: If you're looking at the link now can you share?
13:19mindbender1ok
13:20puredanger(was finding - just knew from memory)
13:21tutysaraI recently started doing frontend development using angular, having used clojure for some time, I am missing the jump-to-source and jump-to-definition functions offered by cider. Do we have anything similar to nrepl for coding interactive javascript with angular
13:21puredangermindbender1: feel free to vote on that if you want to raise visibility, I would like to fix it as it trips people up
13:24mindbender1puredanger: sure!
13:31bodie_just curious whether anyone's got any input about opengl interfaces for clojure? is LWJGL suitable? I'm working on a game engine right now and weighing between scala, clojure and C++/SDL for my approach.
13:32stuartsierrammitchell: I like the protocol approach, because that's what protocols are for. I assume that virtual method dispatch in Java is always going to be faster than a hash-map lookup.
13:32mmitchellstuartsierra: ahh good point
13:34tbaldrid_bodie_: the OpenGL interface is so simple just about any Java binding would work
13:34tbaldrid_bodie_: but you haven't explained what you're trying to do
13:37bodie_tbaldridge, make an extensible base so I can start some really minimal work on a game -- I have something pretty unique in mind for the mechanics so I'm trying to put my own thing together under the hood
13:37bodie_not quite sure what you're looking for beyond that :)
13:38jjl`use unity3d?
13:38bodie_doesn't really fit the bill, I'm academically interested in engine programming anyway
13:38tbaldridgebodie_: yeah, then a simple OpenGL binding will work. If you were looking to visualize 500GB of medical data, I might suggest something else.
13:39bodie_ah, I see
13:39bodie_cause data structures and heap behavior?
13:39bodie_it's a voxel rts kind of thing with lots of units on screen, so... might be vaguely comparable
13:39bodie_why?
13:39clojurebotwhy not?
13:40bodie_^ clever :D
13:40jballancclojurebot: botsnack
13:40clojurebotThanks, but I prefer chocolate
13:41jballancclojurebot: chocolate
13:41clojurebotactually I decided I prefer botsnacks after all.
13:41jballancclojurebot: recursion
13:41clojurebotGabh mo leithscéal?
13:41arrdem(inc clojurebot)
13:41lazybot⇒ 35
13:41hyPiRionoh woah, when did clojurebot reply on chocolate? That's a neat easter egg
13:45tbaldridgebodie_: there's some technical stuff that may cause issues if you're attempting to stream tons of data to/from a GPU. I don't see it being a problem for most games as you'll probably stream the data once and leave it there
13:46tbaldridgebodie_: namely, Clojure likes to work with doubles and not floats. So if you're doing tons of CPU processing of float data you might run into issues.
13:47tbaldridgelike I said, not a problem for a prototype, and easy enough to work around when it comes to optimizing. That's what I love about Clojure easy to prototype, not hard to optimize when the time comes.
13:53borkdudeDoes this, or something similar already exist in clojure? https://www.refheap.com/62421
13:55ssadoes anyone know how to intern a defmethod?
13:57amalloyssa: they're not interned, so no
13:57ssaok
13:57amalloyborkdude: that looks like comp?
13:57ssamaybe i should describe my problem
13:58ssai'm using liberator and trying to override one of its defmethods -- specifically its json encoding
13:58amalloylike, (filter= :a 2 coll) is (filter (comp #{2} :a) coll)
13:59ssai added a defmethod in my project that i thought would "override" the original
13:59ssait does seem to override it some, but not all the time
13:59ssaso i thought it could be a binding issue?
13:59ssais this a good intuition or no?
14:01amalloyssa: probably not. if you succeed in overwriting a defmethod, the original is gone and nobody's the wiser. perhaps liberator sometimes goes through that defmulti and sometimes does something else, or perhaps it sometimes has a different dispatch value and thus goes through a different method
14:02ssainteresting, ok, thanks amalloy. i'll do some more investigating, cheers
14:03amalloyor you might be reloading the liberator namespaces, which re-tramples back over your definition, ssa
14:05bodie_thanks for the input, tbaldridge
14:06ssai see what you're saying; i have a feeling that isn't happening -- only one endpoint has this problem (defmethod isn't overwritten), whereas the other endpoints are ok (defmethod is overwritten)
14:06SegFaultAXAnyone played with EEP?
14:11AeroNotixis weavejester around?
14:11AeroNotixor do they have a different handle in IRC?
14:13hyPiRion$seen weavejester
14:13lazybotweavejester was last seen joining on clojure 2 weeks ago.
14:13AeroNotixheh, nice!
14:32borkdudeWhat is the common clojure way to deal with (compare 1 "foo") => Exception?
14:32borkdudeamalloy thanks for your reply earlier
14:32amalloyborkdude: you're welcome. and: use a different/custom comparator
14:33borkdudeI kind of solved it like this: (compare 1 (if (string? v) nil v))
15:56amalloyborkdude: that's fine if you're calling compare by hand, but that seems pretty rare to me: most uses of compare will be from trying to put things in a sorted collection, no?
16:00ToBeReplacedcan someone point me to an example using reduced? and reduced
16:01justin_smithhttp://kunstmusik.com/2014/03/20/clojure-and-bluecsound-example/ blog post on using clojure with blue (a java csound frontend)
16:03JavaIsAwfulcsound? why use csound when there's overtone
16:03ToBeReplacednevermind reduced question, got there
16:04AeroNotixis it a pita to integrate midje and core.test?
16:04AeroNotixor will it be fine enough?
16:07justin_smithJavaIsAwful: csound has better performance, more diversity in its audio processing functions, and better low level control. The main benefit of sc is the more flexible language, which you are going around anyway with a clojure frontend.
16:07JavaIsAwfulI suppose that's a good point
16:07JavaIsAwfulthe clojure frontend bit
16:08JavaIsAwfuldidn't know csound performed better than sc
16:08justin_smithI switched from sc csound when I got a nokia n900
16:08dacci thought sc was more interactive than csound?
16:08justin_smithon a small mobile device like that, csound was fully functional (and much fun) and sc was useless
16:08justin_smithdacc: latest csound allows definition of instruments at runtime
16:09justin_smith(and redefinition)
16:09justin_smithit also compiles to pnacl such that you can run it in a chrome browser(!)
16:09bob2AeroNotix, integrate how?
16:10bob2pretty sure midje runs core.test tests
16:10justin_smithhttp://vlazzarini.github.io/ (link to run csound in your browser)
16:12justin_smithI have thought of using clojurescript to control the pnacl csound port
16:17ToBeReplaceddoes reducers/fold allow you to set reduced on each subgroup? can't seem to get it to function
16:17daccjustin_smith: wow cool
16:18garietyxxxHi, #clojure, I'd like to write a Node.js app in Clojure, but I'm confused as to ClojureScripts association with the Closure compiler. Google Closure and Node use different `require` formats, so how could they possibly work together?
16:19justin_smithdacc: be sure to check out stria
16:19justin_smithan excellent piece of computer music, all algrorithmic, generated in the browser
16:21dbellis there a clean idiomatic way to have to two different datatypes share implementation of the same protocol? Would you just write a common function and then reference the function when extending?
16:22amalloyToBeReplaced: i wouldn't expect reduced to make sense in the context of a fold
16:26amalloydbell: you can use extend (rather than extend-type/extend-protocol) to pass in a map of all the functions. otoh, you may want to double-check whether you really want a protocol and not just a function, if you need multiple identical implementations
16:26seangrovednolen_: I'd like my components to implement another protocol, zr/IPreview, and to have my Om instrumentation be able to select between using om/IRender and zr/IPreview - basically swapping out the rendering methods. Any ideas on how to approach that
16:26seangrove?
16:27stuartsierragarietyxxx: I think ClojureScript apps targeting Node.js do not use the G.Closure compiler. But it's not an area I know much about.
16:27dbellsorry, I realized i wasn't clear;
16:27dbellit's a third-party type/protocol pair
16:27amalloyyikes. i mean, it's not against the law, but you should be cautious when extending a protocol you don't control for a type you don't control
16:28dbelloh, sorry
16:28dbellstill not clear
16:28dbelltrying to extend the protocol
16:28dbellto *my* type
16:28dbelland wanting to use the implementation of the 3rd-party type
16:28dbelli mean i can just copy paste
16:28dbellbut...
16:29amalloyso type T implements protocol P, and you want an identical implementation for your type S?
16:29seangrovedbell: You want a type that basically wraps a third-party type, so you can safely extend protocols to it?
16:29dbellyeah
16:30justin_smithdacc: woah, going directly to that piece, I see it is by the guy who invented FM synthesis http://vlazzarini.github.io/stria
16:30amalloythere's not much to share then
16:31dbellyeah something tells me i've got a logic problem rather than a not-knowing-clojure-feature problem
16:31amalloyyou just have to copy/paste or something, if the code is not in a function you can use
16:31dnolen_seangrove: what's the difference between those two methods exactly?
16:33seangrovednolen_: One renders a dummy/mockup version of the component (possibly with drop-target for sub-components to be built) with resizing/editing handles, the other renders exactly as the production version of the component
16:35seangrovednolen_: I think I can work around it by making IPreview return a separate Om component. It was messy last time I tried, but I might have better context for it now
16:35dnolen_seangrove: why can't you handle this with :instrument? You can intercept and back with a component that will call the preview method instead?
16:37seangrovednolen_: I can, but ultimately Om is going to call (render ...) on it, so I can't provide a preview method alongside my Om methods easily - right now they're separate components
16:37dnolen_seangrove: "back with a React component that call preview method instead"
16:37seangroveAhh, ok
16:37seangroveGot it
16:38dnolen_seangrove: look at how Pure is constructed now in master
16:38dnolen_seangrove: you can just create your like Pure is constructed but you just assoc in your custom render method
16:38dnolen_om.core/build takes :ctor so you can use your own constructor instead of `pure`
16:39seangrovednolen_: Looks good, thanks
16:41dnolen_seangrove: let me know how that goes, that's a pretty cool use of :instrument, replacing all the standard Om components with a custom thing
16:42seangrovednolen_: Just wrapped my head around :instrument yesterday, cleaned up quite a bit of stuff
16:42dnolen_seangrove: nice
16:56JavaIsAwfulwhen you guys GPL your clojure projects, what do you typically put under :license :name in your project.clj?
16:56JavaIsAwfuljust GNU General Public License?
16:56JavaIsAwfulor do you include "version 3" after, or whatever version
16:59bts-JavaIsAwful: https://github.com/search?q=license+GNU+path%3Aproject.clj&amp;type=Code&amp;ref=searchresults
16:59JavaIsAwfulbts-: good to see there's no consensus :D
17:12eraserhd_Is there a lein plugin that checks for dependency updates?
17:12eraserhdOops.
17:12technomancyJavaIsAwful: the GPL is incompatible with Clojure's own license
17:13devth_eraserhd: https://github.com/xsc/lein-ancient
17:13JavaIsAwfultechnomancy: but that doesn't mean I can't use it, right?
17:13JavaIsAwfultechnomancy: I'm not licensing clojure with it
17:13technomancyJavaIsAwful: you're licensing a derivative work
17:14hiredmantechnomancy: are you a lawyer? you have to tell me if you are
17:14JavaIsAwfulor a cop
17:14JavaIsAwfulgotta tell us if you're a cop
17:14gfredericksor an angel
17:15joegallohe's not a cop, seriously, though, how about that meth?
17:16technomancyjoegallo: https://twitter.com/NotAPoliceman/status/263447666376187904
17:16arohnerhiredman: lol
17:16hiredmanas long as technomancy has some too, then we are ok under attorney client privilege
17:16joegallotechnomancy: "crime men" i'm dying
17:20JavaIsAwfullol, this is pretty great
17:20JavaIsAwfulthanks for giving me something to waste the next 5 minutes reading
17:24JavaIsAwfulwell, that was a fun 5 minutes
17:27gfredericksyeah that was great now lets all go do our favorite drugs and tell each other what/where we're doing
17:34technomancyand when
17:39JavaIsAwfulI'll be going to the corner of 5th and main with my kilo of heroin, everyone and their non-cop friends should join me #yolo #notacop
17:39JavaIsAwfulat exactly 6pm EST
17:51arrdemwhere's Bronsa when you need him :c forget the time delay between the US and Italy.
17:55amalloyarrdem: you can $mail him
17:56amalloynot synchronous, of course, but if your development process relies on synchronous access to bronsa you're probably out of luck
17:57arrdemhey now.. synchronous access to Clojure contributors tends to be an amazingly viable assumption
17:57arrdemsee my last 20 months of bothering yall successfully :P
18:01JavaIsAwfuldoes using () vs [] make a difference when I use :import?
18:01JavaIsAwfulin (ns), that is
18:01gtrak() is weird imo
18:02JavaIsAwfulyeah
18:02JavaIsAwfulI don't like it
18:02gtrakbut it works
18:02JavaIsAwfulbut [] will work the same?
18:02gtrakyea
18:02JavaIsAwfulok good
18:02cbpjava is the best
18:02JavaIsAwfulI'm looking at a clojure.contrib example that uses [] for everything but :import
18:02gtrakns is a macro, so normally, (blah would call a function called blah, but it just takes it as a list
18:02JavaIsAwfulgtrak: makes sense
18:02gtraksince that's what makes macros macros
18:03JavaIsAwfulis there any way to force evaluation in a macro's arguments?
18:03gtrakthe key question is 'when'
18:03JavaIsAwfulwhen is there a way?
18:04gtrakwhen do you want it to be evaluated
18:04JavaIsAwfulno particular example, just wondering
18:04gtrakthis: http://www.infoq.com/presentations/Clojure-Macros
18:04tbaldridgeJavaIsAwful: it's purely convention, there is no difference between using [] or () in a ns
18:07JavaIsAwfuldoes paredit have a way to convert ()'s to []'s?
18:07gtrakJavaIsAwful: so that's the long answer, the short answer is you can run eval yourself on the arg in the body of the macro to eval at compile-time, and if the macro returns a data structure, it'll be evaluated just like normal code.
18:07JavaIsAwfulgtrak: I see
18:08gtrakmacros run at compile-time, outside-in.
18:08JavaIsAwfulright
18:08gtrakif the return result contains the arg, that'll get evaluated at run-time.
18:09cbpJavaIsAwful: yes it does
18:09gtrakwith normal function call order
18:09cbpJavaIsAwful: But I dont remember the keybinding ahahah
18:09JavaIsAwfulcbp: that's just about everything in paredit for me
18:09JavaIsAwfulC-left and C-right are about all I can remember :P
18:10JavaIsAwfulwhich are really annoying, because I have to move my right hand :\
18:10FrozenlockParedit is making me crazy
18:11FrozenlockBut apparently it's the best thing since sliced bread...
18:11JavaIsAwfulFrozenlock: when doing something in paredit makes your hair fall out, don't forget M-x disable-paredit-mode
18:12tbaldridgeFrozenlock: it takes a bit to get used to, but once you do it's really nice
18:12_2_Heben2olaao
18:13cbpActually now tit
18:13cbper
18:13cbpnow that i remember I
18:13Frozenlockalways the keyboard
18:13cbpnow that I remember it might've been light table or emacs live that had it
18:14cbpbecause I remember removing it
18:29JavaIsAwfuldoes cider have a keybinding or command to do a `lein run` on the current project?
18:33cbpJavaIsAwful: it has a keybinding for jack-in which is kinda like lein repl but not lein run afaik
18:36JavaIsAwfulcbp: yeah I know about jack-in
18:36JavaIsAwfulI guess I could jack-in to my project's main file and run (-main) myself
18:38cbpJavaIsAwful: Just be careful it doesnt kill your emacs :-D
18:40JavaIsAwfulcbp: why would it do that?
18:40JavaIsAwfulI seem to remember that happening in the past
18:40JavaIsAwfulbut never understanding why
18:40JavaIsAwfulor maybe I'm just thinking about when I got infinite recursion and emacs locked up
18:41cbpI dont know it's been a long time since i started a clojure app from emacs, I think i had problems when I ran stuff like shutdown-agents
18:41JavaIsAwfuland I got to run my favorite shell command
18:41JavaIsAwful`killall java` :::)
18:46JavaIsAwfulso I noticed in the examples for tools.cli, they do things like #(Integer/parseInt %)
18:47JavaIsAwfulI saw that and thought "that's redundant, I'll just do Integer/parseInt, without the anonymous function"
18:47JavaIsAwfullo and behold, I get an exception about being unable to find static field parseInt
18:47JavaIsAwfulunless I do it like they did
18:47cbpstatic methods arent first class
18:47amalloymethods aren't first-class values
18:47JavaIsAwfulah
18:47JavaIsAwfulis there any other way to wrap them in a function?
18:47Wild_Catare they not?
18:48Wild_CatAww :(
18:48JavaIsAwfulseems like an ugly way to do things
18:48amalloywell uh...use a lambda. like the example
18:48amalloyyou couldn't really ask for a more convenient way
18:48JavaIsAwfulI'd rather do something like (some-function Integer/parseInt)
18:48JavaIsAwfultried partial but it didn't work
18:49JavaIsAwfulI mean, using lambdas means assuming something about the arguments it takes
18:49amalloyit's not possible if some-function is a function, because Integer/parseInt is not a value. if it were, you wouldn't need to do this at all. you can do it as a macro, which is fine, but it's not really exciting
18:49brehautthere is memfn but why be silly. use the lambda
18:49JavaIsAwfulohhhh
18:49amalloybrehaut: memfn doesn't work for non-member functions
18:49amalloy(as implied by its name)
18:49brehautoh thats a static, sorry
18:49JavaIsAwfulnow I understand
18:50JavaIsAwfulbut non-static methods *are* first class?
18:51brehautno method is first class
18:51myguidingstarhi all, I tried Overtone on my Linux box and it crashed whenever I call `(use 'overtone.live)`
18:51JavaIsAwfulwhoops, well running (-main) from cider crashed cider
18:51myguidingstarhere's the output https://gist.github.com/myguidingstar/897664b8c0c61f89556e
18:51myguidingstarI tried to google but found nothing
18:54JavaIsAwfulis there any good clojure frontend for doing sockets stuff?
18:55cbpjava.web.socket :-P
18:55JavaIsAwfulI said clojure!!! :P
18:56cbpmaybe aleph
18:56cbp$google clojure aleph
18:56lazybot[ztellman/aleph · GitHub] https://github.com/ztellman/aleph
18:56amalloyaleph, and there's another one. clj-http, or http-kit or something?
18:57cbpthat's actually java.net.Socket duh
18:57amalloycbp: uggghhhhhh, i can't imagine the pain of trying to implement websockets on top of Socket
18:57clojurebotExcuse me?
18:57amalloyclojurebot: nobody asked you
18:57clojurebotNo entiendo
18:57cbphttp-kit has good websocket support
18:58brehautclj-http is the requests library
18:58noonianyeah, depends if you want tcp sockets or websockets
18:59noonianhttp-kit is good for websockets but no socket support afaict
18:59JavaIsAwfulactually, I just need to do udp sockets, not http
19:00yedi_newb question: i want to work from within the context of namespace in my repl, how would I go about doing that?
19:00yedi_i'm trying to use (in-ns <namespace>) but none of the vars from the namespace seem to be loaded. Also I lose my other core functions like `use` and `keys`
19:00yedi_is there a better way to do this
19:00cbpyedi_: require the namespace first
19:00cbpbefore you in-ns
19:00noonianJavaIsAwful: aleph is probably what you want: https://github.com/ztellman/aleph/wiki/UDP
19:01cbpor.. load-file
19:01amalloyyedi_: in-ns doesn't load any code, it just goes into a namespace (creating it empty if it isn't already loaded)
19:01JavaIsAwfulnoonian: ooh, this actually looks pretty good
19:01amalloyrequire is for loading namespaces from disk
19:02JavaIsAwfulwait, is that the entire documentation for UDP? lol
19:02cbpJavaIsAwful: read the source! :-P
19:02JavaIsAwfulcbp: lul
19:03JavaIsAwfulthere's this too: http://ideolalia.com/aleph/aleph.udp-api.html
19:03noonianit looks like it just delegates to netty
19:03yedi_cbp amalloy: many thanks
19:04JavaIsAwfulwait, does using two names like that highlight it for both of them?
19:04JavaIsAwfulin irc
19:07JavaIsAwfulback in 10, about to cook up some chickens
19:11yedi_i want to use my library in another project, what do I have to do to make my library lein friendly?
19:11yedi_is there a guide i could look at?
19:11justin_smithyedi_: you probably want to put it on clojars
19:11technomancyyedi_: try `lein help tutorial`
19:12yedi_sweet, will check it out
19:21amalloyJavaIsAwful: it depends on the recipients' clients, of course - highlighting isn't a part of the irc protocol. but just about every client takes notice when your username appears anywhere in any message
19:29JavaIsAwfulI'm baaack
19:29JavaIsAwfulamalloy: I knew it wasn't part of the IRC protocol, but there seem to be common conventions
19:30JavaIsAwfulI always thought it looked at the start or end of a message for your name, but I guess it really is just looking for your name anywhere in the message
19:31justin_smithit's 100% up to the client
19:32JavaIsAwfuljustin_smith: I know, but there are some pretty standard things that clients do
19:37JavaIsAwfulso I left out a dependency in my project.clj
19:37JavaIsAwfuland the error message I got was a ClassNotFound exception for my project's core class
19:37JavaIsAwfulhow does that make any sense?
19:38chareok we have two projects that need solved
19:38chare(1) make clojure framework that beats out ruby on rails
19:38amalloyyou were unable to load your project's class, because loading it depended on loading some other stuff. it should be in the stacktrace, probably as a Caused By
19:38justin_smithns declaration fails because dep is missing so that class does not exist
19:38chare(2) why is there no tail call optimization in JVM? writing clojure code without recursion is really annoying.
19:39JavaIsAwful(recur)
19:39JavaIsAwfulchare
19:39charerecur is really annoying to use
19:39JavaIsAwfulwelp, that's how you do TCO
19:40charewhy didn't tail call optimization ever get added to jvm
19:40JavaIsAwfulbecause it's java
19:40rasputnikchare: pay Larry Ellison, he'll hook you up
19:40JavaIsAwfuljava's icky
19:42chareand what happens if you need to tail call a totally different function
19:42charethen you can't use looping
19:42beamsotrampoline
19:43technomancyif lack of TCO is the biggest problem in your life you've got it pretty good
19:43beamsohttp://bugs.java.com/bugdatabase/view_bug.do?bug_id=6804517
19:43beamsoscheduled for jdk9
19:45chareomg thats going to take forever, 8 just got released
19:45seangroveCan't tell if that's serious or not
19:46JavaIsAwfulmaybe when I implement mini-java in my compiler class next semester, I'll add TCO
19:46JavaIsAwful /s
19:47justin_smithJavaIsAwful: I'll one up you by making a primitive, crude version of tail call which I will name the bootycall
19:48JavaIsAwfullol
20:01amalloyJavaIsAwful: if you do implement a compiler at all, adding tco is really easy. it's only hard for java because of other decisions that have since been made that depend on not having tco
20:01JavaIsAwfulamalloy: hmm, well maybe that's what I'll do then
20:02JavaIsAwfulfrom what I've heard about past years, the semester-long project is to implement a certain subset of java, plus one new thing
20:03chareamalloy: you suggesting we switch to racket/scheme for a clean start?
20:05arrdemJavaIsAwful: ohai bro
20:08brehautapropos: http://i.imgur.com/5X3VwOy.png
20:08JavaIsAwfularrdem: eyy
20:08brehaut(via @webyrd)
20:09technomancybrehaut: that expression... so much pain.
20:09brehautwhich?
20:10brehaut(please excuse my uncaffenated friday brain)
20:10cbpits thursday
20:10technomancythe pic you linked to
20:10brehautnot in new zealand
20:10cbpoh i guess
20:10brehautcbp: living in the future isnt all its cracked up to be
20:11brehauttechnomancy: oh, yes indeed
20:13JavaIsAwfulbrehaut: what's today's winning lottery number?!
20:13JavaIsAwfulbrehaut: that's yesterday for you, I guess
20:16amalloyaussies have the future knowledge to win the lottery, but not the inclination. the prize is always a dropbear
20:18SegFaultAXbrehaut: Was that a plea for generalized TCO or only direct recursion?
20:19brehautSegFaultAX: i assume that with a picture of Steele, its generalized TCO?
20:20brehautyou have as much context as i do though
20:21SegFaultAXMaybe. Even if Java only supported self recursive tail calls, that'd be a huge step up.
20:22hiredmanhttp://openjdk.java.net/projects/mlvm/subprojects.html
20:23hiredmanthe oracle bug database says the tco bug is targeted at version 9
20:25hiredmanthe continuation bug says the same thing though
20:25arrdemcontinuations in Java....
20:25arrdemokay.
20:25amalloyyeah, i assume 9 isn't getting any of this stuff. 9 is just the current "sounds cool" bin
20:25arrdemsounds about right to me
20:25SegFaultAXThat would be awesome, even if it was only at the bytecode level. Native call/cc
20:26arrdemI think they'd just add an interproc GOTO first and let library / lang authors fudge it from there...
20:26arrdemwere such a thing to ever happen.
20:26JavaIsAwfullol, aleph's documentation is pretty top-tier
20:26JavaIsAwfulit linked to this page https://github.com/ztellman/lamina/wiki/Result-Channels
20:27SegFaultAXJavaIsAwful: I'm sure he'd love to have your help!
20:27JavaIsAwfulSegFaultAX: if only I had the time :)
20:27JavaIsAwfulor understood how his libraries worked
20:28arrdemone day I will finish cloutjure... then we will all get karma for PRs :P
20:29beamsoif i have a protocol and types that implement that protocol, does the protocol create an interface and do the types implement the interface?
20:30amalloyJavaIsAwful: https://github.com/amalloy/hermes/blob/master/src/flatland/hermes/server.clj is a project i did at my last job, using aleph's websocket implementation. it has some other stuff that you don't care about, but https://github.com/amalloy/hermes/blob/master/src/flatland/hermes/server.clj#L132 is most of the webserver
20:31beamsoyogthos: i'm cool with that, but (instance? selmer.node.INode selmer.node.TextNode) returns false for me.
20:31yogthosbeamso: not sure why that's happening...
20:31yogthosthis all lives here https://github.com/yogthos/Selmer/blob/master/src/selmer/node.clj
20:32beamsomaybe that means i was getting INode instances whereas everyone else is getting TextNode instances
20:32amalloybasically a function gets called whenever a client connects, and you get a lamina channel to talk to them over. enqueue data into the channel to write to the client, receive to read from them
20:32yogthosbeamso: you should always get either a FunctionNode or a TextNode instance
20:33amalloybeamso: protocol implementations don't necessarily implement any interface
20:33amalloythey satisfy a protocol, and sometimes that's done by implementing an interface, but it's not required
20:34JavaIsAwfulthank you amalloy, that's probably the most helpful thing anybody could have said :)
20:34yogthosindeed :)
20:34beamsoamalloy: so if i've typehinted a parameter to a function call, it could go wrong?
20:34amalloydon't typehint protocol functions. there's no reason
20:35amalloyi'm looking at you too, yogthos - what is the deal with the ^String in that code you pasted?
20:35yogthosamalloy: seemed like a good idea at the time :P
20:35amalloybeamso: in the selmer example, it looks like those types *do* implement the interface
20:35amalloybut (instance some-class other-class) is never true
20:36amalloyinstance? wants an object and a class, not two classes
20:36amalloy(yes, yes, (instance? Class other-class) works specifically for java.lang.Class, but that's not the point)
20:38beamsowould there be something with reloading a repl that could break that instance? call?
20:42amalloyyes. i intended to say as much myself, but then i got sidetracked
20:42amalloy(this assumes you mean a sensible instance? call, and not one comparing two classes)
20:43amalloyif you (def n (TextNode.)) (require :reload 'selmer.whatever) (def m (TextNode.)), now m and n are of different classes
20:43beamsoyeah, i worked out that using the instance and the class worked, so my apologies to both yourself and yogthos on getting that wrong.
20:43yogthosno worries
20:43beamsooh, that would explain why i was only getting the error on repl reload.
20:48SegFaultAXOh the fun of redefining vars at the REPL.
20:55JavaIsAwfulamalloy: in your hermes project, did you do any client side stuff?
20:55JavaIsAwfulor just server-side?
20:56JavaIsAwfulamalloy: oh, I see from your readme that there is a client
20:56JavaIsAwfulbut it appears to be all js
20:57JavaIsAwfulI'm sure I'll figure it out in clojure
21:08JavaIsAwfulamalloy: y u no follow 80 character law?
21:09hlshipDoing some interesting work combining Ring and core.async right now. I'll be able to make it public in a bit.
21:09JavaIsAwfulI don't want to make my editor wider to read your code :(
21:17brehautJavaIsAwful: i believe you mean the 1980s character law
21:30akhudekwhat would prevent fold from parallelizing?
21:30JavaIsAwfulisn't there a parallelized fold in the reducers library?
21:31akhudekJavaIsAwful: yes, but one of my coworkers is finding that it's not using more than a single cpu in particular application: https://www.refheap.com/ca4a1f117b952a2d8e2193e3e
21:32gfredericksdoes it sound plausible that reply mis-parses "foo//"?
21:32akhudekeverything looks right to me, and it certainly should give a speedup given the profiling I've done
21:32gfredericksdoes reply just use the builtin reader?
21:42amalloygfredericks: i think it uses tools.reader
21:43amalloyakhudek: lazy sequences aren't random-access, so folding is not possible
21:43hiredmanamalloy: parallel folding is not possible
21:44amalloyyes, sorry
21:45akhudekamalloy: thanks, I thought it might be something like that but wasn't sure if it batched non-random access sequences or something.
21:50gfredericks,clojure.core//
21:50clojurebot#<core$_SLASH_ clojure.core$_SLASH_@24764f>
21:50gfrederickshttps://github.com/trptcolin/reply/issues/136
21:54seangroveOh man, love this https://bugzilla.mozilla.org/show_bug.cgi?id=505521#c4
22:17yeditechnomancy: wow.. that was incredibly simple. lein is quite tight
22:17technomancythanks
22:19JavaIsAwfulso what are the idomatic ways of handling byte streams in clojure?
22:20JavaIsAwfulI need to create and read datagram packets at the raw bytes level
22:20JavaIsAwfulshould I just be using ByteBuffer or whatever it's called?
22:24technomancycopying into bytearrayoutputstream is the normal way I think
22:26malynYou may also want to look at https://github.com/ztellman/byte-streams ; Aleph and Lamina have some built in byte stream support if you are using those (by way of ztellman's gloss).
22:27hiredmanJavaIsAwful: it really depends on whatever the library you are using uses
22:28JavaIsAwfulI've decided to just use java.net.DatagramSocket
22:28hiredmanyeah, so that uses byte arrays
22:28JavaIsAwfulI'm trying to do things like put a short, followed by a string, into a byte array
22:29hiredmanJavaIsAwful: ah, well wrapping the byte array with a bytebuffer can make that easier
22:29hiredman(ByteBuffer/wrap ...)
22:30gfrederickslol I did `lein help tutorial` and the first thing it did was start copying dependencies
22:30JavaIsAwfulwhy is ByteBuffer abstract?
22:30JavaIsAwfulthat doesn't make sense to me
22:30shriphanihi. how do I make lein use the pom.xml that I have in my java source directory ? I can build a jar with maven but lein can't seem to compile it
22:30malynJavaIsAwful: Maybe take a look at gloss then? It gives you a DSL for encoding/decoding byte arrays. https://github.com/ztellman/gloss/wiki/Introduction
22:30hiredmanJavaIsAwful: because there are different kinds, heap and direct(native?)
22:31JavaIsAwfulthe javadoc only lists MappedByteBuffer as a subclass
22:31JavaIsAwfulwhich is also abstract
22:32JavaIsAwfulis that just because the others aren't in java.nio?
22:32hiredman,(class (java.nio.ByteBuffer/allocate 1))
22:32clojurebotjava.nio.HeapByteBuffer
22:32hiredmanmaybe they aren't public
22:32hiredmandoesn't matter
22:33hiredmanwrap is all you'll need
22:34yediso here, I'm opening a file that's in the libraries folder/repo -- https://github.com/yedi/rhyme-finder/blob/master/src/clj/rhyme_finder/core.clj#L15
22:34yedibut when I add that repo as a dependency in a different project, I get this error: Exception in thread "main" java.io.FileNotFoundException: cmudict.txt (No such file or directory), compiling:(core.clj:15:34)
22:35JavaIsAwfulokay, I think I get it now
22:35yediif I add the cmudict file to the new project, the lib works. but how can i fix rhyme-finder so that it opens/looks for the file from within its own jar
22:35hiredmanyedi: you need to put the file in resources/ and load it from the class path using clojure.java.io/resource
22:35JavaIsAwfulIf I do .putShort, it should automatically cast to short, right?
22:36JavaIsAwfulyeah, it does
22:36hiredmanit depends on the type, more complicated conversions won't happen automatically
22:36hiredman,(byte \c)
22:36clojurebot99
22:36hiredmanclojurebot: jerk
22:36clojurebotyou cut me deep, man.
22:37gfredericks(defn -main [] (def the-server (start-server)))
22:37hiredmangfredericks: :(
22:37gfrederickskinda useful though...
22:37hiredman(def the-server) (defn -main [] (alter-var-root #'the-server (constantly (start-server))))
22:37gfrederickscompared to that repetitive option
22:37hiredmandon't put defs inside things
22:38gfredericksI know I just thought this was an interesting use case, since I don't know of concrete downsides and the alternative is repetitive
22:40gfredericks,(def x (def y (def z (def w 'def))))
22:40clojurebot#'sandbox/x
22:40gfredericks,x
22:40clojurebot#'sandbox/y
22:40gfredericks,y
22:40clojurebot#'sandbox/z
22:40gfredericks,z
22:40clojurebot#'sandbox/w
22:40gfredericks,w
22:40clojurebotdef
22:40gfrederickswell that was exciting
22:41JavaIsAwfulI think I just got a small stroke from looking at that
22:41hiredmangfredericks: the issue is def causes a var to get interned during compilation, but putting the def inside a function means it won't get a value until the function is run
22:42cminusJavaIsAwful: You'll have to run through unchecked-short and friends to use bytebuffer
22:42JavaIsAwful(doc unchecked-short)
22:42gfrederickshiredman: sure, but again for this particular use case I can't imagine that backfiring
22:42clojurebot"([x]); Coerce to short. Subject to rounding or truncation."
22:42JavaIsAwfulcminus: even if I know the values are valid shorts?
22:43hiredmangfredericks: just because it works doesn't mean it is good
22:43gfrederickshiredman: yeah it's ethically indefensible
22:45ArchPySo is Clojure just a trendy language?
22:45gfrederickshiredman: come to think of it, your "won't get a value until the function is run" point applies to the alter-var-root alternative just as much
22:45hiredmangfredericks: no, the var has a value in that case, nil
22:45gfredericks,(def hiredman)
22:45clojurebot#'sandbox/hiredman
22:45gfredericks,hiredman
22:45clojurebot#<Unbound Unbound: #'sandbox/hiredman>
22:45cminusJavaIsAwful: I ended up doing it that way. Reading and writing to a serial port.
22:45hiredmanwell damn
22:46hiredmananyway, at least it reads as getting no value
22:47hiredmaninstead of (def foo ...) which reads like foo should have a value
22:47SegFaultAXArchPy: It's trending right now, yes, but that shouldn't suggest it isn't also being used in industry.
22:47gfredericksfair enough
22:48shriphanihas anyone had success with large java codebases and lein ?
22:49hiredmanthe larger the code base the more likely it is that it is taking advantage of some feature of a java build system which lein doesn't expose or have
22:49ArchPySegFaultAX: How is it being used?
22:50JavaIsAwfulis there a reader syntax for shorts?
22:50shriphanihiredman, I can compile with mvn install
22:50shriphanithe java codebase i.e.
22:50shriphaniI am not sure how to make lein use mvn install
22:51SegFaultAXArchPy: In many of the same places that you might expect Java, Scala, Python, or Ruby for example.
22:51hiredmanshriphani: why bother?
22:51shriphanihiredman, because I want to build.....
22:51shriphaniso here's my situation
22:52ArchPySegFaultAX: Do you prefer Clojure over Python?
22:52shriphanione of the components of said java codebase I want to extend with clojure and use it from the java app
22:52JavaIsAwfulArchPy: as someone who started programming on Python, and loves it to bits, I personally like clojure more now
22:53shriphanibecause I have a lot of code written in clojure and porting to java is going to be a big waste of my time.
22:53hiredmanshriphani: since the project already builds using maven, perhaps the clojure maven plugin would be a better bet
22:53SegFaultAXArchPy: By a large margin, yes.
22:53seangroveHey guys, I just implemented a semi-hacky drag-and-drop bit of code! For the browser! I don't think anyone had done it before, because if they had, I can't see why it wouldn't be built into the browser properly
22:53shriphanioh I didn't know such a thing existed
22:53hiredmanshriphani: depending on what the clojure code does, you may just be able to include it as a resource on the maven build
22:54shriphanihiredman, it basically extends a java class.
22:54hiredmanno "build" of it required
22:54hiredmanshriphani: in what way, gen-class?
22:54shriphaniI am using :gen-class to do it and override a method
22:54shriphaniyes
22:54hiredmanshriphani: ah, yeah, you'll want the maven plugin
22:55hiredmanI am not sure what the state of the maven plugin is, before lein existed it was what people used
22:56beamsoi think it's still being used
22:56beamsothe clojure.java.jdbc project using the clojure-maven-plugin
22:56beamso*uses
22:56shriphanihiredman, would that essentially mean continuing to use the java project ?
22:56shriphaniso I wanted to somehow let clojure take control of the situation
22:56shriphaniand say have my main class invoke its main
22:57shriphaniit = java
22:57hiredmanshriphani: then make a clojure lein project that depends on your maven project as a library
22:57shriphanihiredman, so the class I am extending needs to be seen by another component
22:58JavaIsAwfuljust took another look at Gloss frames
22:58JavaIsAwfuland realized just how beautiful they are
22:58JavaIsAwfulexactly what I need
22:58shriphaniand when I tried using a jar I built and a localrepo, then I could call the java project's main but it couldn't see my new class
22:58hiredmanthat isn't going to work with lein anyway, lein doesn't compile java and clojure together somehow, it compiles java using javac, then compiles clojure
22:58shriphaniok so I don't have an alternative I gues
22:58yedity hiredman, that did the trick
22:59hiredmanshriphani: most likely because you didn't aot compile
22:59shriphanihiredman, I've got :aot :all in my project.clj
22:59shriphaniand I did lein uberjar
23:01shriphanibut yeah I just used the compiled jars from that project
23:01shriphanibut if I could somehow make my extended class visible, that would be like problem solved essentially
23:01ArchPySegFaultAX: Can you speak to the advantages of Clojure over python?
23:02yediseangrove: can i hear more about the drag n drop doowicky
23:03shriphaniArchPy, you have all of java.
23:03shriphanithere is no real python alternative to stuff like stanford-corenlp
23:03ArchPyshriphani: That seems like a distinct advantage of Python, no java. :p
23:05shriphanihiredman, although is it possible?
23:06shriphanito somehow make my extended class visible to classes in that jar I already have
23:06seangroveyedi: Just making a generic-ish draggable Om component
23:07yedigot code anywhere?
23:08seangroveyedi: Just started in on it, but here are some draggable circles https://www.refheap.com/62598
23:08SegFaultAXArchPy: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
23:08JavaIsAwfulArchPy: check out clojure-py. basically take clojure, and replace java with python, and you have clojure-py
23:08JavaIsAwfulthough it's not as developed as vanilla clojure
23:09Frozenlockseangrove: Ahhhh so much Om everywhere! :p
23:09seangroveFrozenlock: ?
23:10FrozenlockSorry, Om always scares me :p
23:10seangroveHrm, alright...
23:11Frozenlockseangrove: This might interest you: If you use the html Draggable tag with https://github.com/alandipert/storage-atom, you can have some pretty nice cross tabs/windows drag n drop.
23:12JavaIsAwfuldo gloss's frames order the bytes the same way they're ordered in the frame map you give it?
23:12seangroveYeah, that's a pretty cool library
23:12ArchPySegFaultAX: I will check that out
23:13Frozenlockseangrove: give it a try http://hvac.io. Go in the controllers tab. Duplicate your browser window and drag n drop between them. Much fun! :-D
23:14ArchPyJavaIsAwful: checking that out. thank you.
23:14seangroveFrozenlock: Wow, nice!
23:14JavaIsAwfulArchPy: just be careful, there are a few bits of syntax that are different
23:15JavaIsAwfulArchPy: mainly with things that interact with the underlying language
23:15Frozenlockseangrove: The app uses Reagent (alternative to Om) to render stuff from some atoms. The atoms are kept in sync between windows by using the storage-atom.
23:18vermaFrozenlock, pretty cool!
23:18seangroveFrozenlock: I agree, pretty cool
23:19FrozenlockThanks :)
23:20FrozenlockThe advantage over the vanilla html DnD is that you can access complex EDN --while-- you are dragging.
23:20FrozenlockThis is what enables the color change.
23:29FrozenlockAnyhow... now I want an undo library for react.js
23:29FrozenlockAny volunteer to implement Gundo/undo-tree? :-p
23:36amalloyJavaIsAwful: yes, frames are decoded in the same order as the input map
23:36amalloyand because maps are not guaranteed to have any particular order, gloss provides an ordered-map construct of some kind; i forget where it is
23:36JavaIsAwfulamalloy: ah, I saw something like that
23:36JavaIsAwfulfigured that's why it was there
23:43JavaIsAwfulI see that you can put a fixed value in for one of the frame fields
23:43JavaIsAwfule.g. I could do this (compile-frame {:a 2})
23:43JavaIsAwfulbut not strings it seems
23:43JavaIsAwfulis there a workaround?
23:44JavaIsAwfulwait, maybe I'm misunderstanding what's giving me an error
23:46JavaIsAwfulnow I see, I was just putting keyvals in incorrectly
23:46JavaIsAwfulI thought I had to group them like [key val] [key val]