Fork me on GitHub
#clojure
<
2019-04-16
>
lspector02:04:20

Looking for Clojure-scriptable 3D/physics environments. Know about Arcadia and #quil but want to know what else is out there. Big plus if a world/system can be created entirely in code, ideally all Clojure/script.

mars0i02:04:06

Hi @lspector . I don't have the answer but wonder if Zulip would be a good place to ask. (Do I remember that you used to to ABM modeling in Clojure? I've been working on a little library to make it easier to use MASON in Clojure.)

đź‘Ť 4
mars0i02:04:17

Would someone be willing to post a pointer to instructions for deploying to Clojars with Leiningen without signing? I'm sure the info is there somewhere, but the lein help on this is not very clear to me give what I don't know, and the docs on the web seem to focus on signing. I may be overlooking the crucial bit ....

seancorfield03:04:18

@mars0i You'll need something like

:repositories {"clojars" {:url "" :sign-releases false}}
in your project.clj file.

seancorfield03:04:29

(or your ~/.lein/profiles.clj file)

seancorfield03:04:36

@deleted-user you can do (let [{:keys [painter novelist]} artist-map] ...)

seancorfield03:04:38

You only need the form you showed if you want to rename the matches (as you did with writer)

seancorfield03:04:38

I pretty much always use the :keys form -- I just the other day used the long form because I was renaming a substructure match.

seancorfield03:04:59

Because you normal bind symbol to expression.

seancorfield03:04:28

So destructuring binds symbols to keyword selections from the right hand side expression.

deleted03:04:58

because you can call (:keyword artist-map)

noisesmith16:04:40

another reason is that the destructuring form is a hash-map, and you can't have a hash map that uses the same key multiple times there are valid reasons to destructure on the same key twice in one destructure

mars0i04:04:41

@seancorfield great--thanks much. I wasn't even sure what config file I should be looking at.

keymone11:04:17

what’s idiomatic way to deduplicate messages from one channel into another within some window of X messages?

marcol11:04:34

Would anybody know why I'm getting this error message getting the Client for Datomic cloud

Unable to resolve entry point, make sure you have the correct version of com.datomic/client on your classpath

jumpnbrownweasel13:04:19

try #datomic channel?

lspector12:04:09

@mars0i Just looked into Zulip but not sure how to get started and find where you're suggesting I ask about this. Pointers? Clojure-scripted MASON might indeed be useful for me, especially if it could really all be done from Clojure.

lspector12:04:31

If anyone else has pointers to Clojure/script-scriptable environments for 3D simulations/physics, beyond Arcadia and #quil, I'd love to hear about them!

eval202013:04:40

@lspector searching on Zulip yields results from streams you're subscribed to. Searching for 'quil' yields results from the following streams for me: clojure-stl (https://clojurians.zulipchat.com/#narrow/stream/152255-clojure-stl), data-science (https://clojurians.zulipchat.com/#narrow/stream/151924-data-science) and the slack-archive (https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive)

Jakub HolĂ˝ (HolyJak)14:04:28

