This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-11
Channels
- # announcements (1)
- # beginners (35)
- # calva (28)
- # cider (14)
- # cljdoc (6)
- # cljs-dev (42)
- # cljsrn (2)
- # clojure (14)
- # clojure-spec (6)
- # clojure-uk (1)
- # clojurescript (13)
- # data-science (1)
- # emacs (3)
- # joker (3)
- # kaocha (1)
- # klipse (1)
- # leiningen (3)
- # off-topic (4)
- # pathom (10)
- # rewrite-clj (1)
- # shadow-cljs (28)
- # sql (5)
DRM strategies so people don't just copy/paste pay-to-access articles?
maybe generate an image instead of rendering raw text ... was my thought
I'm not a fan. I prefer to trust people. DRM is a huge amount of work for really a small payback and it often has negative impact on people with disabilities.
(in particular, generating an image instead of text prevents assistive technology from working which blind people rely on -- a lawsuit just waiting to happen in the US!)
(If we want to discuss this in more depth, we should probably move to #off-topic since it really isn't Clojure-specific and not really even tech-specific, let alone beginner friendly)
Yeah I dislike DRM too
maybe just a thoughtful note is enough
Trying to think which of the online book sellers it is that makes a big point that their PDF format books are DRM-free and rely on trust not to share the books/undermine their business...
Even all that aside, DRM is hard tech to work with. It usually involves encryption, license verification systems, "phoning home"... all of which are "incidental complexity".
how do you feel about disabling copy/paste on pay-to-read articles?
Not worth it. It's easy to get around for anyone who cares.
roger that
And it's a really annoying inconvenience for folks who've actually paid to read this and want to clip some text for later reference.
remind me to bust out the hostile architecture slides more often 😂
Rome was a Hostile Architecture 😂
saw someone talking about having a keybinding that saves the result of an evaluated operation to a temporary var that can be used for debugging. might have been @seancorfield. that sounded super handy. though iirc he is not using emacs. does anyone know if this function exist for emacs. in cider or similar. or should it be written?
@sakalli The only thing I know of is that you can reference the last evaluated values with *1
*2
etc. where *1
is the last value evaluated and *2
the second last
i'm following the basic gen-class
example [1] from the http://clojure.org docs website. my example class compiles just fine (present in classes/clojure/examples/hello.class
), but i'm having trouble running it. am i missing something obvious? 🙂
[1] https://clojure.org/reference/compilation#_gen_class_examples
$ java -cp ./classes:clojure.jar clojure.examples.hello Fred
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Var
at clojure.examples.hello.<clinit>(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Var
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 1 more
of course... i was missing clojure.jar. however, when i add clojure-1.10.1.jar i get the following: Caused by: java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class, clojure/spec/alpha.clj or clojure/spec/alpha.cljc on classpath.
page updated to use new clj command line tool
@joshkh Newer versions of Clojure depend on spec. I think the example on that page is a little outdated. One easy way to ensure you get the spec dependency is to use the new command line tools to run Clojure in lieu of invoking java
directly: https://clojure.org/guides/deps_and_cli
Thanks @U04VDQDDY!
thanks @alpox, those are handy as well. hacked a couple of elisp functions for this. C-c w saves the the symbol before the point and C-c c evaluates last expression and binds it to the saved symbol. If no symbol exists it binds it to 'temp
(defun eval-last-sexp-to-var ()
"Evaluates last sexp and binds it to symbol stored in 'saved-symbol.
saved-symbol defaults to 'temp"
(interactive)
(if (not (boundp 'saved-symbol)) (setq saved-symbol "temp"))
(cider-interactive-eval
(format (concat "(def " saved-symbol " %s)")
(cider-last-sexp))))
(define-key cider-mode-map (kbd "C-c c") 'eval-last-sexp-to-var)
(defun set-last-sexp-to-symbol ()
"Saves the last sexp to 'saved-symbol for use with eval-last-sexp-to-var"
(interactive)
(setq saved-symbol (cider-last-sexp)))
(define-key cider-mode-map (kbd "C-c w") 'set-last-sexp-to-symbol)
@sakalli A bit over my head (Never used elisp really) but it looks quite useful! 😄 thanks, I'll see if I can make some use of it
Not a spacemacs user, but think you can just paste those in the config or at least that there is an area where you can save your own customizations. You might want to change those keybindings to something more appropriate for spacemacs tho
@alpox look at the spacemacs config file, you can put all your custom configs in that file. however spacemacs comes with pretty decent defaults and key bindings. look at the specific layer to see if the keybindings are already not there- http://develop.spacemacs.org/layers/+lang/clojure/README.html