Unable to get a response from my server, after re-architecting to get away from global vars

2015-06-12 Thread Lawrence Krubner
When I first wrote a Clojure web app, I followed a lot of the basic tutorials out there, and those tend to create a lot of global vars. So, for instance, I used the "defroutes" macro from Compojure, which left me with a global "app-routes" var. But lately I wanted to switch to a style that wou

Re: stuartsierra/component is oop, can clojure namespace self init to solve the dependencies?

2015-06-21 Thread Lawrence Krubner
There are ways to handle dependencies without going down the OOP route that Stuart Sierra took. However, there are a lot of good ideas in Stuart Sierra's Component library, and to the extent that you can borrow those ideas, you end up with code that resembles "best practice" in the Clojure comm

Re: stuartsierra/component is oop, can clojure namespace self init to solve the dependencies?

2015-06-21 Thread Lawrence Krubner
t; style you mention. > As it sounds a lot like your definition of OOP to me. Not to mention that > anything that talks to a queue is performing io and is therefore not > functionally pure. So it sounds like you went and re-built component, but > this time around message passing, and mu

How to share the large files that can not fit in Github?

2015-06-22 Thread Lawrence Krubner
This is more of Java eco-system/development question, but I am curious what folks in the Clojure community might regard as "best practice". Up till now most of the projects that I've worked on we've been able to share resources informally via "scp" and email, or via Github, but on the current p

Using Hystrix comes at a cost?

2015-07-24 Thread Lawrence Krubner
I find this very interesting: http://blog.josephwilk.net/clojure/building-clojure-services-at-scale.html "[Using Hystrix comes at a cost:] We cannot use Clojure’s concurrency primitives (futures/promises/agents)." That is fascinating to think that at some point Clojure's concurrency primitive

Re: Using Hystrix comes at a cost?

2015-07-24 Thread Lawrence Krubner
ncluding frameworks like Hystrix. > > Clojure makes it easier to write programs which manage their state > correctly. Hystrix makes it easier to write programs which manage > side-effect-heavy libraries correctly. Together, they make a pretty good > combination. > > –

a question about Chris Zheng's "Abstract Container Pattern"

2015-07-27 Thread Lawrence Krubner
I have a question about this: "Servers that are running on a particular port can be tracked and stopped. I have to say, this was the feature that I wanted the most, which motivated the framework's design. The annoying thing about development in emacs is that I have to be careful of not losing

Re: a question about Chris Zheng's "Abstract Container Pattern"

2015-07-27 Thread Lawrence Krubner
a contract? Why not just clearly write a contract, using a library that is meant to write contracts? I mean, why not use something like Typed Clojure? On Monday, July 27, 2015 at 1:37:41 PM UTC-4, Lawrence Krubner wrote: > > I have a question about this: > > "Servers that

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-27 Thread Lawrence Krubner
Off topic, but I wonder if there was ever any discussion of megarefs being added to Clojure? https://github.com/cgrand/megaref On Tuesday, July 21, 2015 at 3:30:46 PM UTC-4, Rangel Spasov wrote: > > Ok, I think someone already mentioned this - sorry. Got it to compile by > bumping to [potemkin

Re: Advice on introducing a Java dev to Clojure

2015-07-28 Thread Lawrence Krubner
I wrote this for a blog post, but I think it is relevant here. After a long comparison of a bit of code, first in Javascript and then in Clojure, I wrote: At this point, a Javascript developer might say, “You've shown that the Functional style has some advantage, but why should I care? I

Re: a question about Chris Zheng's "Abstract Container Pattern"

2015-07-29 Thread Lawrence Krubner
ract >> (either the shape of data or effects of a fn) in the ‘functional’ paradigm; >> this guy clearly wanted something in the OO paradigm. >> >> Is there a ‘functional’ implementation which gives the same benefits; >> sure, but that isn’t what he wanted. Are th

Why is next.jdbc using my IP address?

