Re: [ANN] Clojure 1.8.0-RC3

2015-12-07 Thread Sean Grove
It's not super compelling for us (we can upgrade with some work), but we've
run into an issue with [org.clojure/clojure-contrib "1.2.0"] when
requiring clojure.contrib.math:

Exception in thread "main" java.lang.RuntimeException: Unable to resolve
symbol: remainder in this context, compiling:(clojure/contrib/math.clj:46:1)


As I said, I can look into it deeper if need be, but we're on clojure 1.5
and I expect we'll need to spend time updating dependencies soon anyway.
Just wanted to mention it in case it affects anyone else.

On Mon, Dec 7, 2015 at 8:17 PM, Alex Miller  wrote:

> Happy to consider stuff like that, sooner better than later though.
>
> The only var in core that has been marked ^:redef so far is
> clojure.core/load.
>
> On Monday, December 7, 2015 at 7:47:15 PM UTC-6, Howard M. Lewis Ship
> wrote:
>>
>> I suspect there's a few cases where we would like to use direct linking,
>> but will not be able to, because it will disrupt a 3rd party library we
>> use.  This is hypothetical, so I'll keep you posted ... I may run some
>> experiments in the next couple of days.
>>
>> Certainly, the use of alter-var-root by, say, io.aviso/pretty (and others
>> of its ilk) may be affected; I'll want to review which Vars, in which
>> namespaces, have been annotated with ^:redef (if not already ^:dynamic).
>>
>> It's possible a solution where we can provide a list of namespaced
>> symbols to exclude from dynamic linking will be needed for full adoption.
>>
>> --
> 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: Library suggestions requested for clojure-toolbox.com

2015-10-05 Thread Sean Grove
Talaria https://github.com/dwwoelfel/talaria [client/server messaging]
"Messaging library for real-time client/server communication over
websockets with fallback to ajax long-polling"

On Mon, Oct 5, 2015 at 4:35 PM, Jony Hudson  wrote:

> Not exactly a library, but Gorilla REPL could fit in there.
> http://gorilla-repl.org . Maybe in the REPL category, although it's not
> really quite that. Probably a bit much to have its own 'notebook' category
> though!
>
>
> Jony
>
>
> On Monday, 5 October 2015 20:41:11 UTC+1, James Reeves wrote:
>>
>> If you've written or know about a Clojure or ClojureScript library, and
>> it's not already on clojure-toolbox.com ,
>> I'd like to hear about it.
>>
>> Post the name and URL (and an optional category) as reply to this
>> message, and I'll add it to the site.
>>
>> - 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.
>

-- 
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: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Sean Grove
I also love this idea - the more info we give to tools to provide a uniform
formatting, the less I have to worry about configuring my local editor to
match the project styles.

On Sun, Sep 13, 2015 at 3:15 AM, Colin Yates  wrote:

