Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X

“A small team of A+ players can run circles around a giant team of B and C players.” ~ Steve Jobs (image from this twitter page)

That’s true in software, and as I’ve found out recently, it’s true with doctors and other medical professionals.

Steve Jobs on 'A' players

A friend wrote these words today:

“Loaded accusatory silence”

It’s a beautiful phrase, and it refers to people making assumptions about what other people are thinking or doing. Rather than talk to those people to find out what’s really going on, they accuse them in their own minds (and also judge them to be guilty).

(The word “judgmental” comes to mind.)

Facebook tells me that I was having health problems three years ago, when I posted the attached image, and this text: “My heart has been dancing to the beat of its own drummer again lately, so rather than sleep at night I've been listening to the coyotes and watching movies. These were all good. You Kill Me cracks me up.”

Movies I watched in 2013

One way to describe what I was going through was “brain fog,” or having difficulty thinking clearly, articulating my thoughts, and remembering anything. This quote comes from the mastocytosis.ca web page:

“When the symptoms occur, it is common for patients to have difficulty thinking clearly ... mast cells are in every organ including the brain.”

This is a list of “Nonimmunologic histamine releasers other degranulation triggers” from the Mastocytosis Society of Canada. Please see their website for more information about Mastocytosis triggers.

I just read that mast cell diseases are inherited, and this list makes me wonder if this comes from my dad’s side of the family. I know that he was allergic to quinine, which is on this list, and if I remember the story right, one of his brothers died when given a radioactive dye during an MRI or CT Scan. I got very sick the last time I was given dye during an MRI, and immediately broke out in hives.

Mastocytosis - Histamine releasers, triggers

This MastAttack.org page may describe what I have been doing through:

Mast cell activation syndrome (MCAS) (also known as ‘Mast cell activation disorder, or MCAD’) is when a normal amount of mast cells behave badly. It is clinically similar to indolent systemic mastocytosis; life span is normal; biopsies are negative.”

Wikipedia also has a good mast cell activation syndrome page. Both pages cover the MCAS/MCAD symptoms very well.

The information about the iPhone 7 performance in this image comes from this post by Jon Gruber. The mind-blowing stats are in the two updates at the end of the image.

iPhone 7 performance

This espn.com article on having a sports psychologist isn’t very deep, but the paragraph shown in this image reminds me of Tiger Woods “Standard Operating Procedures” (SOP) he used to use in golfing. His father was in the military, and as I remember it, he taught Tiger to have SOP routines for approaching every ball.

I can’t remember the person’s name right now, but there’s a popular sports psychologist in Colorado who works with Adam Gase, some of the Broncos players, and the University of Alabama football program.

Sports psychology becoming popular

“Even when I was just three years old, I could recall many previous lives. But to many people this sort of thinking isn’t acceptable, so now when I’m asked what I can remember, I just say, ‘I remember when I was three years old.’”

~ a monk

Table of Contents1 - The answer2 - More Java division and arithmetic rules3 - Summary

Java FAQ: What are the rules about Java arithmetic (multiplication, division) involving mixed data types?

While working on a math problem in Java just a little while ago, I realized that I wasn’t comfortable with the Java mixed-type division rules. That is, I wondered if the result of this equation:

3 / 2

the same as the result of this equation:

3 / 2.0

or this equation:

3.0 / 2.0

Over the last few days I have been feeling about 98% better than I have in several years, and I now know that most of the problems I was having were related to histamines and mast cell disorders. This book, Never Bet Against Occam (i.e., Occam’s Razor), covers the symptoms and problem(s) of Mast Cell Activation Syndrome (MCAS) from a medical perspective.

Mast Cell Activation Syndrome

As someone who is dealing with something like Mastocytosis or histamine intolerance, this book, “My Crazy Life: A Humorous Guide to Understanding Mast Cell Disorders,” strikes a chord with me. For a long time you walk around going “WTF?,” and during that entire process you find that American doctors are no help at all.

A Humorous Guide to Understanding Mast Cell Disorders

I generally try to avoid this coding style these days, but, if you want to see how to use a Java BufferedReader and its readLine method in a Scala while loop, here you go:

I won’t link to it (because it’s a link-bait article), but I was surprised to see that medium.com ran a little article (very little), titled, “Functional Programmers are Better Programmers.” This image shows the crux of the article. I was surprised that the authors come right out and state, “Yes, FP is more difficult.”

Functional Programmers are Better Programmers?

I was looking for a good way to access XML resources (like RSS feeds) in Scala, and I currently like the idea of using ScalaJ-HTTP to access the URL and download the XML content, and then using the Scala XML library to process the XML string I download from the URL.

This example Scala program shows my current approach:

To run external shell commands in SBT, first start SBT from your operating system command line:

$ sbt

Then run the consoleProject task/command:

> consoleProject

After some output you’ll see this prompt:

scala>

Now you can execute shell commands by including them in double quotes, and following them by an exclamation mark, like this:

scala> "ls -al" !

For more information, see the SBT consoleProject documentation page.

Here’s some Scala source code that shows how to scrape the tweets off of a Twitter page. I was thinking about rewriting a Twitter module I use to use a “pure HTML” approach, and the test/demo code I came up with looks like this:

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 14.4, “How to run a shell command from the Scala REPL.”

Problem

You want to be able to run a shell command from within the Scala REPL, such as listing the files in the current directory.

Solution

Run the command using the :sh REPL command, then print the output. The following example shows how to run the Unix ls -al command from within the REPL, and then show the results of the command:

“All things that appear in this world are illusion. If you view all appearance as nonappearance, you will see your true nature.”

Today’s song of the day is Can’t Shake You, by Gloriana: