Re: Literate programming in emacs - any experience?

2012-02-01 Thread Sam Aaron

On 30 Jan 2012, at 17:07, daly wrote:
> 
> The key result was that I discovered what I call my personal
> "irreducible error rate". If I do 100 things I will make 3 errors.
> This was independent of the task. So typing 100 characters has
> 3 wrong letters which were mostly caught while typing. Writing
> 100 lines of code had 3 errors somewhere. Composing email
> introduces 3 errors per 100 lines of code.

I wonder if that rate has changed since the time you measured it. 

Sam

---
http://sam.aaron.name

-- 
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: ForkJoin updates

2012-02-01 Thread pron
This is exactly what I meant. :)

-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread daly
On Wed, 2012-02-01 at 10:43 +, Sam Aaron wrote:
> On 30 Jan 2012, at 17:07, daly wrote:
> > 
> > The key result was that I discovered what I call my personal
> > "irreducible error rate". If I do 100 things I will make 3 errors.
> > This was independent of the task. So typing 100 characters has
> > 3 wrong letters which were mostly caught while typing. Writing
> > 100 lines of code had 3 errors somewhere. Composing email
> > introduces 3 errors per 100 lines of code.
> 
> I wonder if that rate has changed since the time you measured it. 
> 
Unfortunately not. However I am now able to identify several
errors that I continue to make. The 2/3 keys get mistyped.
The _/+ keys get mistyped. I seem unable to overcome this.
Which is really bad considering my hobby is computer algebra.

The largest contribution to my errors is using copy/paste.
It is responsible for about 50% of all errors. If I could
convince myself to stop using it my error rate would drop.
On good days I don't use it but I get lazy.

Curiously I do have a lower error rate in Lisp than I do in
other languages. In C, for instance, I get caught by things
like float to double conversions on calls, despite knowing
about it. In Java I miss the null case checks despite being
aware that Java is brain-dead about null. In Python I skip
"self"ing things. In Javascript I miss the 'var' occasionally.

Lisp "just works" and works just as I expect. It eliminates
whole categories of errors. (The most annoying thing about
Clojure is the "null pointer exceptions" from Java.) When
I want solid, correct code I reach for Lisp. For random
segment faults, C. For heap exhaustion or null pointers,
Java, etc. Rich did a marvelous thing by forcing alter to
require dosync. It eliminates a whole class of errors. 

When I find a mistake I still try to find the root cause.
Then I try to change what I do so the mistake cannot exist.
This changes the type of possible errors but the 3% is still
there. I just make "more sophisticated, higher level errors".
I am hoping that Literate Programming will raise my errors
to truly epic proportions :-)

One of my personal motivations for literate programming is
to eliminate errors. I have no tool that will catch errors
in reasoning, missing cases, bad design, mindless stupidity,
and horrible inefficiency. Writing an explanation of the
code is the best way I have found to catch errors of this
kind. 

One of Rich's stated motivations for Clojure was that he
found concurrent programming in various languages to be
very error prone and wanted to create a language that would
eliminate concurrent errors. In some sense, we are trying
to achieve similar goals.

So Literate Programming is not about tools. It is about a
change in mindset. I want to be a better programmer and this
is an effective tool to help me generate higher quality (ie
less buggy) code.

Tim Daly


-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Colin Yates  writes:

> Has anybody got any "real world usage reports" regarding using literate 
> programming in emacs?  In particular, does paredit and slime work inside 
> the clojure "fragments" when using org.babel for example?

For the update in Pallet docs [1], we've been using Jekyll with
markdown. To edit code blocks within the markdown, I've been using
mumamo [2] in emacs, with a variant of jekyll-mumamo.el [3]. An example
of what markdown with clojure blocks looks like is the how-to for using
a server-rack with Pallet [4] (unfortunately, Jekyll doesn't use the
same fencing for code blocks as GitHub).

SLIME works fully within the code blocks. For example C-x C-e can be
used to evaluate expressions. Paredit also works.

Obviously this is not a full literate programming environment, but
someone might find it useful.

Hugo


[1] http://palletops.com/doc/
[2] http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html
[3] https://gist.github.com/1666286
[4] 
https://raw.github.com/pallet/pallet.github.com/master/doc/how-tos/_posts/2012-01-26-using-pallet-with-existing-servers.md

-- 
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: Accessing vals in clojure.lang.PersistentVector

2012-02-01 Thread Simon Holgate


I missed your reply, Raek. Sorry. Your solution is very helpful.

Cheers,

Simon