> My knee-jerk reaction is:
>  - +10
>  - leaving it up to the user is absolutely the right thing to do
>  - the name ‘indent’ and what it is actually capturing are at different
> levels of abstraction. Possibly ‘structure’ might be a better name as that
> is what it is describing?
>
> But don’t listen to a word I say - I am hacking through some of my old
> code which uses :admission-date and :start-date interchangeably *for the
> same data structure* - sigh.
>
> My 1.5 cents.
>
> On 13 Sep 2015, at 11:06 AM, Artur Malabarba 
> wrote:
>
> Hi everyone,
>
>
> Over at CIDER we're adding a feature where the author of a macro (or
> function) can specify how that macro should be indented by adding an
> :indent metadata to its definition. This way the editor (and other tools,
> like cljfmt) will know what's the proper way of indenting any macro (even
> those custom-defined) without having to hardcode a bajillion names.
>
> Here's an example of how you specify the indent spec for your macros
>
>
> (defmacro with-out-str
>   "[DOCSTRING]"
>   {:indent 0}
>   [& body]
>   ...cut for brevity...)
>
> (defmacro defrecord
>   "[DOCSTRING]"
>   {:indent [2 nil nil [1]]}
>   [name fields & opts+specs]
>   ...cut for brevity)
>
> (defmacro with-in-str
>   "[DOCSTRING]"
>   {:indent 1}
>   [s & body]
>   ...cut for brevity...)
>
>
> We'd like to hear any opinions on the practicality of this (specially from
> authors of other editors).
> Below, I'll be saying “macros” all the time, but this applies just the
> same to functions.
>
> *Special arguments*
>
>
> Many macros have a number of “special” arguments, followed by an arbitrary
> number of “non-special” arguments (sometimes called the body). The
> “non-special” arguments have a small indentation (usually 2 spaces). These
> special arguments are usually on the same line as the macro name, but, when
> necessary, they are placed on a separate line with additional indentation.
>
> For instance, defrecord has two special arguments, and here's how it
> might be indented:
>
>
> (defrecord TheNameOfTheRecord
> [a pretty long argument list]
>   SomeType
>   (assoc [_ x]
> (.assoc pretty x 10)))
>
>
> Here's another way one could do it:
>
>
> (defrecord TheNameOfTheRecord
>[a pretty long argument list]
>   SomeType
>   (assoc [_ x]
> (.assoc pretty x 10)))
>
>
> *The point of the indent spec is not to specify how many spaces to use.*
>
>
> The point is just to say “a defrecord has *2* special arguments”, and
> then let the editor and the user come to an agreement on how many spaces
> they like to use for special and non-special arguments.
>
> *Internal indentation*
>
>
> The issue goes a bit deeper. Note the last argument in that defrecord. A
> regular function call would be internally indented as
>
> (assoc [_ x]
>(.assoc pretty x 10))
>
> But this is not a regular function call, it's a definition. So we want to
> specify this form internally has 1 special argument (the arglist vector),
> so that it will be indented like this:
>
> (assoc [_ x]
>   (.assoc pretty x 10))
>
> The indent spec we're working on does this as well. It lets you specify
> that, for each argument beyond the 2nd, if it is a form, it should be
> internally indented as if it had 1 special argument.
>
> *The spec*
>
>
> An indent spec can be:
>
>- nil (or absent), meaning *“indent like a regular function call”*.
>- A vector (or list) meaning that this function/macro takes a number
>of special arguments, and then all other arguments are non-special.
>   - The first element of this vector is an integer indicating how
>   many special arguments this function/macro takes.
>   - Each following element is an indent spec on its own, and it
>   applies to the argument on the same position as this element. So, when 
> that
>   argument is a form, this element specifies how to indent that form
>   internally (if it's not a form the spec is irrelevant).
>   - If the function/macro has more aguments than the vector has
>   elements, the last element of the vector applies to all remaining 
> arguments.
>- If the whole spec is just an integer n, that is shorthand for [n].
>
>
> *Examples*
>
>
> So, for instance, if I specify the defrecord spec as [2 nil nil [1]],
> this is saying:
>
>- defrecord has 2 special arguments
>- The first two arguments don't get special internal indentation
>- All remaining arguments have an internal indent spec of [1] (which
>means only the arglist is indented specially).
>
> Another example, reify is [1 nil [1]] (which should be easy to see now).
>
>
> (reify Object
>   (toString [this]
> (something)
> else
> "here"))
>
>
>
> For something more complicated: letfn i

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-04 Thread Sean Grove
I've been hoping someone would rebuild Codeq
, now that tools.analyzer (and friends)
is out and ClojureScript has made so much progress. Not only would it be
useful for diving into a new codebase (I've needed it several times when
working with a large, unfamiliar codebase), but generating both useful and
interesting docs from the structured data should be far easier than ad-hoc
analysis.

Just a thought, not sure that's the angle you want to take, but didn't see
it on your list and each of the items on the list would probably have
benefited from a revamped, well-documented, well-marketed Codeq.

On Mon, May 4, 2015 at 12:30 AM,  wrote:

> Hi all!
>
> I'm one of this year's students accepted to the Google Summer of Code for
> doing
> a Clojure project. (Thanks to Alex Miller for supporting my application!)
> For
> those who like to decide from the first paragraph whether they will read
> on or
> not: the goal of my project is to develop a model for Clojure source
> metadata
> (most of them are documentation) and ways to capture and publish them. The
> following two paragraphs are taken from my project proposal:
>
>  ❧ To the joy of the community, the number of Clojure-based libraries is
> steadily growing. To the dismay of the community, there is no agreed-upon
> way of
> getting information about those libraries' APIs. We have API documentation
> generators for individual libraries, like Autodoc or Codox. And we have big
> overview sites like Grimoire and CrossClj. None of them are comprehensive.
> All
> provide their information in a human-friendly way. Only some cater for the
> computer.
>
> The goal of this project is to develop a comprehensive and extensible
> model for
> describing Clojure sources from an API perspective. I will also write a
> program
> that analyses Clojure sources according to this model and outputs data
> documenting their usage. This could be compared to Javadoc, but emitting
> data to
> be consumed by other tools instead of HTML. In order to foster adoption, I
> will
> provide extensive  documentation, including examples of such consumer
> tools, and
> emphasize active communication with the community. ☙
>
> The project idea comes from Alex Miller, who also is my mentor, together
> with
> Reid McKenzie. Coding for the GSoC hasn't started yet. – Until 24 April
> we're in
> the warmup phase called community bonding. I wanted to use this time for
> getting
> ideas and feedback from you, so I've prepared some questions as a starting
> point:
>
>  - Who is interested in the project?
> - What would you like to see?
>  - Who has done/thought about similar things?
> - What have you done?
> - How have you done it?
> - What have you found? – Difficulties, annoyances, surprises.
> - What would you like to see?
> - What is important to you?
> - Have you built something that I might reuse?
>  - What else comes to your mind?
>
> There are many things out there which are more or less closely related to
> my
> project:
>
>  - cljs.info: https://github.com/cljsinfo
>  - Autodoc: https://github.com/tomfaulhaber/autodoc
>  - Codox: https://github.com/weavejester/codox
>  - Grimoire: http://conj.io/
>  - CrossClj: https://crossclj.info/
>  - ClojureDocs: https://clojuredocs.org/
>  - Clojure Atlas: http://www.clojureatlas.com/
>
> I would be especially happy to receive input from the people involved in
> those
> efforts.
>
> Reading this might help not having to say things again that have been said
> before: https://groups.google.com/d/topic/clojure/E1oxVE4UMxQ/discussion
>
> I wish everyone a good summer!
>
> Richard
>
>  --
> 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...@googleg

Re: ANN: Gamma, GLSL shaders made simple

2015-05-01 Thread Sean Grove
I was literally just looking over this right before you sent the
announcement, and it looks fantastic. Really looking forward to playing
with it over the next few weeks.

On Fri, May 1, 2015 at 12:39 PM, kovas boguta 
wrote:

> Gamma is a substrate for graphics software, such as games and data
> visualization tools. It presents a simple, composable language for
> representing GLSL shaders. It allows using Clojurescript to abstract
> shaders.
>
> https://github.com/kovasb/gamma
>
> Technically, Gamma is an EDSL that hosts GLSL within Clojurescript. It is
> inspired by Carlos Scheidegger's Lux and Conal Elliot's Vertigo and Pan.
> Gamma targets the WebGL subset of the OpenGL ES 1.0 Shading Language.
>
> This is a 0.1 release; work remains to get to 100% coverage of GLSL.
>
>
>
> --
> 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: What is the best setup to program Clojurescript IF...

2014-10-02 Thread Sean Grove
Presumably LightTable is a good way to get started?

On Thu, Oct 2, 2014 at 12:13 PM, Peter Mancini  wrote:

> What is the best setup to program Clojurescript IF:
>
>- you hate EMACS
>- use linux or windows
>
> Any suggestions?
>
> --
> 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: How to transform one data structure to another data structure?

2014-02-04 Thread Sean Grove
One way:

user> (reduce (fn [s [k v]]
(merge-with concat s {k [v]}))
  {} [[:a 123]
  [:b 124]
  [:a 125]
  [:c 126]
  [:b 127]
  [:a 100]])

=> {:c [126], :b (124 127), :a (123 125 100)}


On Tue, Feb 4, 2014 at 1:06 PM, Thomas  wrote:

> Hi all,
>
> I was wondering how I can convert the following data structure to the one
> below:
>
> from:
>
> [[:a 123]
>  [:b 124]
>  [:a 125]
>  [:c 126]
>  [:b 127]
>  [:a 100]]
>
> to
>
> {:a [123 125 100] :b [124 127] :c [126]}
>
> All the names here are arbitrary, but there are potentially a lot more
> keys and certainly a lot more numbers. The order of things is not important.
>
> TIA,
> Thomas
>
> --
> 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: Suggestions for state modification improvements in this bit of code?

2013-11-30 Thread Sean Grove
Dave, I may not have totally understood the original function, but here are
a few possible implementations, each moving towards what I would think of
as being simpler: https://www.refheap.com/21379

It could of course be made more efficient and slightly cleaner, but maybe
it's a start.

On Sat, Nov 30, 2013 at 3:49 PM, Dave Tenny  wrote:

> What, not conj!urers?
>
>
> On Sat, Nov 30, 2013 at 6:33 PM, Thomas  wrote:
>
>> On Saturday, November 30, 2013 11:17:01 PM UTC, Dave Tenny wrote:
>>
>>> I'm still learning clojure and wrote this decidedly unfunctional bit of
>>> code as part of a common lisp style DESCRIBE function.
>>>
>>> I was wondering what experienced clojure-ers  (what's the proper
>>> reference?)
>>>
>>
>> Clojurians ;)
>>
>> Thomas
>>
>> --
>> --
>> 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 a topic in the
>> Google Groups "Clojure" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/clojure/gbg1ABsbT-I/unsubscribe.
>> To unsubscribe from this group and all its topics, 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: [ClojureScript] Re: ANN: ClojureScript 0.0-1885 (Source maps!)

