Re: easier way to write "not not"?

2013-07-16 Thread Alex Baranosky
`boolean`.  Agreed.

On Tue, Jul 16, 2013 at 11:13 PM, Shantanu Kumar
wrote:

>
>
> On Wednesday, 17 July 2013 11:42:10 UTC+5:30, JvJ wrote:
>>
>> Not that it's a big deal, but is there a standard library function for
>> #(not (not %))?
>
>
> Just say `boolean` maybe?
>
> Shantanu
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: easier way to write "not not"?

2013-07-16 Thread Shantanu Kumar


On Wednesday, 17 July 2013 11:42:10 UTC+5:30, JvJ wrote:
>
> Not that it's a big deal, but is there a standard library function for 
> #(not (not %))?


Just say `boolean` maybe?

Shantanu 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




easier way to write "not not"?

2013-07-16 Thread JvJ
Not that it's a big deal, but is there a standard library function for 
#(not (not %))?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Alex Baranosky
Hi Reid,

I dig how nicely it integrates with clojure.test.  Does simple-check
implement some form of shrinking?

On Tue, Jul 16, 2013 at 12:20 PM, Reid Draper  wrote:

> Derp, I fat-fingered my own library name in the subject :)
>
>
> On Tuesday, July 16, 2013 2:18:54 PM UTC-5, Reid Draper wrote:
>>
>> I'm happy to announce the first non-snapshot version (0.1.0) of
>> simple-check, a QuickCheck inspired testing tool: https://github.com/**
>> reiddraper/simple-check .
>>
>> simple-check is a fairly faithful port of a subset of Haskell's
>> QuickCheck, with some additional inspiration from Erlang QuickCheck. With
>> simple-check, you write your tests as a property that holds true for all
>> input to your function. So, supposing you were testing the `reverse`
>> function, you might say: for all vectors V, the reverse of the reverse of V
>> is equal to V. Further, reversing V preserves it's count. simple-check will
>> then test your property with some number of random input. If the property
>> fails, simple-check will attempt to 'shrink' the input, finding smaller
>> input for which the test still fails, where 'smaller' is data-type
>> specific. More documentation is available in the README, and API
>> documentation: 
>> http://**reiddraper.github.io/simple-**check/.
>> Enjoy, and please don't hesitate with feedback, positive or negative.
>>
>> Reid
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: core.async: close! and control channels

2013-07-16 Thread Alan Shaw
My code is at https://github.com/nodename/async-plgd . Here I reproduce
Hoare's coroutines from the CSP paper, and find that none of the examples
with pipelined coroutines work reliably. I'd appreciate any advice.


On Tue, Jul 16, 2013 at 4:34 PM, Alan Shaw  wrote:

> It appears that you cannot call close! within a go block and so
> to signal the end of input to a channel you have to use another channel
> upon which the receiver can alt!.
>
> Some channels that are not stateful, such as a plain copier, would
> need no such mechanism. Or would it be good to use such a thing
> so the channel will get collected?
>
> Further, if I want to have a chain of coroutines pipelining data,
> it would appear that control channels must be threaded through
> all of them as long as at least one of them must be notified of
> end of input.
>
> Is any of this correct?
>
> -A
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Socket.IO and Clojure?

2013-07-16 Thread Sean Corfield
At work we're starting down the path of building a new piece of
functionality based on WebSockets and the external team we're working
with is a Node.js shop so their go to solution is Socket.IO and
they've produced a very nice front end in CoffeeScript and a prototype
back end on Node.js.

I'd really like to have our back end on the JVM, of course, and so I'd
like to find a JVM-based Socket.IO solution that I use from/with
Clojure...

This seems like a reasonable option:

https://github.com/mrniko/netty-socketio

A little bit of experimentation with lein-try (Thank you Ryan!) shows
that it's pretty easy to get a basic server up and running in the REPL
- and I was able to get several of their demos running unchanged
against Clojure, instead of their Java applications, so that was
promising.

Are there other folks out there doing Socket.IO stuff with Clojure?
What approaches have you taken?

Obviously, we could run Node.js and have it hit a Clojure-based REST
API to do the integration, and that might be less pain long term
but...
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ANN: core.match 0.2.0-rc4

2013-07-16 Thread David Nolen
Yet another core.match release candidate this time addressing outstanding
ClojureScript support issues as well as some breaking changes for
ClojureScript users - I've reorganized the namespaces, documented here -
http://github.com/clojure/core.match/blob/master/CHANGES.md

Feedback welcome!

http://github.com/clojure/core.match

David

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: --> macro proposal

2013-07-16 Thread Gary Johnson
Ugh. What a pointless thread. Someone could have just said:

 ---
 It's already in clojure 1.5. The form you are looking for is called as->.
 Your original example would be written like this:

  (as-> 3 x (+ 1 x 4) (prn "answer:" x))
  ---

Done. Yeesh.

On Sunday, July 14, 2013 12:34:02 PM UTC-4, Jeremy Heiler wrote:
>
> On Sat, Jul 13, 2013 at 9:08 PM, Daniel Dinnyes 
> > 
> wrote: 
> > Just made a quick search on `main arguments` on both Google and 
> Wikipedia. 
> > Do you mean the arguments in `public static void main (String[] args)`? 
> If 
> > not please provide some definition what do you mean by main arguments. 
> Else 
> > the point is meaningless. 
>
> He means the arguments you are threading. 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for clojure help

2013-07-16 Thread Sean Corfield
NP. Many of us are only too happy to help folks new to Clojure get
over these humps and become productive! :)