Hello! Any tips how to stop symbol included inside from being fully qualified? See `` (let [s 'hello] (defn ~s [] nil))`` produces (defn myns.core/hello [] nil) Thank you!

bronsa14:04:52

`(defn ~'hello [] nil)

❤️ 8
Noah Bogart15:04:39

Are the macro characters processed from left to right/outer to inner?

lilactown15:04:17

what do you mean by “macro characters”?

Noah Bogart15:04:26

sorry, didn't want to say symbols, I mean the tilde and apostrophe and others

lilactown15:04:48

still not sure I completely understand the question, but syntax quotes and other symbols operate the same as any other clojure form

lilactown15:04:36

e.g. ` will syntax quote the following form and everything inside it

lilactown15:04:25

another way of thinking about it: '(foo bar) is the same thing as (quote (foo bar))

lilactown15:04:58

` and ~ operate the same

Alex Miller (Clojure team)16:04:31

All of them operate on the next read form

mars0i19:04:29

@lspector, well there are a bunch of data science people hanging out on Zulip lately, mostly in the data science section, but posting elsewhere. What you're asking about isn't data science per se, I suppose, but there may be some overlap, and if nothing else, the data science people are interested in graphical representations such as quil. Yes, you can do everything in MASON from Clojure, although there have to be parts that smell of Java. More soon.

mars0i19:04:37

Also, I haven't done anything with 3D MASON. It's possible that my library has some 2D bias, but I don't think so. If so, I'll fix it.

mars0i19:04:51

Ah, I see, eval2020 responded usefully.

Lennart Buit20:04:10

Spec question: Say that I have a graph of nodes and edges modelled as a map with those keys. Now lets say that I want to spec that all nodes are connected. I can write a predicate is-connected? that takes the entire graph, and says whether it is connected yes or no. But for large graphs, that will be hard to track down. Is there a way to also be able to spec it in such a way that I can also explain which node was not connected?

Lennart Buit20:04:23

Example: {:nodes [:a :b :c :d] :edges [[:c :d]]} is invalid because :a and :b are non-connected

benoit20:04:22

What about {:nodes [:a :b :c :d] :edges [[:c :d] [:a :b]]}?

benoit20:04:15

What I mean is that you might need a more precise definition of connected.

Lennart Buit20:04:56

Right, in reality I am interested in their degree, I am however struggling with writing a spec that is evaluated for each node with the graph as “context”. There is no way to determine the degree of a node without knowing to which other nodes it is connected to.

Alex Miller (Clojure team)20:04:04

you are really just in the land of writing a function I think

Alex Miller (Clojure team)20:04:13

spec is not going to help you with this problem much

Alex Miller (Clojure team)20:04:51

there is not currently a way for predicates to give a more precise answer than valid/invalid

benoit20:04:24

Yes, you should write a predicate that test whether the graph is connected and use it in your spec for the whole graph. If it is not you can write another functions that will return the potential "culprits".

Alex Miller (Clojure team)20:04:41

explain can potentially tell you a more detailed reason why

Lennart Buit20:04:23

I can attach a custom explanation, right? Because saying that it failed is-connected? is the thing that I am trying to avoid

Lennart Buit20:04:44

or… I want to be more specific than that

benoit20:04:11

But you don't have to do this inside spec. You can detect that the graph is not connected by applying your spec and in a second time call a function that will identify the subgraphs.

Alex Miller (Clojure team)20:04:40

I'm not sure that spec is giving you any value in what you're describing over just writing functions

Lennart Buit20:04:02

right, yeah I just wanted to add it to the other things being checked with specs, but maybe I indeed shouldn’t. Such that checking with s/valid? gives you the “entire” picture. I’ll hammock over that, thanks as always!

JP20:04:00

Has anyone had issues using scroll from clojurewerkz/elastisch API pointing to ES version 6.4.2? This method works fine for ES 5.x.

hipster coder22:04:28

are you implementing infinite scroll?

hipster coder22:04:07

I wrote those from scratch in JS. Saving the position on the page and loading it…. is a deal breaker in terms of UX. I don’t like infinite scroll for that reason.

hipster coder22:04:07

Infinite scroll does not add value to UX… You could just write an ajax pagination if you want a better user experience. If you are just trying to save the user from needing to refresh a web page/

hipster coder01:04:43

Why can’t you just query the search page by page… instead of setting a scroll timeout parameter?

hipster coder01:04:13

Solr/ElasticSearch should be able to paginate your search

hipster coder01:04:50

it sounds like scroll is for clients that cannot keep track of the same search url

JP14:04:28

@UGQJZ4QNR thanks for your response! I am not trying to implement anything UX related- I simply want to retrieve all the data from a given index which is too much data to fetch at once (more than 10K records). I can definitely look into pagination instead. clojurewerks.elasticsch did a good job with scroll-seq in that it was very simple to retrieve all data with one call so I was hoping to use it in in a newer ES version.

hipster coder14:04:32

hmm. thinking. When I worked with Solr Lucene, I remember just iterating through the pages by page number in the get url portion.

hipster coder22:04:18

@jp are you trying to do infinite scroll?