2013-09-16 Thread Sean Grove
Yeah, tools.reader is amazing. Honestly the source map patch was just a bit
of glue between David's existing work and integrating tools.reader, the
bulk of the results are due to them.


On Mon, Sep 16, 2013 at 2:31 PM, David Nolen  wrote:

> Nicola Mometto also deserves quite a bit of credit, the fact that
> tools.reader emits line and column information on all symbols is essential
> for the accuracy of ClojureScript source maps.
>
>
> On Mon, Sep 16, 2013 at 1:58 AM, Marco Munizaga wrote:
>
>> I'm so happy for this, I've been subscribed to that issue on Jira for a
>> while now, and here it is, alive and working! Just ran some demo code and
>> it looks amazing! Thanks Sean Grove and thanks David Nolen. I'll let you
>> know about any bugs I find.
>> On Sunday, September 15, 2013 2:48:46 PM UTC-4, David Nolen wrote:
>> > ClojureScript, the Clojure compiler that emits JavaScript source code.
>> >
>> >
>> >
>> > The biggest change in this release thanks to Sean Grove - much improved
>> source maps. You can provide a :source-map option to the compiler to name
>> the source map file. Feedback on this significant enhancement welcome.
>> >
>> >
>> > README and source code: https://github.com/clojure/clojurescript
>> >
>> >
>> > New release version: 0.0-1885
>> >
>> >
>> > Leiningen dependency information:
>> >
>> > [org.clojure/clojurescript "0.0-1885"]
>> >
>> >
>> >
>> >
>> > Enhancements:
>> >
>> > * Accurate source maps!
>> >
>> >
>> > Changes:
>> >
>> > * cljs.core/format based on goog.string/format backed out
>> > * set-print-fn! no longer exported
>> >
>> >
>> >
>> > Fixes:
>> > * CLJS-588: allow upstream :foreign-libs to be used
>>
>> --
>> --
>> 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.
>>
>
>  --
> 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: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Sean Grove
Also, a warning about breaking change with the strings no longer being
keywords:

