This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-22
Channels
- # beginners (24)
- # boot (80)
- # braid-chat (11)
- # cider (89)
- # clara (11)
- # cljsfiddle (5)
- # cljsjs (9)
- # cljsrn (63)
- # clojure (114)
- # clojure-austin (1)
- # clojure-berlin (5)
- # clojure-brasil (4)
- # clojure-dusseldorf (5)
- # clojure-hamburg (17)
- # clojure-india (1)
- # clojure-new-zealand (3)
- # clojure-poland (1)
- # clojure-russia (91)
- # clojure-taiwan (1)
- # clojure-uk (54)
- # clojurebridge (3)
- # clojurescript (170)
- # core-matrix (1)
- # cursive (14)
- # datomic (8)
- # emacs (13)
- # hoplon (96)
- # immutant (20)
- # jobs (9)
- # jobs-rus (13)
- # kosmos (3)
- # off-topic (8)
- # om (111)
- # onyx (41)
- # parinfer (116)
- # pedestal (2)
- # proton (4)
- # re-frame (46)
- # reagent (7)
- # ring-swagger (24)
- # slack-help (2)
- # testing (1)
- # untangled (8)
@seb321 glad you found core.matrix helpful! Please do send issues / PRs my way if you find any use cases in which it could be improved, trying to make it as generally useful for everyone as possible
@bfabry: I don't think you should expect that to necessarily work forever
@alexmiller fair enough, I don't think I would metaprogramming stuff seems to be inherently like that
Is there a collection library of schemas for plumatic schema? Looking for common things like URL, email etc.
@rm: A bit worrying that they have not merged pull requests and not updated since Aug 2014 though. The whole point of this kind of lib is to have everyone contribute...
is there a form similar to cond->
but that uses the 'running value' as input to each predicate?
(magicond-> 1
true (* 2)
even? inc
#(= 3 %) (fn[_] "seven")
string? clojure.string/upper-case)
something like this?@acron: A little less magic: https://blog.juxt.pro/posts/condas.html
Hi there
I'm struggling with a simple import
of a Java class. I suspect the problem is that this Class
has a .
in it's name.
(import
will yield a ClassNotFoundException.
However, it looks to me to be the correct classname regarding the JavaDoc: http://docs.oracle.com/javase/8/docs/api/javax/sound/sampled/Port.Info.html
Java Interop beginners help is much appreciated(;
@zcaudate: This works! Thank you very much! May I know where you learned about that? I actually did some digging before I asked here and didn't get a clue.
@zcaudate: That's a very good answer that I can relate to. I have written a couple Clojure and CLJS apps so far, but I still am just a beginner regarding Clojure. In time I do hope to be able to help other people here as quickly as you just did. Again, thank you very much^^
@munen this is hidden in the java interop documentation. http://clojure.org/reference/java_interop. "Note that nested classes are named EnclosingClass$NestedClass, per the JVM spec."
@jmayaalv: Now I'm a bit embarrassed. I did have that page open, of course. This is one of those times to just RTFM better... I skimmed it multiple times, but I didn't read everything in that chapter, because I didn't deem it relevant. How wrong I was. I'll re-read the whole page right now just in case. You have my gratitude!
@munen this post explains this and many other "special" characters very well: https://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/ . And I just noticed it has a search feature at the top!
@nberger: I remember seeing this one on HackerNews a good while ago. Back then I didn't have the chance to do much in Clojure, though. I'll get into that one today and learn me some internals. Thanks for the reference!
I use emacs + cider and like the pair. Unfortunately, it is not easy to start with.
@zcaudate: Even though I disqualified myself a bit here, I'm a bit of an editor Nerd. I've been using and pushing VIM for 14 years, but for Clojure I switched to Emacs+Cider and wouldn't look back. Also Emacs is a wonderful operating system, not just an awesome editor^^
@munen: yeah, true. I have been using emacs since '03. Each year I try to find better alternative, but failed.
@zcaudate: When I started, I did move everything I did in Mail, Evernote and Things (GTD Tool) into Emacs within the week. Now I don't have to leave it for the occasional look at the browser*g*
@featalion: I'm not sure it's possible. The underlying concept of being similar to a LISP machine is hard to improve upon. Took me a long time to figure out that VIM might be the best Editor, but it could just be one of the programs that I run inside Emacs^^
I was stupid and never looked into Emacs, because I wasn't doing Lisp and the shortcuts of Emacs looked just too clumsy compared to VIM's modal editing. It's interesting, though, how many friends I could interest with a couple of demos or talks during coffee(;
@munen: it is only true in common, but not to execute specific tasks. I haven't found better solution for programming, but I still prefer google's interface for email and trello web interface, for example.
@featalion: I have to admit, that I'm in Love with Mu4e (the mail client). I have 5 mail addresses for different companies and none of them is from Google. So far I was lucky not to have to use it. I know it of course, I did use it some years ago for work and didn't like it for the reason that it didn't fit well into my GTD workflow of being able to cross-reference Mails, Notes and Todos. Now, that's even more awesome with Org-Mode and Mu4e^^ I'm not using Trello, but Pivotal - and for that I confess to also use the web client, because it is really well done.
Being a web-dev, there's certainly a couple pages that I still visit from time to time^^
@munen: all my last customers use google apps for business. and it is very easy to forward email to master address and filter them there. it is also possible to send messages from "remote" email addresses. But in your case emacs rocks for sure ( ;
@featalion: Yeah, I'm not going to argue against Google Apps^^ I also did what you just explained some years ago and have friends who still do it. I do like the option to not share everything with Google, though. Plus, I really like the workflow of Mu4e - and did tweak it with some Elisp goodness to make i even better^^
for example, I'd like x
to be type-hinted with Foo
when compiled to clojure in (fn [x] 42)
hi, how does partition work? I tried (partition 30 (range 5)) and it returned me empty list.
According to ClojureDocs, defn has this as a function signature: (defn name doc-string? attr-map? [params*] prepost-map? body), where supposedly, the attributes in attr-map are added to the var metadata. I've defined a function: (defn foo {:a :b} [] nil), which matches the signature, but when I check the metadata using (meta 'foo), all that is returned is the standard function compilation metadata. Any idea why this is not acting as the documentation specifies?
Let's say I have the following: (def k '[(:aaa 1 :bbb 2 :ccc 3)]) What would be a nice and clean way to update the value after :aaa, or :bbb, :ccc? (I know it could be easy if the list '() was a map, but sadly it's not)
thiagofm: if the order doesn’t matter, it would be pretty simple to transform it into {:aaa 1 :bbb 2 :ccc 3}, update it, and then concat it back together
@matthavener: (into {} k) wouldn't work for this. I'm thinking about just mapping over and do what I want
(into {} (map vec (partition 2 k))
@thiagofm: If you are often updating the value after one of those, then the map will be your best bet (using update-in or assoc). If you need to keep it as a list and you can write your own update-after
fn and it will still feel pretty clean when you use it.
I think you want to partition (first k)
for @matthavener's suggestion
Hi, could any give me any ideas why when I call my (-main "--input" "something" "--output" "something")
works fine from the repl but when I launch (after using lein uberjar
) with the args passed in as java -jar --input" "something" --output "something"
it dosen't do anything...
(defn -main
[& args]
(let [args-map (parse-opts args cli-options)
input-path (get-in args-map [:options :input-path])
file-list (list-directory-from-HDFS input-path)]
(pmap upload->file-storage file-list)))
crankyadmin: check out doall
Thanks both. I was looking for any easy to do it in parallel. pmap
seemed like a sensible idea. Whats a better approach
hiredman: doesn’t pmap use executors behind the scenes?
Cool. In the above snippet; where would the doall
be place? Do I wrap the pmap
or dump it all together?
yeah, wrap the pmap which forces realization of the seq, which forces the execution of upload->file-storage
Sweet! Thank you.
Yep. That fixed it! Thanks again guys
I'm studying about declarative databases, and abstracting away from REST backends, and it's led me to decision overload with Falcor, GraphQL, Relay, and DataScript all thrown in the mix. What should I use if I want have a more declarative database, where I can request with JSON syntax from the client side, and avoid many REST endpoints? And are these solutions a layer over, ex Mongo, or Postgres, or something else entirely?
hi everyone
josh.freckleton: you should probably look at om.next and join #C06DT2YSY
@matthavener: I'v been reading up on it and from what I can tell, om.next is still not production ready, no? Something like reagent feels a bit more stable, is there anything that would work if I went the reagent route, or is it really just om.next?
sorry, I don’t know enough about reagent to know if it would work. my limited understand of reagent suggests you’d have to write a lot of the equivalent falcor/relay functionality yourself
@josh.freckleton: see re-frame
@smw: thanks, I love re-frame! How do you build a non-REST backend for doing declarative database requests in re-frame??
is there an idiomatic way to accomplish this, taking a vector and converting it to a map?:
(defn make-entry [id name contact description]
{:id id
:name name
:contact contact
:description description})
I'd like to make many of these maps dynamically, and i'd love if I could add/remove things from the parameters without duplicating the effort by creating an entry that pointst to that...
good point, just curious if there was a better way
@josh.freckleton: There is zipmap
ah nice, so would you think like this:?
(defn make-entry [& rest]
(zipmap [:id :name :contact :description] rest))
(make-entry "a" "josh" "123-4567" "hi there")
that looks a lot better
I’m trying to simplify some with-redefs(-fn) code — how do I go from a fully qualified symbol to a var?
is there an easy way to get a limited collection? maybe just (take 5 (into [] items)) ?
Is there an issue with clojars? I just pushed a SNAPSHOT version, it uploaded it just fine, but when I try to use it from a project, I get an error that says: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.danielsz:system:jar:0.3.0-20160322.233127-13 in clojars (https://clojars.org/repo/)
@danielsz: Is [org.danielsz/system "0.3.0-SNAPSHOT"]
your artifact?
➜ system1 lein deps
Retrieving org/danielsz/system/0.3.0-SNAPSHOT/system-0.3.0-20160322.233148-13.pom from clojars
Retrieving reloaded/repl/reloaded.repl/0.1.0/reloaded.repl-0.1.0.pom from clojars
Retrieving com/stuartsierra/component/0.2.1/component-0.2.1.pom from clojars
Retrieving prismatic/schema/1.0.4/schema-1.0.4.pom from clojars
Retrieving com/stuartsierra/component/0.3.1/component-0.3.1.pom from clojars
Retrieving org/danielsz/system/0.3.0-SNAPSHOT/system-0.3.0-20160322.233148-13.jar from clojars
Retrieving prismatic/schema/1.0.4/schema-1.0.4.jar from clojars
Retrieving reloaded/repl/reloaded.repl/0.1.0/reloaded.repl-0.1.0.jar from clojars
Retrieving com/stuartsierra/component/0.3.1/component-0.3.1.jar from clojars
for fresh project
@danielsz: may be your ~/.m2
is wrong or there're some DNS issues?
@danielsz: I think you might try renaming ~/.m2
it and then lein deps
too
@andrewboltachev: Ah, you don't have any trouble retrieving it? It's only me?
may be
@andrewboltachev: That's already good news
sorry, Slack is very slow for some reason for me. JS hangs while I type
@andrewboltachev: no problem. Thanks. I don't get it. Clojars is accessible to me (so not a DNS issue). I'm using Boot in my project, but I never had this problem before.