SOAP server

2018-10-05 Thread Renata Soares
Hello!

I need suggestions of libraries (or others solutions) to implement a soap 
server in a clojure project. The project is long-term and i saw some 
libraries that are no longer maintained. So anyone uses one of them? Which 
is recommended?

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 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/d/optout.


Re: Future

2018-05-19 Thread Renata Soares
It worked, thanks!

Em sábado, 19 de maio de 2018 19:38:28 UTC-3, Alex Engelberg escreveu:
>
> Not sure what's going on with shutdown-agents, but you could call (run! 
> deref ...) to wait for all the futures to complete.
>
> On Sat, May 19, 2018 at 3:29 PM Renata Soares  > wrote:
>
>> Hello,
>>
>> I am using future this way:
>>
>> (doall (map #(future ()  (range 1 
>> max-size))
>>
>> When the max-size is small like around 6, if I don't print (println 
>> (doall (map #(future ()  (range 1 
>> max-size))), the result  becomes empty
>>
>> (Without print)
>>
>> renata@renata:~/$ lein run
>> ranking  {}
>>
>> (With print)
>> renata@renata:~/$$ lein run
>> (#object[clojure.core$future_call$reify__6962 0x6492fab5 {:status :ready, 
>> :val {:2 0, :4 0.0, :5 0, :1 2.5}}] 
>> #object[clojure.core$future_call$reify__6962 0x2c532cd8 {:status :ready, 
>> :val {:2 0}}] #object[clojure.core$future_call$reify__6962 0x294e5088 
>> {:status :ready, :val {:2 0, :4 0.0, :5 0, :1 2.5, :3 1.0}}] 
>> #object[clojure.core$future_call$reify__6962 0x51972dc7 {:status :ready, 
>> :val {:2 0, :4 0.0}}] #object[clojure.core$future_call$reify__6962 
>> 0x3700ec9c {:status :ready, :val {:2 0, :4 0.0, :5 0}}])
>> ranking  {"1":2.5,"3":1.0,"5":0,"4":0.0,"2":0}
>>
>> I am using (shutdown-agents) after the doall...
>>
>> Any ideas why? I think it is because the futures aren't ready when 
>> (shutdown-agents) executes.
>>
>> (When the max-size is big, run normally)
>>
>> There is a way that I can wait for print the result until all futures are 
>> ready?
>>
>> Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/d/optout.


Future

2018-05-19 Thread Renata Soares
Hello,

I am using future this way:

(doall (map #(future ()  (range 1 max-size))

When the max-size is small like around 6, if I don't print (println (doall 
(map #(future ()  (range 1 max-size))), the 
result  becomes empty

(Without print)

renata@renata:~/$ lein run
ranking  {}

(With print)
renata@renata:~/$$ lein run
(#object[clojure.core$future_call$reify__6962 0x6492fab5 {:status :ready, 
:val {:2 0, :4 0.0, :5 0, :1 2.5}}] 
#object[clojure.core$future_call$reify__6962 0x2c532cd8 {:status :ready, 
:val {:2 0}}] #object[clojure.core$future_call$reify__6962 0x294e5088 
{:status :ready, :val {:2 0, :4 0.0, :5 0, :1 2.5, :3 1.0}}] 
#object[clojure.core$future_call$reify__6962 0x51972dc7 {:status :ready, 
:val {:2 0, :4 0.0}}] #object[clojure.core$future_call$reify__6962 
0x3700ec9c {:status :ready, :val {:2 0, :4 0.0, :5 0}}])
ranking  {"1":2.5,"3":1.0,"5":0,"4":0.0,"2":0}

I am using (shutdown-agents) after the doall...

Any ideas why? I think it is because the futures aren't ready when 
(shutdown-agents) executes.

(When the max-size is big, run normally)

There is a way that I can wait for print the result until all futures are 
ready?

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 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/d/optout.


doall

2018-05-16 Thread Renata Soares
Hello,

I have this vec called *inviteds* [:2 :4]

and I want to produce something like (hash-map :2 1, :4 1)