Previously in ClojureScript, strings could be invoked to look themselves up
as keys inside maps, just like keywords. So both (:a {:a 10 "b" 20}) and
("b" {:a 10 "b" 20}) would work (the latter will not work in vanilla
Clojure). We had a few places where we (Zenbox) were doing this without
realizing it (think (defn my-fn [k] (k @profiles)) and k ends up being a
string).

This worked because previously ClojureScript modified the String.prototype
to add a .call and a .apply method. Many of you will have run into problems
with JS interop where this broke other libraries' type-checking (see
https://groups.google.com/forum/#!topic/clojure/NPWnikR8tro for an example
if not).

If you want to upgrade and run into problems with the unmodified
String.prototype, of course the best thing to do would be to write some
tests and fix the problems. If that's not possible, a (very) temporary
workaround is to use the old code here:
https://github.com/clojure/clojurescript/blob/a113b08a8c2811b0590cc6a36b2e9e5adc1c4c1e/src/cljs/cljs/core.cljs#L2060-L2074

Hope this might save some confusing late night debugging sessions.

Best,
Sean


On Mon, Sep 9, 2013 at 7:15 AM, David Nolen  wrote:

> Are you trying that with an existing project that may have a stale target
> directory lying around? If you can reproduce this issue after a `lein
> cljsbuild clean` then yes please open a ticket with a minimal project that
> exhibits the issue.
>
> Thanks!
> David
>
>
> On Mon, Sep 9, 2013 at 9:18 AM, Julien Eluard wrote:
>
>> Hi David,
>>
>> that is really nice! Speedup during incremental build is definitively the
>> one thing that would improve my ClojureScript dev workflow.
>>
>> I gave this build a try with lein-cljsbuild and got some unexpected
>> WARNINGS.
>>
>> What I am doing:
>> * lein cljsbuild once => everything is fine
>> * change some cljs file
>> * lein cljsbuild once
>>  => tons of WARNINGS, all variations of "WARNING: Use of undeclared Var
>> clojure.string/reduce at line 16
>> file:/Users/../clojurescript-0.0-1877.jar!/clojure/string.cljs"
>>
>> It looks like unchanged cljs files also generate those warnings (but I am
>> not quite sure what the incremental compilation does exactly).
>>
>> Interestingly resulting js file seems correct.
>>
>> Let me know if I should open a JIRA/create a simple reproducing example.
>>
>> Thanks for the awesome work on ClojureScript,
>> Julien
>>
>>
>> Le dimanche 8 septembre 2013 20:42:51 UTC-3, David Nolen a écrit :
>> > ClojureScript, the Clojure compiler that emits JavaScript source code.
>> >
>> >
>> > README and source code: https://github.com/clojure/clojurescript
>> >
>> >
>> > New release version: 0.0-1877
>> >
>> >
>> > Leiningen dependency information:
>> >
>> > [org.clojure/clojurescript "0.0-1877"]
>> >
>> >
>> >
>> >
>> >
>> > Breaking Changes:
>> >
>> > * Keywords are no longer represented as JavaScript Strings
>> >
>> >
>> >
>> >
>> > Enhancements:
>> >
>> > * Only analyze files that need re-analysis, significant speedup for
>> incremental compilation
>> > * Leiningen project.clj provided
>> >
>> >
>> > Fixes:
>> > * CLJS-582: duplicate items in sets
>> >
>> > * CLJS-585: ChunkedCons does not implement INext
>> > * ClojureScript clojure.string/split same behavior as Clojure
>> >
>> > * CLJS-565: Allow the clojurescript reader to read "%"
>> > * CLJS-580: def + fn bug when fn in a data literal
>> >
>> > * CLJS-509: spurious protocol warning under incremental compilation
>>
>> --
>> --
>> 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://grou

