Thank you again. This has been educational.
On Monday, April 3, 2017 at 1:07:18 PM UTC-4, Sean Corfield wrote:
>
> This is lazy: (remove #{(first scores)} scores)
>
>
>
> Since find-related-positive-negative-true-false-records does not realize
> set-of-scores in order to return its value,
I apologize for my ignorance, but why is this lazy?
(conj vector-of-maps-of-vector-key-and-score
(find-related-positive-negative-true-false-records scores (first scores
Assuming the functions are not called eagerly simply because I am in a
loop. But what would the eager version of thi
> Because when you recur in your loop, you’re passing in lazy sequences, so
those
> are essentially building up a giant stack of delayed evaluations – and
when you hit bottom
> and try to realize those, that’s when your stack overflow hits you.
I was thinking the answer had something to do wi
Crazy! I re-wrote the (loop) to use (reduce) instead and now everything
works:
(defn loop-over-scores
[set-of-scores]
"2017-03-08 -- called from start.clj"
(reduce
;; 2017-04-01 -- we assume vector-with-path-score looks like this:
;; [[:positive :true 0.88 19 60 10 12 3 1 3 1 2 1]
Well, I am out of ideas. Let's assume I'll re-write this some other way.
What would be better than using (loop)? What would be less likely to cause
StackOverflow, or at least reveal why I'm seeing it.
On Saturday, April 1, 2017 at 6:23:29 PM UTC-4, piast...@gmail.com wrote:
>
>
> I have a func
So for instances, starting with an object that has about 32,000 lines that
need to be looped over, the code gets this far:
in loop-over-scores again 2375
It prints that out and then throws StackOverflow error.
But I don't see anything in there that would exhaust the stack. These
functions r
I have a function that will run repeatedly, so I use the at-at library to
call it:
https://github.com/overtone/at-at
I don't think this is the problem.
Sad to say, the Error is catching a StackOverflow, which I'm having trouble
finding. I don't see a place where I call a function recursively
I was completely horrified when I saw the title. Truly a moment when the
Empire wins and the Rebels are defeated.
On Saturday, April 1, 2017 at 4:08:26 PM UTC-4, solussd wrote:
>
> Beware the 1st of April.
>
> ---
> Joseph Smith
> j...@uwcreations.com
> @solussd
>
>
> On Apr 1, 2017, at 3:0
> doesn't drive me mad, but it does puzzle ans annoy
> me. puzzle: why is it? not sure, personally.
I've seen this pattern at the last 2 startups that I've worked at:
The startup hires a bunch of people as they graduate from college. They are
hired to do data analysis, typically on some kind
> This did get me thinking though. If the community *did* want to score
highly
> on some of these metrics, what would those be?
I'll be happy so long as Clojure is the popular choice for doing the things
where it's advantages should matter: machine learning, AI, NLP, concurrent
programming.
Not especially a Clojure question, though my app is in Clojure, so I have
all the tools of the JVM to work with.
Suppose I release a small Clojure app that people should run on the
servers, and it releases some data over some port. Let's say port 4.
The idea is that I want this data from t
That is a great article. Possibly there is a solution to this using
tree-seq. I hope to explore that at some point.
On Wednesday, March 8, 2017 at 3:50:02 PM UTC-5, Erik Assum wrote:
>
> You've already gotten your answer, but since Alex mentioned postwalk, and
> the problem looks like a flatt
Thank you, Alex. That makes sense. What is the main use case for walk?
On Wednesday, March 8, 2017 at 3:16:42 PM UTC-5, Alex Miller wrote:
>
> Usually the walk solution for transformation is easiest with postwalk:
>
> (require '[clojure.walk :refer [postwalk]])
>
> (defn m-to-v [m]
> (if (map?
Thank you so much! Your solution was almost perfect. It gave me:
#{[[:positive :false 30 8 9090] 1] [[:negative :true 30 4 50] 43]
[[:positive :false 30 4 1000] 32] [[:positive :true 30 8 9090] 1]
[[:positive :false 30 4 50] 43] [[:negative :true 30 8 9090] 1] [[:negative
:false 30 4 50] 43] [
Given this:
{:positive :true {30 {4 {50 43, 1000 32}, 6 {40 12, 90 2}, 8 {777 23, 9090
1}}}
I'd like a series of arrays that I can feed into (reduce) so I can easily
sum them:
[ 30 4 50 43 ]
[ 30 4 1000 32 ]
[ 30 6 40 12 ]
[ 30 6 90 2 ]
[ 30 8 777 23 ]
[ 30 8 9090 1 ]
I've been trying
Thank you.
On Wednesday, March 8, 2017 at 12:11:26 PM UTC-5, Sean Corfield wrote:
>
> Because you have a space in your regex, it is treated as a range, from
> space to underscore which matches a lot of characters. Move the – to the
> start:
>
>
>
> (clojure.string/replace phon
I built a string matching system, so when we get new records, from crawling
the web, we can find out if we already have the same information in the
database. There are many parameters to tune, and so I wanted to generate
the F1 score for the different parameters. I can easily test True Positives
Thanks for that. I couldn't figure this one out. But using your suggestion,
I finally get what I expected:
(try (/ 4 0) (catch ArithmeticException e (println (ancestors (type e)
#{java.lang.Exception java.lang.Throwable java.lang.RuntimeException
java.lang.Object java.io.Serializable}
On
This gives me nil:
(try (/ 4 0) (catch Exception e (println (parents e
This too:
(try (/ 4 0) (catch Exception e (println (ancestors e
This too:
(try (/ 4 0) (catch ArithmeticException e (println (ancestors e
How is this possible? Shouldn't Exception be an ancestor?
Or, more gen
I asked the same question a year ago. The problem was that I was getting an
OutOfMemoryError. This is an Error but it is not an Exception. If you catch
all Exceptions, you will still not catch the OutOfMemoryError. You have to
catch that too.
On Tuesday, March 7, 2017 at 2:54:26 PM UTC-5, Ke
This error is also intermittent. It doesn't happen every time I start the
app. I would guess this is some kind of timing issue, but I can't think
where the issue of timing comes up.
On Monday, January 25, 2016 at 4:04:50 PM UTC-5, piast...@gmail.com wrote:
>
> I've never had this problem befo
I've never had this problem before, but now I'm getting this:
in resource-usage there was this exception: #
at startup, for this function:
(defn- resource-usage []
(let [my-pool (at/mk-pool)]
(at/every 6
(fn []
(try
(timbre/log :trace "
Can anyone point me to a good tutorial about setting up a Ring/Jetty app
that works through a reverse proxy via Apache?
--
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 fr
This error seems related to Redis:
http://stackoverflow.com/questions/18430324/redis-error-oom-command-not-allowed-when-used-memory-maxmemory
On Tuesday, August 11, 2015 at 1:09:03 PM UTC-4, piast...@gmail.com wrote:
>
>
> I do not know much about the JVM. I never worked with Java, though I am
I do not know much about the JVM. I never worked with Java, though I am now
working with Clojure. I am getting this error:
clojure.lang.ExceptionInfo: OOM command not allowed when used memory >
'maxmemory'. {:prefix :oom} stack trace: {:class
clojure.lang.ExceptionInfo, :message \"OOM command
I don't know how to read this:
http://www.leonardoborges.com/writings/2012/12/02/monads-in-small-bites-part-ii-applicative-functors/
(defmulti pure (fn [f _] f))(defmethod pure List [_ v]"Wraps value v in a
list"(List. [v]))
Is this a List followed by a vector of 2 elements, or this a
Stuart, about the JSVC, I am curious if you have an opinion about the
argument made in the comments of this blog post:
"Great post, but in reality you should never write app that daemonize them
self. Always use supervisors that your system provides."
http://www.rkn.io/2014/02/06/clojure-cookbo
What blog posts did you find useful?
On Tuesday, May 26, 2015 at 10:01:29 PM UTC-4, andy.c...@fundingcircle.com
wrote:
>
> This page on Jira says that dynamic binding should be documented as "The
> Clojure Way" to do error handling. Was this ever done? I managed to find a
> few blog posts disc
Thank you all. I especially like the use of reduce-kv and the 2 fnils. I
looked at reduce-kv, but I was too stupid to figure out how to apply it
here.
On Tuesday, May 26, 2015 at 12:27:16 PM UTC-4, Francis Avila wrote:
>
> Your two functions can be written more succinctly (and with fewer expl
Stuart Sierra,
Thank you for the response. I won't take that talk as encyclopedic.
The 'chain-consequences' function is very interesting, though it is
unfamiliar to me. I am still learning about Clojure.
You mention that the State/Event pattern is a common one. If you were
talking about archi
Thank you for that. I'm curious, when Stuart Sierra mentions a "sequence
monad", does he offer this example simply to keep the Haskell programmers
happy, or is he suggesting that Clojure programmers sometimes use this
pattern? I am especially puzzled by this code that he offers, since this
does
I am watching this video, Stuart Sierra's 2012 talk about Functional Design
Patterns:
http://www.infoq.com/presentations/Clojure-Design-Patterns
His description of event sourcing for functional programming emphasizes:
recreate past states
recreate any past state by reducing over even
Can anyone point me to a project on Github that is using Clojure 1.5
reducerers?
--
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
The docs offer this example:
https://clojuredocs.org/clojure.core/defrecord
user=> (defrecord Someone [nick-name preffered-drink] Fun-Time (drinky-drinky
[_] (str nick-name "(having " preffered-drink "): uuumm")))
user.Someone
user=> (def dude (->Someone "belun" "daiquiri"))
#'user/dude
use
Maybe I should have already known this, but I am struck by this, and I'd
like to confirm it. If I'm working with this code:
https://github.com/drewr/postal/blob/389162cafab08224e50bd6721cac93fe14ca3257/src/postal/support.clj
and if, at the REPL, I do this:
user=> (require '[postal.suppor
If I:
git clone https://github.com/overtone/overtone.git
cd overtone
lein repl
and then at the REPL, I try to load Overtone:
user=> (all-ns)
(# # # # # #
# # # #
# # # # # # # # # # # # # # # # # # #
# #)
user=> (resolve 'overtone.studio.inst)
ClassNotFoundException overtone.studio.ins
That is interesting. What is xempty for?
On Friday, May 8, 2015 at 4:09:53 PM UTC-4, miner wrote:
>
> I wouldn’t make any claims about “best practices” but I’ve been playing
> with transducers in my little project:
>
> https://github.com/miner/transmuters
>
> I have a blog post about how to
Sadly, Google seems to think I am search for "internal" when I search for
"^:internal" so that makes it hard to find the documentation. I am curious
about this code:
;;; Capture the standard def forms' arglists
(def ^:internal defn-arglists (vec (:arglists (meta #'defn
(def ^:internal fn-arg
> An other thing when I have used with agents is implement an async
interface for jdbc
> like applications. I have a little explication on how it is done
> here: http://funcool.github.io/suricatta/latest/#_async_interface
That is an impressive bit of documentation. Thank you.
On Satur
This seems to be true:
"I would have to say that the biggest surprise is how little they're needed
in Clojure."
Run this search on Google:
agent send clojure site:github.com
The first 5 pages point me to examples from several years ago, or error
reports, or unit tests. Nothing substantial or
I am curious about something that Michael Drogalis did here:
(defn- load-support [support-file]
(let [support-ns (create-ns 'support-ns)
support-text (slurp (.getPath support-file))]
(binding [*ns* support-ns]
(eval '(clojure.core/refer 'clojure.core))
(eval '(refer 'janu
41 matches
Mail list logo