Re: Pmap on hash maps

2016-04-17 Thread Timothy Baldridge
The cost of creating that extra collection will be vastly overshadowed by
the cost of running pmap. pmap involves the use of several locks, and
thread co-ordination primitives, these will most likely be orders of
magnitude more expensive than an extra allocation.

Timothy

On Sun, Apr 17, 2016 at 12:38 AM, JvJ  wrote:

> Perhaps I should have rephrased.  I meant calling it in such a way that
> the result is a hash map.
>
> I know I could do something like:
>
> (into a (pmap f a))
>
> This will give the same result, but there's an extra collection in there
> that I'm not sure is necessary.
>
>
> On Saturday, 16 April 2016 20:15:51 UTC-7, Alex Miller wrote:
>>
>> You can call pmap on hash maps!
>
> --
> 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/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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/d/optout.


remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
Hi,

I just published a project [1] to clojars and neglected to use an
organization.  I don't really want to claim a top-level name for the
project.  Is there a way to unpublish, remove or otherwise deprecate a
project that I've pushed to clojars.org?  Sorry if it's obvious and I'm not
seeing it in the clojars interface.


Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
Forgot the link (though it shouldn't matter):

[1] https://clojars.org/com.github.kyleburton/repl-from-java

On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton 
wrote:

> Hi,
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
> Kyle
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Sean Corfield
I assume this is the one that should not be there:

 

https://clojars.org/repl-from-java

 

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


 

On 4/17/16, 9:58 AM, "Kyle R. Burton"  wrote:

 

Forgot the link (though it shouldn't matter):

 

[1] https://clojars.org/com.github.kyleburton/repl-from-java

 

On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton  wrote:

Hi,

 

I just published a project [1] to clojars and neglected to use an organization. 
 I don't really want to claim a top-level name for the project.  Is there a way 
to unpublish, remove or otherwise deprecate a project that I've pushed to 
clojars.org?  Sorry if it's obvious and I'm not seeing it in the clojars 
interface.

 

 

Kyle

 

-- 
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/d/optout.


Re: Pmap on hash maps

2016-04-17 Thread JvJ
Orders of magnitude?  Is it even worth running things in parallel in this 
case?

On Sunday, 17 April 2016 07:20:30 UTC-7, tbc++ wrote:
>
> The cost of creating that extra collection will be vastly overshadowed by 
> the cost of running pmap. pmap involves the use of several locks, and 
> thread co-ordination primitives, these will most likely be orders of 
> magnitude more expensive than an extra allocation. 
>
> Timothy
>
> On Sun, Apr 17, 2016 at 12:38 AM, JvJ > 
> wrote:
>
>> Perhaps I should have rephrased.  I meant calling it in such a way that 
>> the result is a hash map.
>>
>> I know I could do something like:
>>
>> (into a (pmap f a))
>>
>> This will give the same result, but there's an extra collection in there 
>> that I'm not sure is necessary.
>>
>>
>> On Saturday, 16 April 2016 20:15:51 UTC-7, Alex Miller wrote:
>>>
>>> You can call pmap on hash maps!
>>
>> -- 
>> 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/d/optout.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

-- 
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/d/optout.


Re: Pmap on hash maps

2016-04-17 Thread adrian . medina
It depends on your specific use case. Sometimes the overhead of parallelism 
overshadows the performance gains. The rule of thumb for any language is to 
first identify bottlenecks in your code through profiling and optimize 
accordingly. 

For a concrete example, a while ago I was created a program with Clojure 
which interprets 3D game assets in one format and re-exports them to 
another format. I needed to run this on thousands of files. After 
profiling, I found that parallelizing the conversion process for one asset 
was a red herring as I could barely saturate one thread before it finished. 
So instead of parallelizing the internals of the conversion process, I 
found it was much more efficient (and less complex) to just run the 
conversion process in parallel on many assets at the same time. This meant 
I could scale the import/export procedure linearly with CPUs, and it was 
incredibly simple to do with Clojure out of the box without increasing the 
complexity of the program at all. 

I know this is a relatively obvious use of parallelism, but my point is 
that while sometimes it's tempting to try to parallelize things all the way 
down my experience has taught me that parallelism is often more important 
at the I/O boundaries of your program, whatever that may be. 

On Sunday, April 17, 2016 at 5:23:32 PM UTC-4, JvJ wrote:
>
> Orders of magnitude?  Is it even worth running things in parallel in this 
> case?
>
> On Sunday, 17 April 2016 07:20:30 UTC-7, tbc++ wrote:
>>
>> The cost of creating that extra collection will be vastly overshadowed by 
>> the cost of running pmap. pmap involves the use of several locks, and 
>> thread co-ordination primitives, these will most likely be orders of 
>> magnitude more expensive than an extra allocation. 
>>
>> Timothy
>>
>> On Sun, Apr 17, 2016 at 12:38 AM, JvJ  wrote:
>>
>>> Perhaps I should have rephrased.  I meant calling it in such a way that 
>>> the result is a hash map.
>>>
>>> I know I could do something like:
>>>
>>> (into a (pmap f a))
>>>
>>> This will give the same result, but there's an extra collection in there 
>>> that I'm not sure is necessary.
>>>
>>>
>>> On Saturday, 16 April 2016 20:15:51 UTC-7, Alex Miller wrote:

 You can call pmap on hash maps!
>>>
>>> -- 
>>> 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/d/optout.
>>>
>>
>>
>>
>> -- 
>> “One of the main causes of the fall of the Roman Empire was that–lacking 
>> zero–they had no way to indicate successful termination of their C 
>> programs.”
>> (Robert Firth) 
>>
>

-- 
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/d/optout.


ANN: turboshrimp 2.0.2, for control of Parrot AR.Drone

2016-04-17 Thread John Wiseman
I've released a new version of turboshrimp, my library to control the
Parrot AR.Drone.

https://github.com/wiseman/turboshrimp

Version 2.0.2 includes the following:

   - A more consistent API. E.g., instead of (drone/command drone :animate
   :flip-left) to make the drone do a flip in mid-air, you can use
   (drone/animate :flip-left).
   - Much more comprehensive documentation at
   http://wiseman.github.io/turboshrimp/, including an example of how to
   process a drone's video stream with a latency reduction queue.

Turboshrimp is compatible with clojure-android.
https://github.com/wiseman/shrimpdroid is a complete android app that you
can use to fly a drone.

-- 
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/d/optout.


Reagent html tags

2016-04-17 Thread 'Alan Forrester' via Clojure
I am trying to use reagent for a personal project, but I have a problem with 
html tags. The keywords corresponding to html tags are not the same as the html 
tags with a colon in front of them. For example, the onclick html tag becomes 
:on-click in reagent. So I would like to see a list of which html tags are 
available and what keywords correspond to them. I have looked at reagent’s 
documentation, and hiccup’s documentation and I can’t find any such list. Nor 
can I find such a list in any of the other sites I found while googling.

Does anybody know where I might find such a list?

Thanks,
Alan

-- 
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/d/optout.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
That's the one :)


Kyle

On Sunday, April 17, 2016, Sean Corfield  wrote:

> I assume this is the one that should not be there:
>
>
>
> https://clojars.org/repl-from-java
>
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
>
> On 4/17/16, 9:58 AM, "Kyle R. Burton"   on behalf of
> kyle.bur...@gmail.com
> > wrote:
>
>
>
> Forgot the link (though it shouldn't matter):
>
>
>
> [1] https://clojars.org/com.github.kyleburton/repl-from-java
>
>
>
> On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton  > wrote:
>
> Hi,
>
>
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
>
>
>
> Kyle
>
>
>
> --
> 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/d/optout.
>


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
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/d/optout.


Re: Reagent html tags

2016-04-17 Thread Mimmo Cosenza
onclick is not an html tag.

here is the event list of react. take into account that react events are 
camelCase like onClick

http://facebook.github.io/react/docs/events.html#supported-events 


and here is the explanation of the event system in react

http://facebook.github.io/react/docs/events.html 


reagent, as almost everything in clojure(script), is kebab case like 
this-is-a-name:

in my understanding any event available in react should be available (as 
keywordized kebab case) in reagent as well, but I did not used all of them and 
could be wrong.

mimmo

> On 18 Apr 2016, at 01:02, 'Alan Forrester' via Clojure 
>  wrote:
> 
> I am trying to use reagent for a personal project, but I have a problem with 
> html tags. The keywords corresponding to html tags are not the same as the 
> html tags with a colon in front of them. For example, the onclick html tag 
> becomes :on-click in reagent. So I would like to see a list of which html 
> tags are available and what keywords correspond to them. I have looked at 
> reagent’s documentation, and hiccup’s documentation and I can’t find any such 
> list. Nor can I find such a list in any of the other sites I found while 
> googling.
> 
> Does anybody know where I might find such a list?
> 
> Thanks,
> Alan
> 
> -- 
> 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/d/optout.

-- 
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/d/optout.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Toby Crawley
For details on deleting or deprecating jars, please see:
https://github.com/clojars/clojars-web/wiki/About#how-do-i-delete-a-jar

We intentionally don't allow users to delete their own jars via the
interface, instead requiring an admin to do it. This is to help
prevent breaking the builds for projects that may be depending on the
jar.

For cases like this though, where you have a jar with few or no
downloads, we're generally happy to do the deletion. Can you please
file an issue at https://github.com/clojars/clojars-web/issues?

And while we're on the subject, here's a related PSA: if you
accidentally push private data in a jar and need that deleted, please
email cont...@clojars.org *instead* of filing an issue, since the
issues are public.

- Toby

On Sun, Apr 17, 2016 at 7:31 PM, Kyle R. Burton  wrote:
> That's the one :)
>
>
> Kyle
>
>
> On Sunday, April 17, 2016, Sean Corfield  wrote:
>>
>> I assume this is the one that should not be there:
>>
>>
>>
>> https://clojars.org/repl-from-java
>>
>>
>>
>> Sean Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>>
>> "If you're not annoying somebody, you're not really alive."
>> -- Margaret Atwood
>>
>>
>>
>> On 4/17/16, 9:58 AM, "Kyle R. Burton" > of kyle.bur...@gmail.com> wrote:
>>
>>
>>
>> Forgot the link (though it shouldn't matter):
>>
>>
>>
>> [1] https://clojars.org/com.github.kyleburton/repl-from-java
>>
>>
>>
>> On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton 
>> wrote:
>>
>> Hi,
>>
>>
>>
>> I just published a project [1] to clojars and neglected to use an
>> organization.  I don't really want to claim a top-level name for the
>> project.  Is there a way to unpublish, remove or otherwise deprecate a
>> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm not
>> seeing it in the clojars interface.
>>
>>
>>
>>
>>
>> Kyle
>>
>>
>>
>> --
>> 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/d/optout.
>
>
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>
> --
> 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/d/optout.

-- 
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/d/optout.


Re: Return from a function

2016-04-17 Thread Brian Marick



Colin Yates wrote:

Also, you might want to invest in either core.typed or prismatic
schema for validating shapes of data. I think Brian Marick of Midje
fame has a similar answer but I can't recall the name.


https://github.com/marick/structural-typing/

--
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/d/optout.


ANN: Structural-typing 2.0.1

2016-04-17 Thread Brian Marick
"Structural typing for Clojure, somewhat inspired by Elm. Tailored to 
'flow-style' programming, where complex structures flow through a series 
of functions, each of which makes a smallish change. Can also be used in 
testing tools and the like that need to describe how a nested structure 
differs from a description."


Like prismatic/schema, but coming from a different tradition.

https://github.com/marick/structural-typing/

[Re: 2.X. It is extremely unlikely that you'll have to change client 
code, unless you used functions that were explicitly deprecated.]


--
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/d/optout.


Re: Return from a function

2016-04-17 Thread Varun Kamra
Thanks for the links. No, I am not on slack.

On Friday, April 15, 2016 at 12:24:23 AM UTC-7, Colin Yates wrote:
>
> Hi Varun - the best advice I think I could give you is to spend a 
> whole bunch of time on https://clojuredocs.org and https://www.conj.io 
> (any others?) familiarising yourself with the core API. There is also 
> the official http://clojure.org/api/api but I find the example on 
> clojuredocs invaluable. 
>
> For me, my first few months was spent writing a whole bunch of 
> unidiomatic and ugly code badly replicating what was already in the 
> core libs. In fact, there was a bit of a bad smell of writing lots of 
> Clojure code as the core lib provides a _lot_ more than you might 
> think (I came from Java). 
>
> Also, you might want to invest in either core.typed or prismatic 
> schema for validating shapes of data. I think Brian Marick of Midje 
> fame has a similar answer but I can't recall the name. 
>
> Oh, and this community is great - keep asking questions and someone 
> will answer :-) - are you on slack? 
>
> On 15 April 2016 at 03:42, Varun Kamra > 
> wrote: 
> > Oh, I didn't even know we could loop using dotimes. Thanks for the 
> > explanation and for the code as well. 
> > 
> > 
> > On Thursday, April 14, 2016 at 6:58:57 PM UTC-7, Bobby Eickhoff wrote: 
> >> 
> >> The result of the last expression evaluated is always returned.  Hence, 
> >> the shape of the function is what determines the points of return and 
> the 
> >> returned values.  For example,  if you're entire function is defined as 
> one 
> >> (if ...) statement, there are two possible points of return, each of 
> the 
> >> branches. 
> >> 
> >> But I think you're probably asking if you can return early from a 
> >> function, like in Java or Javascript.  No, there's no return 
> "statement" in 
> >> Clojure.  You just have to structure your functions a certain way. 
> >> 
> >> Here's an alternate version of your pyramid function which uses (recur 
> >> ...).  This is equivalent to calling pyramid recursively, but the 
> compiler 
> >> is able to optimize this recursive call away.  In other words, it will 
> never 
> >> overflow the stack. 
> >> 
> >> (defn pyramid [n] 
> >>   (when (pos? n) 
> >> (dotimes [_ n] 
> >>   (print "* ")) 
> >> (println) 
> >> (recur (dec n 
> >> 
> >> 
> >> 
> >> 
> >> On Thursday, April 14, 2016 at 9:23:58 PM UTC-4, Varun Kamra wrote: 
> >>> 
> >>> On Thursday, April 14, 2016 at 5:58:33 PM UTC-7, Varun Kamra wrote: 
> >>> > Hey guys I am new to clojure. I was just experimenting by printing a 
> >>> > pyramid of stars 5 rows and 5 column. Here's the code: 
> >>> > 
> >>> > (defn pyramid [j i] 
> >>> > (if (and (= i 0) (neg? 
> >>> > (println "There's your pyramid")) 
> >>> > (if (= j 0) 
> >>> > (do (println) 
> >>> > (pyramid (- i 1) (- i 1))) 
> >>> > (do (print "* ") 
> >>> > (pyramid (- j 1) i 
> >>> > 
> >>> > It's working fine till it prints the pyramid, but after printing it, 
> it 
> >>> > continues printing a lot of stars and eventually fail with stack 
> overflow. I 
> >>> > am guessing that a if I put a negative check I can prevent it but I 
> wanted 
> >>> > to know if there's a way to return from the recursive call instead. 
> >>> 
> >>> I understood now, it was going in the else condition of the if so 
> here'so 
> >>> the modified code 
> >>> 
> >>> (defn pyramid [j i] 
> >>> (if (= i 0) 
> >>> (println "There's your pyramid")) 
> >>> (if (= j 0) 
> >>> (do (println) 
> >>> (pyramid (- i 1) (- i 1 
> >>> (if (not (neg? j)) 
> >>> (do (print "* ") 
> >>> (pyramid (- j 1) i 
> >>> 
> >>> But my question still stands if ther's a way to return from function. 
> > 
> > -- 
> > 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/d/optout. 
>

-- 
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

Re: [ANN] CIDER 0.12 (Seattle)

2016-04-17 Thread Timothy Washington
+1. Great work :)


Tim


On Sat, Apr 16, 2016 at 7:54 PM, Bozhidar Batsov 
wrote:

> Hey everyone,
>
> CIDER 0.12 (Seattle) is out! It packs a lot of small improvements and bug
> fixes!
>
> Check out the release notes here
> https://github.com/clojure-emacs/cider/releases/tag/v0.12.0
>
> We've also got a brand new user manual
> http://cider.readthedocs.org/en/stable/ for your
> consideration. We'd love to get some help and feedback to make it better.
>
> Enjoy!
>
>

-- 
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/d/optout.


Re: Reagent html tags

2016-04-17 Thread James Reeves
On 18 April 2016 at 00:02, 'Alan Forrester' via Clojure <
clojure@googlegroups.com> wrote:

> I am trying to use reagent for a personal project, but I have a problem
> with html tags. The keywords corresponding to html tags are not the same as
> the html tags with a colon in front of them. For example, the onclick html
> tag becomes :on-click in reagent. So I would like to see a list of which
> html tags are available and what keywords correspond to them. I have looked
> at reagent’s documentation, and hiccup’s documentation and I can’t find any
> such list. Nor can I find such a list in any of the other sites I found
> while googling.
>
> Does anybody know where I might find such a list?
>

For one of my libraries, I made a map of HTML attributes to their
equivalent React attributes:

https://github.com/weavejester/flupot/blob/master/src/flupot/dom.clj#L14

I believe Reagent just turns the camel-case into a dashed version.

- James

-- 
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/d/optout.


Re: Pmap on hash maps

2016-04-17 Thread Erik Assum
There was this talk on this a while ago by Leon Barrett
https://m.youtube.com/watch?v=BzKjIk0vgzE
Also, I guess this from this years Clojure West might be useful, all though I 
haven't watched it yet:
https://m.youtube.com/watch?list=PLZdCLR02grLq4e8-1P2JNHBKUOLFTX3kb&v=fA9ZXy4N13s

Erik. 
-- 
i farta

> Den 17. apr. 2016 kl. 23.23 skrev JvJ :
> 
> Orders of magnitude?  Is it even worth running things in parallel in this 
> case?
> 
>> On Sunday, 17 April 2016 07:20:30 UTC-7, tbc++ wrote:
>> The cost of creating that extra collection will be vastly overshadowed by 
>> the cost of running pmap. pmap involves the use of several locks, and thread 
>> co-ordination primitives, these will most likely be orders of magnitude more 
>> expensive than an extra allocation. 
>> 
>> Timothy
>> 
>>> On Sun, Apr 17, 2016 at 12:38 AM, JvJ  wrote:
>>> Perhaps I should have rephrased.  I meant calling it in such a way that the 
>>> result is a hash map.
>>> 
>>> I know I could do something like:
>>> 
>>> (into a (pmap f a))
>>> 
>>> This will give the same result, but there's an extra collection in there 
>>> that I'm not sure is necessary.
>>> 
>>> 
 On Saturday, 16 April 2016 20:15:51 UTC-7, Alex Miller wrote:
 You can call pmap on hash maps!
>>> 
>>> -- 
>>> 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/d/optout.
>> 
>> 
>> 
>> -- 
>> “One of the main causes of the fall of the Roman Empire was that–lacking 
>> zero–they had no way to indicate successful termination of their C programs.”
>> (Robert Firth)
> 
> -- 
> 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/d/optout.

-- 
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/d/optout.


Re: Pmap on hash maps

2016-04-17 Thread Mars0i
On Sunday, April 17, 2016 at 4:23:32 PM UTC-5, JvJ wrote:
>
> Orders of magnitude?  Is it even worth running things in parallel in this 
> case?
>

I got a 2X-5X speed improvement with pmap, but as adrian says, it depends.

The nice thing about  pmap, though, is that using it just involves adding a 
"p" to the front of a map call.  So if you're already using map for 
something, it's easy to test whether pmap helps (preferably using Criterium 
).  

One thing that can help make pmap worthwhile is rearranging code so that 
the function passed to a single map/pmap call does a lot of work with each 
element of the collection passed to it.  If the amount of computation for 
each element is sufficiently high, pmap will be faster.e.g. rather than 
(map f1 (map f2 (map f3 my-collection))), do (map (comp f1 f2 f3) 
my-collection), and then try adding the "p" on the front.  This avoids 
constructing unnecessary intermediate sequences, too.

-- 
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/d/optout.


Re: [clojure-android] ANN: turboshrimp 2.0.2, for control of Parrot AR.Drone

2016-04-17 Thread Alexander Yakushev
This is amazing! Thanks for sharing, John! I must myself get a drone now:)

On Mon, Apr 18, 2016, 01:33 John Wiseman  wrote:

> I've released a new version of turboshrimp, my library to control the
> Parrot AR.Drone.
>
> https://github.com/wiseman/turboshrimp
>
> Version 2.0.2 includes the following:
>
>- A more consistent API. E.g., instead of (drone/command drone
>:animate :flip-left) to make the drone do a flip in mid-air, you can use
>(drone/animate :flip-left).
>- Much more comprehensive documentation at
>http://wiseman.github.io/turboshrimp/, including an example of how to
>process a drone's video stream with a latency reduction queue.
>
> Turboshrimp is compatible with clojure-android.
> https://github.com/wiseman/shrimpdroid is a complete android app that you
> can use to fly a drone.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "clojure-android" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure-android+unsubscr...@googlegroups.com.
> To post to this group, send email to clojure-andr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojure-android.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/d/optout.


Re: [ANN] CIDER 0.12 (Seattle)

2016-04-17 Thread Andrea Russo
Awesome! Thank you very much!
Il 18/apr/2016 03:50, "Timothy Washington"  ha scritto:

> +1. Great work :)
>
>
> Tim
>
>
> On Sat, Apr 16, 2016 at 7:54 PM, Bozhidar Batsov 
> wrote:
>
>> Hey everyone,
>>
>> CIDER 0.12 (Seattle) is out! It packs a lot of small improvements and bug
>> fixes!
>>
>> Check out the release notes here
>> https://github.com/clojure-emacs/cider/releases/tag/v0.12.0
>>
>> We've also got a brand new user manual
>> http://cider.readthedocs.org/en/stable/ for your
>> consideration. We'd love to get some help and feedback to make it better.
>>
>> Enjoy!
>>
>>
> --
> 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/d/optout.
>

-- 
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/d/optout.