> From what I can tell, you want to list the values and extract the
> value associated with :time for a map. The problem is that res is not
> a map, but a vector of maps. If you want to do these operations on
> every map in the vector you can use the map function ("map" as in "to
> map"):
>
>     (map vals res)
>
>     (map :time res)
>
> In the last example I made use of the fact that keywords also work as
> functions. (:some-keyword some-map) is the same as (get some-map
> :some-keyword).
>
> To play in the repl with the first value in the vector in the repl you
> can extract it with nth or get:
>
>     user> (def res ...)
>     #'res
>     user> (def first-res (nth res 0))
>     #'first-res
>     user> (vals first-res)
>     ...
>     user> (get first-res :time)
>     ...
>
> // raek

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


SoftCaching in core.cache

2012-02-01 Thread Bill Caputo
Hello All,

Looking at the docs for core.cache:
https://github.com/clojure/core.cache

There is mention that support for SoftCache (caching using soft references) is 
not supported as the clache implementation was buggy and so not (yet) brought 
over.

We are looking to add soft-reference based caching to one of our applications 
and I was wondering if anyone could shed light on what the issues with clache's 
implementation were (i.e. is a total loss, or would it potentially be a good 
place for us to start, and so perhaps implement something that could be 
submitted back).

For background:
Our ideal solution would be something like a LRU cache that had a fixed-memory 
constraint (e.g. some % of the total memory available to the box and/or JVM) so 
that we can minimize trips to the data store yet still ensure the application 
doesn't start paging due to too large a cache in an otherwise pretty 
simple/vanilla environment (i.e. no updates, read-only data).

Also open to other approach than core.cache that are being used by others in 
the clojure community (e.g. wrapping ehcache or memcache-d, jcs etc).

thanks,
bill

-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread Mark Engelberg
On Wed, Feb 1, 2012 at 5:38 AM, Hugo Duncan  wrote:
> SLIME works fully within the code blocks. For example C-x C-e can be
> used to evaluate expressions. Paredit also works.

My understanding is that unless you use C-c C-k to evaluate the entire
file (which I don't think works in a literate program) the expressions
evaluate in a way that doesn't provide Clojure with line numbers,
making stacktraces even more obtuse.  Am I wrong, or has anyone found
a way around this issue?

-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Mark Engelberg  writes:

> On Wed, Feb 1, 2012 at 5:38 AM, Hugo Duncan  wrote:
>> SLIME works fully within the code blocks. For example C-x C-e can be
>> used to evaluate expressions. Paredit also works.
>
> My understanding is that unless you use C-c C-k to evaluate the entire
> file (which I don't think works in a literate program) the expressions
> evaluate in a way that doesn't provide Clojure with line numbers,
> making stacktraces even more obtuse.  Am I wrong, or has anyone found
> a way around this issue?

I use ritz [1], which keeps track of of both repl source forms, and sets
correct line numbers when compiling functions with C-c C-c. 

Each REPL source form is numbered, and you can list them with M-x
slime-list-repl-forms.

When running a function compiled from a markdown file with C-c C-c
(which is M-x slime-compile-defun), any exception ends up showing the
line number in the markdown file. eg.

  Backtrace:
0: user$f.invoke (2012-01-14-script.md:27)

Also, exceptions land you in the debugger, so it is quite easy to see
where a problem is occurring.


[1] https://github.com/pallet/ritz

-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread Fogus
I would love to see your .emacs setup around these tools.

-- 
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: SoftCaching in core.cache

2012-02-01 Thread Fogus
Oddly enough it was leaking memory, but suspect it had to do with the
queue reaper.  I'd think that what's in Clache needs only a little
work.  Patches welcomed.

-- 
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: Literate programming in emacs - any experience?

2012-02-01 Thread Hugo Duncan
Fogus  writes:

> I would love to see your .emacs setup around these tools.

I'll put together a blog post - my .emacs files could do with a cleanup,
so this sounds like a good excuse to get it done.

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


Clojure/West "friend of attendee" discount and Stu H's talk

2012-02-01 Thread Alex Miller
1) I updated the Clojure/West site today with Stuart Halloway's talk:

__Evident Code, at Scale__

According to Webster, evident means "clear to the vision or
understanding." In this talk, I will present specific practices that
you can apply to make your code more evident, particularly on larger
projects.

It is relatively easy to make toy-sized programs evident, but the
exciting aspect of these ideas is their application at scale. I will
share insights from my own experience applying these practices on a
multi-year product effort undertaken in Clojure.

Link: http://clojurewest.org/sessions#halloway

2) I announced the Clojure/West "friend of attendee" program this
week.

If you're already attending and you have a friend register, you get a
$25 refund (for up to 4 friends)!  If you register and you already
have a friend attending, you get a $25 discount!  Unicorns all around.

More: http://clojurewest.org/friend-of-attendee

3) I decided to keep the early bird pricing for Clojure/West training
sessions going so those did not go up this week as originally
planned.  Due to a lack of interest, we did unfortunately cancel the
Pallet class.  Maybe next time...

