Wouldn't this be simpler with pmap, e.g. http://gist.github.com/399269
although to be honest I don't really know how the automatically
parallelized clojure functions decide how many threads to use. Is the
JVM smart enough to only create as many system-level threads as make
sense on my hardware?
- Eric
>
> Regards...
> --
> Nurullah Akkaya
> http://nakkaya.com
>
>
>
> On Thu, May 13, 2010 at 2:26 AM, Eric Schulte wrote:
>> Wouldn't this be simpler with pmap, e.g. http://gist.github.com/399269
>>
>> although to be honest I don't really
Hi Steven,
I recently put together a propagator/cell system using Clojure's
actors/watchers. The code for implementing a concurrent propagator
system actually came out to a little less than a single page. Take a
look at the following for the full implementation.
http://gist.github.com/403987
H
Mark Engelberg writes:
> If you're developing a trio, like ltrim, trim, rtrim, wouldn't it be
> better to call them triml, trim, trimr so that they show up next to
> each other in the alphabetized documentation?
+1 for modifiers at the end
Let's not forget those of us who search for functions u
This is the best I've seen so I thought I'd share
(pulled from a post on the guile mailing list)
http://mumble.net/~campbell/scheme/style.txt
(note: the attached copy opens in Org-mode in Emacs for easier reading)
--
You received this message because you are subscribed to the Google
Groups "Clo
t; stacked parens over trailed parens is laughably devoid of any rational
>> thought:
>>
>>> Rationale: The parentheses grow lonely if their closing brackets are
>>> all kept separated and segregated.
>>
>>
>> - Greg
>>
>> On Aug
Hi,
I'd recommend looking at how plt-scheme solved this problem (see [1]).
They actually defined alternative readers in which either prose or code
can be the default input mechanism (with the other escaped in some way).
I don't know if Clojure's reading system is quite flexible enough to
support s
Phil Hagelberg writes:
> On Tue, Sep 7, 2010 at 1:25 AM, Mark Engelberg
> wrote:
[...]
>> Javadoc has an interesting property: it considers that the first
>> sentence serves as a summary for the doc. The "sentence" delimiter is
>> just the point in the case of javadoc.
>
> Emacs docstrings work
Hi,
Having recently upgraded to this newest lein
$ lein --version
Leiningen 1.3.1 on Java 1.6.0_18 OpenJDK Client VM
I notice that the "lein swank" command is no longer supported.
$ lein swank
That's not a task. Use "lein help" to list all tasks.
What's the recommended way to start up
Phil Hagelberg writes:
> On Mon, Sep 20, 2010 at 12:08 PM, Eric Schulte wrote:
>> Having recently upgraded to this newest lein
>>
>> $ lein --version
>> Leiningen 1.3.1 on Java 1.6.0_18 OpenJDK Client VM
>>
>> I notice that the "lein swank" com
Related to controlling an Arduino with Clojure, a while ago I put
together a wrapper enabling interacting with a group of IXM boards
(cousin to the Arduino) from a Clojure REPL.
http://repo.or.cz/w/ixm-repl.git
Although in this case the boards are exposed through a shell script
which the Clojure
Baishampayan Ghose writes:
>>> Why do you ask? Is there some particular functionality you are
>>> interested in?
>>
>> Well, I'm just learning too. Currently I rely on lein swank to start
>> up my JVM so that slime can connect to it. CDT seems to want you to
>> manually start up the JVM with a p
Mike Meyer writes:
> It was also more work than submitting patches looks to be for apache,
> django, gnu
FWIW in gnu projects if your patch is >10 lines long then they do
require you to go through a fairly lengthy attribution process.
http://www.gnu.org/prep/maintain/html_node/Copyright-Papers.
Chris writes:
> On Oct 26, 9:54 am, Andrew Gwozdziewycz wrote:
>> I like that idea, especially if it could be extended to reference other code:
>
> Agreed. So now that's links to images, web pages, Clojure vars...
> anything else?
>
LaTeX equations. Which are increasingly easy to render in HT
around, but that shouldn't be too much of a problem).
>>>
>>> The bigger problem is figuring out what to tell folks who type (doc
>>> foo) at the REPL and get a bunch of gobbledegook back. That's the
>>> thing that's been making me look for a better for
I don't know if use of `partial' is considered idiomatic, but I think
it's the clearest in cases like this.
user> (def all-pairs '([ [1 2] [3 4] [5 6] ] [[5 6] [7 8] [9 0]]) )
#'user/all-pairs
user> (apply map (partial map +) all-pairs)
((6 8) (10 12) (14 6))
-- Eric
Ulises writes:
>> A littl
Without each type specifying where it would like the function applied
the result will be sort of hacky, but here's my hackey attempt at fmap
in clojure.
It makes some assumptions (e.g. you would only want to apply f to the
values rather than the keys of a hash). Also I'm not sure what the best
wa
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 ch
Hi Saul,
Saul Hazledine writes:
> On Nov 10, 11: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.
>
> This i
neurons overtop of this DSL and
testing them over some slightly more realistic data (a classification
problem). I'll post that work up to [3] as it progresses.
>
> Sean
>
> On Nov 10, 2010, at 2:20 PM, Eric Schulte wrote:
>
>> Hi,
>>
>> Inspired by cgra
Carson writes:
> Hi! That looks interesting. I'm curious how big a network are you
> intending to experiment with? (ie, # of layers, size of layers?).
>
I haven't really thought about limits on the size of the networks,
although I suppose with very large networks it may become a good idea to
Hi Albert,
Albert Cardona writes:
> Hi Eric,
>
> Your neural network DSL looks great. One minor comment: why use lists
> instead of sets? In the webpage you state:
>
> "Lists are used to represent a unordered series"
>
I used lists because I want to be able to specify a network in which (at
lea
#+begin_src clojure
(let [n {:phi identity
:accum (comp (partial reduce +) (partial map *))
:weights [2 2 2]}]
[(repeat 3 n) (repeat 5 n) (assoc n :weights (vec (repeat 5 1)))])
#+end_src
would result in the following connection pattern
[[file:/tmp/layers.png]]
> Howe
Hi,
I find myself frequently using the `comp' and `partial' functions and
while I really enjoy being able to program in a point free style, the
length (in characters) of these command names often has the effect of
causing what should be a brief statement to span multiple lines.
I'm about to begin
Hi Paul,
Thanks for sharing this. It seems like the best compromise between the
desire to keep my code brief (at least to my eyes) without wanting to
introduce my own custom function names for global functions.
If you don't mind I'd like to add this to my fork of the Emacs Starter
Kit (will cred
atreyu writes:
> Yep, you have to use flip and it is not so elegant
>
> Prelude> let f x y z=(x+z)*y
> Prelude> map (flip (f 1) 2) [3,4,5]
> [9,12,15]
>
> OTOH in clojure we have, you guess..., macros!!!
>
> user> (->> [[2 3][3 3][6 6]] (filter (comp even? sum)) concat2 (map
> #(+ 5 %)))
> (8 8 1
("\\" ?¬)
#+end_src
I think the results look quite nice, a small example is attached
Best -- Eric
"Eric Schulte" writes:
> Hi Paul,
>
> Thanks for sharing this. It seems like the best compromise between the
> desire to keep my code brief (at least to my
I generally prefer to pass in a sequence rather than use a variable
number of arguments. The only time variable arguments are really useful
is in functions like map (or maybe +) in which you rarely use more than
one (or two) arguments and it would be a pain to wrap the last argument
in a list.
e.
Hi Sunil,
This is not quite what your asking for, but Org-mode [1] (an Emacs
outlining mode) has support for embedded code blocks which can be
executed, tangled etc... [2] in a number of languages including Clojure.
Also, I often see ^L characters in lisp files inside of Emacs, I believe
these ch
"Alan D. Salewski" writes:
> On Sun, Dec 05, 2010 at 07:35:35AM -0700, Eric Schulte spake thus:
>> Also, I often see ^L characters in lisp files inside of Emacs, I believe
>> these characters are used for in-file navigation, but I don't know how,
>>
Ken Wesson writes:
> Are you honestly suggesting I search the archives
It is common courtesy on open-source lists such as this one to check if
a question you are about to ask has already been answered. Not only
does it save a lot of noise on the list, but it often means that you
find your answe
Ken Wesson writes:
> On Wed, Dec 15, 2010 at 12:51 PM, Eric Schulte wrote:
>> Ken Wesson writes:
>>
>>> Are you honestly suggesting I search the archives
>>
>> It is common courtesy on open-source lists such as this one to check if
>> a question you
Hi Sunil,
This is already possible using `partial' function in clojure core, which
also works for variable arity functions, e.g.
(map (partial reduce +) [[1 2 3 4] [5 6 7 8]])
Best -- Eric
Sunil S Nandihalli writes:
> Hello everybody,
> I remember that the key reasoning for not supporting cu
ion
>> when called with fewer number of arguments than necessary like it
>> happens in haskell..
>> thanks,
>> Sunil.
>>
>> On Sat, Dec 18, 2010 at 3:02 AM, Eric Schulte wrote:
>>
>>> Hi Sunil,
>>>
>>> This is already possible u
Tim Daly writes:
>
> Haskell has neat ideas but I've seen them before in lisp-based
> systems. I work in a language which is strongly typed, allows
> currying, is functional, etc., implemented in Common Lisp. I have
> not found the "ah-hah!" in Haskell.
>
Sounds interesting, could you share a po
Hi,
I just recently became aware of the built-in `align' [1] function for
Emacs while looking for a nice way to auto-align some hash-maps in my
Clojure code. This was easily done using align with the following piece
of customization.
#+begin_src emacs-lisp
(add-to-list 'align-lisp-modes 'cloju
Thanks for sharing this library, I found reading your code to be very
useful.
I need to be able to read and write elf files from within Clojure code,
and Gloss initially looked like a good option. However much of the
streaming support and frame-based conception got in the way of my
particular nee
also, here's a patch to Gloss which I've used locally but which may be
generally useful.
Cheers -- Eric
"Eric Schulte" writes:
> Thanks for sharing this library, I found reading your code to be very
> useful.
>
> I need to be able to read and write elf files
Seth writes:
> The literate programming is actually a contrib to org-mode.
> http://orgmode.org/worg/org-contrib/babel/
>
This has been moved out of contrib and into the Org-mode core, so with
recent versions of Org-mode the code block "Literate Programming" and
"Reproducible Research" support i
Hi,
Seth writes:
>>Just discovered org-mode myself --- does anyone know of guide to using
>>it with clojure for a total newbie?
>
> I havent actually used it for clojure per se. I was just imagining how
> it could be used. You have the ability to embed arbitrary code (from
> many different langu
Hi Tim,
I'm confused as to what parts of LP practice are not supported by
Org-mode. Are you aware that Org-mode files can be exported to formats
more suitable for publication and human consumption (e.g. woven). See
http://orgmode.org/manual/Exporting.html
Tim Daly writes:
> I looked at org-m
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming or
Reproducible Research) the online manual is also very useful.
http://orgmode.org/manual/Working-With-Source-Code.html
also, for a good review of Org-mode's support for
Mark Engelberg writes:
> On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulte wrote:
>> For the most up-to-date and comprehensive documentation of using
>> Org-mode to work with code blocks (e.g. Literate Programming or
>> Reproducible Research) the online manual is also very us
>>>
>>> Emacs org-mode, on the other hand, is a useful development
>>> technology but it really isn't literate programming.
>>>
>> I would be interested to hear your thoughts as to why Org-mode is not a
>> literate programming tool.
> I never said org-mode wasn't a 'literate programming tool'. It i
> Can you post examples of these? I'd love to see some other examples.
Sure thing, check out this old version of a file which tangles out into
the directory layout expected by lein.
http://gitweb.adaptive.cs.unm.edu/?p=asm.git;a=blob;f=asm.org;h=f043a8c8b0a917f58b62bdeac4c0dca441b8e2cb;hb=HEAD
Al
Tim Daly writes:
> On 1/6/2011 12:03 AM, Eric Schulte wrote:
>>> Can you post examples of these? I'd love to see some other examples.
>> Sure thing, check out this old version of a file which tangles out into
>> the directory layout expected by lein.
>> h
'm going to give Gloss a try. For complex binary structures, I think
> I like it's way of specifying formats using (keyword, type) pairs and
> reading and writing maps instead of bytebuffer's which specifies
> formats as strings ('b' for byte, 'i' for int,
Hi,
The following case statement
#+begin_src clojure
(defn buggy-case [n]
(case (int n)
0 :null
1 :load
0x7000 :loproc))
#+end_src
throws the following error
No distinct mapping found
[Thrown class java.lang.IllegalAr
Hi,
Even using Phil's clojure-mode I find myself often editing the source
code of clojure-mode to add custom indentation or fontification for my
own macros or for forms I feel have been missed. Perhaps some of the
lists of function/marco-names in clojure-mode could be tucked behind
user-configura
As an example of a user-accessible function for customizing indentation,
the following can be used with the latest clojure-mode either
interactively or from a user's config.
(defun clojure-new-indent (&optional func level)
"Set the indentation level of FUNC to LEVEL."
(interactive)
(
Miki writes:
>> It isn't nearly as big a deal as you think it is. I'm guessing you have a
>> single file called 'fs.clj' with the namespace 'fs', right?
>>
>> mkdir src/fs/
>> mv src/fs.clj src/fs/core.clj
>>
> and then edit the file and change the namespace to fs.core.
>
> I know it's easy to
Nice concise example,
A while back I implemented something similar; a propagator system using
agents fed with `send', coming in at a slightly more verbose ~35 lines
of code.
http://cs.unm.edu/~eschulte/research/propagator/
Cheers -- Eric
Ken Wesson writes:
> (defmacro consumer [[item] & body]
Ken Wesson writes:
> On Sat, Jan 22, 2011 at 11:26 AM, Eric Schulte wrote:
>> Nice concise example,
>
> Thanks.
>
>> A while back I implemented something similar; a propagator system using
>> agents fed with `send', coming in at a slightly more verbo
>> That would be a great application for this system. Each cell of the
>> spreadsheet could be a cell, and each formula could be a propagator.
>> I've implemented this and it seems to work well, I've committed this to
>> the repo above, and posted the spreadsheet code with example usage into
>> a
54 matches
Mail list logo