Fork me on GitHub
#clojure
<
2016-02-02
>
trancehime02:02:35

question: has anyone tested https://github.com/drewr/postal on Windows environment?

jethroksy03:02:13

what benefits does java.time.Instant give over java.util.Date?

jonahbenton03:02:22

hey @trancehime it wraps javamail, which is extensively used. it should work if you have an smtp server and configure it to use smtp (not sendmail)

jethroksy03:02:52

eh that's neat

jaen03:02:55

@jethroksy: basically you get ~JodaTime in the standard JVM package.

jethroksy03:02:23

I was struggling to call until on an instance of Instant

jethroksy03:02:43

ended up just using ChronoUnit's between

crocket03:02:18

Has clojure caught up with python and R in terms of exploratory data science? I know there are Incanter and various machine learning packages for clojure.

jethroksy03:02:55

@crocket: @mikera gave a local talk on that last week, and my general impression is that it's coming really close. Core.matrix doesn't have all the things NumPy has yet, but most of the core stuff is already implemented. He's working on a top-secret library with a team, of which no details has been leaked 😶

crocket03:02:20

top-secret? You mean proprietary. I can't utilize proprietary libraries.

jethroksy03:02:42

Nah, it means it's just too early to be released yet

jethroksy03:02:02

his top-secret library

crocket03:02:10

What does it do?

jethroksy03:02:18

no details have been leaked so I don't know

crocket03:02:26

Then, I wouldn't expect nothing. Nobody knows what it is.

crocket03:02:21

What do you use on clojure for exploratory data science?

jethroksy03:02:35

I don't do it, but core matrix is great

crocket03:02:58

I heard Incanter was slow.

jethroksy03:02:05

there are different java implementations that it can use

jethroksy03:02:17

I think Incanter used to use Clatrix?

jethroksy03:02:37

vectorz-clj really took over, and now they've swapped over iirc

jethroksy03:02:17

his argument against R was that it wasn't general purpose enough

jethroksy03:02:39

R's great but only for data science, and when you try to push beyond that you'll end up with lots of problems

jethroksy03:02:46

so it really depends on your use-case

crocket03:02:07

Is clojure close to R with respect to data science?

jethroksy03:02:30

I'm not familiar enough to answer that question

jaen03:02:42

I daresay not; R is explicitly geared towards statistics; you'll get loads of statistics, bioinformatics, machine learning and such packages for it. Of course in Clojure you can use Java libraries for those tasks, but it's somewhat different than using language that was created from ground up for those specific niche.

jaen03:02:53

So you basically can do the same, but it won't be as effortless as in R.

crocket03:02:16

I don't like R as a language.

jaen03:02:18

Where you can just nls(results ~ arguments) and get nonlinear regression model.

jaen03:02:25

Pfff, I don't like it that much either; the subtle things like differences between [], [[]] and $ for example are vexing. But you can't deny it has a rich set of libraries for all those tasks.

jaen03:02:03

Python and R are both high up there in scientific applications.

cfleming04:02:12

14 companies in HN who’s hiring mentioning Clojure, 9 of them seem to be totally or mostly Clojure

crocket04:02:13

How do you do nls(results ~ arguments) in clojure?

jaen04:02:30

Write Gauss-Newton algorithm from scratch?

jaen04:02:54

Though I guess Incanter might have something. Or a Java numerical algorithms library.

jaen04:02:39

But I don't think anything's as convenient as in R. You can vcov(model) to get variance-covariance matrix; residuals(model) to get residuals and so on.

meow04:02:02

IIRC @mikera told me he was working on a machine learning library. I use core.matrix and like it, but I don't use it for data science.

jaen04:02:26

You can even do confint(model) to get a confidence interval without knowing the error propagation formula.

meow04:02:10

There is also #C0533TY12 #C0BQDEJ8M #C0F0V8DT5 and #C08384015

crocket04:02:59

I'm not as good at statistics and math as you are.

crocket04:02:03

Actually, I'm learning math.

jaen04:02:02

