Fork me on GitHub
#clojure
<
2018-05-01
>
pablore01:05:05

Is there a workaround of passing a macro as an argument?

mfikes02:05:12

@pablore Yeah, wrap it in a fn. For example you can't map or, but you can (map #(or %) [true false]))

vinai10:05:38

It might seem quaint, but I'm trying to use cemerick/drawbridge as an ad-hoc ui for an app I'm deploying on heroku. Connecting over http works, but I'm failing to get the connection over https to work.

% lein repl :connect ''
Connecting to nREPL at 
SSLException Received fatal alert: internal_error
	sun.security.ssl.Alerts.getSSLException (Alerts.java:208)
	sun.security.ssl.Alerts.getSSLException (Alerts.java:154)
	sun.security.ssl.SSLSocketImpl.recvAlert (SSLSocketImpl.java:2023)
	sun.security.ssl.SSLSocketImpl.readRecord (SSLSocketImpl.java:1125)
	sun.security.ssl.SSLSocketImpl.performInitialHandshake (SSLSocketImpl.java:1375)
	sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1403)
	sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1387)
	org.apache.http.conn.ssl.SSLSocketFactory.connectSocket (SSLSocketFactory.java:543)
	org.apache.http.conn.ssl.SSLSocketFactory.connectSocket (SSLSocketFactory.java:409)
	org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection (DefaultClientConnectionOperator.java:177)
	org.apache.http.impl.conn.ManagedClientConnectionImpl.open (ManagedClientConnectionImpl.java:304)
	org.apache.http.impl.client.DefaultRequestDirector.tryConnect (DefaultRequestDirector.java:611)
Bye for now!
The ring middleware is pretty much straight out of the readme:
(defn wrap-drawbridge [handler]
  (let [repl-handler (-> (drawbridge/ring-handler)
                         (keyword-params/wrap-keyword-params)
                         (nested-params/wrap-nested-params)
                         (params/wrap-params)
                         (session/wrap-session)
                         (basic/wrap-basic-authentication authenticated?)
                         (ssl/wrap-forwarded-scheme)
                         (proxy-headers/wrap-forwarded-remote-addr))]
    (fn [request]
      (if (= repl-uri (:uri request))
        (repl-handler request)
        (handler request)))))
How can I debug this issue? Or maybe there is a more appropriate channel to ask?

emccue15:05:58

data.diff is giving me results i dont expect

emccue16:05:03

why is comments nil in the first one

emccue16:05:32

shouldn't that be an empty vector?

noisesmith16:05:57

@emccue data/diff shows nil for data that's unchanged between items

noisesmith16:05:36

err, wait, maybe something else is going on...

noisesmith16:05:35

does this help?

user=> (clojure.data/diff {:a []} {:a [:b]})
({:a nil} {:a [:b]} nil)

noisesmith16:05:15

it seems that data/diff truncates empty collections in the diff to nil

dpsutton16:05:24

haha that's exactly what i typed out

noisesmith16:05:48

canonical example data ftw

dpsutton16:05:01