(doall (map #(hash-map % 1) *inviteds*))

but returns ({:2 1} {:4 1})

How can I produce the same result as (hash-map :2 1, :4 1) with doall (or 
other similar function)?

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 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/d/optout.


Key must be integer error

2018-04-29 Thread Renata Soares
Hi,

How can I update the atom accounts in the field of operations?

(def accounts (atom [{:id "7512a15b-0770-4a9b-a74b-389374b46461", :balance 
0.0, :operations nil, :blocked false} 
  {:id "7446cfe6-882c-4f25-bad1-5ed8c9aea994", :balance 0.0, :operations 
nil, :blocked false} 
  {:id "3136860d-ab7f-4814-8f3b-2d18048db9b9", :balance 0.0, :operations 
nil, :blocked false} 
  {:id "2dc20615-f1f7-4637-9602-ae9494689166", :balance 0.0, :operations 
nil, :blocked false}
  {:id "c6dccf4a-535c-4eba-8cfc-0554408de8bd", :balance 0.0, :operations 
nil, :blocked false}]))

I tried this:

(swap! accounts (fn [x] (update-in x [:operations]  #(if (= (:id %) 
account-id) new-value

and returns "key must be integer" because of [:operations]

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 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/d/optout.


Re: lein midje not working

2018-04-11 Thread Renata Soares
I found the problem... in my core.clj i was using (slurp *in*) to get 
contents via stdin. 
'lein midje' performs 'lein run' first?

Em quarta-feira, 11 de abril de 2018 20:27:04 UTC-3, Renata Soares escreveu:
>
> Hello,
>
> I am running 'lein midje' on my project and looks like an infinite loop. 
> Doesn't show any message of error. 
>
> Project.clj:
>
> (defproject job-queue "0.1.0-SNAPSHOT"
>   :description "FIXME: write description"
>   :url "http://example.com/FIXME";
>   :main job-queue.core
>   :license {:name "Eclipse Public License"
> :url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.8.0"]
>  [org.clojure/data.json "0.2.6"]
>  [midje "1.9.0"]]
>   :plugins [[lein-midje "3.2.1"]])
>
> I created this test just to check the midje:
>
> (ns job-queue.core-test
> (:require [job-queue.core :refer :all]
>   [midje.sweet :refer :all]))
>
> (fact
>   [1 3 5 8] => (contains even?))
>
> What can it be?
>
> 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 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/d/optout.


Re: lein midje not working

2018-04-11 Thread Renata Soares
It happens with 'lein repl' too (gives timeout in this case).

Em quarta-feira, 11 de abril de 2018 20:27:04 UTC-3, Renata Soares escreveu:
>
> Hello,
>
> I am running 'lein midje' on my project and looks like an infinite loop. 
> Doesn't show any message of error. 
>
> Project.clj:
>
> (defproject job-queue "0.1.0-SNAPSHOT"
>   :description "FIXME: write description"
>   :url "http://example.com/FIXME";
>   :main job-queue.core
>   :license {:name "Eclipse Public License"
> :url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.8.0"]
>  [org.clojure/data.json "0.2.6"]
>  [midje "1.9.0"]]
>   :plugins [[lein-midje "3.2.1"]])
>
> I created this test just to check the midje:
>
> (ns job-queue.core-test
> (:require [job-queue.core :refer :all]
>   [midje.sweet :refer :all]))
>
> (fact
>   [1 3 5 8] => (contains even?))
>
> What can it be?
>
> 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 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/d/optout.


lein midje not working

2018-04-11 Thread Renata Soares
Hello,

I am running 'lein midje' on my project and looks like an infinite loop. 
Doesn't show any message of error. 

Project.clj:

(defproject job-queue "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :main job-queue.core
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
 [org.clojure/data.json "0.2.6"]
 [midje "1.9.0"]]
  :plugins [[lein-midje "3.2.1"]])

I created this test just to check the midje:

(ns job-queue.core-test
(:require [job-queue.core :refer :all]
  [midje.sweet :refer :all]))

(fact
  [1 3 5 8] => (contains even?))

What can it be?

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 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/d/optout.


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
Thanks for the tips!

Em terça-feira, 3 de abril de 2018 20:39:25 UTC-3, Base escreveu:
>
> Swap requires an atom as an input. 
>
> https://clojuredocs.org/clojure.core/swap!
>
> If you are trying to perform swap! on a collection that was just read from 
> json/read-str then it is probably not an atom, and you would need to 
> convert it to an atom before doing this. 
>
> However, generally there are specific use cases where you would want to 
> use an atom (concurrency), but most of the time you would just want to use 
> a regular data structure unless concurrency is an issue with what you are 
> doing with the data. 
>
> Read this as well.
>
> https://clojure.org/reference/atoms
>
> On Tuesday, April 3, 2018 at 6:24:27 PM UTC-5, Renata Soares wrote:
>>
>> Good Night,
>>
>> I have this function:
>>
>> (defn treat-requests [key-request collection]
>> (let [selecteds (filter #((keyword key-request) %) input)]
>> (doseq [item selecteds]
>> (swap! collection conj item
>>
>> where input is an output of clojure.data.json/read-str and swap is giving 
>> this following error:
>>
>> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>>
>> How can I solve it?
>>
>> Thanks in advance.
>>
>

-- 
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/d/optout.


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
I was passing as a parameter with @ before... it worked when i passed just 
the atom name. Thanks.

Em terça-feira, 3 de abril de 2018 20:36:58 UTC-3, André escreveu:
>
> collection probably isn’t an atom. Do you have a fully working snippet?
>
> On 04/03/2018 08:24 PM, Renata Soares wrote:
>
> Good Night,
>
> I have this function:
>
> (defn treat-requests [key-request collection]
> (let [selecteds (filter #((keyword key-request) %) input)]
> (doseq [item selecteds]
> (swap! collection conj item
>
> where input is an output of clojure.data.json/read-str and swap is giving 
> this following error:
>
> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>
> How can I solve it?
>
> Thanks in advance.
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
> ​
>

-- 
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/d/optout.


clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
Good Night,

I have this function:

(defn treat-requests [key-request collection]
(let [selecteds (filter #((keyword key-request) %) input)]
(doseq [item selecteds]
(swap! collection conj item

where input is an output of clojure.data.json/read-str and swap is giving 
this following error:

clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

How can I solve it?

Thanks in advance.

-- 
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/d/optout.


Re: How to apply multiple values to a function

2018-03-28 Thread Renata Soares
It worked, thanks!

Em quarta-feira, 28 de março de 2018 21:25:31 UTC-3, Moe Aboulkheir 
escreveu:
>
> Renata,
>
> It depends on what you want to with the results of treat-request.  If you 
> don't care about them, which seems like the case:
>
> (doseq <https://clojuredocs.org/clojure.core/doseq> [[x y z] [x1 y1 z1] 
> [x2 y2 z2] [x3 y3 z3]]
>   (treat-request x y z))
>
> Is one way to accomplish it.  If you want a collection of the results, 
> replace doseq with for <https://clojuredocs.org/clojure.core/for> (maybe 
> take a look at doall <https://clojuredocs.org/clojure.core/doall>, also).
>
> In terms of the general approach - if the goal is to end up with a 
> sequence containing only the specified keys from each map (i.e. the 
> 'collection' argument is the same for all invocations), then you can 
> accomplish this without an atom:
>
> (for [[m ks] [[m1 ks1] [m2 ks2] ...]]
>   (select-keys m ks))
>
> Does just that.
>
> Take care,
> Moe
>
> On Thu, Mar 29, 2018 at 12:27 AM, Renata Soares  > wrote:
>
>> Good night,
>>
>> I have this function: 
>>
>> (defn treat-requests [input key-request collection]
>> (let [selecteds (select-keys input key-request)]
>> (swap! collection conj selecteds)))
>>
>> and I want to execute that 3 times with 3 differents arguments
>>
>> How can I do to apply a list of differents arguments to a function?
>>
>> Instead of calling 3 times like:
>>
>> (treat-request x1 y1 z1)
>> (treat-request x2 y2 z2)
>> (treat-request x3 y3 z3)
>>
>> I want to call one time. For example... (apply treat-request [x1 y1 z1] 
>> [x2 y2 z2] [x3 y3 z3]) 
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/d/optout.


How to apply multiple values to a function

2018-03-28 Thread Renata Soares
Good night,

I have this function: 

(defn treat-requests [input key-request collection]
(let [selecteds (select-keys input key-request)]
(swap! collection conj selecteds)))

and I want to execute that 3 times with 3 differents arguments

How can I do to apply a list of differents arguments to a function?

Instead of calling 3 times like:

(treat-request x1 y1 z1)
(treat-request x2 y2 z2)
(treat-request x3 y3 z3)

I want to call one time. For example... (apply treat-request [x1 y1 z1] [x2 
y2 z2] [x3 y3 z3]) 


-- 
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/d/optout.