Meh, me neither. Statistics is damn hard. All that I just said is what I had to learn while helping my sister with her engineering thesis because her advisor couldn't be arsed to help : V (didn't know a smidgen of R until a month ago)

jaen04:02:20

From what I can tell, at least.

jaen04:02:10

The point still stands though - R is certainly richer, being a language focused on statistics that has been around for close to 15 years.

jaen04:02:32

Clojure is cool and all, but you will probably need to put a bit more effort to achieve the same you would with a few lines of R.

clumsyjedi04:02:31

what are people using for facebook graph?

jethroksy07:02:43

is there a function to trigger the stop and start of a component's lifecycle?

jaen07:02:06

A single component?

jaen07:02:14

Apart from the system?

jaen07:02:01

You could just call the start and stop protocol methods directly on the component

jaen07:02:15

But that won't update the system

crocket08:02:28

How does clojure utilize all CPU cores?

jaen08:02:08

Just the way Java does - with threads. Immutability and being (mostly) referentially transparent gives nice, simple performance boosting changes, like using pmap instead of map to utilise all CPU cores.

trancehime09:02:29

What is the meaning of No implementation of method: :render of protocol #'compojure.response/Renderable found for class: java.lang.Integer?

crocket09:02:03

Professor. Lee Spector said Actually getting the hoped-for multicore speedups, however, can be more difficult on clojure.

plexus09:02:13

@trancehime: you can pass different types of things to compojure, and it wil know how to handle them and render a response, e.g. a string or a map

hans09:02:46

@crocket: maybe you want to talk to lee spector to have him qualify what he said.

plexus09:02:02

;; route that returns a string
(GET "/" request "<h1>hello world</h2>")

plexus09:02:50

;; route that returns a map
(GET "/" request {:status 200, :body "<h1>hello world</h2>"})

plexus09:02:21

I'm guessing you have a route that passes a number to compojure (a java.lang.Integer), and it doesn't know what to do with that

plexus09:02:52

;; route that returns an integer, this blows up
(GET "/" request 42)

trancehime09:02:54

Never mind. I think I have an idea of where the error is coming from.

trancehime09:02:11

(I was passing the wrong map to my route)

trancehime09:02:32

The code is riddled with typos and silly errors; that's what I get for working in a hurry

crocket10:02:29

Does clojure have decent CUDA support?

jasonbell11:02:36

Does anyone else have issues with CIDER/Emacs on Ubuntu? cider-jack-in taking an absolute age to startup.

agile_geek11:02:05

@jasonbell: Hi Jase, nice to see u. Might be worth asking this in the #C0617A8PQ channel?

jasonbell11:02:54

@agile_geek: apols didn’t realise there was one, nice to see you too my friend, all well?

agile_geek11:02:52

@jasonbell: I'm fine. One of the advantages of #C0617A8PQ channel is you get to talk to Bug (@bozhidar) and that's always a pleasure!

jasonbell11:02:17

@agile_geek: just asked there so thanks for the nod in the right direction,

michael_at_sosupper11:02:20

Hi. Any Cursive users around?

val_waeselynck11:02:11

@michael_at_sosupper: although you may want to ask in #C0744GXCJ simple_smile

tesseract13:02:11

@meow: I’m sorry where is proton

michael_at_sosupper16:02:12

In a REPL, I can scroll back through command history one item at a time, but is it possible to list the history (within the REPL) much as I do "history" from a shell?

jjttjj16:02:49

hmmm clojars is down?

jeff.terrell16:02:33

@michael_at_sosupper: Good question. I don't know, but (1) my guess is that it's controlled by the GNU readline library, and (2) I rarely use this feature in the shell, in favor of CTRL-R for reverse searching.

mattyb16:02:38

seems so re: clojars

pguillebert16:02:51

jjttjj: Yeah apparently

michael_at_sosupper16:02:21

@jeff.terrell: it's just something I would like to get a visual on my workflow (or to remind myself after getting interrupted)

jeff.terrell16:02:41

