This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-28
Channels
- # admin-announcements (2)
- # alda (5)
- # arachne (4)
- # beginners (49)
- # boot (92)
- # capetown (3)
- # cider (9)
- # cljs-dev (6)
- # cljs-edn (1)
- # cljsjs (29)
- # cljsrn (4)
- # clojure (65)
- # clojure-android (1)
- # clojure-berlin (2)
- # clojure-chicago (2)
- # clojure-gamedev (2)
- # clojure-greece (11)
- # clojure-india (1)
- # clojure-japan (1)
- # clojure-new-zealand (2)
- # clojure-quebec (2)
- # clojure-russia (49)
- # clojure-spec (73)
- # clojure-uk (38)
- # clojurescript (118)
- # clojutre (4)
- # community-development (17)
- # cursive (3)
- # data-science (1)
- # datascript (1)
- # datomic (17)
- # emacs (6)
- # euroclojure (2)
- # events (2)
- # immutant (30)
- # keechma (11)
- # leiningen (4)
- # luminus (2)
- # off-topic (19)
- # om (14)
- # onyx (28)
- # planck (9)
- # re-frame (11)
- # reagent (35)
- # ring-swagger (4)
- # schema (4)
- # slack-help (6)
- # spacemacs (2)
- # specter (11)
- # testing (4)
- # untangled (88)
- # utah-clojurians (2)
- # vim (2)
- # yada (9)
Does anyone have a good script or program to alter the name of a project and propagate that to all the relevant files? I want to change the name of all the file paths in the filesystem my/proj1/ns.clj => my/proj2/ns.clj
and change all references to the namespaces my.proj1.ns => my.proj2.ns
.
I'm thinking something like sed
but not sure how to do the filesystem part.
not a direct answer, but if there are only a few hits to change I'd recommend doing it manually. can be done fast anyway if you have good enough find/grep/vim-fu. it doesn't scale to a huge number of hits, but has advantage of being context-smart and filetype smart, and safer. plus it should be rare you change a project name
aengelberg: clj-refactor has cljr-rename-file which updates both the file name and the package name, including references to it within the same project.
Need to turn foo *bar /baz/ bar* _foo_
into ["foo " [:b "bar " [:i "baz"] " bar"] " " [:u "foo"]]
Org-mode inline parsing, in other words. I've already got the regexps, but efficiently recursing over the string is a mystery to me.
Also, hat tip to @chingfan_newbie for helping me figure out the missing bit for my regexps earlier.
With http://github.com/engelberg/instaparse:
boot.user=> (def p (insta/parser "
S = token*
<token> = b | i | u | string
b = <'*'> token* <'*'>
i = <'/'> token* <'/'>
u = <'_'> token* <'_'>
<string> = #'[^*/_]+'
"))
#'boot.user/p
boot.user=> (p "foo *bar /baz/ bar* _foo_")
[:S "foo " [:b "bar " [:i "baz"] " bar"] " " [:u "foo"]]
You could also change S
to <S>
to effectively omit the :S
in the result
instaparse looks amazing!
anyone else had a problem with ring-jetty serving an empty root response only when packaged in an uberjar (ie works fine in dev mode)
can’t think of anything other than that the wrap-resource middleware resolves “/“ as an empty resource and serves it
I have a thing that gives me allowed-actions
which will advance the thing into a new state which in turn also has allowed-actions
— now I want to compute all possible paths using these allowed actions.
With "thing" I'm referring to a state machine such as this: https://github.com/ztellman/automat/raw/master/docs/readme-2.png
For the image above I'd want to end up with [[1 2 3] [1 3]]
I considered clojure.walk
but I'm not seeing how it would help me yet.
Something like the paths
function in Loom? http://aysy.lu/loom/loom.alg-generic.html#var-paths
unlikely anyone has this particular problem, bit if you are using the “friend” auth library be sure to exclude ring/ring-core from it if you plan on deploying an executable jar to run your web app
there was a fix put in long ago into ring to account for empty directories being picked up as valid resources
So, I feel pretty sure Alex Miller had a great post on protocol and multi-method performance, but I'm having trouble finding it now
and indeed, can't even seem to find his blog. My google-fu is failing me. Anyone know where that is?
(hey Tim!)
yeah, that seems to be his old one though
I could swear he has a newer one
his newer one you mean? Yeah I'm confused as to where that went
I know, I'll try twitter
hrm, wonder if this is related: https://twitter.com/puredanger/status/740373660440006656
weelll I'll stop spamming #C03S1KBA2 about this. @alexmiller or anyone if you see this and can point me in the right direction, let me know! Thanks
Aha, I figured it out: I was looking for his posts on http://insideclojure.org. This is the one in particular I was after if anyone else cares: http://insideclojure.org/2015/04/27/poly-perf/
sorry again for the noise!
yeah, lots of great pieces there
Hello all, is there a way, with an immutant server, to wait for it to close? akid to aleph's wait-for-close
https://github.com/ztellman/aleph/blob/master/src/aleph/netty.clj#L732
oh, redirecting to #C085AR8RE
Clojure 1.9.0-alpha8 is now out https://groups.google.com/d/msg/clojure/vF3RuDWuX8I/pvn4IUuUAwAJ
@austb - Yes if I wrap in count function but the Cursive evaluator there is showing count of 1
Hmm I’m not experienced with how Cursive evaluator works, but is it possible that it’s saying the result was 1 LazySeq?
@staypufd: filter
returns a seq with the list items where the predicate function returns true. Since none of those maps have the value associated to :id
as nil, filter returns an empty list.
You can remove elements satisfying a predicate with remove
@staypufd: does this give a count of two?
(doall (filter (fn [li] (nil? (:id li))) [{:id 1} {:id 2}])) ()
oh I understand the concern.
I also get 0
that's odd