2017

A Scala method to run any block of code slowly

The book, Advanced Scala with Cats, has a nice little function you can use to run a block of code “slowly”:

def slowly[A](body: => A) = try body finally Thread.sleep(100)

I’d never seen a try/finally block written like that (without a catch clause), so it was something new for the brain.

In the book they run a factorial method slowly, like this:

slowly(factorial(n - 1).map(_ * n))

FWIW, you can modify slowly to pass in the length of time to sleep, like this:

def slowly[A](body: => A, sleepTime: Long) = try body finally Thread.sleep(sleepTime)

Seeing a therapist

I’ve been seeing a therapist for the last several years. With all that I’ve been going through health-wise, it’s been nice to have someone to talk to.

When I got to her office last night there was nobody else there, so we just sat in the lobby and started talking. But after a while some other people came in, so we had to move. When we got up to move I used telekinesis to move some of the chairs and our things. “How .. how .. how are you doing that?,” she stammered.

“Well, I guess I think about the objects, and then I kind of create my own gravity, or maybe something like a tractor beam, and well, then I move them.” Nobody had ever asked me that before, so my answer wasn’t very well thought out.

Anyway, she said I’m doing fine, but she took a couple of pills herself.

(Notes from a dream, March 9, 2017.)

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

Perform the work that has to be done without attachment

I like most of Dana Stabenow’s work, and while I didn’t particularly like Dead in the Water, I did enjoy some of the quotes in the book, such as, “Always perform the work that has to be done without attachment,” which comes from the Bhagavad Gita, of which there are many translations (such as this one, this one, and this one).

Apple’s Terms: We may slow down your old iPhone

So on page 51 of Apple’s iPhone Terms and Conditions it clearly states, “We may slow down your iPhone to increase the sales of new iPhones.”

(It may say that, who knows. Having just updated iOS, I wouldn’t mind if they get sued over the ridiculous length of that doc.)