(clojure.data/diff {:a '(:a)} {:a [:b]}). note it's not returning the same data structure (vector, list, etc)

dpsutton16:05:21

i used a list of that and got back ({:a [:a]} {:a [:b]} nil)

emccue16:05:59

its documented that collections go to vectors

dpsutton16:05:14

interesting (clojure.data/diff {:a [:a :b :c]} {:a [:b :e]})

dpsutton16:05:35

it doesn't compare the values of the key a

dpsutton16:05:46

they are totally different, not similar at all

dpsutton16:05:47

({:a [:a :b :c]} {:a [:b :e]} nil)

emccue16:05:07

I feel like clojure core libs violate the law of least suprise

noisesmith16:05:11

right, theres no index in common

emccue16:05:18

just in general

dpsutton16:05:47

oh right, @noisesmith. i forget those aren't general collections

noisesmith16:05:05

but there's almost always a good rationale for the surprise

noisesmith16:05:44

@emccue I think one way to put it is that Clojure will pick the behavior that is most useful to an opinionated expert named Rich Hickey over the intuitive option if the two are ever in conflict

noisesmith16:05:17

I think Rich is usually right, so I enjoy using Clojure

Alex Miller (Clojure team)16:05:21

as Rich says, people find many things surprising

Alex Miller (Clojure team)16:05:37

“least surprise” is not an objective measure

💯 4
fatihict17:05:03

I was wondering when/if there will be a EuroClojure 2018 conference. I saw a similar question in clojurians-log, but I can't seem to load that page

Alex Miller (Clojure team)17:05:33

there will not be one this summer

fatihict17:05:05

Thanks for the info

WhoNeedszZz19:05:26

Do you guys know a good place to try and find fellow Clojure developers looking to help on a side project?

seancorfield19:05:00

@whoneedszzz We have #jobs and #remote-jobs for that -- and #jobs-discuss to talk about hiring practices etc.

WhoNeedszZz19:05:27

Side as in on the side; not paid

seancorfield19:05:18

An open source project?

dpsutton19:05:34

are you looking to work on someone's project or looking for others to work on your project?

WhoNeedszZz19:05:02

Yes, open source.

WhoNeedszZz19:05:11

I'm looking for help on a project I'm planning to start.

seancorfield20:05:17

Then asking folks here (in #clojure ) to help is probably reasonable. It'll help your cause if you already have a repo and README to explain the project so you can point folks at a link.

WhoNeedszZz20:05:55

The project is still in the early planning phase so there isn't any code or repo existing yet, but for sure.

WhoNeedszZz20:05:44

Essentially the project starting is dependent on being able to have help.

dpsutton20:05:55

well, you've already started selling it. and like @seancorfield said, the better flushed out and interesting the idea, the more likely you are to get interested contributors. but no repo is your first impression

WhoNeedszZz20:05:03

Certainly. I came up with the initial idea a couple of days ago 😛

WhoNeedszZz20:05:28

So to get to the point - I have been experimenting with various budgeting apps and haven't been satisfied with any of them. Almost all of the ones I have tried have appealing features, but there is something significant that is bothering the users that makes them switch back and forth between them. I'd like to make one that is a bit more fleshed out to be able to appeal to a wider audience. YNAB, for instance, is pretty good, but has trouble adding accounts and then actually importing transactions. It also is targeted specifically for their methodology. I'd like to offer a service that offers multiple styles of budgeting depending on what the user's needs are, but not try to be a virtual financial manager like many other services are doing.

WhoNeedszZz20:05:02

On the technical aspect I'd like to implement the backend API in Clojure and the client in ClojureScript with re-frame.

the2bears20:05:13

@whoneedszzz keep in mind that today's conversation here will drop off the site after a week or so. A README will be something you can keep around, adjust as you think about the project more, etc.

qqq21:05:00

I can't seem to figure this out. I know of int-array, float-array ... but how do I create an array of Strings ?

gtrak21:05:03

make-array

gtrak21:05:35

eg. (make-array String 10)

rjb21:05:06

also into-array, as in (into-array java.lang.String ["one" "two"])

emccue22:05:00

@whoneedszzz What do Clojure and Clojurescript solve in this picture?

WhoNeedszZz22:05:36

Not sure what you mean

emccue22:05:40

what part of your problem is best solved by clojure as a language/platform?

WhoNeedszZz22:05:40

It isn't necessarily. A language is a tool. My goal is to do it with them because I'd like to demonstrate that it can be done as an alternative to other languages and frameworks. Be an ambassador for Clojure and ClojureScript if you will.

WhoNeedszZz22:05:09

It would be quite helpful as a successful project to refer to when pitching Clojure or ClojureScript on a business project for those that aren't familiar with them.

emccue22:05:57

at this stage I would say write a POC or at least formalize your hypothesis

emccue22:05:21

do a UX mock up perhaps

WhoNeedszZz22:05:44

I'm not there yet. I'm one person. This would be a group project and those sort of details need to be discussed together.

WhoNeedszZz22:05:23

I don't have a precise definition of the service

emccue22:05:07

Its not about having a complete idea or a complete picture of the solution

emccue22:05:32

Just write out as carefully as you can what you think the problem is (similar to your above paragraph, but just spend some more time on it) and one idea for the shape of a solution

WhoNeedszZz22:05:06

Apparently there's some kind of miscommunication here

WhoNeedszZz22:05:09

I mentioned earlier that the project will require multiple people to complete it in any reasonable time frame. It's not a quick and dirty project. So I need to find people that would be interested in working together on it. If I can't find people it isn't happening and not worth spending that sort of time on.

WhoNeedszZz22:05:51

Due to my goal being to cover a wider audience it is more complex. I would like how to accomplish that to be a group discussion. That will determine how the UI and UX look and flow.

emccue22:05:23

Okay, so I think I see where you are coming from now

emccue22:05:04

What I was saying was around dpsutton's point that "the better flushed out and interesting the idea, the more likely you are to get interested contributors"

emccue22:05:15

I assume he meant fleshed

WhoNeedszZz22:05:17

I have some thoughts about that task, but nothing concrete yet.

WhoNeedszZz22:05:11

I agree with that completely and would apply if I had all of the details concrete already.

dpsutton22:05:25

I sure did 🙂

WhoNeedszZz22:05:08

I have a habit of coming up with grand ideas for software projects that are just impractical or impossible for one person to accomplish and in the past would spend time starting the project and then finally coming to the realization where I'm at. So I now check myself on that and don't want to go down a rabbit hole trying to accomplish it solo.

theeternalpulse23:05:38

I fall into the "make a chair making tool before you've ever made a chair" rabbit hole often

😬 24