Fork me on GitHub
#clojure
<
2019-02-06
>
Aaron West00:02:38

Confirming isak's comment, I had to combine stderr with stdout, as follows, to get output from the shell command: /usr/bin/ffmpeg -i myfile.mpg 2>&1 | grep Duration | cut -d' ' -f4 | cut -d, -f1

Aaron West01:02:57

Also, you should not need to shell out to a cmd.exe or bash shell to run ffmpeg, provided you pass the arguments properly to the process execute command. (much later); I added a comment to the gist as an improved version, to remove cut/split/grep/bash dependencies. (I'm still a Clojure novice, so my code is not well-formatted)

noisesmith01:02:19

@tallpeak fyi def inside a function alters a single global value, but it's easy to move those defs into the adjacent let

noisesmith01:02:38

but yeah, def inside any other form is very rarely what you want

Aaron West02:02:33

I guess I liked def for testing in the repl, but should remember to reformat my code a little after my interactive testing/debugging

vemv05:02:19

I use Component + tools.namespace.repl and very occasionally I encounter these spurious errors: java.lang.IllegalArgumentException: No implementation of method: xxx of protocol: #'yyy found for class: zzz The code is certainly right, it's simply a code loading issue Can one fix these without a JVM restart?

vlaaad08:02:32

Using :extend-via-metadata and meta to implement protocols made these errors go away for me

phill09:02:17

@vlaaad hmm... trouble might arise when most of the app reloads but the the via-meta protocol implementations do not, and therefore get out of synch.

witek10:02:04

How to fill a vector like [:a :b :c] with seperators :sep to get this: [:a :sep :b :sep :c]?

erwinrooijakkers10:02:22

(def v [:a :b :c])
(vec (interpose :sep v))

🙏 40
vlaaad16:02:06

works for me

bronsa16:02:01

yup it works now

bronsa16:02:16

must've been a blip

Alex Miller (Clojure team)16:02:59

It’s github pages, so not much I can do if it is

Noah Bogart16:02:50

@alexmiller Do you use a SSG? If so, which one?

Alex Miller (Clojure team)16:02:26

(so I guess no) :)

😅 5
Noah Bogart16:02:27

Static Site Generator, like Jykell or Hugo

Alex Miller (Clojure team)16:02:46

oh, it’s jekyll, just path of least resistance

👍 5
Alex Miller (Clojure team)16:02:36

if I wanted to spend time on it I’d use a Clojure one like stasis (Strange Loop site is done with that) or Cryogen

Alex Miller (Clojure team)16:02:20

for something like this, Cryogen is probably ideal

Noah Bogart16:02:36

cool, thank you!