Fork me on GitHub

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.


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?


(or perhaps there is a better workflow?)


@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

🙏 4

i'm following the basic gen-class example [1] from the 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]

$ 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(
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
	at java.base/java.lang.ClassLoader.loadClass(
	... 1 more

👍 4

of course... i was missing clojure.jar. however, when i add clojure-1.10.1.jar i get the following: Caused by: Could not locate clojure/spec/alpha__init.class, clojure/spec/alpha.clj or clojure/spec/alpha.cljc on classpath.

Alex Miller (Clojure team)16:08:34

page updated to use new clj command line tool


cheers, Alex!


@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:

Alex Miller (Clojure team)14:08:58

Yeah that example is old, I can fix it up

👍 4

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"
  (if (not (boundp 'saved-symbol)) (setq saved-symbol "temp"))
   (format (concat "(def " saved-symbol " %s)")

(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"
  (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


pretty n00b myself so "hacked" would the appropriate term. 🙂


I wonder if I could dump this somewhere in my spacemacs config


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-


sorry @alpox there was an error in the first funciton ^^ updated it, should be working now.