On Tue, Jul 16, 2013 at 6:57 PM, Keith Maynard  wrote:
> Wow Awesome Sean, I dropped your code in and it worked immediately
>
> It's quite a challenge figuring out the various idioms in all these amazing
> languages. Thanks for clearing up my attempt at a multimethod :)
>
> Regards,
>
> Keith
>
> On Tuesday, July 16, 2013 6:03:14 PM UTC-4, Sean Corfield wrote:
>>
>> On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard  wrote:
>> > (defn perms
>> >   ( [] [[]])
>>
>> This is not pattern matching in Clojure. It defines an alternative
>> arity version of the function so that (perms) would return [[]].
>>
>> >   ([xs]
>> >
>> >   (for [x xs p (perms (removeFirst x xs))] (cons x p))  )
>> >
>> > )
>>
>> You need something like this:
>>
>> (defn perms
>>   [xs]
>>   (if (seq xs)
>> (for [x xs p (perms (removeFirst x xs))] (cons x p))
>> [[]]))
>>
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>> World Singles, LLC. -- http://worldsingles.com/
>>
>> "Perfection is the enemy of the good."
>> -- Gustave Flaubert, French realist novelist (1821-1880)
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Request for clojure help

2013-07-16 Thread Keith Maynard
Wow Awesome Sean, I dropped your code in and it worked immediately

It's quite a challenge figuring out the various idioms in all these amazing 
languages. Thanks for clearing up my attempt at a multimethod :)

Regards,

Keith

On Tuesday, July 16, 2013 6:03:14 PM UTC-4, Sean Corfield wrote:
>
> On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard 
> > 
> wrote: 
> > (defn perms 
> >   ( [] [[]]) 
>
> This is not pattern matching in Clojure. It defines an alternative 
> arity version of the function so that (perms) would return [[]]. 
>
> >   ([xs] 
> > 
> >   (for [x xs p (perms (removeFirst x xs))] (cons x p))  ) 
> > 
> > ) 
>
> You need something like this: 
>
> (defn perms 
>   [xs] 
>   (if (seq xs) 
> (for [x xs p (perms (removeFirst x xs))] (cons x p)) 
> [[]])) 
>
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAuth2

2013-07-16 Thread Chas Emerick
Hi Steven,

I'm sorry to hear you didn't find Friend easy to use.  FWIW, you (and whoever 
is following along) might find this helpful:

https://friend-demo.herokuapp.com/

There are live examples of apps using OpenID, OAuth (via github), and more 
pedestrian stuff like forms and HTTP Basic, with code linked from each.

If anyone has suggestions on how friend and its accompanying libraries could be 
made easier to use (beyond more better docs faster), or would like to 
contribute in any way, that door is always open. :-)

Cheers,

- Chas

On Jul 16, 2013, at 11:24 AM, Steven Degutis wrote:

> I heard good things about friend, so I tried to use it for OpenID (to sign-in 
> with Google). But I couldn't figure out how, so I just used openid4java.
> 
> 
> On Mon, Jul 15, 2013 at 8:57 PM, Plínio Balduino  wrote:
> Hi there
> 
> What are you using to authenticate with Google, Facebook, GitHub or Twitter?
> 
> Thanks
> 
> Plínio
> 
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] bouncer 0.2.3-beta4

2013-07-16 Thread Leonardo Borges
Hi all,

bouncer is a validation DSL for Clojure apps

Github: https://github.com/leonardoborges/bouncer
Clojars: https://clojars.org/bouncer

New in version 0.2.3-beta4:

- Validator sets can now be used at the top level call to validate and
valid?
- Added tests and a doc section around validation pipelining. It was an
undocumented assumption.
- Initial support for inter-field validation via validator pre-conditions
(alpha)
- Bug fixes

Please have a look at the
CHANGELOG
for
details.

As always, feedback is welcome.

Cheers,
Leonardo Borges
www.leonardoborges.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




core.async: close! and control channels

2013-07-16 Thread Alan Shaw
It appears that you cannot call close! within a go block and so
to signal the end of input to a channel you have to use another channel
upon which the receiver can alt!.

Some channels that are not stateful, such as a plain copier, would
need no such mechanism. Or would it be good to use such a thing
so the channel will get collected?

Further, if I want to have a chain of coroutines pipelining data,
it would appear that control channels must be threaded through
all of them as long as at least one of them must be notified of
end of input.

Is any of this correct?

-A

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Vertigo: fast, idiomatic C-style structs

2013-07-16 Thread Zach Tellman
Yeah, one nice property of this is that all the underlying objects play
nicely with byte-streams [1], so it's trivial to do something like:

---

(def s (vertigo.core/wrap type "some-huge-file"))

(let [indices (sort-by #(vertigo.core/get-in s [% :foo :bar]) (range (count
s))]
  (doseq [idx indices]
(byte-streams/transfer (nth s idx) sorted-file {:append true})))

---

If there's framing information we won't be able to do this quite as
efficiently, but it shouldn't be too much more expensive.


[1] https://github.com/ztellman/byte-streams


On Mon, Jul 15, 2013 at 9:48 PM, kovas boguta wrote:

> Interesting. This seems like a pretty promising direction for the bottom
> of the big-data stack.
>
> A use case on my mind is sorting a big list of datastructures by key (or
> some set of keys/paths) .
>
> Once the data gets big, you need to do an external sort, which means tons
> of serialization round trips if implemented naively. Being able to just
> pluck out the values you need really helps in that case. Besides saving on
> the serialization overhead, it also cuts down on memory which means you can
> sort much bigger segments at a time, and complete the overall sort in fewer
> passes.
>
>
>
>
>
>
>
> On Mon, Jul 15, 2013 at 1:40 PM, Zach Tellman  wrote:
>
>> If you (vertigo.core/wrap "a-file-name"), that will use mmap under the
>> covers, so if no one's tried it, it's easy enough to start.
>>
>> With respect to non-fixed data layouts, that could be supported by a
>> library which parses the framing information, and then layers Vertigo atop
>> the actual data.  In effect, that's what Gloss [1] is going to become, so
>> keep watching the skies.
>>
>> Zach
>>
>> [1] https://github.com/ztellman/gloss
>>
>>
>> On Sun, Jul 14, 2013 at 9:16 PM, kovas boguta wrote:
>>
>>> This is pretty neat.
>>>
>>> Anyone try using this in conjunction with mmap?
>>>
>>> It would be nice to have some way to deal with strings & other
>>> variable-length data.
>>>
>>> I'm also curious if its possible to make the analog of this for
>>> fressian, basically to avoid unpacking objects that are not necessary for
>>> the computation at hand.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Jul 9, 2013 at 8:56 PM, Zach Tellman  wrote:
>>>
 Last year, I gave a talk at the Conj on my attempt to write an AI for
 the board game Go.  Two things I discovered is that it was hard to get
 predictable performance, but even once I made sure I had all the right type
 hints, there was still a lot of room at the bottom for performance
 improvements.  Towards the end [1], I mentioned a few ideas for
 improvements, one of which was simply using ByteBuffers rather than objects
 to host the data.  This would remove all the levels of indirection, giving
 much better cache coherency, and also allow for fast unsynchronized
 mutability when the situation called for it.

 So, ten months and several supporting libraries [2] [3] later, here it
 is: https://github.com/ztellman/vertigo

 At a high level, this library is useful whenever your datatype has a
 fixed layout and is used more than once.  Depending on your type, it will
 give you moderate to large memory savings, and if you're willing to forgo
 some of core library in favor of Vertigo's operators, you can get
 significant performance gains on batch operations.  And, in the cases where
 performance doesn't matter, it will behave exactly like any other Clojure
 data structure.

 I want to point out that something like this would be more or less
 impossible in Java; reading from an offset in a ByteBuffer without the
 compile-time inference and validation provided by this library would be
 pointlessly risky.  There's not a lot of low-level Clojure libraries, but
 there's an increasing amount of production usage where people are using
 Clojure for performance-sensitive work.  I'm looking forward to seeing what
 people do with Vertigo and libraries like it.

 Zach

 [1]
 http://www.youtube.com/watch?feature=player_detailpage&v=v5dYE0CMmHQ#t=1828s
 [2] https://github.com/ztellman/primitive-math
 [3] https://github.com/ztellman/byte-streams

 --
 --
 You received this message because you are subscribed to the Google
 Groups "Clojure" group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups "Clojure" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+unsubscr...@googlegroups.com.

 For more options, visit https://group

Re: Request for clojure help

2013-07-16 Thread Sean Corfield
On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard  wrote:
> (defn perms
>   ( [] [[]])

This is not pattern matching in Clojure. It defines an alternative
arity version of the function so that (perms) would return [[]].

>   ([xs]
>
>   (for [x xs p (perms (removeFirst x xs))] (cons x p))  )
>
> )

You need something like this:

(defn perms
  [xs]
  (if (seq xs)
(for [x xs p (perms (removeFirst x xs))] (cons x p))
[[]]))

--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Request for clojure help

