Re: Two clojure with emacs questions

2012-12-19 Thread Tassilo Horn
Jonathon McKitrick writes: >> Yes, then you are using nrepl and not SLIME/Swank. I use that, too, >> and I haven't encountered hangs with (in-ns ...) forms yet. If you >> have your project accessible somewhere, I'm happy to try to reproduce >> the issue. > > I have a bit more information. > > T

Re: Tail call in multi method?

2012-12-19 Thread bruce li
Very helpful. Thanks so much! 2012/12/18 Chas Emerick > On Dec 17, 2012, at 12:39 PM, Ben Wolfson wrote: > > > On Mon, Dec 17, 2012 at 9:32 AM, Chas Emerick wrote: > >> > >> What you're trying to do is really a special case of mutual recursion: > >> because Clojure's methods are separate functi

Re: Little namespace question

2012-12-19 Thread Alan Shaw
Oh! yes it does! -A On Wed, Dec 19, 2012 at 6:39 PM, Dave Ray wrote: > It does, right? > > > On Wednesday, December 19, 2012, Alan Shaw wrote: > >> But returning the evaluation was a requirement... >> >> >> On Wed, Dec 19, 2012 at 2:58 PM, Alan Shaw wrote: >> >> No, there was no requirement

Re: clojure-contrib migrations

2012-12-19 Thread Alasdair MacLeod
On Monday, 17 December 2012 23:44:12 UTC, Christopher Meiklejohn wrote: > > [...]I'd like to offer to step up and maintain clojure-contrib.graph, > mainly starting with converting the defstructs over to defrecords [...] > Out of interest - why use records rather than plain maps? -- You receive

Re: compojure in production

2012-12-19 Thread Sun Ning
Check out ring-jetty-adapter https://github.com/ring-clojure/ring/tree/master/ring-jetty-adapter The compojure app can be treated as a ring app. On Thu 20 Dec 2012 08:22:19 AM CST, Maris wrote: How can I run my compojure app without leiningen ? I want to use dedicated jetty server (not war f

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Murtaza Husain
I have changed the parameter name to 'identifier', however I am still hitting the NPE, any ideas? I have placed the code on github - https://github.com/murtaza52/cfaiz.git, if you would like to take a look. Thanks, Murtaza On Thursday, December 20, 2012 12:12:27 AM UTC+5:30, Chas Emerick wr

Re: Little namespace question

2012-12-19 Thread Dave Ray
It does, right? On Wednesday, December 19, 2012, Alan Shaw wrote: > But returning the evaluation was a requirement... > > > On Wed, Dec 19, 2012 at 2:58 PM, Alan Shaw wrote: > > No, there was no requirement that it be a macro. Thanks! > > -A > > > > On Wed, Dec 19, 2012 at 7:40 AM, Dave Ray wro

Re: Two clojure with emacs questions

2012-12-19 Thread Jonathon McKitrick
Yes, then you are using nrepl and not SLIME/Swank. I use that, too, and > I haven't encountered hangs with (in-ns ...) forms yet. If you have > your project accessible somewhere, I'm happy to try to reproduce the > issue. > I have a bit more information. The interface hangs running in Carb

compojure in production

2012-12-19 Thread Maris
How can I run my compojure app without leiningen ? I want to use dedicated jetty server (not war file). -- 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 a

Re: Fair conjunction and parallel solvers in core.logic

2012-12-19 Thread David Nolen
Great write up! :) David On Wed, Dec 19, 2012 at 5:52 PM, Jamie Brandon wrote: > Last week I figured out how to add fair conjunction and a parallel > solver (via fork-join) to core.logic. I just wrote up an explanation > of how it works which may be interesting: > > > http://scattered-thoughts

Re: [ANN] lein-stencil 0.1.0

2012-12-19 Thread Matthew O. Smith
I renamed the project to lein-resource as that better matches the intent of the project rather than an implmentation detail *https://github.com/m0smith/lein-resource * -- You received this message because you are subscribed to the Google Groups "Clojure

Fair conjunction and parallel solvers in core.logic

2012-12-19 Thread Jamie Brandon
Last week I figured out how to add fair conjunction and a parallel solver (via fork-join) to core.logic. I just wrote up an explanation of how it works which may be interesting: http://scattered-thoughts.net/blog/2012/12/19/search-trees-and-core-dot-logic/ https://github.com/jamii/core.logic/tree

