#clojure logs

2014-06-29

00:03gastove(defn hack [arg] (Shennendoah$DeviceEvent$DeviceRegistrationEvent/parseFrom arg)
00:03gastove...damnit.
00:06ambrosebsgastove: nice one
02:20ShayanjmI'm trying to build a function that returns all values of a given key inside a nested map
02:20Shayanjmhttps://gist.github.com/shayanjm/9702996c62ef46e8fc1e
02:20ShayanjmI'm having an issue though, because given this data: https://gist.github.com/shayanjm/a1986f9787870a070507
02:21ShayanjmI get this result: https://gist.github.com/shayanjm/8a3114b18055dded0941
02:21Shayanjmwhen searching for the key :content
02:21Shayanjmany assistance would be much appreciated
02:34TEttingerShayanjm, those parens don't line up in the last gist
02:34TEttingeris it returning a nested seq?
02:35Shayanjmah yes sorry, the last 2 parens got cut off for some reason
02:35ShayanjmThe use case is this: I'm getting a map from enlive which represents a DOM structure. I'm trying to extract the text content from the page while essentially 'ignoring' the fact that some of the text might be links and such
02:35TEttingerI'd guess that has to do with the recursive call to (all-values-of-key)
02:36ShayanjmYeah I mean the nested seq thing isn't too bad currently
02:36Shayanjmthe part I was referring to is the fact that it returned a string, a map, and then a string
02:36Shayanjmwhen I need it to return 3 strings
02:36TEttingeryeah that's a bit odd
02:36ShayanjmThe map it returned also has the key :content
02:37Shayanjmso ideally instead of that map being there, it would just have the value for that :content (in this case: "Washington Wizards"
02:37Shayanjm)*
02:38TEttingerwell one of the :content fields has a value of a seq
02:38TEttingerso I am guessing it mostly finds that
02:39TEttinger:content ("Andre Miller’s agent, Andy Miller, said he had been officially notified by the " {:tag :a, :attrs {:class "meta-org", :title "Recent news and scores about the Washington Wizards.", :href "http://topics.nytimes.com/top/news/sports/probasketball/nationalbasketballassociation/washingtonwizards/index.html?inline=nyt-org"}, :content ("Washington Wizards")} " that the team would guarantee Andre Miller’s contract
02:40ShayanjmTEttinger: any ideas on how I can adjust my function to account for that?
02:40ShayanjmI've been poking at this for a little over an hour :\
02:41TEttingerwell you have :content keys with non-string values, how do you want to handle those?
02:59ShayanjmI'd essentially like to grab the value and turn it into a string
02:59Shayanjm(or extract the string from the sequence)
03:24TEttingerShayanjm, right, I'm looking at clojure.zip now
03:25Shayanjmk, just pulled up docs
04:03TEttingerShayanjm:
04:05TEttinger,(def data {:tag :p, :attrs {:class "story-body-text story-content"}, :content ("Andre Miller’s agent, Andy Miller, said he had been officially notified by the " {:tag :a, :attrs {:class "meta-org", :title "Wizardry.", :href "http://"}, :content ("Washington Wizards")} " that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15.")})
04:05clojurebot#<CompilerException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn, compiling:(NO_SOURCE_FILE:0:0)>
04:05TEttinger,(def data {:tag :p, :attrs {:class "story-body-text story-content"}, :content (list "Andre Miller’s agent, Andy Miller, said he had been officially notified by the " {:tag :a, :attrs {:class "meta-org", :title "Wizardry.", :href "http://&quot;}, :content (list "Washington Wizards")} " that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15.")})
04:05clojurebot#'sandbox/data
04:05TEttinger,(reduce (fn get-strings-out [base nx] (cond (string? nx) (str base nx) (map? nx) (get-strings-out base (get nx :content "")) (sequential? nx) (reduce get-strings-out base nx) :else base)) "" data)
04:05clojurebot"Andre Miller’s agent, Andy Miller, said he had been officially notified by the Washington Wizards that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15."
04:06TEttingerShayanjm, took me a fair amount of time to figure it out, I'm glad it works
04:21crocketWhere does clojure excel?
04:22crocketIs it suitable for web backends such as search engine?
04:47daGreviscan I have a little help with deps?
04:47daGrevisI want to use http://richhickey.github.io/clojure-contrib/math-api.html#clojure.contrib.math/sqrt
04:47daGrevisit's not built-in, right? i need to put it in project.clj
04:48technomancyclojurebot: what happened to contrib?
04:48clojurebotWell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
04:48technomancydaGrevis: that lib is deprecated, but you may be able to find similar functionality elsewhere
04:49daGreviswhere did it go? :O
04:49daGrevislink you gave me is 404 :D
04:49technomancyoh really, ugh.
04:49daGrevisbasically https://github.com/clojure/math.numeric-tower
04:50daGrevisi should be careful thought, because i'm targeting clojurescript and java interopt wont work
04:53daGrevisor... i could use javascript interopt.
04:53daGrevisugh
06:33daGreviswhats the best way to deal with functions that have multiple versions based on param count?
06:38daGrevisi guess something like this is fine https://github.com/daGrevis/clojure-koans/blob/master/src/koans/09_runtime_polymorphism.clj#L1
07:05pradeepcHi, i have a vector of maps .. I want to create a new map out of each map and return a new vector of new maps. can someone tell me how to do this.
07:36Glenjaminpradeepc: ##(doc mapv)
07:36lazybot⇒ "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remai... https://www.refheap.com/87650
07:40visofhello
07:40visofis there a binary search over a list strings in clojure "builtin" ?
07:56pradeepcGlenjamin: thank you :)
08:34visofi tried this code to convert a file separated by : into a hash but return a nil that's my code (into {} (with-open [rdr (clojure.java.io/reader path)] (doseq [line (line-seq rdr)] (clojure.string/split line #":")))))
08:34visofcan anybody help in this?
09:28zoldarHi. I'm creating a basic cljs om app project that - when fully functional - I want to convert into a lein template. I have a problem with compiling for release (a single file version) - the advanced mode fails and I don't know how to track the cause down. Is there any way to debug the advanced compilation process in some way? Or at least disable name mangling leaving all other optimizations?
09:29zoldarWhat I have so far is here: https://github.com/zoldar/om-with-tests
09:55szymanowskiHello, is there a simple way to make custom type that acts exactly like a vector without rewrite implementation?
09:58zoldarOk that was some problem with temporary files, when I've started with a clean output-dir for the target, it worked
10:31zoldarszymanowski: what do you mean by "acts exactly as vector"? You could extend IPersistentVector protocol (and all other relevant protocols) simply proxying to existing implementations where needed.
10:34szymanowskiI would like this to extend this new type to some locals protocols but I don't want to extend IPersistentVector to those protocols
10:34szymanowskiI would like to extend this new type to some locals protocols but I don't want to extend IPersistentVector to those protocols
10:34szymanowskisorry
10:35zoldarok, but without extending IPersistentVector you won't be able to use the same vector API related fns
10:35zoldarafaik at least
10:36szymanowskiok i will look at the IPersistentVector interface
10:37szymanowskithank you
10:37zoldarszymanowski: I'm not familiar with your exact requirements but maybe the other way around would be more suitable? like extending LazilyPersistentVector with your local protocols?
10:38szymanowskiI will look at this :)
10:38zoldarwrong wording: extending your local protocols for the LazilyPersistentVector type
10:40Bronsayou really mean PersistentVector, not LazilyPersistentVector
10:40zoldarBronsa: guess you're right
10:40BronsaLPV just contains some static methods to construct a PV
10:40Bronsait's probably just a leftover
10:49jinks_Hi. I'm trying to find a simple schema-less embed-able database to use as storage engine for a collection of nested objects. I can't seem to find anything that fits. Is there such a thing with a basic clojure API? (There's a more fleshed out version of what I already tried at http://redd.it/29dzb8)
10:53zoldarjinks_: what about jiraph?
10:55shiranaihitois there a way to "consistently" add an element to a collection's end (without relying on conj used on a vector, for example)?
10:56jinks_zoldar: To be honest, I couldn't make heads or tails of jiraph. It has pluggable storage backends? Can it run without native dependencies? I want to distribute the final result as a single jar without requiring external libs or databases
11:09zoldarjinks_: after a short research (was curious myself) it seems that jiraph relies on an interface to key-value stores that - from what I see - has support for redis, tokyo and memcached
11:11jinks_zoldar: all of those require native compiled dependencies which is a route I'd like to avoid... also the advertised website (jiraph.org) seems to not exist which tends to fill me with mistrust in it's long-term viability
11:12zoldarjinks_: right, these were just my 2 c
11:12pradeepcHi.. i have an arrays of hashmaps .. how can i check that all hashmaps has one of the key not null ?
11:14jinks_to be honest, the whole flatland namespace looks like a dumping ground for i-didn't-really-know-what-to-with-it projects and circlejerking (huge lists of interdependencies between the different flatland projects)
11:14jinks_maybe I'm just picky :D
11:16zoldarshiranaihito: you could use concat with one-element list as a second argument, or convert the collection to vector with vec and use conj
11:17shiranaihitozoldar: thanks, that seems to be the standard "workaround".. it's kind of weird that there's a problem like this though
11:17shiranaihitoofc, some people don't consider it a problem
11:18zoldarjinks_: I'm not a native English speaker but 'circlejerking' sounds a bit offensive. It's just a way to keep the small libs organized and modular/resusable, don't see anything wrong with it
11:18zoldarshiranaihito: depends on what are your requirements
11:20jinks_zoldar: You're probably right, it's a bit of a harsh judgment. I don't know the whole flatland ecosystem just rubs me the wrong way without me being able to pinpoint why.
11:20shiranaihitozoldar: yep.. well, my requirement was just to append an element to a collection's end, but have it happen "consistently", without having to worry about what the collection's type is
11:24ShayanjmI'm trying to build a function that returns all values of a given key inside a nested map
11:24zoldarshiranaihito: adding to the end of the list is considerably less efficient. Anyway, it ain't that hard to create a helper fn for such case - it's only a list that you have to branch out for from the basic collection types available in clojure
11:24Shayanjmhttps://gist.github.com/shayanjm/9702996c62ef46e8fc1e
11:25ShayanjmI'm having an issue though, because given this data: https://gist.github.com/shayanjm/a1986f9787870a070507
11:25ShayanjmI get this result: https://gist.github.com/shayanjm/8a3114b18055dded0941
11:25Shayanjmwhen trying to return for the :content key (there shouldn't be a map inside the result)
11:25Shayanjmany ideas?
11:26shiranaihitozoldar: branching out? .. i don't follow.. but anyway, i think i'm getting the result i want by applying a separate variadic function etc
11:27wheeeeOm tutorials out there?
11:27wheeeeI'm writing one and want to see what folks are addressing
11:27zoldarshiranaihito: I mean putting a conditional branching out for list type
11:28zoldarwheeee: testing :P
11:28shiranaihitozoldar: .. to what end?
11:29shiranaihito(the "conditional branching", that is)
11:30zoldarshiranaihito: now I don't follow :) I just mean (defn append [coll elem] (if (list? coll) (append-with-concat...) (do-a-simple-conj-or-sth...)))
11:30shiranaihitozoldar: alright :P
11:31zoldarwheeee: I mean that's what is usually missing
11:34wheeeezoldar: testing is missing?
11:34wheeeeI'm trying to write for JS devs new to CLJS
11:37halogenandtoastCan anyone explain what the Cons class is and how that differs from a PersistentVector?
11:38bbloom~seqsandcolls
11:38clojurebotHuh?
11:38bbloom~colls
11:38clojurebotcolls is http://www.brainonfire.net/files/seqs-and-colls/main.html
11:39zoldarhalogenandtoast: this so answer may be partly relevant: http://stackoverflow.com/a/3009747
11:39bbloomhalogenandtoast: the Cons class specifically is more or less legacy, but it's related to LazySeq and PersistentList.... which differ in quite a few ways from PersistentVector
11:40zoldarwheeee: it's a chore to set it up properly
11:41Shayanjmcan anyone help with my function to return all values of a key given a nested map?
11:42zoldarwheeee: I've just made a simple skeleton for an om app that takes into account the testing aspect: https://github.com/zoldar/om-with-tests . I want to convert it into a template when it proves to work as expected
11:44zoldaryet still it's bound to a particular os due to test runner requirements
11:48wheeeezoldar: I know some friends who are using phantom to test. I'll take a look at it and see what's doin'
11:48wheeeeI think I want to target my writing at folks who ask questions like "Wtf does #() mean?"
11:48zoldarwheeee: that's that I'm using as well
11:49wheeeeAt least initially
11:49zoldarwheeee: Nolen's tutorial is pretty good in that regard I think
11:51zoldarShayanjm: the value under :content seems to contain a nested structure so that's what is grabbed in the process. Don't see anything wrong with it
11:51Shayanjmzoldar: there is a :content inside of the nested structure
11:51Shayanjmwhich I would like to return instead of the structure itself
11:52zoldarShayanjm: you have to account for a situation where value under :content is a nested structure - collect this first value (string) from that structure and process the rest recursively
11:52Shayanjmzoldar: if you look at the function that I gist'd, I thought I was doing that
11:53zoldarShayanjm: no, you simply cons the value on acc when the key is matched and the cond processing ends there
11:54wheeeezoldar: I think it seems good from the eyes of someone who has done Clojure but a lot of JS devs don't "get" it as easily
11:55zoldarwheeee: guess you are right
11:55zoldarwheeee: but this will be a pretty loaded task for a single tutorial
11:56zoldarwheeee: anyway, good luck!
12:22{_blake_}I've got a project that refers to other of my projects (in the same master directory) and lein is telling me it can't find the SNAPSHOTs for these projects. I haven't had this problem before. (This is my first time with this project under Windows. Been using Linux up till now.) What needs to be pointed where?
12:33ShayanjmI have 2 swap! statements - one assoc-in's [:key] with a nested collection, and the other maps an averaging function to each collection
12:33Shayanjmand assoc-in's that result to [:anotherkey] on the same atom
12:33Shayanjmis it 'good clojure' to perform both of these within a single dosync?
12:35bbloomShayanjm: dosync has nothing to do with swap!
12:36Shayanjmehh, okay - is it 'good clojure' to perform both swap!'s within a single function?
12:36zoldarShayanjm: can you show the actual code?
12:37bbloomShayanjm: prefer pure functions, compose them together, use swap! at the top-level / edges-of-system only
12:38Shayanjmsure zoldar one minute
12:38bbloomit's not that uncommon to see relatively large programs with zero or one atom... and zero or one swap call!
12:39zoldarShayanjm: basically what bbloom says but the actual code would give better context to give more concrete advice (if necessary)
12:41Shayanjmhttps://gist.github.com/shayanjm/469a8f0484753f777672
12:42zoldarShayanjm: just do that in a single swap!
12:42zoldarShayanjm: and dosync is completely unnecessary here, as it was already pointed out
12:44squeedeebecause swap is already synchronos?
12:44squeedee'atomic'
12:45daniel__im trying to write a tempfile from upload to the local disk, can't get past this error: https://gist.github.com/danielstockton/cb5e5c60cb98ff493ff5
12:46zoldarsqueedee: atoms allow only atomic change of a single reference
12:46squeedeecool thanks zoldar
12:47squeedeeI kind of knew that, but every bit of reinforcement helps
12:54shiranaihitoi'm using Jetty as an embedded server, and it contains a "Request" -class.. and now i'm getting the error: "ClassFormatError: Duplicate interface name in class file" probably because i'm defining a record called "Request" too.. but my record is in a file that does not import Jetty's "Request" .. what's wrong?
12:55shiranaihito(in fact, the compile error happens specifically where i define the Request record)
12:55shiranaihitocan i just not have a record with that name, or am i missing something?
12:56ShayanjmIf I want to round various values to their nearest integers - is it better to use the clojure.contrib.math library or just build my own rounding function since that's the only thing I need?
13:02ziltiIs cider 0.6.0 failing for anyone else too? It can't connect to an nREPL session, it just is stuck at connecting to it.
13:03daniel__zilti: i saw on /r/clojure people were having issues
13:03daniel__whats the most popular sql library for clojure nowadays? korma?
13:04ziltidaniel__: I'd say korma, yes. I had good experiences with it too. Seems like it's the only actively developed one. Except the tools.sql one of course
13:10shiranaihito(nevermind, i think i found the problem)
13:31whodidthisyesql
13:31fifosineI have the following in my profiles.db http://pastebin.com/PxqQjCwN but when I try to open my repl I get the following compilation error http://pastebin.com/WtrNrwe4. Have I set something up wrong?
13:32fifosine*profiles.clj
13:34whodidthismissing outer curly brackets maybe
13:52ziltiwhodidthis: Wow, that's a very neat lib!
13:53fifosineIs anyone familiar with working with environ?
13:54fifosineI've added an :env map to my profiles in project.clj, but it doesn't seem to be loading the values
14:12wheeeezoldar: once I put it out would really dig comments from folks
14:18halogenandtoastForgot to thank zoldar and bbloom earlier, thanks for the Cons info.
15:13fifosineHow do I create a composite key with clojure.java.jdbc.create-table?
15:31ybit2why wouldn't you use models with Om?
15:31ybit2the value-oriented programming talk didn't quite explain this one for me,
15:31ybit2maybe i need to rewatch and not skim
15:32squeedeetake a look at nolens blog too
15:32borkdudecan I ask an Om question in here? #clojurescript seems to be very quiet now
15:36FrozenlockYou can, but both #clojure and #clojurescript tend to be quite slower on weekends
16:05FrozenlockThat's weird... I get this error when uberjaring:
16:05FrozenlockException in thread "nREPL-worker-0" java.lang.Error: java.net.SocketException: Socket closed
16:10fifosinehow do I test if my database connection is working?
16:11gfredericksSELECT 1
16:19Raynesgfredericks: drop table production.stuff;
16:19RaynesActually, drop schema production cascade;
16:19bbloomRaynes: i was going to suggest drop database
16:20RaynesI think you win.
16:52TEttingerShayanjm: you around?
16:53TEttinger,(def data {:tag :p, :attrs {:class "story-body-text story-content"}, :content ("Andre Miller’s agent, Andy Miller, said he had been officially notified by the " {:tag :a, :attrs {:class "meta-org", :title "Wizardry.", :href "http://&quot;}, :content ("Washington Wizards")} " that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15.")})
16:53clojurebot#<CompilerException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn, compiling:(NO_SOURCE_FILE:0:0)>
16:54TEttingerright
16:54TEttinger,(def data {:tag :p, :attrs {:class "story-body-text story-content"}, :content (list "Andre Miller’s agent, Andy Miller, said he had been officially notified by the " {:tag :a, :attrs {:class "meta-org", :title "Wizardry.", :href "http://&quot;}, :content (list "Washington Wizards")} " that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15.")})
16:54clojurebot#'sandbox/data
16:54TEttinger,(reduce (fn get-strings-out [base nx] (cond (string? nx) (str base nx) (map? nx) (get-strings-out base (get nx :content "")) (sequential? nx) (reduce get-strings-out base nx) :else base)) "" data)
16:54clojurebot"Andre Miller’s agent, Andy Miller, said he had been officially notified by the Washington Wizards that the team would guarantee Andre Miller’s contract for $4.6 million in 2014-15."
17:12ivansearching for ":keyword" does not quite work in the presence of :keys destructuring, heh
17:19bbloomivan: i get burned by that occasionally when using * and # in vim
17:28andonilssonI'm looking for a "function?"-predicate.
17:28andonilssonI have a map, where some of the values are functions, and I'd like to filter them...
17:29bbloom(doc fn?)
17:29clojurebot"([x]); Returns true if x implements Fn, i.e. is an object created via fn."
17:29bbloom(doc ifn?)
17:29clojurebot"([x]); Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn"
17:29andonilssonDoh!
17:29andonilssonI was only looking for function, never fn...
17:29andonilssonthx bbloom
17:29bbloomandonilsson: http://clojure.org/cheatsheet
17:30zoldarwhen creating a lein template, how do I set file's executable flag?
17:38zoldarok, found it. :executable true has to be added at the end of path definition vector in ->files form
18:24zoldarI have created a basic template for a Om application with continuous testing setup if anyone's interested: https://github.com/zoldar/om-with-tests-template . It can be used with 'lein new om-with-tests app-name' command. Any feedback welcome.
19:25rurumateI have a nice function that returns a core.async channel. How to make a nice java API of it? Is there a java interface "Channel" or what to return? Thanks
19:26rurumateManyToManyChannel seems not a regular java interface, and there is not much else in the src/java folder of core.async
19:27rurumateor is there an "aot plugin" for maven yet, so I can aot the ManyToManyChannel?
19:31whodidthishow do i open a file by namespace in vim
19:34whodidthislike what fireplace does when gf on a namespaced function
19:42taliosrurumate - you mean like clojure-maven-plugin?
19:43taliosa protocol should generate an interface - failing that, just write your api in Java and use the clojure.api.* to refer to your clojure
19:44taliosnot sure how exporting a channel to java would look like tho.
19:44taliosif using Java8 streams could be an idea, maybe.
19:56zilti__I'm trying to add type annotations to an untyped library. Now I get "Polymorphic function clojure.core.async/<! could not be applied to arguments: Polymorphic variables: p, t Domains: (Chan2 p t) Arguments: (Chan2 (Boxed java.lang.String) (Boxed java.lang.String))"
19:57zilti__I'm trying to figure out now what I did wrong when annotating Boxed.
19:57rurumatetalios: ManyToManyChannel implements Queue, so maybe return that?
19:58rurumateor no, actually that would suck because it's not straightforward to wait on a queue in java
19:58rurumatea Future would be natural and suffienct in many cases (if only one value is ever put on the ch)
19:58taliosit would be nicer in Java8 due to lambdas
19:59zilti__You can't use the lambdas together with Clojure anyway
19:59taliosno - but if the clojure exposed a Queue, that doesn't matter
19:59rurumateso the moral is there's nothing to help integrate core.async into the java world yet?
20:00taliosthe moral is clojure interop is a lie :) for advanced things anyway
20:00rurumatewell at least there should be some way to represent a channel in java, that would be a start
20:01taliosyou could do it via say a bridge to Akka actors
20:01rurumatenever heard of that
20:01ziltivert.x has a Clojure- and a Java-API
20:02ziltiBut what I'd do is use the observer pattern and let the Java classes register in a Clojure namespace so they get what they want and can send back
20:03JaoodSTM is a lie too
20:04rurumateif channels become more prevalent in clojure libs, good for them but will be bad for interoperability?
20:06rurumatereturning a channel is good style in clojure, but no easy way to deal with it if you're calling from java
20:06rurumateif you don't know who's calling you
20:06ziltirurumate: You can read a channel asynchronously providing a callback
20:07rurumatehmm
20:07ziltirurumate: And you can read and write it blockingly, too
20:07ziltiNo big deal, essentially
20:07rurumatebut then would need to write extra code for the case of a java caller
20:07rurumatecan't we just make a nice java library and say here's a channel and here are your tools to use it?
20:08ziltirurumate: Of course we can. But it seems no one really wants to do it at the moment.
20:08rurumateit's ok if it's more work than in clojure, the java people are used to it
20:09rurumatezilti: yes but if IChannel is not a thing, it's hard. core.async should define that core abstraction
20:10ziltirurumate: Basically you shouldn't use any of the internal Clojure interfaces since they're implementation detail.
20:13rurumateis there an example how to use channel with callback?
20:16ziltirurumate: A Callable should be enough to pass to "take!", but I haven't tried it.
20:16ziltiJust took a quick glance at the code
20:17rurumateok but calling RT.val("clojure.core.async","take!").invoke(ch, callback) from java is not fun
20:17rurumate*RT.var
20:18rurumateit would be possible like that of course, but the java people will not like it
20:18ziltirurumate: Then make a wrapper class!
20:18brehautFFI not as nice as native use, film at 11
20:18rurumateno use, the will read that and complain about improper implementation
20:19rurumatethey&
20:19rurumateFFI? film?
20:20ziltirurumate: Well but what do you want, type safety inside the channels? You don't even have that in Clojure itself
20:21rurumateno not the channels, it's ok for them to return an object I guess. but at least they should provide blockingGet() functionality, clojure.util.Queue doesn't have that
20:21taliosrurumate - so wrap that in your service API - you're java users don't need to use RT or clojure.api.API directly
20:21rurumate*java.util.Queue
20:22ziltirurumate: <!! is blocking get
20:22rurumateI know, but that's not java either
20:22ziltiYeah, well, it's a Clojure library after all, and in the end it's all Bytecode
20:23rurumatein the java world, this function name is not allowed due to code style guidelines, pmds checkstyles
20:23rurumateand findbugs
20:24ziltirurumate: Then wrap it, either in a clojure ns or in a Java wrapper. You don't even call it as a function in Java, you just pass the String to RT.var
20:25rurumatemkay got that
20:26rurumateit's a java world out there, you know
21:00log0ymxmAnyone know how to use the "in" operator with clojurescript?
21:00log0ymxmSomething like the following (js* "\"onwheel\" in document.createElement(\"div\")")
21:06bbloomlog0ymxm: just use `undefined?
21:07bbloom(undefined? (.. js/document (createElement "div") -onwheel))
21:07bbloomthere's also `exists?
21:08bbloomyou can also use `aget
21:08bbloomand .hasOwnProperty, depending on your needs
21:49noncom|2can i get a vector or list of required namespaces for a namespace?
21:50noncom|2all in all, can i reflect on required namespaces and put them in a list?
21:50bbloom(find-doc "ns-")
21:51bbloomtry something like (ns-refers *ns*)
21:52noncom|2(ns-refers) gets all available top-level declarations.. but (ns-aliases) does the job!
21:52noncom|2thanks!
21:54michaelrosequestion I know little about clojure atm but when I start lein repl looking at system resources I have 3 java processes eating a total of 1.2gb of memory
21:54noncom|2,(ns-aliases *ns*)
21:54clojurebot{}
21:54noncom|2michaelrose: thats strange
21:55noncom|2bbloom: hey, could you please try (ns-aliases *ns*) - it will return a map. then tell me, how can i extract namespaces from it by keys ? whatever i try for the key, (get (ns-aliases *ns*) key) retuns nil
21:56bbloom,(alias 'clj 'clojure.core)
21:56clojurebotnil
21:56bbloom,(ns-aliases *ns*)
21:56noncom|2i even tried (symbol "my-alias-key") but still..
21:56clojurebot{clj #<Namespace clojure.core>}
21:56brehautmichaelrose: one of those is lein; another is your project. they run in seperate JVMs to allow you to use a different clj version than lein. no idea about the third
21:57bbloom,(get (ns-aliases *ns*) 'clj)
21:57clojurebot#<Namespace clojure.core>
21:57bbloomseems to work
21:57noncom|2umm... straaaange..
21:57bbloom,(get (ns-aliases *ns*) (symbol "clj"))
21:57clojurebot#<Namespace clojure.core>
21:57noncom|2hmmm
21:57bbloom,((ns-aliases *ns*) 'clj)
21:57clojurebot#<Namespace clojure.core>
21:57bbloom,('clj (ns-aliases *ns*))
21:57clojurebot#<Namespace clojure.core>
21:57bbloom:-)
21:58noncom|2:)
21:58noncom|2oh, i must confess, i made a stupid mistake
21:58noncom|2brehaut: but should it take that much memory? i guess no..
21:59brehauti dont like to guess but i have no way to measure so i cant answer that
22:02Frozenlockmichaelrose: are you running Cider? I remember having a bunch of weird RAM issues with it.
22:03michaelroseI had added as it was recommended by I think tpopes vim fireplace but deleting it had no effect
22:04michaelroseto be clear I'm assuming deleting it from .lein/profiles.clj is immediately sufficient
22:05FrozenlockI honestly don't know, it's just something I noticed before going back to nrepl.el
22:06michaelrosefreaking wierd worse it leaves beyond a zombie java , and each of the 3 actually use around 400mb
22:11michaelroseanyone using clojure 1.6?
22:11michaelrosewith lein repl
22:16FrozenlockBut I'm far below 400 mo per java instances. And I don't have zombies either... :-/
22:16FrozenlockOh wait... does lein repl uses nrepl?
22:17FrozenlockHmm looking at the source I'd say yes.
22:17brehautyeah it does; trptcolin's reply project
22:24michaelroseaaand found the problem
22:25Frozenlockmichaelrose: What was it?
23:17munderwoHey all. I've just read clojure Programming. And im tossing up about reading either "Programming Clojure" or "The Joy of Clojure" … any suggestions or insight into pros, cons?
23:17brehautJoC is a deep dive. its really good, but be ready to drink from the firehose
23:19brehautif you want to get deep into the mindset of clojure, JoC(2) is the one to get
23:22munderwoCool. Thats what I thought. Thanks for the Advice!
23:23brehautthe book you have read is the oreilly one right?
23:55fitzOm/cljs question on this https://www.refheap.com/87660
23:56fitzAnyone know why the build-all in canvas is failing? build works, build-all doesn't, I've tried hard coding values with the same result
23:56fitzI just get a data-react-id span