Re: Clojure/West 2013 videos?

2013-03-24 Thread Sean Grove
I'm sure that having nice videos (which have all been awesome) aren't
cheap, nor are they easy to produce. It's unfair to trivialize the
production and editing of high-quality material.

That said, a thought I've been surprised no one has suggested is a
crowdtilt/kickstarter-style campaign to get the videos released immediately
on youtube/vimeo. If there's sufficient demand, then the costs can be
recovered (and the events can be in the black), and if not, then they'll go
on InfoQ without any complaints.

$400 would be likely too steep for me personally, but $100 is certainly
reasonable.


On Mon, Mar 25, 2013 at 1:53 PM, Cedric Greevey  wrote:

> On Sun, Mar 24, 2013 at 11:24 PM, Rich Morin  wrote:
>
>> On Mar 24, 2013, at 18:44, Cedric Greevey wrote:
>> > Where are these costs coming from? ...
>>
>> To get professional results, you need more than a camera
>> on a tripod.  For example, someone has to:
>>
>>   *  keep the camera on the speaker
>>
>
> The speaker can stay approximately in one place, or, any random person can
> be paid minimum wage to rotate the camera. Cost: $0-8 per hour. I'd not be
> surprised if there are automated solutions for this, involving some
> motorized gadget in the tripod head and some invisible-to-human-eyes mark
> or reflector on the speaker's clothing perhaps, and then there'd be only a
> one-time cost (plus some trivial amount of electricity).
>
>
>>   *  get clean copies of the slides
>>
>
> Whoever is giving the presentation should have these already.
>
>
>>   *  merge the slides with the video
>>
>
> A lot of computers are shipping with free no-frills video editing software
> these days that probably suffices for this.
>
>
>>   *  create assorted web pages, etc.
>>
>
> Youtube will create a page for your video for you if you upload it there,
> and a page for your channel/account/whatever listing all of your videos
> that are uploaded to Youtube. There are other sites that will do similar
> things. For ongoing series, there are sites optimized for that, too,
> usually with .tv domains.
>
>
>>   *  ...
>>
>> Outfits like InfoQ and Confreaks do a very good job, but
>> they use professional staff (who expect to be paid).
>
>
> And I'm guessing what they're doing is obsolescent, if not already
> obsolete, in that it can be done about as well for a lot less money. If
> they're charging $400 a video I smell a market ripe for disruption.
>
>
>>  I'm
>> delighted that these folks provide high-quality recordings
>> of talks, at no cost or inconvenience to me.
>
>
> It seems that the delays before the videos get posted, and not having
> control over when videos get posted, qualifies as an "inconvenience", or
> this thread wouldn't exist.
>
>
>> It's also wonderful to have a local meeting recorded by a
>> volunteer, but I _really_ don't want this to be the way our
>> conferences are recorded.  I can wait a bit for the editing;
>> clean results are more important than saving a month or so.
>>
>
> Why are you so convinced that a volunteer couldn't do a good job?
>
>  --
> --
> 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: Understanding sequences

