This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
any one know an more lightweight alternative to slingshot? I know that it exists but I don't remember the name 😞
clj-webdriver: why show me the login page even if I have already logined in and let the site remember me? Since I already signed in manually, if I close the web, and reopen the web again manually, it doesn't let me login again. So I hope if I use clj-webdriver, it also doesn't need me login in again. But it actually ask me to sign in. I am using (set-driver! {:browser :firefox} some_url_need_sign_in). Is there any parameter to control whether to used the saved cookie?
My Clojure app needs to run another program and keep a reference to it and if for some reason it’s not running (crashed or whatever), it needs to restarted. Should I use Runtime.exec and put the result in an atom so that it’s accessible by all threads?
@pupeno: does the Clojure program need to do that? The reason I ask is that there are lots of mature tools for monitoring processes and restarting them already
@danielcompton: I want my library to be as self contained as possible and my library needs to run nodejs. Not running nodejs would be a big abstraction leakage. It’s not the end of the world, but it will make the library much less useful.
@danielcompton: BTW, I do the devops for my company, I wrote the init script for rails/unicorn, solr, many delayed jobs, I am familiar with that side of things too, I’m not avoiding it because I don’t know it; I think it’d be a poor design for my lib.
Ok, no problem. I don't remember the details, but I seem to recall there being dragons with running external processes from the JVM. Someone more knowledgable can speak to that though.
the Java APIs for this stuff are pretty bad
there are some clojure libs that clean up access though
I’m looking at clojure.java.shell
that's one
not sure if that's still maintained
clojure.java.shell blocks while it’s running, which is not what I want unless I dedicate a thread to it, which… doesn’t sound like a good approach. At least, not an approach I ever took before.
dedicating a thread may be inevitable
This is something I observed in Clojure… some libraries are so small that lack of activity is not lack of maintenance but the fact that the library is pretty much done. Compared to other programming languages, in Clojure, it sometimes harder to know whether to use a library or not.
alexmiller: conch looks cool, but it’s still blocking.
the java apis give you streams that you are expected to read
so you will almost definitely have to consume a thread reading that stream
Oh, there’s a way to run processes non-blockingly: http://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html
@alexmiller: nice, thanks; I've already figured out why the method is not getting registered, but it will come in handy for the future.
@pupeno: I haven't used this myself, but maybe it'll suit your needs. https://github.com/tebeka/popen
@pupeno: take a look to the "low level" api of conch. You'll find it in the readme that way. It gives you access to the streams too
Hi, I'm a newbie and am trying to use the stuartsierra.component framework. I'm confused as to how I use components that I've created. For example. Here we have the function upload-receipt. https://github.com/Moocar/clojure-west-2015/blob/master/src/system.clj#L49 But where would this upload-receipt function be called from / who would be passing the uploader and receipt params here?
I am still fighting heavily with using lazy sequences, nested in a large tree and avoiding head retention issues. Maybe some of you would like to have a look at my SO question: http://stackoverflow.com/questions/32667778/removing-elements-from-lazy-sequences-in-a-large-clojure-tree-structure-avoidin Any help is highly appreciated!
@timfield: e.g. when you have compojure routes you can get Uploader injected into your context then you can dispatch upload-receipt with this record. I have similar example in my repo https://github.com/pjagielski/modern-clj-web/blob/master/src/modern_clj_web/endpoint/example.clj
in clojure/west example that would be:
(defn example-endpoint [{uploader :uploader}]
(routes
(POST "/" [receipt]
(response (upload-receipt uploader receipt))))))
bidi seems to think /about and /about? are different routes 😕
maybe someone's interested https://github.com/pjagielski/clojure-landscape-from-java
Hmm, what's the motivation between Spring Data -> system mapping? As far as I understand system that's just a collection of component components and Spring Data seems like some meta-ORM from the description.
how sequential are squuids? If I were to sort a million squuids, would they be perfectly ordered by timestamp?
I'm developing an API, and realizing that after I log in, I don't know how to test that my identity is on the session without just hitting a resource that requires authentication (or creating a "current-account" route specifically for this purpose).
To be more exact: 1. Visit the login route, supplying credentials. 2. Test that response status is 200. 3. Test that response body is a JSON representation of the user who just logged in. 4. Test that the app will remember me on my next request... ❓
Number 4 is where I'm getting hung up. For now, I'll just do the most obvious thing, and make a current-account route which returns info on the logged-in user. Nothing wrong with that... it just seems like a very black-box approach. But since sessions live at the request/response level, I don't know how to test them anywhere else.
(I have a hazy idea of how to test middlewares, by passing in Ring requests, but I don't know exactly how to craft the lower-level requests that would test this situation. All I really want to do is make sure my login handling code added the right stuff to the session!)
@jaen: system provides connectors to both jdbc and nosql datastores, this is what spring-data can be used for. however i consider adding a "notes" column with some additional information
@amacdougall: use https://github.com/xeqi/peridot, and hit request another URL that will only work if you’re logged in?
@pjagielski: I see
@arohner: Yep, that's what I'm going to do! I just switched from ring.mock.request to peridot for that reason.
I was hoping to test the exact keys added to the session by my login route, but it seems like I might have to test it only implicitly. Which is honestly not a huge deal.
Oh, interesting. I'll dig deeper. Thanks!
Hi. Is there way to maintain own suite of modules, e.g. as common part for series of projects, like [my.organization.module-foo 1.0.0] and have them on some server?
thanks, but I believe my task is somehow simpler but I don't know how exactly
aha, thanks!