This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-12
Channels
- # aws (21)
- # aws-lambda (8)
- # beginners (53)
- # boot (56)
- # braveandtrue (1)
- # cider (49)
- # cljs-dev (8)
- # cljsjs (1)
- # cljsrn (57)
- # clojure (403)
- # clojure-austin (17)
- # clojure-dusseldorf (10)
- # clojure-greece (9)
- # clojure-spec (57)
- # clojure-uk (144)
- # clojurescript (60)
- # datomic (149)
- # docker (1)
- # emacs (1)
- # hoplon (23)
- # humor (1)
- # jobs (1)
- # leiningen (2)
- # luminus (1)
- # off-topic (1)
- # om (24)
- # om-next (15)
- # onyx (23)
- # protorepl (2)
- # re-frame (58)
- # reagent (90)
- # remote-jobs (1)
- # ring-swagger (4)
- # slackpocalypse (1)
- # spacemacs (2)
- # specter (18)
- # untangled (4)
- # vim (1)
- # yada (27)
If i have (def foo ["A" "B" "C"])
and (def bar [1 2 3])
... is there a clean way where i can get [ ["A" 1] ["A" 2] ["A" 3] ["B" 1] ["B" 2] ["B" 3] ["C" 1] ["C" 2] ["C" 3] ]
(order of resulting vector elements doesnt have to match as written). i can do it in a few lines, but i felt like there is a function that does this somwehere, maybe i am mistaken tho
@gadfly361 Outer product can be done with for
.
Somebody have an idea what is the problem with that?
(assoc (ring.util.response/redirect "/addpass") :flash "Passwords don't match!”)
how can I add multi-params for this or how can I handle the best this flow in clojure?trying to java interop onto a method defined in the java inherited parent class , but clojure claims the method is not there
@gregnwosu what's the type of client
?
(def secrets
(let [
provider (DefaultAWSCredentialsProviderChain.)
client (AmazonDynamoDBClient. provider)
region (Region/getRegion (Regions/EU_WEST_1))
client-opts {
;
:access-key "someTest"
:secret-key "someTest"
}
]
(.setRegion client [region])
client))
is there any way to use local dependencies (project) for my Clojure project?
.
├── README.md
├── project.clj
├── repo
├── src
├── target
├── libraries
│ └── my-project
└── test
and how to add my-project
as a dependency?
@kamillelonek if you’re “my-project” is built as a jar, you can add it to the :resource-paths
in your project.clj
(saves you from building your own private Maven repo 😄 )
what if it's just a regular directory with the project
is it its own, separately managed project (has it’s own project.clj, builds on its own, etc)?
it's a library
regular Clojure library project
that’s fine - from a dep mgmt perspective, you shouldn’t be mixing your project sources though - they should be managed as two separate projects, and the artifacts from the build of the library should be brought in. You’re mixing them together, which actually makes it more difficult.
> you shouldn’t be mixing your project sources though - they should be managed as two separate projects
they are
they have their own repositories
I just want to use my library in my application
in the simplest possible way
build a jar of the lib; add it to the resource-paths in the consuming project
http://stackoverflow.com/questions/2404426/leiningen-how-to-add-dependencies-for-local-jars <— this has that and other options
lein2 doesn't support that
I tried http://jakemccrary.com/blog/2012/03/28/working-on-multiple-clojure-projects-at-once/ but it doesn't seems to be working either
I mean, that does leave using a local maven repo, but ¯\(ツ)/¯
I could use local maven repository, but lein deps
doesn't seem to look at it at all
I’m doing an exercise to learn clojure(script) which is basically a list of counters. You can add and remove counters as well as inc and dec the individual counters. I wondered if the following was a sound data model:
(def counters (atom [{:id 0
:amount 0}]))
as opposed toI would probably start with an empty list: (def counters (atom []))
Sorry, called away suddenly
Anyway, I was starting to say you should think about how you want to refer to your counters. If you’re just going to refer to “the first one” and “the second one” and so on, then you can just use an array of values
but that might cause problems because you said you want to add and remove counters, so if you have 3 counters [18 14 6]
, and you remove the first counter, you have to remember that the 14
is now the first counter, etc.
Cool, makes sense. In my project you would always remove from the end of the list allowing use of subvec
sounds good. If you want to attach a specific ID to each different counter, I’d just us a map of id -> current-count, so something like {:a-counter 12, :b-counter 8}
. It’ll be easier to work with than an array of objects
though with a plain map I think you might lose the ordering.