Scala, Java, Unix, MacOS tutorials (page 225)

I was curious about how the “input redirection” program on page 170 of Learn You a Haskell for Great Good (LYAH) worked, so I typed it into a file named do1.hs, with one additional line:

import Data.Char

main = do
    contents <- getContents
    putStrLn "dude"
    putStr $ map toUpper contents

The line I added is the putStrLn "dude" line.

I compiled it like this:

When I had a medical procedure done a couple of weeks ago, the person who stayed with me watched the movie The Bucket List while I slept after the procedure. That made me think of coffee, both the coffee that is, ahem, produced by the cats, and the “Chock full o’ Nuts” cans. I decided to see if the “Chock” coffee was a real thing, and indeed it is. I ordered some on Amazon, and I have to say, it is very good. You can make it as weak or as strong as you like, and it’s very mild either way.

Chicago Cubs pitcher Jake Arrieta threw a no-hitter against the Los Angeles Dodgers yesterday. I like this quote from him about doing what he has to do to be consistent. (The quote comes from this espn.com page.) I see that he also talked about consistency when I posted this quote about ‘routines’ last year.

Without much discussion, here is some source code for a Scalaz 7 “Hello, world” example, using the Scalaz putStrLn function:

It’s official: Termination dust has appeared in Anchorage, Alaska. (Image from this Twitter page.)

After scoring a lot of runs during a 19-day homestand, the Chicago Cubs went on the road, and in back-to-back games they got to face Madison Bumgarner and Clayton Kershaw, and scored two runs in two games. Other Cubs teams may have panicked at this point, but this Cubs team seems to have a good attitude about the experience. Image from this mlb.com article.

This is an except from a story titled, The Taboo of Enlightenment, on Tricycle.com.

This short article shows how to write a command-line timer in Scala. There are simple ways to do this as just a regular Unix/Linux shell script, but I wanted to use Scala, in part so I could try to remember how to use the Java sound libraries. (I also initially thought about writing this is a GUI app, but decided to just make it a command-line app.)

I wanted a simple command-line timer, so I wrote one in Scala.

This is part of a great story by Pema Chödrön about what her teacher, Chögyam Trungpa Rinpoche, told her when her life hit rock bottom. From this article on LionsRoar.com.

In some ways Scrivener is a bit of a klunky, older-looking Mac OS X application, but I started using it two days ago, and it has helped me organize my ideas, so for that I give it credit. It’s intended to be used by writers who want to write books, and as I said, it does help with the organization aspect, and that is helpful. It’s better than a pile of files in a directory that you manually try to keep in order, that’s for sure.

As shown in the image, I’ve finally come to the realization that I can’t write a book. But I can write a few sentences, and then a few pages, and eventually a chapter on a given topic. And then I can write another chapter, and then another. But to sit down and say, “I’m going to write a book,” no, that’s too hard.

I just used this ImageMagick code in a Unix shell script to add a 20% black border to every image in the current directory:

Because most of the people I know have a really hard time facing death, it’s hard to recommend Seeking a Friend for the End of the World to them. But hey, it’s a quirky love story, and I liked it. It’s currently playing on Netflix.

According to a USA Today survey, Boulder, Colorado has the best “Farmers Market” in the United States.