2013-02-13 Thread Sean Grove
Presumably just (map vector [1 3 5] [2 4 6] [10 20 30]) should do the trick.


On Wed, Feb 13, 2013 at 7:49 PM, Jonathon McKitrick wrote:

> I have 3 arrays, and need to process one element of each array as a
> triplet.
>
> So [1 3 5] [2 4 6] [10 20 30]
>
> needs to produce
>
> [1 2 10]
> [3 4 20]
> [5 6 30]
>
> In Common Lisp, I would just use LOOP.  What's the correct Clojure way?
>
> --
> --
> 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] Jida - Explore Clojure projects via hosted Codeq

2012-12-22 Thread Sean Grove
Hey all, Wei and I put together Jida, a pastie-bin for running
Codeq/Datomic queries on Clojure repos.

To dive in, here's a query that shows all of the authors for a given
imported clojure repo (domina, in this case):

http://jida.herokuapp.com/?query-id=50ba637ae4b0d89fb0a4ae40

You can 3 do things:

   1. Execute basic Codeq/Datomic queries againt imported git repos
   2. Save and share your queries with a link
   3. Import publicly-accessible clojure repos

We thought it could be a great way for people to

   - Expermient with Codeq
   - Explore/share high-level stats about the Clojure code and community
   - Possibly drive visualization using C2?

We're looking to you for ideas, feedback, and most importantly,
pull-requests!

   - Site: http://jida.herokuapp.com/
   - Code: https://github.com/yayitswei/jida
   - Wiki https://github.com/yayitswei/jida/wiki

Note that Datomic is running on a very under-powered server, so Jida may go
down from time to time. If you're interested in helping out with hosting,
we would really appreciate it!

Best,
Sean

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

Re: Best way to include a passwords file in a project?

2012-12-19 Thread Sean Grove
Hey Alex, I accidentally hit a button to subscribe you a mailing list while
reading this thread, please ignore it. Sorry about that!


On Wed, Dec 19, 2012 at 1:40 PM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:

> I don't like the environment variable approach because of the dependency
> on global state makes deploying harder.
>
> I'd usually have a config file like config.clj whose contents were just a
> Clojure map.  When loading the application I'd pass in the location of the
> config file as a parameter, and read-string the file at run-time.  That
> said, it can sometimes be convenient for development to have some default
> config file location, so you don't always need to pass the config location
> in.
>
> Alex
>
> On Wed, Dec 19, 2012 at 12:13 PM, Manuel Paccagnella <
> manuel.paccagne...@gmail.com> wrote:
>
>> I'm not sure that a password file is an optimal solution for this
>> problem. Maybe the 12 factors , and in
>> particular the config  one, could give
>> you some ideas.
>>
>> Personally I think that credentials are environment-specific, not
>> application-specific. So I'd place them in an external storage service
>> (like a DB). Or, to make things simple, put them in a file somewhere in the
>> system and load it through an environment variable (see 12 factors, III).
>>
>> This is as simple as writing:
>>
>> (load-passwords-from-file (System/getenv "PASSWORD_FILE"))
>>
>> Hope it helps :)
>>
>> Il giorno martedì 18 dicembre 2012 03:21:31 UTC+1, Marco Munizaga ha
>> scritto:
>>
>>> I'm currently doing something like src/project/passwords.clj and git
>>> ignoring that, does anyone have a better solution? maybe a way to place the
>>> passwords.clj alongside project.clj in the root directory? Would this be
>>> possible through leiningen profiles?
>>>
>>>
>>> Thanks
>>>
>>  --
>> 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 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 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

Re: Clojurescript tests not including non-test source-path

2012-11-27 Thread Sean Grove
Thanks for the tip!

Sadly, doesn't seem to make any difference - here's the updated
project.clj and the (same) output:
https://gist.github.com/c159e76e559f407287ce

SEVERE: 
/Users/sgrove/code/clojure/zenbox/.lein-cljsbuild-compiler-1/zenbox/test/main.js:3:
ERROR - required "zenbox.main" namespace never provided
goog.require('zenbox.main');
^

zenbox.main is defined in src/cljs/main.cljs:

(ns zenbox.main
  (:require [domina :as domina]
[domina.css :as dcss]
[goog.events :as ge]
[goog.ui.Component.State]
[goog.Disposable]
[goog.ui.Menu]
[goog.ui.MenuButton]
[goog.ui.MenuItem]
[goog.ui.MenuSeparator]
[goog.ui.PopupMenu]
[goog.dom :as gd]
[goog.dom.DomHelper :as gdh]
[goog.positioning :as gp]
[zenbox.events :as ze]
[zenbox.dom :as zd]
[zenbox.profile-data :as data]
[zenbox.templates :as templates]
[zenbox.widget.user-profile :as zup]))

Any other ideas?

On Tue, Nov 27, 2012 at 11:24 AM, David Nolen  wrote:
> I think you need to make sure that the cljs files are also on the Lein 2
> :source-paths
>
> David
>
>
> On Tue, Nov 27, 2012 at 12:50 PM, Sean Grove  wrote:
>>
>> I've been trying to create a simple project with CLJS source and CLJS
>> tests using lein-cljsbuild 0.2.9, but it doesn't seem to be able to
>> pick up on the cljs source.
>>
>> How can I get the clojurescript tests to compile/run and include the
>> actual project source?
>>
>> The output from running `lein clean && lein cljsbuild test`, the
>> project.clj, and the relevant cljs files are all here:
>> https://gist.github.com/31613f73e92212e161bb
>>
>> The repo structure is:
>>
>> /
>> |-src
>> |- -/clj
>> |- -/cljs
>> |-  |-main.cljs
>> |-test
>> |- - test.cljs
>> |- -/zenbox
>> |-  |-test/
>> |-|-main.cljs
>>
>> --
>> 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 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 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


Clojurescript tests not including non-test source-path

2012-11-27 Thread Sean Grove
I've been trying to create a simple project with CLJS source and CLJS
tests using lein-cljsbuild 0.2.9, but it doesn't seem to be able to
pick up on the cljs source.

How can I get the clojurescript tests to compile/run and include the
actual project source?

The output from running `lein clean && lein cljsbuild test`, the
project.clj, and the relevant cljs files are all here:
https://gist.github.com/31613f73e92212e161bb

The repo structure is:

/
|-src
|- -/clj
|- -/cljs
|-  |-main.cljs
|-test
|- - test.cljs
|- -/zenbox
|-  |-test/
|-|-main.cljs

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


Re: Promise for ClojureScript?

2012-11-27 Thread Sean Grove
I've been meaning to write a wrapper around the google closure async
primitives: 
https://groups.google.com/forum/#!msg/closure-library-discuss/aHjKn7K6O9Q/XmZSK54lc3cJ

Are there any reasons not to, or any libraries that have attempted it already?

On Tue, Nov 27, 2012 at 12:21 AM, Niel Drummond
 wrote:
> angularjs also has a promise - http://docs.angularjs.org/api/ng.$q
>
> I can vouch for using angularjs with clojurescript (it's much better than
> using jquery in cljs), but haven't got as far as using this API item, though
> I can't imagine that it would be that complicated.
>
> - Niel
>
>
> On Tue, Nov 27, 2012 at 2:53 AM, Frank Siebenlist
>  wrote:
>>
>> I've been following the separate discussion-thread about your enhanced
>> Promise effort, and it looks really cool and very useful.
>>
>> Having that also available (next week ;-) ) in clojurescript would be
>> fantastic!
>>
>> -FS.
>>
>>
>> On Nov 26, 2012, at 5:32 PM, Stuart Sierra 
>> wrote:
>>
>> > I've been working on a promises API with callbacks for Clojure (JVM):
>> > http://dev.clojure.org/display/design/Promises
>> >
>> > If I can get buy-in and support for implementing this as a
>> > language-level feature in Clojure, the obvious next step would be to port 
>> > it
>> > to ClojureScript.
>> >
>> > -S
>> >
>>
>> --
>> 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 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 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


Re: Simple Neural Network DSL -- request for feedback

2010-11-10 Thread Sean Grove
Very elegant. From the example, it looks like it takes away a great deal of the 
tedium of neural networks.

Do you have any more significant code examples than those listed on [3]?

Sean

On Nov 10, 2010, at 2:20 PM, Eric Schulte wrote:

> Hi,
> 
> Inspired by cgrand's regexp example [1], I've implemented a simple DSL
> for specifying neural networks using Clojure data types.  The code is
> available in this gist [2], and a brief introduction with some usage
> examples is up at [3].
> 
> Construction of this simple language involved a number of choices as to
> where to place complexity (into the DSL or into user land), generally I
> erred on the side of leaving complexity out of the DSL resulting in
> potentially more complex usage, but in increased generality.  I'd love
> to hear any feedback on how this could be improved, simplified, or made
> more idiomatic.
> 
> Thanks -- Eric
> 
> Footnotes: 
> [1]  https://github.com/cgrand/regex
> 
> [2]  https://gist.github.com/671636
> 
> [3]  http://cs.unm.edu/~eschulte/src/neural-net/
> 
> -- 
> 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 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