2013-07-16 Thread Keith Maynard
(defn removeFirst
  [x xs]
  (if (= x (first xs)) (rest xs) (cons (first xs) (removeFirst x (rest 
xs)

(defn perms  
  ( [] [[]])
  ([xs]

  (for [x xs p (perms (removeFirst x xs))] (cons x p))  )

)

Good day,
I have been studying a functional approach to the design and analysis of 
algorithms. I am trying to generate permutations by performing a list 
comprehension to implement the following piece of haskell 


perms [] [[]]
perms [x:p | x<-xs, p<-perms(removeFirst x xs)] 

where 

removeFirst x [] = []
removeFirst  x (y:ys) | x == y   ys
  | otherwise  = y : removeFirst x ys

This is my attempt in clojure:

(defn removeFirst
  [x xs]
  (if (= x (first xs)) (rest xs) (cons (first xs) (removeFirst x (rest 
xs)

(defn perms  
  ( [] [[]])
  ([xs]

  (for [x xs p (*perms* (removeFirst x xs))] (cons x p))  ) ;; I have tried 
using *recur* instead of *perms* here , but clojure complains that 
   

 
;;I cannot recur there - I guess not in tail position

)

(perms [1 2 3])

===

This is the output I receive in the repl (*IntelliJ IDEA*)

#'user/removeFirst
user=>#'user/perms
user=> user=>()
user=> user=> user=>
=

This is how it looked on *lightTable*

(defn removeFirst
  [x xs]   *1 (1)*
  (if (= x (first xs)) (rest xs) (cons (first xs) (removeFirst x (rest 
xs) *1 (1) (1) (1) 1 (1)

*(defn perms  
  ( [] [])
  ( [xs]

  (for [x xs p (perms (removeFirst x xs))] (cons x p))) *() () () () ()*

)


(perms [1 2 3]) *()*

Any idea what's wrong?

Thanks

Keith

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Reid Draper
Derp, I fat-fingered my own library name in the subject :)

On Tuesday, July 16, 2013 2:18:54 PM UTC-5, Reid Draper wrote:
>
> I'm happy to announce the first non-snapshot version (0.1.0) of 
> simple-check, a QuickCheck inspired testing tool: 
> https://github.com/reiddraper/simple-check.
>
> simple-check is a fairly faithful port of a subset of Haskell's 
> QuickCheck, with some additional inspiration from Erlang QuickCheck. With 
> simple-check, you write your tests as a property that holds true for all 
> input to your function. So, supposing you were testing the `reverse` 
> function, you might say: for all vectors V, the reverse of the reverse of V 
> is equal to V. Further, reversing V preserves it's count. simple-check will 
> then test your property with some number of random input. If the property 
> fails, simple-check will attempt to 'shrink' the input, finding smaller 
> input for which the test still fails, where 'smaller' is data-type 
> specific. More documentation is available in the README, and API 
> documentation: http://reiddraper.github.io/simple-check/. Enjoy, and 
> please don't hesitate with feedback, positive or negative.
>
> Reid
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Reid Draper
I'm happy to announce the first non-snapshot version (0.1.0) of 
simple-check, a QuickCheck inspired testing 
tool: https://github.com/reiddraper/simple-check.

simple-check is a fairly faithful port of a subset of Haskell's QuickCheck, 
with some additional inspiration from Erlang QuickCheck. With simple-check, 
you write your tests as a property that holds true for all input to your 
function. So, supposing you were testing the `reverse` function, you might 
say: for all vectors V, the reverse of the reverse of V is equal to V. 
Further, reversing V preserves it's count. simple-check will then test your 
property with some number of random input. If the property fails, 
simple-check will attempt to 'shrink' the input, finding smaller input for 
which the test still fails, where 'smaller' is data-type specific. More 
documentation is available in the README, and API 
documentation: http://reiddraper.github.io/simple-check/. Enjoy, and please 
don't hesitate with feedback, positive or negative.

Reid

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] - 17th tutorial - Enlive by REPLing - of the modern-cljs series

2013-07-16 Thread Giacomo Cosenza
Thanks Greg, your appreciation is very helpful in finding the energy to go on 
creating new tutorials for the series. 
thanks so much again

Mimmo

On Jul 16, 2013, at 6:20 PM, Greg wrote:

> Excellent work as usual Mimmo!
> 
> I continue to find your tutorials very helpful. Thank you very much for 
> creating them!
> 
> -Greg
> 
> --
> Please do not email me anything that you are not comfortable also sharing 
> with the NSA.
> 
> On Jul 14, 2013, at 11:53 AM, Mimmo Cosenza  wrote:
> 
>> Hi all, I just published the 17th tutorial of the modern-cljs series. 
>> 
>> https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-17.md
>> 
>> It shows how to integrate input validators in a form. To be respectful of 
>> the progressive enhancement strategy, in this tutorial I started 
>> implementing the validators into the server-side code by using Enlive. In 
>> the next tutorial I'm going to do the same thing by using Enfocus.
>> 
>> My best
>> 
>> Mimmo
>>  
>> 
>> -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
> 
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-16 Thread Dragan Djuric
Hi Ben and everyone who participated in the discussion. Most of the issues 
we have been discussed (most notably mdo and agnostic return) have been 
implemented in the newly released version 0.3.0. No macrology was necessary 
for agnostic return :)
Please try the new version and post your feedback.

On Wednesday, July 3, 2013 9:31:58 PM UTC+2, Ben wrote:
>
> On Wed, Jul 3, 2013 at 7:49 AM, Dragan Djuric 
> > wrote:
>
>> Monads as a Haskell construct is what the previously mentioned laws 
>> describe. Monads in category theory are defined in a category X as a triple 
>> (T, n, m) where T is a functor and m and n certan natural transformations 
>> such that certan diagrams commute. In that sense, I am not sure that even 
>> Haskell's implementation is perfectly clean.
>>
>> There's a lot of nitpicking to be done, but, that's not the point, and we 
>> are digressing a bit. The point is that in Fluokitten, you are expected to 
>> work within the certain monad as you agree, and since there is no type 
>> checking on the value that a function returns, it is the responsibility of 
>> the developer to make sure that it makes sense as in Clojure generally. It 
>> is fairly easy to do by passing a parameter to f that pure can use, if f 
>> implementation needs to be agnostic to the actual monad that it will be 
>> called from.
>>
>> There are other approaches, so the programmer can make a choice that is 
>> the best fit for the problem at hand.
>>  
>> Even in the example that you gave from your library, what stops the 
>> programmer to shoot himself in the foot by doing basically the same thing 
>> that we are talking about here:
>>
>> (defn f [g] (comp atom g g))
>>
>> (require '[monads.maybe :as m])
>>
>> (def mc (>>= (return 3) (f inc)))
>>
>> (run-monad m/m mc)
>>
>> What is the result if f is broken (in the context of the monad m/m in 
>> this case)? I didn't try it, so I may be wrong, but I doubt that the 
>> Clojure compiler complains about that one. 
>>
>
> Of course the compiler doesn't complain, how could it? I'm not asking you 
> to have the clojure compiler complain. I'm attempting to point out that 
> your library makes it impossible to write generic functions involving 
> monads. That is, for fluokitten, you *have* to write f as something like 
> (comp atom g g) or (comp vector g g) or (comp just g g) or whatever. You 
> don't have the option of writing (comp return g g) and having that work 
> right when the function is run in *multiple* monads. Which is a major 
> expressivity drawback, in my mind. This is basically the same thing as 
> comes up with Armando Blancas' morph library, which is, like yours, based 
> on protocols.
>
> The expressivity point is the key, not the nonexistent haskell-in-clojure 
> typechecker. That's why I asked the question I asked in my first email: 
> whether it's possible to write this function (which I've desugared):
>  
> (defn tst-reader [f] (>>= ask (fn [env] (>>= (lift (f env)) (fn [_] (>>= 
> (return (println "here I am")) (fn [_] (return v
>
> which can operate in an instance of the reader monad transformer 
> parametrized by an *arbitrary* inner monad---so that you don't know in 
> advance what the "return" or ">>=" should be (and you don't know in advance 
> what the "lift" should be, since more than one interpretation of the reader 
> monad is possible---all that's required here is that the monad support an 
> "ask" operation). I suppose you could thread specimen special return, bind, 
> ask, and lift functions through (and if you used fancy macrology to do 
> that, you'd have the core.monads approach), but that's really quite 
> cumbersome.
>
> IMO, the ability to write code like that is a large part of what makes 
> monadic abstraction powerful and interesting.
>
> -- 
> Ben Wolfson
> "Human kind has used its intelligence to vary the flavour of drinks, which 
> may be sweet, aromatic, fermented or spirit-based. ... Family and social 
> life also offer numerous other occasions to consume drinks for pleasure." 
> [Larousse, "Drink" entry]
>
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[ANN] Fluokitten 0.3.0 - Monads and more - now features

2013-07-16 Thread Dragan Djuric
Fluokitten - Category Theory in Idiomatic Clojure has just been upgraded to 
0.3.0

Get started guide: 
http://fluokitten.uncomplicate.org/articles/getting_started.html
The library is in the clojars, so lein will pick it up easily.

There are lot of new features:

   - mdo macro as a syntactic sugar for chained bind calls.
   - Implicit context (monad, functor, applicative) supported inside the 
   dynamic scope of bind and all functions/macros that depend on it (>>=, mdo 
   etc.)
   - return (also called unit) function, a version of pure that uses the 
   implicit context.
   - with-context macro enables setting the implicit context for arbitrary 
   body of expressions.
   - >=> and <=< functions that compose monadic functions.

The documentation and the tutorials have been improved and updated.

Please check the existing tutorials out and post your thoughts here. Your 
feedback is very valuable for making this library better.


-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] - 17th tutorial - Enlive by REPLing - of the modern-cljs series

2013-07-16 Thread Greg
Excellent work as usual Mimmo!

I continue to find your tutorials very helpful. Thank you very much for 
creating them!

-Greg

--
Please do not email me anything that you are not comfortable also sharing with 
the NSA.

On Jul 14, 2013, at 11:53 AM, Mimmo Cosenza  wrote:

> Hi all, I just published the 17th tutorial of the modern-cljs series. 
> 
> https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-17.md
> 
> It shows how to integrate input validators in a form. To be respectful of the 
> progressive enhancement strategy, in this tutorial I started implementing the 
> validators into the server-side code by using Enlive. In the next tutorial 
> I'm going to do the same thing by using Enfocus.
> 
> My best
> 
> Mimmo
>  
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAuth2

2013-07-16 Thread Bastien
Hi all,

Dave Della Costa  writes:

> Here are some more in-depth examples:
>
> https://github.com/ddellacosta/friend-oauth2-examples

Thanks for this examples, very useful!

I'm trying to finish integrating friend within a Luminus-based
webapp project, but I'm stuck, I'd glad to get some help.

Using handler/site for the auth routes (as demonstrated in the github
repo above) works fine.  I can point to http://localhost:3000/repos,
it asks for my github authorization and returns the list of my repos.

Now if I use lib-noir middleware like this:

(defn my-friend [handler]
  (friend/authenticate
   handler
   {:allow-anon? true
:workflows [(oauth2/workflow
 {:client-config client-config
  :uri-config uri-config
  :access-token-parsefn access-token-parsefn
  :config-auth config-auth})]}))

(def app (middleware/app-handler
   [auth-routes home-routes app-routes]
   :middleware [my-friend]   ;; <<< Added
   :access-rules []))

(def war-handler (middleware/war-handler app))

... then there is an infinite redirect to github (error 403.)

Where should I wrap the friend/authenticate middleware when
using lib-noir's war-handler?

Thanks in advance for any pointer!

-- 
 Bastien

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Thanks everyone for contributing.

=> (clojure.string/join "," (map #(str \" % \") my-strings)) works 
perfectly for my case and that will do for now. 

/Sunil.

On Tuesday, July 16, 2013 3:52:03 PM UTC+1, Luc wrote:
>
> I assume here that the strings are already escaped. Which might not be 
> true at all. 
> pr-sr is safer in this regard but 6 times slower. 
>
> Luc P. 
>
> > (apply str (interpose "," (map #(str "\"" % "\"") [...]))) 
> > 
> > Not the most efficient way but short. 
> > 
> > Luc P. 
> > 
> > 
> > > Hi All, 
> > > 
> > > I'm new to Clojure - 
> > > 
> > > I'm defining a vector containing string values. The requirement for me 
> is 
> > > to retrieve the String values separated by comma from the input 
> vector. 
> > > 
> > > Example: 
> > > 
> > > => (def my-strings ["one" "two" "three"]) 
> > > 
> > > ;; My expected output should be ;; *"one", "two", "three"* 
> > > 
> > > I tried interpose and join as below 
> > > 
> > > => (apply str (interpose "," my-strings)) 
> > > 
> > > => (clojure.string/join "," my-strings) 
> > > 
> > > both returning as "one,two,three" but I need each string surrounded by 
> > > double quotes "" like in my example example. 
> > > 
> > > /Sunil. 
> > > 
> > > 
> > > 
> > >   
> > > 
> > > -- 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "Clojure" group. 
> > > To post to this group, send email to clo...@googlegroups.com 
> > > Note that posts from new members are moderated - please be patient 
> with your first post. 
> > > To unsubscribe from this group, send email to 
> > > clojure+u...@googlegroups.com  
> > > For more options, visit this group at 
> > > http://groups.google.com/group/clojure?hl=en 
> > > --- 
> > > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com . 
> > > For more options, visit https://groups.google.com/groups/opt_out. 
> > > 
> > > 
> > > 
> > -- 
> > Softaddicts> sent by ibisMail 
> from my ipad! 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
> > 
> -- 
> Softaddicts> sent by ibisMail from 
> my ipad! 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAuth2

2013-07-16 Thread Steven Degutis
I heard good things about friend , so I
tried to use it for OpenID (to sign-in with Google). But I couldn't figure
out how, so I just used openid4java 
.


On Mon, Jul 15, 2013 at 8:57 PM, Plínio Balduino wrote:

> Hi there
>
> What are you using to authenticate with Google, Facebook, GitHub or
> Twitter?
>
> Thanks
>
> Plínio
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: is it possible to join on lazy seqs?

2013-07-16 Thread mond
I am trying to produce a list of records where the keys match. It makes 
sense to me ;-)

The examples from the docs show this:

*(join animals personalities {:kind :species})
*
and the third argument is a key map to show which fields from the two 
collections should be treated as the same key
*
*
On Tuesday, July 16, 2013 4:48:25 PM UTC+2, Michael Klishin wrote:
>
> 2013/7/16 mond >
>
>> check-delta-feeds.core=> (set/join changed-records feed-entries {:ID 
>> :dh-uuid})
>> ClassCastException clojure.lang.LazySeq cannot be cast to java.util.Map 
>>  clojure.lang.RT.find (RT.java:733)
>>
>
> You can use clojure.set/join on lazy sequences but joining a list 
> (produced by a sequence) with
> a map makes no sense.
>
> You have {:ID :dh-uuid} in the code above. Maybe you want #{:ID :dh-uuid}, 
> another set?
> -- 
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
I assume here that the strings are already escaped. Which might not be true at 
all.
pr-sr is safer in this regard but 6 times slower.

Luc P.

> (apply str (interpose "," (map #(str "\"" % "\"") [...])))
> 
> Not the most efficient way but short.
> 
> Luc P.
> 
> 
> > Hi All,
> > 
> > I'm new to Clojure - 
> > 
> > I'm defining a vector containing string values. The requirement for me is 
> > to retrieve the String values separated by comma from the input vector.
> > 
> > Example: 
> > 
> > => (def my-strings ["one" "two" "three"])
> > 
> > ;; My expected output should be ;; *"one", "two", "three"* 
> > 
> > I tried interpose and join as below
> > 
> > => (apply str (interpose "," my-strings))
> > 
> > => (clojure.string/join "," my-strings)
> > 
> > both returning as "one,two,three" but I need each string surrounded by 
> > double quotes "" like in my example example.
> > 
> > /Sunil.
> > 
> > 
> > 
> >  
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with 
> > your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > --- 
> > You received this message because you are subscribed to the Google Groups 
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> > 
> > 
> > 
> --
> Softaddicts sent by ibisMail from my ipad!
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
Pr-str is very slow compared to string concats
Luc P.


> Jay beat me to it. :)
> 
> I'll add the documentation for pr-str:
> http://clojuredocs.org/clojure_core/clojure.core/pr-str
> 
> Jonathan
> 
> 
> On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields  wrote:
> 
> > this seems to do what you want: (clojure.string/join ", " (map pr-str
> > my-strings))
> >
> >
> > On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey wrote:
> >
> >> (apply str "\"" (interpose "\", \"" my-strings) "\"") might work...
> >>
> >>
> >> On Tue, Jul 16, 2013 at 9:53 AM,  wrote:
> >>
> >>> Hi All,
> >>>
> >>> I'm new to Clojure -
> >>>
> >>> I'm defining a vector containing string values. The requirement for me
> >>> is to retrieve the String values separated by comma from the input vector.
> >>>
> >>> Example:
> >>>
> >>> => (def my-strings ["one" "two" "three"])
> >>>
> >>> ;; My expected output should be ;; *"one", "two", "three"*
> >>>
> >>> I tried interpose and join as below
> >>>
> >>> => (apply str (interpose "," my-strings))
> >>>
> >>> => (clojure.string/join "," my-strings)
> >>>
> >>> both returning as "one,two,three" but I need each string surrounded by
> >>> double quotes "" like in my example example.
> >>>
> >>> /Sunil.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Clojure" group.
> >>> To post to this group, send email to clojure@googlegroups.com
> >>> Note that posts from new members are moderated - please be patient with
> >>> your first post.
> >>> To unsubscribe from this group, send email to
> >>> clojure+unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/clojure?hl=en
> >>> ---
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Clojure" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> >>> an email to clojure+unsubscr...@googlegroups.com.
> >>> For more options, visit https://groups.google.com/groups/opt_out.
> >>>
> >>>
> >>>
> >>
> >>  --
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Clojure" group.
> >> To post to this group, send email to clojure@googlegroups.com
> >> Note that posts from new members are moderated - please be patient with
> >> your first post.
> >> To unsubscribe from this group, send email to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure?hl=en
> >> ---
> >> You received this message because you are subscribed to the Google Groups
> >> "Clojure" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to clojure+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >>
> >
> >  --
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> > your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "Clojure" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and s

Re: is it possible to join on lazy seqs?

2013-07-16 Thread Michael Klishin
2013/7/16 mond 

> check-delta-feeds.core=> (set/join changed-records feed-entries {:ID
> :dh-uuid})
> ClassCastException clojure.lang.LazySeq cannot be cast to java.util.Map
>  clojure.lang.RT.find (RT.java:733)
>

You can use clojure.set/join on lazy sequences but joining a list (produced
by a sequence) with
a map makes no sense.

You have {:ID :dh-uuid} in the code above. Maybe you want #{:ID :dh-uuid},
another set?
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




is it possible to join on lazy seqs?

2013-07-16 Thread mond
Sorry if this is a RTFM style question ... this is what I have in terms of 
types and was wondering if there is another form of join or another library 
/ collection combination that can achieve the same relational join?

Thanks in advance,

Ray

check-delta-feeds.core=> (def changed-records (map find-changed-records 
(set/select #(= (:entity %) (entity-names :project))  query-parts)))   

#'check-delta-feeds.core/changed-records
check-delta-feeds.core=>check-delta-feeds.core=> 
check-delta-feeds.core=> (def feed-entries (obtain-feed-entries 
(fetch-atom-feed-until tgb-feed-url until-datetime)))
#'check-delta-feeds.core/feed-entries
check-delta-feeds.core=> (type changed-records )
clojure.lang.LazySeq
check-delta-feeds.core=> (type feed-entries)
clojure.lang.LazySeq
check-delta-feeds.core=> (set/join changed-records feed-entries {:ID 
:dh-uuid})
ClassCastException clojure.lang.LazySeq cannot be cast to java.util.Map 
 clojure.lang.RT.find (RT.java:733)



-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
(apply str (interpose "," (map #(str "\"" % "\"") [...])))

Not the most efficient way but short.

Luc P.


> Hi All,
> 
> I'm new to Clojure - 
> 
> I'm defining a vector containing string values. The requirement for me is 
> to retrieve the String values separated by comma from the input vector.
> 
> Example: 
> 
> => (def my-strings ["one" "two" "three"])
> 
> ;; My expected output should be ;; *"one", "two", "three"* 
> 
> I tried interpose and join as below
> 
> => (apply str (interpose "," my-strings))
> 
> => (clojure.string/join "," my-strings)
> 
> both returning as "one,two,three" but I need each string surrounded by 
> double quotes "" like in my example example.
> 
> /Sunil.
> 
> 
> 
>  
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Jonathan Fischer Friberg
Jay beat me to it. :)

I'll add the documentation for pr-str:
http://clojuredocs.org/clojure_core/clojure.core/pr-str

Jonathan


On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields  wrote:

> this seems to do what you want: (clojure.string/join ", " (map pr-str
> my-strings))
>
>
> On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey wrote:
>
>> (apply str "\"" (interpose "\", \"" my-strings) "\"") might work...
>>
>>
>> On Tue, Jul 16, 2013 at 9:53 AM,  wrote:
>>
>>> Hi All,
>>>
>>> I'm new to Clojure -
>>>
>>> I'm defining a vector containing string values. The requirement for me
>>> is to retrieve the String values separated by comma from the input vector.
>>>
>>> Example:
>>>
>>> => (def my-strings ["one" "two" "three"])
>>>
>>> ;; My expected output should be ;; *"one", "two", "three"*
>>>
>>> I tried interpose and join as below
>>>
>>> => (apply str (interpose "," my-strings))
>>>
>>> => (clojure.string/join "," my-strings)
>>>
>>> both returning as "one,two,three" but I need each string surrounded by
>>> double quotes "" like in my example example.
>>>
>>> /Sunil.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojure@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Jay Fields
this seems to do what you want: (clojure.string/join ", " (map pr-str
my-strings))


On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey  wrote:

> (apply str "\"" (interpose "\", \"" my-strings) "\"") might work...
>
>
> On Tue, Jul 16, 2013 at 9:53 AM,  wrote:
>
>> Hi All,
>>
>> I'm new to Clojure -
>>
>> I'm defining a vector containing string values. The requirement for me is
>> to retrieve the String values separated by comma from the input vector.
>>
>> Example:
>>
>> => (def my-strings ["one" "two" "three"])
>>
>> ;; My expected output should be ;; *"one", "two", "three"*
>>
>> I tried interpose and join as below
>>
>> => (apply str (interpose "," my-strings))
>>
>> => (clojure.string/join "," my-strings)
>>
>> both returning as "one,two,three" but I need each string surrounded by
>> double quotes "" like in my example example.
>>
>> /Sunil.
>>
>>
>>
>>
>>
>> --
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Maximilian Karasz
hi,

i might be wrong but it seems you're looking for something like 
https://github.com/clojure/data.csv

cheers,

-Max

On Jul 16, 2013, at 3:53 PM, sunilmu...@gmail.com wrote:

> Hi All,
> 
> I'm new to Clojure - 
> 
> I'm defining a vector containing string values. The requirement for me is to 
> retrieve the String values separated by comma from the input vector.
> 
> Example: 
> 
> => (def my-strings ["one" "two" "three"])
> 
> ;; My expected output should be ;; "one", "two", "three" 
> 
> I tried interpose and join as below
> 
> => (apply str (interpose "," my-strings))
> 
> => (clojure.string/join "," my-strings)
> 
> both returning as "one,two,three" but I need each string surrounded by double 
> quotes "" like in my example example.
> 
> /Sunil.
> 
> 
> 
>  
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Comma separated String values from vector

2013-07-16 Thread Cedric Greevey
(apply str "\"" (interpose "\", \"" my-strings) "\"") might work...


On Tue, Jul 16, 2013 at 9:53 AM,  wrote:

> Hi All,
>
> I'm new to Clojure -
>
> I'm defining a vector containing string values. The requirement for me is
> to retrieve the String values separated by comma from the input vector.
>
> Example:
>
> => (def my-strings ["one" "two" "three"])
>
> ;; My expected output should be ;; *"one", "two", "three"*
>
> I tried interpose and join as below
>
> => (apply str (interpose "," my-strings))
>
> => (clojure.string/join "," my-strings)
>
> both returning as "one,two,three" but I need each string surrounded by
> double quotes "" like in my example example.
>
> /Sunil.
>
>
>
>
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Hi All,

I'm new to Clojure - 

I'm defining a vector containing string values. The requirement for me is 
to retrieve the String values separated by comma from the input vector.

Example: 

=> (def my-strings ["one" "two" "three"])

;; My expected output should be ;; *"one", "two", "three"* 

I tried interpose and join as below

=> (apply str (interpose "," my-strings))

=> (clojure.string/join "," my-strings)

both returning as "one,two,three" but I need each string surrounded by 
double quotes "" like in my example example.

/Sunil.



 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAuth2

2013-07-16 Thread Plínio Balduino
Thank you =)

On Tue, Jul 16, 2013 at 6:47 AM, Dave Della Costa  wrote:
> Here are some more in-depth examples:
>
> https://github.com/ddellacosta/friend-oauth2-examples
>
> Please do use version 0.0.4 or above as anti-CSRF protection is
> incorporated.  I still owe Chas a pull request with an up to date
> version of friend-oauth2.
>
> Please note, it is in development, still rather alpha, and there are
> still some deficiencies I am working through now.  Depending on what you
> are trying to do, you may also want to take a look at:
>
> https://github.com/DerGuteMoritz/clj-oauth2
>
> DD
>
> (2013/07/16 15:36), Bastien wrote:
>> Hi Plínio,
>>
>> Plínio Balduino  writes:
>>
>>> What are you using to authenticate with Google, Facebook, GitHub or
>>> Twitter?
>>
>> I'm experimenting with "friend":
>>
>> https://github.com/cemerick/friend
>> http://friend-demo.herokuapp.com/
>>
>> HTH,
>>
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ClojureScript] core.async - IOC in go blocks

2013-07-16 Thread David Nolen
Yes that won't work. If something locks up the JavaScript process with an
infinite loop those other go blocks will never get a chance to run. I
believe even wrapping the final loop/recur in a go block won't help the
issue.

But I don't think this is a limitation in practice.


On Tue, Jul 16, 2013 at 8:24 AM, Sam Aaron  wrote:

> Hi there,
>
> I'm trying to understand how the new core.async go blocks work in a single
> threaded environment such as Javascript. I'm slowly working through the
> implementation, but it's pretty hairy and tough going.
>
> My current question is how the inversion of control works. In David's
> (excellent) CSP blog post he demonstrated how you can have multiple go
> blocks running concurrently:
>
> (go (loop [] (! c 2) (recur)))
> (go (loop [] (! c 3) (recur)))
>
> I'm unsure how this interleaves with standard ClojureScript code. For
> example consider the following
>
> (go (loop [] (! c 2) (recur)))
> (go (loop [] (! c 3) (recur)))
>
> (loop [] (recur))
>
> Here, we have two go blocks followed by an infinite loop that's not in a
> go block. How does the code in the go blocks ever get 'unparked'?
>
> Sam
>
> ---
> http://sam.aaron.name
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Mike Longworth
 Thanks Tassilo,
  As you point out, if I move the nested function outside the go then the 
problem is fixed.
This test case is only a simplification of the original code so I can't do 
this in my actual code however after much head scratching I now understand 
the purpose of take! and it addresses my issue:

test case solution:
 

> (defn tdw2 [id t]
>   (let [id2 (go ( c (chan)]
> (window/setTimeout (fn [] (go (>! c ( c
> ))

 
Required solution:

> (defn tdw [id t]
>   (let [c (chan)]
> (take! (td id 500) (fn [id2] (window/setTimeout (fn [] (go (>! c 
> id2))) t)))
> c
> ))

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: OAuth2

2013-07-16 Thread Dave Della Costa
Here are some more in-depth examples:

https://github.com/ddellacosta/friend-oauth2-examples

Please do use version 0.0.4 or above as anti-CSRF protection is
incorporated.  I still owe Chas a pull request with an up to date
version of friend-oauth2.

Please note, it is in development, still rather alpha, and there are
still some deficiencies I am working through now.  Depending on what you
are trying to do, you may also want to take a look at:

https://github.com/DerGuteMoritz/clj-oauth2

DD

(2013/07/16 15:36), Bastien wrote:
> Hi Plínio,
> 
> Plínio Balduino  writes:
> 
>> What are you using to authenticate with Google, Facebook, GitHub or
>> Twitter?
> 
> I'm experimenting with "friend":
> 
> https://github.com/cemerick/friend
> http://friend-demo.herokuapp.com/
> 
> HTH,
> 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Tassilo Horn
Mike Longworth  writes:

> I'm trying to use cljs.core.async to convert async code to
> synchronous, I've hit a problem chaining some calls. I'm getting a
> runtime state machine problem, here is a test case for the issue:

Since the go macro transforms its body, you cannot have function defs
using ! internally in it.  Likewise, you cannot call functions from
inside it that use !  cause those calls would be invisible to the
macro.

These limitations are discussed by Rich at the latest think relevance
podcast.

  
http://thinkrelevance.com/blog/2013/07/10/rich-hickey-and-core-async-podcast-episode-035

Bye,
Tassilo

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Mike Longworth
I'm trying to use cljs.core.async to convert async code to synchronous, 
I've hit a problem chaining some calls. I'm getting a runtime state machine 
problem, here is a test case for the issue:

(defn td [id t]
>   (let [c (chan)]
> (window/setTimeout (fn [] (go (>! c (name id t)
> c
> ))
>
> (defn tdw [id t]
>   (go
> (let [id2 (   c (chan)]
>   (window/setTimeout (fn [] (go (>! c id2))) t)
>   (   ))) 
>
> (defn start []
>   (let [p (fn [v] (.debug js/console (str "v: " v)))]
> (go
>   (p (   (p (   (p (   )))
>
> The output is :
v: 1 
v: 2 

   1. Uncaught ReferenceError: state_machine__5113__auto$1 is not 
   defined 


tdw fails in its setTimeout callback.
Is this a legal use case? Have I made a fundamental mistake?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.