2022-03-03 Thread Lawrence Krubner
I just wrote a small app that needs to connect to a MySQL app. I was running it on my laptop, connecting to MySQL on the laptop, and everything was working fine. Then I wanted to connect to one of our test databases in RDS in AWS. I've a simple function that finds the environment variables and

Re: Why is next.jdbc using my IP address?

2022-03-04 Thread Lawrence Krubner
nied kinds of errors include the username > and the host the users connection came from. > > On Thu, Mar 3, 2022, 11:18 Lawrence Krubner wrote: > >> I just wrote a small app that needs to connect to a MySQL app. I was >> running it on my laptop, connecting to MySQL on the lapto

Re: Why is next.jdbc using my IP address?

2022-03-04 Thread Lawrence Krubner
t contains the values you expect it does. > > When you say “cli”, do you mean a mysql client? Double check the > credentials (dbname, user, password) that *it* uses. > > Best, > Orestis > > On 4 Mar 2022, at 13.27, Lawrence Krubner wrote: > > But, again, I can

Re: Why is next.jdbc using my IP address?

2022-03-04 Thread Lawrence Krubner
7;t think plain strings in Clojure would be interpreted like this. Or is this how bash interprets it? On Friday, March 4, 2022 at 8:06:56 AM UTC-5 Lawrence Krubner wrote: > So, as a new way to test this, I've ssh'ed to an EC2 instance that is in > the same VCP as the RDS data

Are there Clojure meetups in NYC?

2022-07-30 Thread Lawrence Krubner
So, I just recently got back to going out to gatherings, post-pandemic. I live in New York City. I logged into Meetup.com, for the first time in 3 years, and I discovered that it is a ghost town. 99% of all the Meetups are gone. I am a bit heartbroken about this. It used to be there were 3 or 4

Re: Ensure more concurrency

2017-03-07 Thread lawrence . krubner
https://clojuredocs.org/clojure.core/ensure Must be called in a transaction. Protects the ref from modification by other transactions. Returns the in-transaction-value of ref. Allows for more concurrency than (ref-set ref @ref) This can be read in two contradictory ways. Protecting a ref dur

Re: Application silently shuts down by itself after running for some hours

2017-03-07 Thread lawrence . krubner
To catch OutOfMemoryError s: catch(OutOfMemoryError e) On Tuesday, March 7, 2017 at 5:18:44 PM UTC-5, JokkeB wrote: > > I'm under the impression that setDefaultExceptionHandler still catches OOM > errors. Some googling suggests this too. If not, how should I try to catch > it? > > I am runn

Re: [ANN] meet postagga, a new lib for natural language processing

2017-03-27 Thread lawrence . krubner
Thank you for this. I am excited to give this a try. On Monday, March 13, 2017 at 9:24:36 AM UTC-4, Rafik NACCACHE wrote: > > Hey guys, > I am pleased to share my new lib, capable of training models that help > parse natural language ! > My french-speaking friends will find it extremely useful

error in nrepl

2017-06-23 Thread lawrence . krubner
I'm using Emacs on my Mac. I ran "nrepl-jack-in" to load up the repl. I'm iterating over a dataset from mysql. My code is very simple, I'm just trying to count the words: (reduce (fn [map-of-word-count next-name] (let [ words (clojure.string/split next-name #"\s") map-of-names-words-with-co

Re: error in nrepl

2017-06-23 Thread lawrence . krubner
Yes, sadly, I've never gotten Cider to work with Emacs. I keep thinking someday I'll take a weekend and work through all the errors and get it working, but I never seem to find the time. So I keep working with an old version of nrepl. But I take it, from your answer, you think this error would

Re: error in nrepl

2017-06-23 Thread lawrence . krubner
On Friday, June 23, 2017 at 4:29:24 PM UTC-4, lawrence...@gmail.com wrote: > > I'm using Emacs on my Mac. I ran "nrepl-jack-in" to load up the repl. I'm > iterating over a dataset from mysql. My code is very simple, I'm just > trying to count the words: > > (reduce > > (fn [map-of-word-count

Re: error in nrepl

