Fork me on GitHub
#clojure
<
2016-01-09
>
magomimmo09:01:44

@spacepluk: with a delay of a day, here is the tutorial trying to explain how to make a library compliant with Reader Conditional extension. HIH. https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-19.md

wei11:01:36

is there a version of some that returns the value, not (pred value)?

wei11:01:15

e.g. (first-val odd? (range)) => 1

solicode12:01:58

@wei: Not that I know of. I always use (first (filter pred coll)) for that.

notjonas12:01:13

why does for example (doc inc)say clojure.core/inc ([x]) and not clojure.core/inc (x) ?

notjonas12:01:29

([x]) looks to me like a vector should be passed

wei12:01:23

@solicode: I went with something similar (first (drop-while #(not (pred %)) coll)

hans12:01:25

@wei: #(not (pred %)) is better written as (complement pred)

solicode12:01:01

@notjonas: Because it can have multiple arities. It's showing all those arities as a list. inc just happens to have one. An example of one that returns more to show this is range. (doc range) will give you:

clojure.core/range
([] [end] [start end] [start end step])
Meaning you can do (range), (range end), (range start end), etc.

notjonas12:01:54

@solicode: aha thanks for the explanation

esnunes13:01:11

In your opinion which graph database best fits with Clojure? Datomic? Neo4j? OrientDB? Other?

meow14:01:15

check out datascript as well

mpenet14:01:40

Depends on the kind of data/volume/access pattern/budget more than anything

rnandan27315:01:18

Hi, I am trying to use sparkling against a standalone cluster, however i get the following message on spark master logs

rnandan27315:01:19

6/01/09 21:00:14 INFO LocalActorRef: Message [akka.remote.transport.ActorTransportAdapter$DisassociateUnderlying] from Actor[<akka://sparkMaster/deadLetters>] to Actor[<akka://sparkMaster/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FsparkMaster%40192.168.1.100%3A64328-2#27545407>] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'. 16/01/09 21:00:50 ERROR EndpointWriter: AssociationError [<akka.tcp://[email protected]:7077>] <- [<akka.tcp://[email protected]:64333>]: Error [org.apache.spark.deploy.DeployMessages$RegisterApplication; local class incompatible: stream classdesc serialVersionUID = -5495080032843259921, local class serialVersionUID = 352674063933172066] [ java.io.InvalidClassException: org.apache.spark.deploy.DeployMessages$RegisterApplication; local class incompatible: stream classdesc serialVersionUID = -5495080032843259921, local class serialVersionUID = 352674063933172066 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:616) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1623) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) a

rnandan27317:01:34

i have figured this out, I was using the latest sparkling with spark 1.2.0. Now i have moved to spark1.5.0 and everything works

Pablo Fernandez17:01:37

Does this line:

(let [{:keys [list/one list/two]} …] …)
bind local symbols one and two?

Pablo Fernandez17:01:23

So, the namespace part is just discarded then.

bronsa17:01:37

locals can't have namespaces

Pablo Fernandez17:01:30

Yeah, I know, but I never seen let used like that, so, I didn’t know it would automatically discard the namespace part to make a local. That’s actually neat.

bronsa17:01:40

it was added in 1.6 IIRC

donmullen17:01:57

@pupeno : you did a deep dive into reagent/re-frame, correct? Will be interesting to hear comparison/thoughts on om.next.

Pablo Fernandez18:01:26

donmullen: yes, I did and once I’m done figuring out Om Next (that is, if sales, marketing and product validation do not distract me too much), I’ll be happy to do that.

Pablo Fernandez18:01:15

donmullen: I can tell you that I’m very intrigued by Om Next’s approach to APIs in which it can get all the data for the app in one call. My super tiny project already makes like 5 calls and that’s a very inefficient. @dnolen also advocates against a visible event system and even though I haven’t suffer this pain yet, I can see his point as that’s one of my fears with re-frame.

Pablo Fernandez18:01:12

My plan is to convert NinjaTools to Om Next, so we can examine them side by side.

akiva18:01:08

Does anyone here have any experience with clj-rethinkdb? I’m trying to get without to work in a filter but nothing I pass to it which describes the field I want to exclude seems to work.

esnunes22:01:55

for the ones new to clojure as I'm, some nice app examples from heroku https://devcenter.heroku.com/categories/clojure

esnunes23:01:03

As I mentioned I'm new to Clojure. I'm developing a microservice using clojure,compojure, ring, etc. I've been following some tutorials and books however most part of them don't include the test part of it and when they do, like Parens of the dead, they don't explain how to setup it. Can you describe or point to a tutorial that covers how to setup a testing environment (maybe a way to watch / run tests as they are modified)?

tom23:01:05

@esnunes: you mean like setting up unit or integration tests? If so you can try the clojure test ns.

esnunes23:01:10

@tom: sorry, I think I wasn't clear enough. I mean the workflow to run tests. How to configure my editor, lein project, etc

esnunes23:01:56

maybe I'm just making the things complex. In node-js I have a package.json script that watches for changes and re-run the tests.

akiva23:01:59

@esnunes, it matters what your editor is and what test framework you’re using. At the very least, you can run lein test. I usually use expectations (https://github.com/jaycfields/expectations) with lein-expect to run my tests automatically whenever I save a file.

esnunes23:01:03

that's what I was expecting simple_smile, the lein plugin

esnunes23:01:38

uhmm I thought lein was the standard build tool (note: learn more about difference between *boot and lein*)

donmullen23:01:25

@esnunes: Sounds like you are doing mostly backend stuff. Boot is great tool for that as well - check out the #C053K90BR channel, where several people use docker + boot for deployment. Clojurescript and custom builds are better suited to using boot IMO : modern-cljs 2nd edition steps through using boot : https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-01.md

akiva23:01:35

@esnunes, boot is just a different approach and, unlike Leiningen, it’s still actively developed. I prefer lein but honestly it’s mostly because it’s what I’m more familiar with. boot stays in the background for me, something to learn one day.

esnunes23:01:53

@donmullen: in the js/node-js world I do both backend and frontend. I will take a look on boot too. I extensively use docker in production as well as in development.

akiva23:01:33

One last note, if I were new to Clojure, I’d learn boot. I’d learn lein too simply because it’s been the ’standard' but I’d use boot for all my projects.

esnunes23:01:31

thanks, it is always good to receive some advices from experienced devs. I'm travelling this tough journey to learn Functional paradigm, Clojure, Emacs, main clojure libs, ClojureScript + Om, all at once.

akiva23:01:50

Right on and best of luck on your adventure. We’re here for any and all questions.

meow23:01:11

@esnunes: I just did the same thing, starting about 8 months ago

meow23:01:14

If you use the Cursive plugin with IntelliJ IDEA as your editor environment there is test integration built into that.

meow23:01:57

You mentioned Emacs and lots of folks use Spacemacs as well. There is an #C050AN6QW channel that's a good resource.