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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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/

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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: 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: If a Java function seems to never return, how do I test?

2015-11-04 Thread Lawrence Krubner
.com/javase/7/docs/api/java/lang/Thread.UncaughtExceptionHandler.html > > to capture it. > > > Rob. > > > On 2 Nov 2015, at 12:22, Lawrence Krubner > wrote: > > > Now there is a new error. > > Somehow, when the exception happens in our Java library, even tho

Re: If a Java function seems to never return, how do I test?

2015-11-04 Thread Lawrence Krubner
sible. > > If you you can connect with a debugger, you can set breakpoints based on > any thrown exception. > > On Monday, November 2, 2015 at 2:22:30 PM UTC-6, Lawrence Krubner wrote: >> >> >> Now there is a new error. >> >> Somehow, when the exception h

Re: If a Java function seems to never return, how do I test?

2015-11-04 Thread Lawrence Krubner
> flush twice, oracle is far far away? Are you saying this is so obvious I should be able to easily look it up? It might be obvious to you, but it is not obvious to me. That's why I'm asking. On Monday, November 2, 2015 at 3:25:36 PM UTC-5, raould wrote: > > flush twice, oracle is far far

Re: If a Java function seems to never return, how do I test?

2015-11-02 Thread Lawrence Krubner
System.out.println(). Can anyone think of another explanation? On Sunday, November 1, 2015 at 5:10:19 PM UTC-5, Lawrence Krubner wrote: > > So, we eventually fixed this. There were 2 bugs that worked together to > make this a mystery. I had to guess at what the problems were, and

Re: If a Java function seems to never return, how do I test?

2015-11-01 Thread Lawrence Krubner
So, we eventually fixed this. There were 2 bugs that worked together to make this a mystery. I had to guess at what the problems were, and fix them blind, since I could not see the Exceptions. I am curious about why I was not able to see the Exceptions. About this: > Exceptions are ALWAYS vis

If a Java function seems to never return, how do I test?

2015-10-30 Thread Lawrence Krubner
I am trying to figure out where this code might die, and why we don't se the Exception, if there is an Exception. Inside of a try/catch block, we have this, when calls a library written in Java: (timbre/log :trace " in parse-sentence fields-and-labels is: " fields-and-labels) (let [

is there a community "best practice" for including your co-workers libraries?

2015-10-16 Thread Lawrence Krubner
I know this question has been asked before, but when I went searching I mostly found old entries that were on a somewhat different topic, such as "How to add a java library (that is not in maven) as a dependency for a clojure library?" I wrote a Clojure app and my co-worker wrote a Java app. I

Re: "get" returns nil even when "not-found" is supplied?

2015-10-16 Thread Lawrence Krubner
ming-message) "") > > > Or figure out why nil is written and prevent it? > > On Friday, October 16, 2015 at 1:33:29 PM UTC-5, Lawrence Krubner wrote: >> >> What am I doing wrong here? I want to call clojure.string/lower-case on >> the :incoming-

"get" returns nil even when "not-found" is supplied?

2015-10-16 Thread Lawrence Krubner
What am I doing wrong here? I want to call clojure.string/lower-case on the :incoming-message of this-users-conversation. If there is no message, I return an empty string. (defn discern-current-state [this-users-conversation] (cond (= (clojure.string/lower-case (get this-users-conversat

Re: what is the shortest series of casts needed to get

2015-10-10 Thread Lawrence Krubner
Thank you. This was a good idea: > So if your coworkers code just needs something iterable (for example), you may > not need to do any casting at all: just give him the vector. On Sunday, October 4, 2015 at 9:39:36 PM UTC-4, Francis Avila wrote: > > Does he actually need a real arraylist,

Re: How does one print the stacktrace from slingshot?

2015-10-09 Thread Lawrence Krubner
") > > > > > On Fri, Oct 9, 2015 at 11:00 AM, Lawrence Krubner > wrote: > >> >> I'm trying to use Slingshot. I would like to print the stacktrace. If I >> do: >> >> (timbre/log :trace " the stack trace via slingshot-

Re: How does one print the stacktrace from slingshot?

2015-10-09 Thread Lawrence Krubner
is good. On Friday, October 9, 2015 at 6:00:35 AM UTC-4, Lawrence Krubner wrote: > > > I'm trying to use Slingshot. I would like to print the stacktrace. If I > do: > > (timbre/log :trace " the stack trace via slingshot-support " > (slingshot-support/s

  1   2   >