2017-06-23 Thread lawrence . krubner
Thank you. Maybe I can find some time to upgrade my whole Emacs setup next weekend. It is a bit out of date. I'm curious if folks think it is easier to work with Emacs on a Linux machine, or on a Mac? On Friday, June 23, 2017 at 5:39:42 PM UTC-4, Kevin Baldor wrote: > > Have you tried foll

Re: error in nrepl

2017-06-29 Thread lawrence . krubner
Thank you for everyone's reply. Both Spacemacs and ProtoRepl sound very interesting. I am torn and am unsure which path to take. I suppose I'll give Spacemacs a try and see if that works out. I am very pleased to see progress being made regarding at least the DE of IDE for Clojure. That's alw

Re: Clojure versions used by java.jdbc users

2017-07-06 Thread lawrence . krubner
I have some old projects that ran Clojure 1.5 and jbcd. I wrote them before the era of Cider. Cider only supports Clojure => 1.7. I do have to now use those old projects, but I was planning on upgrading them anyway, so I could work on them in Cider. On Monday, July 3, 2017 at 7:12:19 PM UT

Re: error in nrepl

2017-07-06 Thread lawrence . krubner
Thank you, Didier, but I'll wait till ProtoRepl is more stable. Also I'm not sure that I'm ready to step away from Emacs. I did try Spacemacs but I felt it was too much influenced by Vim. So now I'm using Prelude. On Thursday, June 29, 2017 at 1:46:11 PM UTC-4, Didier wrote: > > If you're

java.lang.ClassNotFoundException: clojure.lang.Var

2017-07-09 Thread lawrence . krubner
I was trying to knock out a quick project today, and most of it was copy-and-paste of another project that I have. This isn't really a big project, despite the long list of dependencies (which I could trim somewhat). Anyway, if I run "lein clean" and then "lein uberjar" it seems to compile ju

Re: java.lang.ClassNotFoundException: clojure.lang.Var

2017-07-09 Thread lawrence . krubner
Sorry, that was dumb. Obviously I meant to call with classpath. It works fine with standalone. On Monday, July 10, 2017 at 1:27:53 AM UTC-4, lawrence...@gmail.com wrote: > > I was trying to knock out a quick project today, and most of it was > copy-and-paste of another project that I have. Th

I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-10 Thread lawrence . krubner
I'm using Zach Tellman's excellent Manifold library, though I admit I don't fully understand it. My code queries a MySQL database and then needs to do some processing on each row retrieved. I copy-and-pasted some code from the documentation for Manifold: ;; 2017-07-10 -- we want a thread po

Re: I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-10 Thread lawrence . krubner
By the way, this code works fine if I go into a (doseq) a level above enqueue, and then put each individual row onto the stream. Then the code loops over all of the rows. But that seems to defeat the whole point of using something like Manifold. I want to be able to put the whole lazy-seq on th

Re: I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-10 Thread lawrence . krubner
Once again, my lack of knowledge of Java trips me up. Manifold relies on Dirigiste, which relies on Java's Executor Service. I see a bit here: http://www.nurkiewicz.com/2014/11/executorservice-10-tips-and-tricks.html Nurkiewicz writes: "I got bitten by that too many times: it won't print *anyth

Re: I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-10 Thread lawrence . krubner
Okay, that was a deadend. After going through line by line, I could pretty well rule out any kind of Exception or Error. The first row from the database seems to go through all of the functions perfectly, without any errors. But the second row never gets called. Which takes me back to where I

Re: I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-11 Thread lawrence . krubner
Justin, thanks. I'd like to ask a follow up question. To be clear, if I go into (doseq) then this works fine: (defn start [] (let [ config (get-config) mysql-db { :dbtype "mysql" :dbname (get-in config [:database :config :connection :databa

Re: I can only get the first item of a lazyseq via a Manifold stream, and I can't get/find an Exception

2017-07-11 Thread lawrence . krubner
Sean, thanks for asking. The function is so basic that I didn't include it, but here it is: (defn fetch [mysql-db] (slingshot/try+ (jdbc/query mysql-db [" SELECT p.id as profile_id, p.name as profile_name, p.headquarters_addr1, p.headquarters_city, p.headquarters_state_c