Re: Help to optimize palindrome search from input file

2010-10-12 Thread Sean Grove
I actually played with this on Saturday morning while waiting for a friend, and 
thought it was an interesting problem.

Your example is spending most of its time filtering with palindrome? across all 
682695 items generated by all-combs. To see, try:

(defn tony []
  (def source "I like racecars that go fast!")

  (def source2 
"FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvethatthesedeadshallnothavediedinvainthatthisnationunsderGodshallhaveanewbirthoffreedomandthatgovernmentofthepeoplebythepeopleforthepeopleshallnotperishfromtheearth")

  (defn palindrome? [s]
(= s (reduce str (reverse s

  (defn all-combs [in]
(let [len (count in)]
  (for [i (range 0 (- len 2)), j (range (+ i 1) len)]
(do 
(subs in i j)

  (defn max-comp [x y]
(let [lenx (count x), leny (count y)]
  (cond (< lenx leny) 1
(= lenx leny) 0
(> lenx leny) -1)))

  (let [input source
ac1 (all-combs input)
ac2 (all-combs source2)
palindromes-1 (filter palindrome? ac1)
palindromes-2 (filter palindrome? ac2)]
(println "all-combs(input1):")
(time (println (count (all-combs input
(println "all-combs(input2):")
(time (println (count (all-combs source2
(println "Filter(input1):")
(time (println (count (filter palindrome? ac1
(println "Filter(input2):")
(time (println (count (filter palindrome? ac2
(println palindromes-1)
(println palindromes-2)))

(tony)


> It looks a bit procedural.
Looks pretty functional to me :)

Just as a comparison, my solution takes this long, and I highly doubt its 
efficiency:
$ time ./launch.sh 1.clj 
***output removed***
real1m19.176s
user1m13.830s
sys 0m1.636s


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


Re: Lazytest 1.0.0 (beta)

2010-09-25 Thread Sean Grove
Looks very awesome - I'll be giving this a try in my current projects.

Thanks for such a cool library!

sg

On Sep 24, 2010, at 12:38 PM, Stuart Sierra wrote:

> http://github.com/stuartsierra/lazytest
> 
> My attempt to steal all the good ideas from clojure.test, Circumspec,
> ClojureCheck, RSpec, Spock, ScalaTest, etc.  Kudos to all those
> authors for all their great work.
> 
> -S
> 
> -- 
> 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 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


Re: clojure Image/video processing?

2010-09-07 Thread Sean Grove
> I'd be happy to show my frame-hash implementation as long
> as you won't laugh too hard at it. I'll throw it up on github sometime
> soon after I clean it up a bit. I like it because a video treated as
> just a sequence of hash-maps which flows through an image processing
> pipeline.
Sounds excellent - please post it at your earliest convenience :)

> I have to say I've been surprised at the state of video in java. It's
> time to make it better with a clojure library devoted to pulling
> together the best of all these different methods.
Sounds good to me. I'm just starting on a rather complex project pulling in 
(currently) webcam input and processing the video, and need access to this 
anyway. If there's nothing out there, time to roll up my sleeves and get on it.

Let me know if you're looking to start on it any time soon.

-- Sean Grove

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


Re: clojure Image/video processing?

2010-09-06 Thread Sean Grove
On Sep 6, 2010, at 2:57 PM, Robert McIntyre wrote:

> I was wondering if anyone has used clojure for image/video processing
> and how that has worked out.

> Images:
For image processing, I've just been using the java2d api, a la 
http://www.javaworld.com/javaworld/jw-09-1998/jw-09-media.html?page=1 It's 
quite low-level, but it works well enough for my basic needs right now.

> OpenCV : tried two different jna bindings but had many horrible memory
> leaks and crashes
I've been doing some stuff with OpenCV (yes, there are definite problems here, 
but at least it kind of works) to get access to the webcam. Setting it up was a 
nightmare though...

> Video:
> Processing: still don't know at all what this is or how to get it to work.
Processing is a bigger library, I believe OpenCV is a sub-project of it. 

> My own hash-map representation/functional way: elegant and easy to
> write new transforms but incredibly slow and memory hungry.
I would be very happy to see some of that, if you're able to share it. What 
kind of performance are you talking about when you say "slow"?

- Sean Grove

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