# Cute Little Solution

I’m learning Ruby and one small exercise was meant to calculate the sum for simple sentences like this: “eight plus 5 plus five minus three plus 1 minus 4” and output an answer. Numbers can be either numeric or written out. Every set of numbers is separated by either “plus” or “minus.” I’m sure there are many ways to complete this problem. I came up with the cute little solution below.

```NUMBERS = {
"zero"  => 0,
"one"   => 1,
"two"   => 2,
"thrid" => 3,
"four"  => 4,
"five"  => 5,
"six"   => 6,
"seven" => 7,
"eight" => 8,
"nine"  => 9
}

OPERATIONS = ['plus', 'minus']

def is_int?(int)
int.to_i.to_s == int
end

def translate_number(number)
return number.to_i if is_int?(number)
NUMBERS[number]
end

def compute(operation, number)
case operation
when 'plus' then number
when 'minus' then -number
end
end

def computer(expression)
express_array = expression.split
total = translate_number(express_array.shift)
operation = nil
express_array.each do |element|
if OPERATIONS.include?(element)
operation = element
next
end
number = translate_number(element)
total += compute(operation, number)
end
total
end

p computer("two plus two minus one plus 8 plus five minus 3")
```

# Rape in Film

LA Weekly has an important piece this week on rape in film and TV titled, “Rape Choreography Makes Films Safer, But Still Takes a Toll on Cast and Crew.” It discusses the difficulties in filming rape scenes, abuses that have taken place in the past (especially during the 1970s), and the lack of dialogue about how much rape there should be in film and TV.

Here is one bit:

Working on Brian De Palma’s heart-wrenching war drama Casualties of War(1989), editor Bill Pankow and the postproduction crew edited one of the most emotionally charged rape scenes committed to film, in which Sean Penn’s character and three others assault a Vietnamese girl over the objections of Michael J. Fox’s character. As the editor, Pankow’s required to watch and rewatch footage, knowing it intimately, thereby getting a feel for which shots have the desired emotional appeal. After the film’s release, Pankow, in an interview that appeared in Gabriella Oldham’s First Cut: Conversations With Film Editors, revealed, “For the first few days, we couldn’t help crying just looking at the dailies.”

# John Roberts’ Ninth Grade Commencement Speech

John Roberts gave a commencement speech to his son’s ninth grade class at the all-boys Cardigan Mountain boarding school.

You’ve been at a school with just boys. Most of you will be going to a school with girls. I have no advice for you.

From time to time in the years to come, I hope you will be treated unfairly, so that you will come to know the value of justice. I hope that you will suffer betrayal because that will teach you the importance of loyalty. Sorry to say, but I hope you will be lonely from time to time so that you don’t take friends for granted. I wish you bad luck, again, from time to time so that you will be conscious of the role of chance in life and understand that your success is not completely deserved and that the failure of others is not completely deserved either. And when you lose, as you will from time to time, I hope every now and then, your opponent will gloat over your failure. It is a way for you to understand the importance of sportsmanship. I hope you’ll be ignored so you know the importance of listening to others, and I hope you will have just enough pain to learn compassion. Whether I wish these things or not, they’re going to happen. And whether you benefit from them or not will depend upon your ability to see the message in your misfortunes.

# Collectively, humans have watched Adam Sandler on Netflix for longer than civilization has existed

That is the title of a new Quartz piece by Ashley Rodriquez. Here is one bit:

Five hundred million hours may not sound extraordinary compared to the 1 billion hours of YouTube people watch per day. But it equates to about three movies for each Netflix subscriber—or, an astonishing 57,000 years worth of continuous viewing.

What were humans doing 57,000 years ago? Not watching Netflix, that’s for sure. It was the Stone Age and cave paintings didn’t even exist yet. The earliest known cave paintings were believed to be around 40,000 years old (paywall), although there are older known sculptures and engravings.

# You Should Literally Read This

Merriam Webster has a fantastic entry on the use of the word “literally.” Here is the introduction; there is much more of interest at the link.

Is it ever okay to use literally to mean “figuratively”?

F. Scott Fitzgerald did it (“He literally glowed”). So did James Joyce (“Lily, the caretaker’s daughter, was literally run off her feet”), W. M. Thackeray (“I literally blazed with wit”), Charlotte Brontë (“she took me to herself, and proceeded literally to suffocate me with her unrestrained spirits”) and others of their ilk.

# Solitary Confinement

According to the law, deprivation of freedom alone is supposed to be the price society exacts for crimes. Even within this mostly punitive model, people are supposed to be sent to prison as punishment, not for punishment.

That is from an article from Minnesota’s Start Tribune by an inmate that spent 585 days in solitary confinement. It does not sound pleasant.

Imagine being locked in a concrete room the size of your bathroom for 20 months with no way out. Under the glare of bright fluorescent lights that never go dark, the only way to tell day from night is by what type of meal slides through a hole in the door.

Now imagine that door is soundproof and the only noises you’ve heard for almost two years are your own voice and the occasional faint metallic banging as someone loses his mind in another room near yours. Imagine being so deprived of stimulation that watching ants race to a chunk of cookie for hours was the most exciting event of those nearly 600 days.

What you are imagining was my life.

In fact the Star Tribune has a related 4-part series called “Way Down in the Hole,” which I hope to read soon.