What is juxt really doing?

2017-07-15 Thread lawrence . krubner
If I do this: ((juxt :who :what :when) {:who 1 :when 2} {:who 4 :what 99}) I get: [1 {:who 4, :what 99} 2] Why does a map come back instead of a number? Does anyone use juxt in the real world, or is mostly for examples? -- You received this message because you are subscribed to the Goo

Re: What is juxt really doing?

2017-07-16 Thread lawrence . krubner
Thank you for all the responses. The examples of using juxt to sort among results that are otherwise the same is a good example. On Sunday, July 16, 2017 at 3:18:07 AM UTC-4, Boris V. Schmid wrote: > > I don't use juxt much, but the example that I did pick up is where juxt is > used for sortin

how to be notified when a Future is realized?

2017-08-02 Thread lawrence . krubner
I stumbled across this old post by Tomasz Nurkiewicz: http://www.nurkiewicz.com/2013/03/promises-and-futures-in-clojure.html He writes: "And here is where the greatest disappointment arrives: neither future nor promise

does each class need its own file when I include Java files?

2017-09-19 Thread lawrence . krubner
I need to add something very much like this to my Clojure app: https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java I currently have source paths set up as: src/ clojure/ java/ I believe I can copy-and-paste most of this code in

Re: does each class need its own file when I include Java files?

2017-09-20 Thread lawrence . krubner
Sorry, I totally misread it. Thank you so much. On Wednesday, September 20, 2017 at 3:55:40 AM UTC-4, Juraj Martinka wrote: > > > > I believe I can copy-and-paste most of this code in the Java folder. Do > I need to put each class in its own file? > > I'm not sure what you mean by "each class

When does .getThreadCpuTime return nil?

2017-09-22 Thread lawrence . krubner
I've been using this code for years. I copy and pasted it from someone else on this group, someone much smarter than I am. I have never seen an error from this code. Now suddenly I get a null pointer exception at the last line of this code: (ns denormalize_mysql_to_mongodb.monitoring (:impor

Re: When does .getThreadCpuTime return nil?

2017-09-23 Thread lawrence . krubner
Thanks for the answer. I am surprised because I used this code for years without ever seeing that error. I'm trying to imagine what I did differently this one time. I've added error detection, we'll see if it happens again. On Friday, September 22, 2017 at 7:34:49 PM UTC-4, Neil Okamoto wro

How to get an error message from Elastisch?

