Re: conversion problems using (count @someatom)

2012-10-29 Thread Sean Corfield
Your last argument is not a sequence - remove the apply.

(and you probably want to remove the conj [] on the free memory call?)

On Mon, Oct 29, 2012 at 9:21 AM, larry google groups
 wrote:
> Now Ihave this and I get errors:
>
> (defn show-stats-regarding-resources-used-by-this-app [request]
>   (response (apply str "Memory in use (percentage/used/max-heap): "
> (who/memory-usage) "  CPU usage (how-many-cpu's/load-average):  "
> (who/cpu-load-usage)  " free memory in jvm: " (conj []
> (who/free-memory-in-jvm))  " How many people are logged in: " (str (count
> @registry)
>
> I get:
>
> 2012-10-29 12:15:02.045:WARN:oejs.AbstractHttpConnection:/show-resources
> java.lang.IllegalArgumentException: Don't know how to create ISeq from:
> java.lang.Long
>
> I tried this with and without the "str". What is wrong with this?

-- 
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: conversion problems using (count @someatom)

2012-10-29 Thread AtKaaZ
(apply str "Memory
apply str (list "memory ... )
no?

On Mon, Oct 29, 2012 at 5:21 PM, larry google groups <
lawrencecloj...@gmail.com> wrote:

> I decided I wanted to be able to see some stats about my little app, so I
> added this function:
>
> (defn show-stats-regarding-resources-used-by-this-app [request]
>   (response (apply str "Memory in use (percentage/used/max-heap): "
> (who/memory-usage) "  CPU usage (how-many-cpu's/load-average):  "
> (who/cpu-load-usage)  " free memory in jvm: " (conj []
> (who/free-memory-in-jvm)
>
> This worked great, but then I decided to add this to the end:
>
> " How many people are logged in: " (str (count @registry))
>
> The registry is defined as:
>
> (def registry (atom {}))
>
> And this map keeps maps inside of it, one for each user, so it is a 2D
> map.
>
> Now Ihave this and I get errors:
>
> (defn show-stats-regarding-resources-used-by-this-app [request]
>   (response (apply str "Memory in use (percentage/used/max-heap): "
> (who/memory-usage) "  CPU usage (how-many-cpu's/load-average):  "
> (who/cpu-load-usage)  " free memory in jvm: " (conj []
> (who/free-memory-in-jvm))  " How many people are logged in: " (str (count
> @registry)
>
> I get:
>
> 2012-10-29 12:15:02.045:WARN:oejs.AbstractHttpConnection:/show-resources
> java.lang.IllegalArgumentException: Don't know how to create ISeq from:
> java.lang.Long
>
> I tried this with and without the "str". What is wrong with this?
>
>
>
>
>
>
>
>  --
> 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




-- 
I may be wrong or incomplete.
Please express any corrections / additions,
they are encouraged and appreciated.
At least one entity is bound to be transformed if you do ;)

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

conversion problems using (count @someatom)

2012-10-29 Thread larry google groups
I decided I wanted to be able to see some stats about my little app, so I 
added this function: 

(defn show-stats-regarding-resources-used-by-this-app [request]
  (response (apply str "Memory in use (percentage/used/max-heap): " 
(who/memory-usage) "  CPU usage (how-many-cpu's/load-average):  " 
(who/cpu-load-usage)  " free memory in jvm: " (conj [] 
(who/free-memory-in-jvm) 

This worked great, but then I decided to add this to the end:

" How many people are logged in: " (str (count @registry))

The registry is defined as: 

(def registry (atom {}))

And this map keeps maps inside of it, one for each user, so it is a 2D map. 

Now Ihave this and I get errors: 

(defn show-stats-regarding-resources-used-by-this-app [request]
  (response (apply str "Memory in use (percentage/used/max-heap): " 
(who/memory-usage) "  CPU usage (how-many-cpu's/load-average):  " 
(who/cpu-load-usage)  " free memory in jvm: " (conj [] 
(who/free-memory-in-jvm))  " How many people are logged in: " (str (count 
@registry) 

I get:

2012-10-29 12:15:02.045:WARN:oejs.AbstractHttpConnection:/show-resources
java.lang.IllegalArgumentException: Don't know how to create ISeq from: 
java.lang.Long

I tried this with and without the "str". What is wrong with this? 







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