Makes sense, yeah. If you find a way to do this, I'm interested to know.

danielcompton17:02:06

@jjttjj: there’s connectivity issues at Linode Atlanta.

acron17:02:34

ahmagahd clojars

tcrawley17:02:45

s/clojars/linode/

tcrawley17:02:13

we're working on moving away, it's just a slow process with only two of us

tcrawley17:02:52

While clojars is down, you can use the mirror for reads: https://github.com/clojars/clojars-web/wiki/Mirrors

timgilbert17:02:04

Does anyone have a link to the recent presentation about the state of clojars, maybe from the conj? Was looking on YouTube but I can't find it

tcrawley17:02:25

I gave a lightning talk, I can find that for you

tcrawley17:02:32

or answer any ? here

acron17:02:26

tcrawley: I am surprised to see just a single mirror... (hosted by you, it seems) would it be useful for Clojars to have more mirrors?

tcrawley17:02:05

I don't think multiple mirrors would really help - a single mirror is plenty for the load

tcrawley17:02:22

longer-term plan is to move the repo to a cloud file store behind a CDN

tcrawley17:02:45

we have sponsorship from Rackspace for that, we just have to fix some issues in the codebase before we can move

acron17:02:30

fair enough, that's pretty good of Rackspace

tcrawley17:02:16

yeah, it's pretty awesome

cddr17:02:30

There's a few jars that don't appear to be in the mirror: e.g. org.clojure:clojure:jar:1.7.0, org.clojure:java.jdbc:jar:0.4.2, org.postgresql:postgresql:jar:9.3-1103-jdbc41, org.clojure:tools.cli:jar:0.3.3, org.clojure:tools.nrepl:jar:0.2.12:

danielcompton17:02:14

@cddr org.clojure is at Maven Central

tcrawley17:02:10

if you are using the mirror instructions from the wiki, you have to include central in the list, otherwise you remove it

cddr17:02:19

Oh I see

vanrysss17:02:50

is clojars down for anyone else?

vanrysss17:02:23

and nvm, just scrolled up

tcrawley17:02:34

linode is having issues

tcrawley17:02:55

see https://github.com/clojars/clojars-web/wiki/Mirrors to be able to pull dependencies in the meantime

vanrysss17:02:59

thanks, we put that into our project.clj and all's well

griesmey18:02:48

Is http-kit the chosen package for making network requests? [10:02] if so, then how do I install/use it?

billr18:02:37

clj-http works fine too. AFAIK it's a matter of opinion as to which you prefer. Do you use leiningen? If so, just add either to your project dependencies and then you can require/use it in your code. One caveat though, http://clojars.org is down right now so lein will have issues resolving the dependency.

tcrawley18:02:47

@alexmiller: thanks, I got distracted by dealing with the outage

griesmey18:02:57

thanks billr

tcrawley18:02:10

clojars is back up, but upstream is still reporting issues, so it may go down again: http://status.clojars.org/incidents/pdpppjllmjff

jjttjj19:02:00

how does the reloaded workflow relate to testing? Like is normal to just set up start/stop/init/go/reset functions in a test namespace for one or more components and just reset at that start of each test? I'm talking about testing things that are dependent on resources

jefframnani21:02:12

Hello, Clojurians. simple_smile I’m new to clojure and want to set up a simple web project to start learning clojure’s web ecosystem. My preliminary research tells me to look at Ring + Compojure + Hiccup. Am I in the ballpark?

jaen21:02:26

More or less. There are some alternatives (like bidi for routing instead of compojute or something like selmer or mustache for templating instead of Hiccup) but it's probably the core introductory stack, yes.'

jaen21:02:36

You might also want to take a look at Luminus.

jaen21:02:57

It's a set of common webdevelopment libraries wrapped up in a sort-of microframework.

jaen21:02:47

Also it's book is getting 2nd edition soon; already in beta - https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition

jaen21:02:14

I don't agree with all the library or structural choices there, but it's a good introduction to Clojure webdevelopment thought.