2017-10-03 Thread lawrence . krubner
This is probably a stupid question, but is there an obvious way to get an error message out of Elastisch? I had an app that was working with MongoDB and I was then told I had to use ElasticSearch instead (something about only using AWS for everything) so now I'm trying to get an error message,

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
This problem has become much stranger. Really, I thought I was developing some intuitions about how to write Clojure code, but everything about this seems counter-intuitive. When the app starts, it seems to be broken, doing one write per second to ElasticSearch (on AWS). Then I get an error, a

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
One last thing, I should mention, if I go through and add " LIMIT 100 " to all the SQL queries, everything works great. That is, when dealing with a few hundred documents, the app seems to work perfectly, and there are no errors. It's only when I try to work with a few million documents that th

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
Obviously I'm brain-dead, since I forgot to retry the write on failure. So I fixed this now: (defn advance [message db] {:pre [ (= (type message) durable_queue.Task) ]} (let [ ;; 2017-10-05 -- if this is successful, then the return will look like this: ;;

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
Konstantinov, yes, perhaps, though I can't think where. This is a small app, about 950 lines of code. There is a limited number of places where I can make such a mistake. I do aggregate a lot of data into an atom, and I'm sure there is a lot of contention around the atom, but the Socket timeout

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
I did find this: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html "Your performance can also be impacted if your application isn’t sending enough I/O requests. This can be monitored by looking at your volume’s queue length and I/O size. The queue length is the number of pe

Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
I'm trying to use a Zach Tellman's durable-queue to pass information from one part of my app to another. I have 3 queues. I also have a function that runs every 30 seconds, that is suppose to report some statistics for me: (fn [] (future (slingsho

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
(errors/log) simply writes to the Timbre logging library. I thought perhaps there was an error in my Timbre configuration, so I wrapped those functions in try/catch, but I still don't see anything. I'm trying this as my Timbre config: (defn- set-timbre-level [] (timbre/set-config! {:lev

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
More generally, I'm having trouble seeing any kind of logging messages. Even when I delete this Timbre config, and simply go with Timbre defaults, and set the level to "trace", I only erratically see anything printed to the logs. I assume there are messages dying in background threads, but I ha

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
Using spit to an append to a log file, I end up seeing much more than what I can see from Timbre. The app writes a few lines, then dies: ("\n\n\n\n\nResource usage: " "Memory in use (percentage/used/max-heap): (\"3%\" \"133M\" \"3568M\")\n\nCPU usage (how-many-cpu's/load-average): [4 0.0]\n\n

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
So, for instance, this says that 10 documents were retried: {"message" {:num-slabs 1, :num-active-slabs 1, :enqueued 389, :retried 10, :completed 378, :in-progress 1}} The only place that I call retry! is in this catch block (this function runs in a background thread): (defn advance [message

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
Well, the people behind Slingshot have suggested it as the Slingshot version of catch Exception, but I like your idea and I'll try it. Having said that, as I said in my last post, the only place I call (retry!) is inside the catch block, so the code does end up inside of that catch block. But

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
It's a bit absurd, but at the end of core/main I'm now catching Exceptions, Throwable and Object. But this doesn't seem to help me see what is happening on background threads. (defn -main [& args] (slingshot/try+ ;; 2017-10-04 -- see this: ;; https://stackoverflow.com/questions/28908

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
Possibly this is a complication arising from the use of Slingshot? It would take a 2 maybe hours to completely tear Slingshot out of this app, but I would do that if I thought I would then be able to see the error messages. On Sunday, October 8, 2017 at 11:46:26 PM UTC-4, tbc++ wrote: > > I do

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
I just re-wrote much of the code to run on the main thread. And so now I can see the error message (which was about a nil value in a place where I was certain there would be no nil values). Which is great. But since the app does a lot of I/O, I would like to for this app to be multi-threaded. B

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-08 Thread lawrence . krubner
I'm using Cider in Emacs, but the problems I face only occur when I've created an uberjar and I try to run the app on the server. In the REPL I only work with small amounts of data, whereas on the server I work with a few million. Not sure how to get around that as I'm working from my apartment

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Kumar, Just so you know, on this page: https://github.com/cambium-clojure/cambium.logback.core you link to here: https://cambium-clojure.github.io/ but I get a 404 when I go there. On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote: > > >> >> I'm curious what others do fo

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Shantanu Kumar, thanks for that, I might try it. I assume you've never had the problem I'm talking about, of messages on background threads that disappear? On Monday, October 9, 2017 at 2:56:24 AM UTC-4, Shantanu Kumar wrote: > > >> >> I'm curious what others do for logging? >> > > At Concur w

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
MatchingSocks, thanks for that. I think the pattern I followed everywhere was: (future (slingshot/try+ ;;; some code (catch Object o (println o So I think I do catch everything inside of each future that I launch. But I will check again. Perhaps I missed one somewhere. O

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Gary Verhaegen, thanks for that. The idea of buffers and threads dying is a good one and gives me something to look for. On Monday, October 9, 2017 at 2:23:05 PM UTC-4, lawrence...@gmail.com wrote: > > MatchingSocks, thanks for that. I think the pattern I followed everywhere > was: > > (future

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
Sean Corfield, thank you, that is a great tip. On Monday, October 9, 2017 at 2:59:35 PM UTC-4, Sean Corfield wrote: > > Timbre has a logged-future macro that you can use instead of future so > that exceptions are automatically logged. > > > > Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN >

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread lawrence . krubner
I figured a common reason for error messages to disappear is when there is another Exception inside of the catch block, so the catch block itself dies without doing anything. I had copy-and-pasted this from somewhere, without looking at it much: (catch Exception e (println e) (sta

Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
I seem unable to figure out where I made a mistake, though this should be simple. I have two SQL calls that bring back 5 fields: SELECT company_profile_id , reference_id, reference_source FROM company_reference_idlimit 1 ; ++--+--+ |

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Nevermind. Something about my reasoning is off on this one. I notice that even if I use conj, the same problem happens, I get 4 values in 4 vectors instead of 5 values in 4 vectors. So there must be some earlier step that I've gotten wrong. On Wednesday, October 11, 2017 at 11:44:40 AM UTC-4,

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Using conj instead of into, for no particular reason, except debugging. The document is slowly built-up: ({:company_profile_id [["2"]], :topic :company, :url [["mikeshawauto.com"]]}) ({:company_profile_id [["2"]], :topic :company, :url [["mikeshawauto.com"]]}) ({:company_profile_id [["2"]],

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
So I have this: ({:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]}) And then I get this field name and value: (:company_profile_id) (["2"]) The next 3 lines of code are: old-field-value (get old-documents field-name []) new-field-va

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
So I tried this: new-field-value (into [] (concat old-field-value field-value)) And I did not get what I expected. Maybe I am sleep deprived, but I don't see why I can't build up a vector with several values. This is in a map in an atom. This is the code: (swap! documents

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
I should remove the parens before they confuse anyone. They are added by the log statement. Without the parens: {:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]} field-name: :company_profile_id field-value: ["2"] but I in the final document I only get: "final documen

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Sorry, this is the problem with working all night. My sleep deprived eyes skipped over this line: old-field-value (get old-documents field-name []) I fetch the value from the wrong map. Such a basic error. On Wednesday, October 11, 2017 at 1:44:13 PM UTC-4, lawrence...@gmai

possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-11 Thread lawrence . krubner
I can't figure out if this is a Clojure question or an AWS question. And if it is a Clojure question, I can't figure out if it is more of a general JVM question, or if it is specific to some library such as durable-queue. I can redirect my question elsewhere, if people think this is an AWS quest

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-12 Thread lawrence . krubner
Justin Smith, thanks, I've created an Uberjar that I now run under Supervisord on an EC2 instance, and I set the JVM options via the command that Supervisord calls. On Wednesday, October 11, 2017 at 6:58:52 PM UTC-4, Justin Smith wrote: > > a small thing here, if memory usage is important you

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-12 Thread lawrence . krubner
Daniel Compton, good suggestion. I've increased the memory to see if I can postpone the GCs, and I'll log that more carefully. On Wednesday, October 11, 2017 at 8:35:44 PM UTC-4, Daniel Compton wrote: > > Without more information it's hard to tell, but this looks a like it could > be a garbage

(resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-12 Thread lawrence . krubner
At the REPL, this works perfectly: > (defn get-users [] [:susan :kwan]) > > (defn what-is-this-function [f] ((resolve (symbol f > (what-is-this-function "get-users") >[:susan :kwan] In an uberjar this does not work. I read somewhere that the runtime name-space is different than the

Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-12 Thread lawrence . krubner
Nevermind. I found that this works, though I think it is ugly and inelegant: resolved-f (resolve (symbol (str "denormalize.pull-from-mysql/" f))) On Thursday, October 12, 2017 at 9:27:06 PM UTC-4, lawrence...@gmail.com wrote: > > At the REPL, this works perfectly: > > > (defn get-u

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-12 Thread lawrence . krubner
Following Daniel Compton's suggestion, I turned on logging for GC. I don't see it happening more often, but the slow down does seem related to the moment when the app hits the maximum memory allowed. It had been running with 4G, so I increased that to 7G, so it goes longer now before it hits 98

Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-13 Thread lawrence . krubner
Is there a way I can avoid hard-coding " "denormalize.pull-from-mysql"" ? I guess it doesn't matter, but it does seem a little inelegant. On Thursday, October 12, 2017 at 9:54:36 PM UTC-4, Justin Smith wrote: > > you can use (symbol "denormalize.pull-from-mysql" "f") instead > > On Thu, Oct 12,

Re: Nice screencast overview of Specter

2017-10-21 Thread lawrence . krubner
I surprised that I had never heard of this, despite following the other work that Nathan Marz has done. On Wednesday, October 18, 2017 at 11:01:24 AM UTC-4, Alan Thompson wrote: > > I just saw this on YouTube and thought you may enjoy it: > https://youtu.be/rh5J4vacG98 > > While there is lots

Feed predicates from clojure.spec to the inference engine/type checker from the Shen java port?

2017-10-27 Thread lawrence . krubner
This sounds like an interesting idea. Does anyone know if this could work? https://news.ycombinator.com/item?id=15569058 The allure of Shen is that it offers a type system that is, roughly speaking, very similar to what you get with clojure.spec. You construct "predicates", what Shen calls seq

Re: Doc strings for complex cases?

2017-11-08 Thread lawrence . krubner
I'm curious if it would be enough to write a macro that replaces defn in your code? The macro would secretly generate a different function for every arity, and therefore it could have a different doc-string for every arity, but it wouldn't have to appear that way in your code. Is that enough, or

Am I being stupid regarding how much memory I use?

2017-11-12 Thread lawrence . krubner
I recently worked on a minor project that nevertheless needed to use 10 gigs of RAM. It ran on a reasonably powerful server, yet it taxed that server. And I wondered, how are people scaling up such processes? If my approach was naive, what does the less naive approach look like? I wrote a simp

Re: Russ olsen's Clojure Book

2018-01-16 Thread lawrence . krubner
Stuart Sierra wrote a bit about Functional Design Patters here: https://www.infoq.com/presentations/Clojure-Design-Patterns Michael Bevilacqua-Linn wrote "Functional Programming Patterns in Scala and Clojure": https://www.amazon.com/Functional-Programming-Patterns-Scala-Clojure/dp/1937785475/

Re: Officially support Vert.x

2018-01-16 Thread lawrence . krubner
James Gatannah, I apologize for hijacking this thread, but what did you mean here: > The one useful thing I could find that Vert.x provides out of the box > that clojure doesn't is the pub/sub messaging. That turned our > architecture into spaghetti, so I wouldn't call it a win. Was there som

Received fatal alert: protocol_version

2018-11-22 Thread lawrence . krubner
I've been away from Clojure for a year and I'm just coming back to it. I assume some of my dependencies are out of date. I'm working on a project that is 90% Java with a Clojure wrapper. I tried this: lein uber I got a "protocol version" error which seems to have something to do with a new lev

Re: Received fatal alert: protocol_version

2018-11-22 Thread lawrence . krubner
Saw a suggestion here: https://github.com/technomancy/leiningen/issues/2364 and tried it: LEIN_JVM_OPTS=-Dhttps.protocols=TLSv1.2 lein -U deps but got: Could not transfer artifact io.javalin:javalin:pom:2.4.0 from/to central (https://repo1.maven.org/maven2/): java.lang.RuntimeException: Unexp

Re: Received fatal alert: protocol_version

2018-11-22 Thread lawrence . krubner
Okay, on my Macbook Pro, I fixed this problem by adding this to my .bash_profile: export JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustAnchors=$JAVA_HOME/jre/lib/security/cacerts -Djavax.net.ssl.trustStore=$JAVA_HOME/jre/lib/security/cacerts" On Thursday, November 22, 2018 at 3:37:31 PM UTC-5,

What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
I'm coming back to Clojure development after a year away. This is a fast moving community and it is hard to keep up when one is not working on it full time. I'm dusting off some code I wrote 2 years ago, and trying to bring all the dependencies up to their current versions. I have a function t

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
James Reeves, that does sound like the right way to go. I'll do that. On Monday, December 17, 2018 at 3:31:01 PM UTC-5, James Reeves wrote: > > > I'd use an executor: > > (ns example.main > (:import [java.util.concurrent Executors TimeUnit])) > > (def scheduler > (Executors/newSchedu

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
Laurens Van Houtven, good ideas, but then I'd also have to write some code to catch documents that got lost when a process died while trying to fetch a document from S3. If I simply check every 15 minutes, and grab everything that has not already been stored in the database, then I automatically

Exception: clojure.lang.ExceptionInfo thrown from the UncaughtExceptionHandler in thread "main"

2018-12-24 Thread lawrence . krubner
I'm not sure what I did, but suddenly I'm getting this: Exception: clojure.lang.ExceptionInfo thrown from the UncaughtExceptionHandler in thread "main" Exception: clojure.lang.ExceptionInfo thrown from the UncaughtExceptionHandler in thread "Thread-0" I had been using println to do some debugg

Re: Exception: clojure.lang.ExceptionInfo thrown from the UncaughtExceptionHandler in thread "main"

2018-12-26 Thread lawrence . krubner
I did not touch the ~/.lein/profiles.clj file. I got things to work by removing everything related to Timbre. I would guess that I had some kind of naming class between Timbre and clojure.tools.logging. I decided to just use clojure.tools.logging, and that seems to have fixed the problem.

Why did this compile? It's an obvious syntax mistake

2018-12-26 Thread lawrence . krubner
I'm wondering why this compiled? I was supposed to add this to my requirements: [environ.core :refer [env]] Instead I added this: [environ.core :refer [env] I rebuilt this, and it compiled. Then, in the cider REPL, I tried to call my "start" function. I was told it didn't exist, which was

How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-02 Thread lawrence . krubner
I guess this is more of a JVM question than a Clojure question, unless Clojure exerts any special magic here. I'm open to a more Clojure approach than what I have now. Someone suggested I use Executors/newScheduledThreadPool for some recurring work, so I set it up like this: (def scheduler-a

using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-16 Thread lawrence . krubner
I was away from Clojure for a year and I missed it. I am pleased to be back. But I've forgotten certain common errors. I feel like this is something I used to know but now I've lost the knowledge. I'm using Factual's durable-queue to put a step inbetween the import of large JSON files, and the

Re: using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-16 Thread lawrence . krubner
Sorry, I'm an idiot. The real error was when I called put! I don't understand this error: INFO: java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V at durable_queue$checksum.invokeStatic (durable_queue.clj:64) dur

Re: using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-16 Thread lawrence . krubner
On the new EC2 instance, running Ubuntu: java -version openjdk version "1.8.0_191" OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12) OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) Is it possible this version does not have the checksum signature that durable-qu

Re: using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-16 Thread lawrence . krubner
So, I upgraded to Java 11, and now everything works. So I guess this was a version conflict. Just curious, but is there a way for Factual to make durable-queue to tell Leiningen that Java 11 is necessary? On Wednesday, January 16, 2019 at 3:17:49 PM UTC-5, lawrence...@gmail.com wrote: > >

Re: using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-19 Thread lawrence . krubner
> Is the problem possibly a difference between your > compilation environment and your deploy env? This seems to be proven by the fact that upgrading Java on the EC2 instance fixed the problem. On Wednesday, January 16, 2019 at 3:49:41 PM UTC-5, Chris Nuernberger wrote: > > Are you using aot

How should I debug a poorly performing small web app, using Jetty?

2019-01-19 Thread lawrence . krubner
I'm looking for advice about how to debug this. I wrote a small web app. It has about 1,200 lines of code. It is fairly standard for a Clojure app, it uses Jetty, and Compojure. It uses MongoDB. I'm just working on my MacBook Pro right now, so there is no issue such as using Nginx or load bala

why does this file watcher keep triggering?

2015-08-08 Thread Lawrence Krubner
I feel stupid, but I have not been able to track this down. The background is that I have Jenkins running on the server, and when triggered it pulls code from Github, compiles it, and then moves the final uberjar to the directory where I keep all the uberjars that run on this server. Then I ha

  1   2   >