Re: dump html with clojure

2010-05-13 Thread Eric Schulte
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?

Re: dump html with clojure

2010-05-13 Thread Eric Schulte
- 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

Re: Which git version for cells?

2010-05-17 Thread Eric Schulte
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

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Eric Schulte
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

Lisp/Scheme Style Guide

2010-08-31 Thread Eric Schulte
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

Re: Lisp/Scheme Style Guide

2010-08-31 Thread Eric Schulte
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

Re: Documentation tools

2010-09-07 Thread Eric Schulte
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

Re: Documentation tools

2010-09-07 Thread Eric Schulte
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

Re: [ANN] Leiningen 1.3.1

2010-09-20 Thread Eric Schulte
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

Re: [ANN] Leiningen 1.3.1

2010-09-22 Thread Eric Schulte
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

Re: Clojure Serial Connection

2010-09-22 Thread Eric Schulte
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

lein java opts on command line Was: New Release of the Clojure Debugging Toolkit

2010-09-28 Thread Eric Schulte
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

Re: Improving Contrib

2010-10-20 Thread Eric Schulte
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.

Re: Images in autodoc?

2010-10-26 Thread Eric Schulte
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

Re: Images in autodoc?

2010-10-27 Thread Eric Schulte
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

Re: reducing terms in vector

2010-10-28 Thread Eric Schulte
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

Re: apply an higher order function on an arbitrary nested data structure

2010-10-28 Thread Eric Schulte
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

Simple Neural Network DSL -- request for feedback

2010-11-10 Thread Eric Schulte
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

Re: Simple Neural Network DSL -- request for feedback

2010-11-11 Thread Eric Schulte
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

Re: Simple Neural Network DSL -- request for feedback

2010-11-11 Thread Eric Schulte
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

Re: Simple Neural Network DSL -- request for feedback

2010-11-12 Thread Eric Schulte
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

Re: Simple Neural Network DSL -- request for feedback

2010-11-12 Thread Eric Schulte
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

Re: Simple Neural Network DSL -- request for feedback

2010-11-13 Thread Eric Schulte
#+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

shorter alternatives for `comp' and `partial'

2010-11-13 Thread Eric Schulte
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

Re: shorter alternatives for `comp' and `partial'

2010-11-16 Thread Eric Schulte
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

Re: shorter alternatives for `comp' and `partial'

2010-11-16 Thread Eric Schulte
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

Re: shorter alternatives for `comp' and `partial'

2010-11-16 Thread Eric Schulte
("\\" ?¬) #+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

Re: Function Design: sequence or "&" argument?

2010-11-19 Thread Eric Schulte
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.

Re: outlining for clojure files in emacs+slime?

2010-12-05 Thread Eric Schulte
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

Re: outlining for clojure files in emacs+slime?

2010-12-06 Thread Eric Schulte
"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, >>

Re: Clojure 1.3 Alpha 4

2010-12-15 Thread Eric Schulte
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

Re: Clojure 1.3 Alpha 4

2010-12-15 Thread Eric Schulte
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

Re: currying in clojure for fixed number of arg functions

2010-12-17 Thread Eric Schulte
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

Re: currying in clojure for fixed number of arg functions

2010-12-18 Thread Eric Schulte
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

Re: Ah-hah! Clojure is a Lisp

2010-12-19 Thread Eric Schulte
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

Emacs `align' function customization for Clojure

2011-01-05 Thread Eric Schulte
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

Re: ANN: Gloss, a byte-format DSL

2011-01-05 Thread Eric Schulte
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

Re: ANN: Gloss, a byte-format DSL

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
>>> >>> 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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-05 Thread Eric Schulte
> 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

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-06 Thread Eric Schulte
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

Re: ANN: Gloss, a byte-format DSL

2011-01-06 Thread Eric Schulte
'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,

possible bug in `case'

2011-01-06 Thread Eric Schulte
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

Re: how do I improve indentation of reify methods in clojure-mode

2011-01-09 Thread Eric Schulte
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

Re: how do I improve indentation of reify methods in clojure-mode

2011-01-11 Thread Eric Schulte
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) (

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Eric Schulte
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

Re: A tiny producer-consumer framework

2011-01-22 Thread Eric Schulte
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]

Re: A tiny producer-consumer framework

2011-01-24 Thread Eric Schulte
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

Re: A tiny producer-consumer framework

2011-01-24 Thread Eric Schulte
>> 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