Today is an anniversary of sorts for me. After knowing “something” was wrong for a long time, on this day three years ago I passed out for the first time.
Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X
I’m told that this is a famous poster for designers that I just applied a lot of whiteout to. (The missing words seem to have been inspired by Samuel L. Jackson.) I like “Believe in yourself” and “Trust your gut.”
I like this quote from Leo Buscaglia: Take responsibility and grasp it. Don’t be a victim.
Tina Turner talks about the power of love in this LionsRoar.com article.
“Successful design is not the achievement of perfection but the minimization and accommodation of imperfection.”
~ Henry Petrosky
“My best teachers were not the ones who had all the answers. They were the ones deeply excited by questions they couldn’t answer.”
Chicago Cubs’ star Kris Bryant gets pranked by Hall of Famer Greg Maddux:
Table of Contents
- Background: What is a Cons cell?
- What it might look like in Scala
- Starting to create my own Cons class
- My second effort
- Defining my nil value
- Defining Cons
- Replacing the NilCons method bodies
- Adding a toString method to Cons
- The complete code at this point
- I’d really like a :: method
- See also
For some examples in my new book on functional programming in Scala I needed to create a collection class of some sort. Conceptually an immutable, singly-linked list is relatively easy to grok, so I decided to create my own Scala list from scratch. This tutorial shows how I did that.Back to top
Background: What is a Cons cell?
The first time I learned about linked lists was in a language named Lisp. In Lisp, a linked list is created as a series of “Cons” cells. A cons cell is simple, it contains only two things:
Here’s a link to some Effective Scala slides, as presented by Mirco Dotta in 2013.
Via a friend on Facebook:
“My advice: Don’t let yesterday contain the greatest things you’ve ever done. Make tomorrow contain your next great goal. Because once you feel your greatest days are behind you, you begin to die.”
At the very least that quote is about the importance of having goals.
“If you think you know what the state of the payments system 10 years out you're in a state of delusion.”
~ Charlie Munger talking about AMEX
I use the Java StringTemplate library in my Android applications, and Brian Clapper has created a Scala wrapper around it that he calls Scalasti. His intro: “Scalasti is a Scala interface to the StringTemplate Java template library. It provides a subset of the features of StringTemplate, using a more Scala-friendly syntax.”
“Matter is frozen energy.” ~ Einstein
Got this in an email last week, seems appropriate for today: “Marry a person you love to talk to.”
When real and unreal both
Are absent from before the mind,
Nothing else remains for mind to do
But rest in perfect peace,
From concept free.
“Conscience, when it is flawless, is the voice of our soul, whispering in our ear.”
~ B.K.S. Iyengar, in the book, Light on Life: The Yoga Journey to Wholeness
If it seems like someone is winking at you, a) they might be, it’s Valentine’s week, or, b) they may have a condition known as blepharospasm, which is a symptom of MCAS. My right eye started doing this 10-15 years ago, long before I knew anything about MCAS.
(Turns out there are ~5,000 mast cells per cubic mm of conjunctival tissue, i.e., the inside of the eyelids.)
Back in the days before global warming the winters could be cold and long, and one year on February 11th I was on a yoga retreat in Mexico, which is where this picture was taken.
Everyone tells me that the cardiologist I see is the best heart doctor in this area, so on Thursday we were talking and I was telling him about mast cell disease, and said, “So that fake heart attack I had last May may have been allergic angina, you know, Kounis Syndrome. If we had known about MCAS at that time I might not have needed that angiogram, yada yada yada.” Then he said, “Wait, what was the name of that disease?”
At first I was upset that he didn’t know what this was, but then I realized how rare mast cell disease is. (This is the same doctor who knew what a Pheochromocytoma is, and told me to get to the Mayo Clinic.)
The good news is that I was able to give him all of the information I have on mast cell disease and Kounis Syndrome, so hopefully in the future he can try giving patients who present unusually some Benadryl and see if that helps. (I started to write, “Give them Benadryl instead of an angiogram,” but the stress test showed a possible dead spot in my heart, so I was getting that angiogram one way or another.)
(This image comes from the book, Never Bet Against Occam: Mast Cell Activation Disease.)