Examples of aget (multi-dimensional) and make-array

2014-05-17 Thread Colin Kahn
Interested in seeing an example of how to use aget on a multi-dimensional array, and how to use make-array. So far I've had no luck getting either to work. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

Re: Looking for help with a Stack Overflow error

2014-05-17 Thread Karsten Schmidt
Hi Brad, I can't help you with your solution, but just wanted to mention that the core.logic library might be a great tool for this kind of problem (plus I'd be v.interested in seeing a solution using this myself... :) K. On 16 May 2014 22:15, "Brad Kurtz" wrote: > I have since fixed the origina

Re: Examples of aget (multi-dimensional) and make-array

2014-05-17 Thread Frank Castellucci
As per the documentation http://clojuredocs.org/clojure_core/clojure.core/make-array you use this to collect Java Class types into an array. Remember that a make-array return is a mutable type. For example, a string in clojure is backed by java's String class. If you want to make a 3 member a

Re: Looking for help with a Stack Overflow error

2014-05-17 Thread Rob Day
A better approach might be to break it down into three groups: * The first three numbers (rows 1 and 2), constrained by rule D * The middle three numbers (row 3), constrained by rule A * The last four numbers (row 4), constrained by rule E There are only 10!/7! or 10!/6! initial possibilities fo

Advice on data structure communication and awareness

2014-05-17 Thread Mike Fikes
I've never used a dynamically-typed language and an issue I've encountered with Clojure is a difficulty with readily "seeing" the data structures being consumed or returned by functions I'm writing, especially when I come back to them several days later and if those structures get to be somewhat

[ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread Brendan Younger
Hi all, In light of Aaron Bedra's talkat Clojure/West this past March on the (lack of) security in Clojure webapps, I've written a small, easy-to-understand middleware for keeping your authenticated se

Re: Looking for help with a Stack Overflow error

2014-05-17 Thread Gary Verhaegen
I'd suggest taking a look at the following blog post: http://programming-puzzler.blogspot.be/2013/03/logic-programming-is-overrated.html (The ensuing discussion between David and Mark is also worth reading.) On 17 May 2014 14:49, Rob Day wrote: > A better approach might be to break it down into

Re: [ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread James Reeves
Hi Brendan, This sort of work is very much appreciated, but since this involves security, I hope you won't mind if I make a few criticisms. When dealing with security, it's extremely important that you don't re-implement existing functionality without good reason. A large part of avoiding securit

Re: Advice on data structure communication and awareness

2014-05-17 Thread Jace Bennett
There were a number of talks at the Conj that spoke directly to this challenge. One of the approaches I liked was Prismatic's schema. https://github.com/Prismatic/schema And here's Aria's talk on it, since he can explain it better than I. https://www.youtube.com/watch?v=o_jtwIs2Ot8 On Sat, Ma

Re: Examples of aget (multi-dimensional) and make-array

2014-05-17 Thread Colin Kahn
Thanks for the answer Frank. Actually this was my mistake, I was looking for how to do this using Clojurescript thinking this was the Clojurescript group. On Saturday, May 17, 2014 2:30:09 AM UTC-7, Frank Castellucci wrote: > > As per the documentation > http://clojuredocs.org/clojure_core/cloj

Re: Advice on data structure communication and awareness

2014-05-17 Thread James Reeves
I've been toying around with the idea of type signatures that exist specifically for documentation purposes, loosely inspired by the stack effect declarations in Factor. For example, in your case we might start with something like: (defn count-items {:doc/type '([{Keyword String} -> Integer])}

Re: [ANN] clojure.test.check 0.5.8

2014-05-17 Thread Reid Draper
On May 15, 2014, at 2:08 PM, Steve Miner wrote: > I'm generating generators from schemas [1]. I have generators for all my > simple schemas -- "int" corresponds to gen/int, etc. The tougher case is > when I have to convert a conjunction of schema expressions into a generator. > For example,

Re: Advice on data structure communication and awareness

2014-05-17 Thread Sam Ritchie
Check out Prismatic's schema: https://github.com/Prismatic/schema With validation turned off that's exactly what the library provides. James Reeves May 17, 2014 11:42 AM I've been toying around with the idea of type signatures that exist specifically for documen

Re: Advice on data structure communication and awareness

2014-05-17 Thread Sam Ritchie
Ah, sorry, didn't see your reference at the bottom :) Schema does augment the docs to some degree: paddleguru.models.transfer/payout! ([regatta balance our-fee their-fee]) Inputs: [regatta :- regatta/Regatta balance :- graph/Balance our-fee :- s/Num their-fee :- s/Num] Returns: {:success s

Re: I'm reading the book "Web Development with Clojure...". On page 4 I entered the command 'leon ring server' and it returns an error message: 'ring' is not a task. See 'lein help'.

2014-05-17 Thread Alejandro Ciniglio
http://www.meetup.com/Clojure-NYC/ On Friday, May 16, 2014 6:56:01 PM UTC-6, patrick lynch wrote: > > ...solved it - if anyone is reading this book - you're going to have to > change your $PATH in order to get this to work. > ...hope to see you all in the future - if anyone can recommend a Cloj

Re: [ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread Brendan Younger
Hi James, The general point about not unduly duplicating functionality is well taken, however, here are the reasons for the choices I made. Having the ability to keep one insecure session (for anonymous users) and one secure, authenticated session is very helpful. With the standard ring.middl

Re: [ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread James Reeves
On 17 May 2014 20:04, Brendan Younger wrote: > > Having the ability to keep one insecure session (for anonymous users) and > one secure, authenticated session is very helpful. With the standard > ring.middleware.session, you are restricted to setting the HttpOnly and > Secure flags on the cookie

Re: [ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread Brendan Younger
For anyone else following along at home, I'll just re-iterate the benefits of using ring-auth versus trying to write your routes *just right* to avoid the myriad security issues listed at OWASP. - If you initiate a session with a user over HTTP and later on that user logs in over HTTPS but you

Re: [ANN] ring-auth middleware for protecting sessions

2014-05-17 Thread James Reeves
On 18 May 2014 00:09, Brendan Younger wrote: > For anyone else following along at home, I'll just re-iterate the benefits > of using ring-auth versus trying to write your routes *just right* to > avoid the myriad security issues listed at OWASP. > > - If you initiate a session with a user over HT

Re: clojurescript, sourcemaps, and debugging info

2014-05-17 Thread t x
flat namespace is ugly. Someone please please tell me there is a better solution. :-) Is there no 10-line chrome-plugin which solves this? On Fri, May 16, 2014 at 7:35 AM, t x wrote: > Bah, I've reverted to a flat namespace, i.e. foo_internal.cljs, > foo_public.cljs, bar_internal.cljs, bar_public