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

Per Dr. Tania Dempsey, one of the leading researchers in the mast cell field, “MCAS/MCAD causes chronic inflammation in multiple organs/tissue/systems, with or without allergic-type problems and sometimes even abnormal growth and development in various tissues, and there can be acute flares of symptoms.”

Anyone who has seen the inside of my body through MRIs, CT scans, and ultrasounds will agree with that statement. (I write that with Surgery #8 coming up in about three weeks. As usual, a very experienced doctor used words like, “I’ve never seen that before,” “abnormal,” yada yada yada.)

MCAS/MCAD causes chronic inflammation in multiple organs

The most interesting story for me yesterday was that a mile-wide meteor hit Greenland, possibly as recent as 12,000 years ago, and created an impact crater 19.3 miles wide. The impact would have released 47,000 times the amount of energy that was released by the Little Boy nuclear bomb that was dropped on Hiroshima in 1945. The impact crater was hidden by a half-mile thick sheet of ice until recently. (The image shown comes from the article I linked to.)

A mile-wide meteor hit Greenland and was hidden by an ice sheet

I just saw that the first person to take a chance on me out of college — and a person who would become a mentor to me — passed away last November. Frank Jordan, thank you for everything you did for me. You are missed, and I’m sorry we didn’t stay in touch.

“Since I had started to break down all my writing and get rid of all facility and try to make instead of describe, writing had been wonderful to do.”

I’ve been working on a Kotlin book on and off for the past few months, and this morning I pulled a Steve Jobs on myself and canceled the project, even though it’s about 75% complete (by chapter count).

The problem with the book is that at this point it doesn’t contain anything unique, although arguably my way of explaining things might be better than other approaches. Unlike the Scala Cookbook, which provides solutions to common Scala problems, and Functional Programming, Simplified, which provides a unique approach to explaining functional programming in Scala, I don’t feel like there’s anything new here.

So, in short, without getting into the details of what’s next, the “vision guy” part of me decided that there are better things to do with my time. (And if you’ve ever been on a project that was canceled and you thought it was hard to take, imagine canceling your own project.)

“You’ve got to start with the customer experience and work backwards to the technology.”

~ Steve Jobs, as heard in this 1997 video

As a quick note today, if you ever need some examples of how the Kotlin collections methods work, I hope these examples are helpful.

Sample data

First, here’s some sample data:

val a = listOf(10, 20, 30, 40, 10)
val names = listOf("joel", "ed", "chris", "maurice")

“Why, darling, I don’t live at all when I’m not with you.”

“Fear is the cheapest room in the house. I would like to see you living in better conditions.”

~ Hafiz (here’s a link to the full poem)

My MacBook recently told me I was running out of disk space. I knew that the way I was backing up my iPhone was resulting in me having multiple copies of photos and videos, so I finally decided to fix that problem by getting rid of all of the duplicate copies of those files.

So I wrote a little Scala program to find all the duplicates and move them to another location, where I could check them before deleting them. The short story is that I started with over 28,000 photos and videos, and the code shown below helped me find nearly 5,000 duplicate photos and videos under my ~/Pictures directory that were taking up over 18GB of storage space. (Put another way, deleting those files saved me 18GB of storage.)

A brief conversation about the symbolism of flowers, from the movie, Midnight in The Garden of Good and Evil:

MANDY: You want to send some flowers?

JOHN: I think so. I don’t know, though. It’s kind of complicated.

MANDY: For whom? What’s she like?

JOHN: I don’t know her that well.

MANDY: Roses are a favorite ... a bit presumptuous. How about poinsettias?

JOHN: Perennials might give the wrong impression.

MANDY: Too long-term?

JOHN: Yeah, it’s hard to say.

MANDY: This is complicated. How about petunias? They’re pretty without being presumptuous, smell nice, and in 3 days you throw them out. Sound like what you’re looking for? (pause) Sorry, we’re all out of petunias.

“The reason we struggle with insecurity is because we compare our behind-the-scenes with everyone else’s highlight reel.”

Three moose running across my neighbors yard, Wasilla, Alaska, November 12, 2010. I still remember being surprised at how much noise they made, it was like a rolling thunder sound and the little apartment I was in was shaking pretty good.

Three moose running across my neighbor’s yard, Wasilla, Alaska

One tin soldier. :)

One Tin Soldier

I don’t look at website stats very often, but with a little free time tonight I was just curious how many people in Alaska visit this website. I was glad to see people have visited it from Utqiagvik, Kotzebue, Nome, Fairbanks, North Pole, Unalaska, Bethel, Kodiak Island, Ketchikan, and many other locations. Alaska holds a special place in my heart, and I hope the pages on this site have been useful to the people there.

Happy to serve people in Alaska

A friend bought me some of these USB-powered Christmas lights, and I like using them in the winter months, especially on days when it’s snowing, like today. They’d also be a nice “under $20” gift for one of those White Elephant Christmas gift exchange parties.

USB-powered Christmas lights

I was writing some Scala code like this today:

val sb = new StringBuilder
for (b: Byte <- mdOut.digest) {
    val hexString: String = String.format("%02x", b)
    sb.append(hexString)
}
sb.toString

and encountered this error message:

While reading the excellent book, Programming Collective Intelligence recently, I decided to code up the first algorithm in the book using Scala instead of Python (which the book uses). This is a Euclidean distance algorithm, and it provides one way to compare two sets of data to each other, and attempts to score the similarity between the data sets.

Without any further introduction (and assuming you have the Collective Intelligence book), here's the Scala source code for the Euclidean distance algorithm as described in the book:

I was going through some photos recently and came across this one of The Feed Store Church, which is between Alamosa and Monte Vista, a rural area in southern Colorado. I pass it when I drive back home after visiting Taos, Los Alamos, and Santa Fe, New Mexico. I thought it was some sort of a combination of a feed store and a church, but it turns out that it’s a church.

The Feed Store Church

Sometimes during meditation strange things happen. As just one example, this morning I was enjoying a deep meditation, just focusing on the breath ... focusing on the breath ... and suddenly I was standing on a street corner. I looked around briefly, then thought, “What the heck just happened,” and with that thought I returned to my meditation.