cat

A Scala Factory Pattern example

Here’s a small example of how to create a Factory Pattern in Scala. In the Scala Cookbook I created what some people might call a simple factory and/or static factory, so the following code is a much better implementation of a true OOP Factory Pattern.

The factory classes

I don’t have too much time to explain the code today, but here are the classes that make up the factory, including a set of “animal” classes along with a DogFactory and CatFactory that extend an AnimalFactory trait:

Asked for a book on Pavlov’s dog and Schrodinger’s cat

I went to the library and asked for a book on Pavlov’s dog and Schrodinger’s cat. The librarian said it rang a bell but she didn’t know if it was there or not.

The Milky Way galaxy sails through the Universe

The Milky Way galaxy sails through the Universe.
The Earth rotates, and revolves around its Sun.
The Sun shines in Earth’s blue sky.
A puffed-up bird tries to pull frozen seed
from the bird feeder while the cat watches,
and I watch.

Just breathe.

Another dream where I am running on all fours

Had another dream this morning that I was running on all fours. Rather than ask myself, “Why in the world am I doing this?”, I now just accept that I’m a dog (or a cat, or some other animal) in the dream. That helps me go along with whatever is happening in the dream, rather than fight it and wake up.

(Notes from a dream on June 28, 2016)

Mindfulness meditation: Be like a cat purring

If you’re interested in a simple introduction to mindfulness meditation, search the Internet for a free, 25-page PDF booklet named, “Buddha in Blue Jeans,” by Tai Sheridan. Despite that name, the booklet has good, non-denominational tips about meditating and mindfulness (and only mentions the name “Buddha” twice in the main text).

Here’s a favorite quote: “Be like a cat purring. Follow your breath like ocean waves coming in and out.”

Running on all fours in a dream

Wow, how embarrassing. It has taken me *years* to realize that when I run on all fours in a dream that I’m actually a dog (or maybe some other four-legged animal).

I finally realized it this morning when I was running like that and came up to a group of human friends, and one said something like, “Hey, look over there, it’s your new friend.”

When I looked in the direction he was pointing I saw a group of people who didn’t look familiar, and a black dog. Just then the dog came running at me. When it got to me it started licking and biting me and I thought, “This dog is crazy, why doesn’t someone get it off of me,” when everything suddenly made sense.