This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-04
Channels
- # 100-days-of-code (8)
- # announcements (4)
- # beginners (77)
- # boot (11)
- # business (13)
- # cider (69)
- # clara (2)
- # cljdoc (51)
- # clojure (59)
- # clojure-dev (18)
- # clojure-italy (4)
- # clojure-nl (11)
- # clojure-spec (54)
- # clojure-uk (115)
- # clojurescript (33)
- # core-async (4)
- # cursive (95)
- # datomic (27)
- # duct (1)
- # emacs (58)
- # figwheel (22)
- # figwheel-main (63)
- # garden (1)
- # graphql (10)
- # hyperfiddle (1)
- # leiningen (1)
- # luminus (6)
- # off-topic (12)
- # planck (7)
- # portkey (1)
- # quil (3)
- # re-frame (3)
- # reagent (5)
- # ring-swagger (3)
- # shadow-cljs (34)
- # slack-help (19)
- # spacemacs (57)
- # testing (2)
- # timbre (2)
- # tools-deps (42)
- # yada (6)
does anyone know of an open source project (on github or otherwise) that has a non-trivial amount of generative tests?
I remember reading about some gnarly bugs found in the onyx project using generative tests
Does java.net.url have a Clojure wrapper? Or is there a convenient way to getHost()
, getPort()
, getProtocol()
without having to actually call these functions? Maybe by coercing the object into a map?
> (bean (java.net.URL. "https://google.com"))
{:path "", :protocol "https", :ref nil, :content #object[sun.net.www.protocol.http.HttpURLConnection$HttpInputStream 0x3fc84c7c "sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@3fc84c7c"], :authority "
Sorry if this seems gauche but, thanks @lprefontaine @alexmiller @seancorfield @tomfaulhaber and @m_m_m for your work on tools.trace. You saved my bacon yesterday! If I’ve missed any contributors, my apologies!
@olieidel JodaTime was good solution for Java 6/7. Because of api was old and time zone info were old too. From Java 8+ you got most powerful tool as time API. All samples with Clojure uses Date and Calendar. I think that is completely wrong. Keep it in mind
Is there a way to avoid duplicating :require clauses with uneven nesting? I tried: (ns .. (:require [prefix [A :as a ]] [B [C :as bc]]])) but the B clause spits out an error…
Can someone verify my understanding of core.async go blocks? If I have only one go block in a program, and it’s taking from a channel that has a plethora of messages, then that block can/will be executing n times in parallel, where n is based on the number of cores.
no, any particular go block will only ever be executing once at a time.
so, if you only have one go block in a program, you aren’t really utilizing all your cores?
well, not with go blocks anyway (ignoring other threads)
That was never the intent
You can use things like pipeline
to get a parallel stage
@alexmiller is the same thing true with (thread ...)
?
only one instance of that block will be executing at any particular time
I would hope not because these are intended for operations that may take some time waiting on i/o etc…
thread
launches the operation in a thread from an (expandable) thread pool
threads are cached in that pool and reused but should always grow if you need another one
and if I have many go blocks, its the aggregate of those that can be executing in parallel n times
Hi, I have one route which uses m0 middleware. The handler of this routes assoc some data in session.
The problem im having is that other routes use m1 and the middlware middleware-in-which-session-is-nil
does not the session with data.
What is happening there? How can I solve this?
@urzds URL is kind of terrible, but nothing will be more efficient than just calling those methods - any clojure wrapper would be based on calling those methods
URL seemed nice, because it is builtin. What is the general recommendation? What should I use instead?
I wonder - I've usually used str
or format
to construct URLs and clojure.string/split
to break them up in the rare cases that I need to deconstruct them
I hope there's a good library or alternative class but I don't know it off hand if so
calling =
on a URL talks to the network
I’ve got a funny issue with boot-tools-deps. Before raising a ticket I thought I’d ask here in case anyone had any ideas. When using private repositories (having :mvn/repo
in the deps.edn) the credentials in .m2/settings.xml are not being picked up and I get a 401. It works in pure tools.deps so the credentials are correct.
Looking at the source of boot-tools-deps I think it might have something to do with it being run in a boot pod. Does anyone have any ideas what the issue might be?
when serializing custom records with nippy, is there a good way to defer to built-in structured writers, like you can in transit?
@cbowdon Feel free to open an issue on the btd GitHub. I suspect it's due to Boot not picking that file up (since boot-tools-deps
doesn't do any resolution itself -- it calls tools.deps.alpha
and then it hands everything off to Boot itself).
We can discuss in more depth in #boot
I was walking to a hotel from my employers office in Durham, and totally freaked out when I walked by cognitect HQ. I had no idea it was two blocks away!!! (I work remote for the most part) I’m writing clojure based services for them right now and some clojure legends are right down the street. Feels good man! Love this community big time. Keep on keepin on
Hi! I'm having some trouble translating this MongoDB query to Monger The query in JS:
db.getCollection('rooms').aggregate([
{ $unwind: "$tracks" },
{ $match: { $or: [{'tracks.type': "download"}, {'tracks.type': "upload"}]}},
{ $group: { _id: "$tracks.id" }}
]);
The query in Clojure/Monger:
(mc/aggregate db "rooms" [{$unwind "$tracks"}
{$match {$or [{:tracks.type "download"}
{:tracks.type "upload"}]}}
{$group {:_id "$tracks.id"}}]))
It gives me an error:
MongoCommandException Command failed with error 9: 'The 'cursor' option is required, except for aggregate with the explain argument' on server 127.0.0.1:27017. The full response is { "ok" : 0.0, "errmsg" : "The 'cursor' option is required, except for aggregate with the explain argument", "code" : 9, "codeName" : "FailedToParse" } com.mongodb.connection.ProtocolHelper.getCommandFailureException (ProtocolHelper.java:115)
@vheuken It sounds like this issue: https://stackoverflow.com/questions/47472688/spring-data-mongodb-the-cursor-option-is-required
after the pipeline vector just add something like :cursor {:batch-size 20}
A change of behavior from earlier MongoDB versions. Yeah, @rutledgepaulv’s suggestion sounds good.
not totally sure what the default cursor size used to be
sounds like 101
MongoDB's continual API changes is part of why we've moved away from it (and why I no longer maintain CongoMongo).
yeah still waiting to see what becomes of transactions and monger
I’d like to use something else but it’s pretty ingrained at this point
We went pretty all-in with MongoDB some years back but over the last year or so we've either stopped writing certain data to MongoDB or we've actively migrated data back from MongoDB to MySQL (Percona) and I think we'll be shutting down our MongoDB servers in a few months once one last legacy application is retired.
We never migrated to MongoDB 3.x because of all the changes (we were beginning to regret using it by then).