# parent

Sometimes dreams teach us things alvin February 12, 2020 - 11:21am

It seems like sometimes dreams exist to teach us things. Last night there was a very long dream sequence in which a deceased relative was a raging alcoholic. At one point I had to help him off the floor, and when I touched him I instantly saw what he had seen, and felt what he was feeling. It was like 100% empathy for that person. I immediately felt, “Wow, if I had been through these things I might be in the same shape myself,” so rather than feeling pity for him I felt empathy. I got him up into a chair and said, “Talk to me.” He tried to brush me off, but when I told him what I had seen and felt he began weeping and I hugged him for a while.

Ram Dass on being a parent, and a soul alvin May 16, 2018 - 8:47am

Ram Dass on being a parent, and a soul (and attachment).

## How to define a collection whose element are all of some base type (inheritance)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 19.6, “How to define a collection whose element are all of some base type.”

## Problem

You want to specify that a class or method takes a type parameter, and that parameter is limited so it can only be a base type, or a subtype of that base type.

## Solution

Define the class or method by specifying the type parameter with an upper bound. To demonstrate this, create a simple type hierarchy:

## Akka/Scala: How to monitor the death of an Actor with “watch”

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 13.8, “Monitoring the death of an Akka Actor with ‘watch’”.

## Problem

You want an actor to be notified when another actor dies.

## Solution

Use the `watch` method of an actor’s context object to declare that the actor should be notified when an actor it’s monitoring is stopped.