Re: ClojureCLR errors on Mono Linux

2012-12-19 Thread Shantanu Kumar
Here are the steps how to reproduce the issue on 32-bit Ubuntu 12.04: 1. lein new lein-clr foo 2. cd foo 3. # edit project.clj to download the dependencies using :clj-dep 4. lein clr -v compile :all 5. lein clr -v test It will show the exact commands being executed. Are the same Clojure binaries

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

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

2012-12-19 Thread Wei Hsu
I second Manuel's environment variable approach. On herokuthis is easy to set with heroku config:add PASSWORD_FILE="/etc/passwords" For more complex deployments, you can use automation systems like Pallet or Chef to manage environment variable

Re: Little namespace question

2012-12-19 Thread Dave Ray
A function seems to work fine unless I don't understand your requirement: ; normal version that takes code forms and symbols (defn eval-in [code ns] (let [old (-> *ns* str symbol)] (try (in-ns ns) (eval code) (finally (in-ns old) ; sugary

Re: Two clojure with emacs questions

2012-12-19 Thread Jack Moffitt
On Wed, Dec 19, 2012 at 9:52 AM, Jonathon McKitrick wrote: > I was wondering if I could make changes in emacs, C-c C-k, and refresh the > web page to see the results. You'll probably want to use ring-serve for this. To some degree lein-ring also offers this functionality as it uses wrap-reload mi

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

2012-12-19 Thread Alex Baranosky
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

Re: Little namespace question

2012-12-19 Thread Alan Shaw
Thanks again. This version is easier for my non-macro brain to follow. -A On Wed, Dec 19, 2012 at 8:58 AM, juan.facorro wrote: > The following example shows an implementation of *eval-in* as a function. > > There are a some *println* added to show the namespace where the code is > running at e

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

2012-12-19 Thread Manuel Paccagnella
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

Re: How to structure a Clojure day for noobs?

2012-12-19 Thread Nando
What about Clooj? http://dev.clojure.org/display/doc/getting+started+with+Clooj Is it too buggy, or lacking in features, to start out with? On Tue, Dec 18, 2012 at 11:27 AM, ulsa wrote: > Good point. > > I really would like themselves to be able to set up their own environment. > I think it giv

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Chas Emerick
The parameter name is 'identifier' (not 'openid_identifier') by default (which you can customize if you want by specifying a :user-identifier-param option in openid/workflow). That said, the NPE you just hit has drawn my attention to an (unrelated) bug in the openid workflow. Thanks! :-) - Ch

Re: abysmal multicore performance, especially on AMD processors

2012-12-19 Thread Tassilo Horn
"Wm. Josiah Erikson" writes: > Then run, for instance: /usr/bin/time -f %E lein run > clojush.examples.benchmark-bowling > > and then, when that has finished, edit > src/clojush/examples/benchmark_bowling.clj and uncomment > ":use-single-thread true" and run it again. I think this is a > succinct

Reminder! Clojure/West 2013 CFP closes Jan 4th!

2012-12-19 Thread Alex Miller
I think if you reflect back on 2012 you'll find that one of your biggest regrets was not attending enough Clojure conferences. Don't worry though - Clojure/West is right around the corner! Make a new year's resolution to attend, or even better, submit a talk! Rich Hickey will be keynoting (along w

Re: abysmal multicore performance, especially on AMD processors