jaen21:02:41

After you grasp the basics Duct (https://github.com/weavejester/duct) could also be interesting as a next step.

jefframnani21:02:09

Wow. Thank you! simple_smile

cddr21:02:31

Can anyone explain why this returns false?

jefframnani21:02:33

Are there any leiningen templates for a web project worth recommending?

cddr21:02:39

(with-redefs [s/stream? (constantly true)]
  (s/stream? "yolo"))

jaen21:02:16

@jefframnani: Luminus is a lein template de facto. Duct as well.

jefframnani21:02:28

Thanks, a lot @jaen. I really appreciate it.

jaen21:02:31

No problem; if you can afford that book, it'll probably give you a fairly good overview of the ecosystem. And then you could start experimenting on your own with other libraries if they make sense (for example stock compojure has no reverse routing, but bidi has).

jaen21:02:43

If you can't the tutorials on the site also seem not bad.

solicode21:02:38

@cddr I don’t know what s/stream? is, but it shouldn’t matter. I would expect that to return true regardless.

polygloton21:02:42

Can anyone recommend a library that converts prismatic schemas into something human-friendly, say for non-clojure devs? Perhaps HTML or JSON-schema. Thanks!

polygloton22:02:21

Ring-swagger was the best option I found from searching. Its missing support for some parts of schema, though I could certainly add to it. I want to make sure that there isn't something more complete before I start that though. simple_smile

polygloton22:02:34

Cool that looks promsing

jaen22:02:57

https://github.com/metosin/schema-tools/ also might be useful if you wanted to do something of your own - has helpers for transforming schemas for example

polygloton22:02:14

I think the best option might be to start with the ring-swagger code and extend it a bit

nkraft22:02:17

Anyone worked with hbase/hadoop and Clojure? I'm looking into writing a map/reduce job in Clojure, and looking for some good starting places.

nkraft22:02:00

I know about PigPen, just not sure if there is something better or is that what folks use?

bfabry22:02:41

@nkraft: we've written a significant amount of m/r code using cascalog in clojure

bfabry22:02:38

if it's a short lived project I'd recommend it. if it's the start of something that's going to continue being worked on probably not, as it's not being maintained. Also you should probably rethink hadoop if it's long term simple_smile

cddr22:02:46

I was working last weekend to upgrade integrity to the latest version of schema. Didn't quite get it finished but should be able to do it this weekend

nkraft22:02:14

Hadoop isn't my choice, my employer has a big investment in it and TB's of data already there. I was wondering about cascalog, but the docs are all about using it with local databases, not large existing multi-server hadoop installations. It is a one-off job, though. Thanks for the reminder, I'll have another look at it.

bfabry22:02:45

@nkraft: sounds like it would fit the bill. cascalog will decide to use the cluster if it's run in the environment of the cluster. ie, just give your project a main, jar it, and run it using "$ hadoop jar your-jar.jar" you can even run a gorilla repl like that and run cascalog queries direct from gorilla

lvh22:02:38

Hi! In core.logic, i s there an everyg for lvars of seqs? What I’m trying to accomplish is, for some set of events, find a subset for which some logic program is consistent; that means I want to say something like (l/everyg #(l/membero % events) results), by which I mean all of the logic variables in results must be in events, aka don’t make up fresh variables

lvh22:02:23

(let [events [{:x 1}]]
  (l/run 10 [results]
    (l/everyg #(l/membero % events) results)))
doesn’t work, because results is an LVar, not a coll.

lvh22:02:20

I know I can say (fresh [x] (membero x events) (membero x results)) but that doesn’t contrain all results to be something from events. Similarly, neither does (l/everyg #(l/membero % results) events)

cfleming23:02:28

Is anyone here using Gradle to build Clojure code?

jkrueger23:02:15

only exploratory in an android project. still. maybe i can help ?

cfleming23:02:23

@jkrueger: I was just curious what the experience was like. Are you using clojuresque?

jkrueger23:02:28

no i didn’t. sorry