- Intro to Clojure - Stuart Sierra, Alan Dipert (3 days, $1700)
- Cascalog - Sam Ritchie (3 days, $1700)
- Clojure Web - Chris Granger (2 days, $1000)

More: http://clojurewest.org/training

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


WebSockets with Clojure

2012-02-01 Thread blais
Hi Clojurians,

Does anyone have experience with serving WebSockets from Clojure, in
particular w.r.t. scalability? I'm evaluating server-side options for
handling a large number of simultaneous web clients (>100) and
wondering how well this scales.

I already hooked up Clojure to Netty and built a simple test
application. I think I'll write some stress tests, but any feedback
regarding how well this could scale, possible roadblocks, or
experience reports would be appreciated and informative.

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


Re: WebSockets with Clojure

2012-02-01 Thread Jay Fields
I haven't hooked up that many clients, but I can recommend Webbit
(https://github.com/webbit/webbit) based on experience.

Cheers, Jay

On Wed, Feb 1, 2012 at 5:05 PM, blais  wrote:
> Hi Clojurians,
>
> Does anyone have experience with serving WebSockets from Clojure, in
> particular w.r.t. scalability? I'm evaluating server-side options for
> handling a large number of simultaneous web clients (>100) and
> wondering how well this scales.
>
> I already hooked up Clojure to Netty and built a simple test
> application. I think I'll write some stress tests, but any feedback
> regarding how well this could scale, possible roadblocks, or
> experience reports would be appreciated and informative.
>
> 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


Re: SoftCaching in core.cache

2012-02-01 Thread Bill Caputo

On Feb 1, 2012, at 1:25 PM, Fogus wrote:

> Oddly enough it was leaking memory, but suspect it had to do with the
> queue reaper.  I'd think that what's in Clache needs only a little
> work.  Patches welcomed.

Thanks, we'll likely take a look at it then. If we patch it, we'll send 
something along...


bill

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


Leiningen survey results

2012-02-01 Thread Phil Hagelberg

I just finished up summarizing the results for the Leiningen survey I
posted a few weeks ago. We ended up with just over 300 answers, so if
you're interested in getting a snapshot of usage you can see it at
http://lein-survey.herokuapp.com/results

-Phil

-- 
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: WebSockets with Clojure

2012-02-01 Thread Moritz Ulrich
There's also aleph[1] which also uses netty. I'd suggest trying it, as
it encapsulates websockets and other means of transportation in a
clean way.
(Although I have no idea how well aleph scales)

[1]: https://github.com/ztellman/aleph

Cheers,
Moritz

On Wed, Feb 1, 2012 at 23:52, Jay Fields  wrote:
> I haven't hooked up that many clients, but I can recommend Webbit
> (https://github.com/webbit/webbit) based on experience.
>
> Cheers, Jay
>
> On Wed, Feb 1, 2012 at 5:05 PM, blais  wrote:
>> Hi Clojurians,
>>
>> Does anyone have experience with serving WebSockets from Clojure, in
>> particular w.r.t. scalability? I'm evaluating server-side options for
>> handling a large number of simultaneous web clients (>100) and
>> wondering how well this scales.
>>
>> I already hooked up Clojure to Netty and built a simple test
>> application. I think I'll write some stress tests, but any feedback
>> regarding how well this could scale, possible roadblocks, or
>> experience reports would be appreciated and informative.
>>
>> 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



-- 
Moritz Ulrich

-- 
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: Contrib for Clojure 1.3

2012-02-01 Thread kohyama
Sun,

Thank you for your information.

If I want to use the "contrib compiled against 1.3" with Leiningen, does 
anyone know what entry I should specify at :dependencies in project.clj?

Regards,
Yoshinori Kohyama

-- 
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: EuroClojure 2012: CfP open

2012-02-01 Thread Daniel Kwiecinski
What's the promo code?

--
λambder

-- 
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: Contrib for Clojure 1.3

2012-02-01 Thread Sean Corfield
On Tue, Jan 31, 2012 at 6:33 PM, kohyama  wrote:
> If I want to use the "contrib compiled against 1.3" with Leiningen, does
> anyone know what entry I should specify at :dependencies in project.clj?

If you follow that link, you'll see the github repo that Allen
maintains and if you scroll down, you'll see:

How do I use it?

Check it out, then mvn install Change your clojure contrib dependency
to [org.clojure/clojure-contrib "1.3-compat"]

Note that you'll have to host the jar in a private maven repo
yourself, or mvn install it on all boxes that want to use it.

(I can't vouch for those instructions - I haven't tried it myself -
I'm just pasting here what it says in the README)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

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