2012-12-19 Thread Wm. Josiah Erikson
I tried redefining the few places in the code (string_reverse, I think) that used reverse to use the same version of reverse that I got such great speedups with in your code, and it made no difference. There are not any explicit calls to conj in the code that I could find. On Wed, Dec 19, 2012 at

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Murtaza Husain
Thanks for catching that Aaron ! The app currently redirects to the login page now. However I get an error when I try to post to the "/openid" url with {"openid_identifier":"https://www.google.com/accounts/o8/id"} as post data. Here is the updated code - (ns faiz.handler (:use compojure.c

Re: abysmal multicore performance, especially on AMD processors

2012-12-19 Thread Lee Spector
On Dec 19, 2012, at 11:57 AM, Wm. Josiah Erikson wrote: > I think this is a succinct, deterministic benchmark that clearly > demonstrates the problem and also doesn't use conj or reverse. Clarification: it's not just a tight loop involving reverse/conj, as our previous benchmark was. It's our

Re: Two clojure with emacs questions

2012-12-19 Thread Tassilo Horn
Jonathon McKitrick writes: >> 1. Can emacs with swank dynamically update Noir code running locally, >> > or do I need to save the code and then 'lein run' to see the new >> > result? >> >> Without ever having used Noir, I would assume you can hack on the >> living instance at the REPL. > > I

[ANN] mesto, a memory storage for ClojureScript

2012-12-19 Thread Alexander Solovyov
mesto is a MEmory STOrage for ClojureScript, I wrote it because of my experience writing JS apps using Backbone.js. http://github.com/piranha/mesto Idea is that you have atom (or atoms), containing all information you need to show to user. Storing this information directly in DOM is not a nice op

Re: abysmal multicore performance, especially on AMD processors

2012-12-19 Thread Wm. Josiah Erikson
Whoops, sorry about the link. It should be able to be found here: http://gibson.hampshire.edu/~josiah/clojush/ On Wed, Dec 19, 2012 at 11:57 AM, Wm. Josiah Erikson wrote: > So here's what we came up with that clearly demonstrates the problem. Lee > provided the code and I tweaked it until I belie

Re: Little namespace question

2012-12-19 Thread juan.facorro
The following example shows an implementation of *eval-in* as a function. There are a some *println* added to show the namespace where the code is running at each point. ;; (ns another-ns) (defn X [w h] {:w w :h h}) ;; (ns this-ns) (defn eval-in [code

Re: abysmal multicore performance, especially on AMD processors

2012-12-19 Thread Wm. Josiah Erikson
So here's what we came up with that clearly demonstrates the problem. Lee provided the code and I tweaked it until I believe it shows the problem clearly and succinctly. I have put together a .tar.gz file that has everything needed to run it, except lein. Grab it here: clojush_bowling_benchmark.ta

Re: Two clojure with emacs questions

2012-12-19 Thread Jonathon McKitrick
Hi Tassilo > 1. Can emacs with swank dynamically update Noir code running locally, > > or do I need to save the code and then 'lein run' to see the new > > result? > > Without ever having used Noir, I would assume you can hack on the living > instance at the REPL. > I was wondering if I co

Re: [ANN] CJD 0.1.0, a documentation technology for Clojure programs

2012-12-19 Thread greenh
Yes, no argument, this is a problem, and I'm open to suggestions for solving it. As an aside, I personally don't find it to be a problem, as pretty much all of my documentation needs tend to be fulfilled by browser-based mechanisms, and my use of docstrings in a running system is negligible. Th

Re: Two clojure with emacs questions

2012-12-19 Thread Tassilo Horn
Jonathon McKitrick writes: Hi Jonathon, > 1. Can emacs with swank dynamically update Noir code running locally, > or do I need to save the code and then 'lein run' to see the new > result? Without ever having used Noir, I would assume you can hack on the living instance at the REPL. > 2. Whe

Two clojure with emacs questions

2012-12-19 Thread Jonathon McKitrick
1. Can emacs with swank dynamically update Noir code running locally, or do I need to save the code and then 'lein run' to see the new result? 2. When trying (in-ns ...) and a few other commands from emacs, nRepl hangs consistently. Is this user error? -- You received this message because y

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Aaron Cohen
On Wed, Dec 19, 2012 at 8:40 AM, Murtaza Husain < murtaza.hus...@sevenolives.com> wrote: > > (defroutes app-routes > (GET "/" [] (resp/redirect "/landing")) > (GET "/landing" [] (resp/file-response "landing.html" {:root "public"})) > (GET "/index" [] (index index-data)) > (route/files "/" {

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Murtaza Husain
Chas, Thanks for the great library and appreciate your taking the time to answer ! 1) I have included the key/val - :allow-anon? false - in the friend/authenticate options map, but I am still able to access all my urls without any redirection. 2) I have also set the :openid-url "/openid". I

Re: Need help in geeting cemerick/friend working with openid

2012-12-19 Thread Chas Emerick
Murtaza, First, you need to either (a) :allow-anon? false in the configuration map you provide to friend/authenticate — it is true by default, or (b) Use an authorization guard (which can include friend/authenticated, which reuses the authorization mechanism to ensure that only authenticated us