Threads for pyr

  1. 3

    Thanks for this, looks great on mobile!

    A bit of a tangential question: when not using any particular desktop environment in Linux, is there a way to make Firefox ask for dark or light mode. I love it that the phones switch automatically depending on time of day and would love this for the desktop but I wasn’t able to find any pointers on how to do that.

    1. 7

      If you set ui.systemUsesDarkTheme to 1 in about:config, that should do it. Not sure about automating it though.

      1. 2

        Thanks! I’ll leave the automation for a rainy day but this is already great, thanks a lot.

      2. 1

        I’m pretty sure changing the Firefox theme to a dark one changes the color preference too.

      1. 3

        Company: Exoscale

        Company site:

        Position(s): Software engineer, SRE working on either distributed systems or lower level systems engineering

        Location: Remote anywhere in Europe or Onsite in Lausanne Switzerland

        Description: Exoscale provides a complete infrastructure as a service experience with a focus on simplicity, scalability, and safe defaults. We are gearing up to improve our block storage offering as well as our VPC capacity which involves compulsing existing academic work, designing and testing distributed systems, as well as requires an aptitude for mechanical sympathy on the systems engineering side.

        Tech stack: Clojure at the orchestration layer, Golang for workload local software, a few exceptions here and there where mandated. MySQL, Kafka, and FoundationDB for the bulk of storage needs


        1. 11

          For the fun of it, two alternatives to shorten your solutions.

          The first uses juxt and is mostly point-free, but terse:

          (->> "aaaabbbcca"
               (partition-by identity)
               (map (juxt (comp str first) count))))

          The second one with for, a bit chattier but also more legible:

          (for [p (partition-by identity "aaaabbbcca" )]
            [(-> p first str) (count p)])

          Since you were mentioning suggestions in the article, this is one of the

          1. 6

            Here’s my point-free take on it using Dyalog APL

                  (((1∘+ +\) ⊢ ≠ ¯1∘⌽) (((⊃,≢) ⊢) ⌸) ⊢) 'aaaabbbcca'
            a 4
            b 3
            c 2
            a 1
            1. 4

              Nice! Here’s mine:

                a 4  b 3  c 2  a 1
                     ↑x ⍝new formatting, same great taste!
               a 4
               b 3
               c 2
               a 1

              And for bonus points, the decode:

                     g x

              I really wish dyalog had capped forks—they would obviate the last set of parentheses in the encoder.

              1. 4

                I love it! I wonder what differences in memory or performance would be in applying (⊃,≢) as you do to each partition after grouping them, vs during the grouping as I do with the key operation. I’d forgotten about the “n-wise reduce” variant you used, which is much nicer than my ancient rotation idiom.

                It’s interesting how similar the Clojure and APL solutions for a problem like this can be. I mean (juxt first count) and (⊃,≢) are remarkably alike. It makes me wonder what Clojure would be like if it had function trains instead of threading macros.

                1. 2

                  This has to be the most interesting discussion I’ve seen this week. Downside: now I’ll have to relearn APL enough to understand your solutions. :D

                  1. 1

                    memory or performance

                    IME performance is generally not super intuitive to reason about in APL, because of the interpreters’ ability to do pattern recognition.

                    It’s interesting how similar the Clojure and APL solutions for a problem like this can be. I mean (juxt first count) and (⊃,≢) are remarkably alike. It makes me wonder what Clojure would be like if it had function trains instead of threading macros.

                    This is a good read.

                  2. 1

                    duh; simpler: (⊃,≢)¨⊢⊆⍨(+\1,2≠/⊢)

                  3. 2

                    Having never seen this language before, it looks like someone has incorrectly rendered a bunch of UTF-8 characters lol

                  4. 3

                    That’s a nice use of juxt to make it point-free (what do you mean, mostly point-free?). My first intuition was pretty much the same with an anonymous function instead of juxt.

                    I believe getting used to threading macros make data manipulation tasks like this one much, much easier to approach. Both when writing and when reading.

                    I have a hard time believing that most candidates cannot solve the problem. Do they claim to know Clojure?

                    1. 3

                      It looks like the original tweet wasn’t about clojure?

                    2. 3

                      Unrelated, but I thought I’d comment anyhow since I know you’ll read it:

                      Your brainfuck interpreter changed the way I thought about everything. Long, long story short, more than ten years ago I began my journey learning Scheme through SICP, and over time I just lost the spark and sorta fell away from writing beautiful programs and wanted to just write clever programs. I was working on a little side project involving a genetic algorithm and brainfuck, and along the way, I thought “oh, what the hell, I may as well read a bf interpreter and then just try and write my own” and I stumbled across yours.

                      I won’t bore you, but let me just tell you that when I read that code, it became as clear as day to me how long it had been since I read something elegant and beautiful. Since then I’ve been getting deeper and deeper into Clojure, and that old part of my brain that sought after beautiful programs is starting to feel rejuvenated. I’d been reading Ruby classes and Python classes for SO long, it’s been really nice digging my brain out from all of that.

                      This may be a really weird comment to read, sorry. I just really had a ~*~moment~*~ after reading your code. It’s immaculate.

                      1. 3

                        This means a lot, thank you.

                      2. 3

                        Thanks. Both suggestions look good, the first one little bit more readable.

                        1. 3

                          Oh wow, juxt there makes it sweet. Nicely done!

                        1. 1

                          We use a very similar (but admittedly more primitive) approach at work to monitor our current PR workload :

                          We use this as the place for contributors to look for their next review to do

                          1. 3

                            The social rule of being able to create work without having to also lead the resulting fallout work seems crazy to me, in other packaging communities (or more generally speaking software projects) it is often up to the person introducing the change to present its implementation as well.

                            In essence here some packagers can act as unchecked “product managers” pushing a new way of building packages, disregarding ensuing labor.

                            1. 1


                              Exoscale is present in Switzerland, Germany, and Austria. And provides fast VMs and Object Storage. I am biased but think we are OK

                              1. 2

                                Six IMAP accounts, delivered via mbsync to the local, indexed by mu, and read in mu4e. I do no filtering, just archive everything and trust in mu to find what I need. On the iPad/iPhone, I use the native mail client. I’ve tried a bunch of others, and while I actually like Outlook for iOS the best, it also includes calendaring, which is dumb and unnecessary.

                                I segregate work stuff to a different set of clients — the gmail web app on the desktop, and the gmail app on iOS.

                                My personal and our family email, the only really important ones, are hosted at Fastmail.

                                1. 1

                                  Similar setup (msmtp, msync, mu, mu4e) this gives me a fast, unified inbox for both home and business emails. Very happy with it