On May 2, 5:21 am, "John D. Hume" <duelin.mark...@gmail.com> wrote:
> On May 2, 2013 2:04 AM, "David Toomey" <dbtoo...@gmail.com> wrote:
>
> > Is there anything
> > I could show that could reveal the problem?
>
> Yes, you should have shown the stack trace of the exception (or at least
> the part from the top of the text down to your code).
>
> But even without that, you have an error coming out of noir.session that
> says something is unbound where an atom was expected. That should send you
> to the source for noir.session. There you'll see everything depends on the
> dynamic global *noir-session*, which is only ever bound by
> wrap-noir-session, which you're not calling. That's a compojure middleware
> fn. Take a look at some compojure tutorial to see where and how they're
> used.
>
> There are likely other similar middleware fn calls noir will expect you to
> have made. Hopefully having struggled with this one, figuring the others
> out will be easy.

Wow. What an amazing answer.

The stack trace: The main error is the title of this thread. The
second line is something about swap! and clojure.core, the next line
traces directly to the line of code that I pointed out 2 times above.
The next line after that points to a route, which I posted above as
well.

Here is the login code from 4clojure: what "middleware" and what call
to wrap-noir-session is being used here?

    (defn do-login [user pwd]
      (let [user (.toLowerCase user)
            {db-pwd :pwd} (from-mongo (fetch-one :users :where {:user
user}))
            location (session/get :login-to)]
        (if (and db-pwd (.checkPassword (StrongPasswordEncryptor.) pwd
db-pwd))
          (do (update! :users {:user user}
                       {:$set {:last-login (java.util.Date.)}}
                        :upsert false) ; never create new users
accidentally
              (session/put! :user user)
              (session/remove! :login-to)
              (response/redirect (or location "/problems")))
          (flash-error "/login" "Error logging in."))))

Clearly, there is none.

Then you give me a total fuck you answer, "Hopefully having struggled
with this one, figuring the others out will be easy."

How is that at all helpful? You tell me to look at the Lib-Noir source
and the source says exactly what I already knew (because, clearly you
are psychic and you know that I didn't look already). Wait... do you
want me to ask Google for a Clojure login page tutorial? Done, do you
know what the first several hits are? My blog which explains how to do
it in Noir. The next few are Stack Overflow threads asking about
creating login pages and this very topic:

This thread, with 4 upvotes is unanswered:
http://stackoverflow.com/questions/14806063/howto-use-lib-noir-stateful-sessions-in-compojure

Four upvotes is quite a lot for a Clojure question. This probably
indicates that this is a broad issue that affects many people. Why?
Because of this shit right here. Clojure is a beautiful language, but
these kind of LOL answers are exactly why the community sucks (I've
read and heard more that a few disturbing complaints) and why people
don't want to learn the language, which is further exacerbated by the
sub-optimal documentation and don't even get me started on the half-
assed tutorials ("Look at WHAT middleware tutorial?). If a person just
coming to Clojure is struggling to create something incredibly basic
(hell, IDK, a login page?) and when asked, can't get a civil response,
then the language is toast.

I linked to my github. Does the projects look like the work of someone
that is an utter moron at this language or Lisp in general?

Let me take this moment to help you: the correct way to answer the
question is to direct me to a *reputable* source that touches on this
issue, and maybe just maybe accept the retarded idea that I showed you
EXACTLY where the stacktraces pointed (which I did). If all else
fails, you can even tell me the answer or at least try to answer it in
a way that isn't utterly condescending or act like you can't look at 5
LOC and not comprehend that ";;;;error on this line" means "error on
this line." Clearly, I don't see what the issue is and I am asking for
help to see where my logic is wrong: I'm not asking you to be an ass.

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


Reply via email to