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

(From time to time I write little stories that have nothing to do with programming or technology; this is one of those stories. So, if you’re only here for the technology stuff, you’ll want to skip this one.)

I’m standing in the kitchen of a friend’s house at a Christmas party, making myself a drink while talking to a friend named Angie. This was nothing unusual; she and I were always talking about something. We became friends during our last year in high school, and we’ve been talking every since.

In retrospect it’s obvious that I have feelings for her, but I guess you could say that I didn’t appreciate her back then. After high school my ambition took me away to college, and then to a series of jobs in different states. By the time I decided to move back home, she was married and had two young children.

While we talked all the time, this kitchen conversation was unusual. I don’t remember how it started, but Angie did ask me about something I rarely talk about: my parents getting divorced in high school.

There’s a scene in the movie, The Family Man, where Nicolas Cage is sitting in a chair and trying to stay awake, because he knows that when he falls asleep his “glimpse” will be over.

The moments just before passing out are like that. Assuming that you’re not panicking, you’re vibrantly aware of everything around you — colors, smells, etc., because you don’t know if you’re just passing out or this is Game Over.

The end of a lucid dream can also be like that. You can be in the dream, know that you’re dreaming, and then know that you’re starting to wake up. You don’t want to leave, but you don’t have a choice, so you pay great attention to the environment because you know that you may never see it again.

To the best of my knowledge, all of those are also the correct mental state for Zen and mindfulness meditation. As Shunryu Suzuki says, “The true practice of meditation is to sit as if you are drinking water when you are thirsty.”

(Namaste)

According to ARK Invest, the cost of industrial robots will drop 65% by 2025. As they write, “Combined with advances in machine learning and computer vision, this drop in costs should cause an inflection point in the demand for robots as they infiltrate new industries with more provocative use cases.” (Image from the ARK Invest website.)

Industrial robot costs to drop 65%

“You’re gonna catch a cold from the ice inside your soul.”

“Those that invest the most are the last to surrender.”

~ said by many people, most recently Rich Gannon

I am without form, without limit
Beyond space, beyond time
I am in everything, everything is in me
I am the bliss of the universe
Everywhere am I.

~ Ram Kir

A friend of mine was a devout yoga practitioner, and even studied under B.K.S. Iyengar. Right before she passed away, she began to cry tears of joy, and said, “All is one, all is one.”

Can ten minutes of mindfulness meditation make you more creative and feel less negative, restless, nervous, and irritated? The Harvard Business Review says yes it can.

Can mindfulness meditation make you more creative?

As of January 5, 2018, ThinkGeek is having an “up to 80% off” winter clearance sale.

ThinkGeek clearance

I like most of Dana Stabenow’s work, and while I didn’t particularly like Dead in the Water, I did enjoy some of the quotes in the book, such as, “Always perform the work that has to be done without attachment,” which comes from the Bhagavad Gita, of which there are many translations (such as this one, this one, and this one).

Always perform the work that has to be done without attachment

January 5, 2011, Wasilla, Alaska: Our parking lot, a half-inch or more of ice, and black gravel they’ll sweep up and re-use come March or April.

A thick layer of ice in the parking lot, Wasilla, Alaska

As seen in Boulder, Colorado during a walk yesterday.

Wish you were here

As a quick note today, if you’re ever writing a Linux shell script and need to get the filename from a complete (canonical) directory/file path, you can use the Linux basename command like this:

$ basename /foo/bar/baz/foo.txt
foo.txt

A high school student won $250,000 for her explanation of relativity, which she titled, Relativity & The Equivalence of Reference Frames. sciencealert.com has the story, and her video.

If you’re interested in Functional Programming, Simplified, but can’t decide on whether to buy it or not, I just updated the free PDF preview of the book to help you with that decision. And it’s not just any free preview: it’s over 400 pages long.

Here’s a link to the free preview of Functional Programming, Simplified.

Functional Programming, Simplified - free preview

So on page 51 of Apple’s iPhone Terms and Conditions it clearly states, “We may slow down your iPhone to increase the sales of new iPhones.”

(It may say that, who knows. Having just updated iOS, I wouldn’t mind if they get sued over the ridiculous length of that doc.)

If you’ve read any of my books (like the Scala Cookbook or Functional Programming, Simplified), and thought, “Hey, I can write a book,” I encourage you to do so. One book that has been helpful in my writing career is William Zinsser’s On Writing Well: The Classic Guide to Writing Nonfiction. If you’re seriously thinking about writing a book about programming or any other technical topic, it’s a good read.

I gave myself two gifts for Christmas: A set of new bathroom rugs, and a few guilt-free days to learn the LibGDX game framework so I can eventually rewrite my football game. (Usually I think, “You need to finish writing XYZ,” so “a few guilt-free days” means not having those thoughts, or having them but ignoring them.)

I just started working with LibGDX, so I don’t know if there’s a better way to create a LibGDX Scene2d ImageButton, but I can confirm that this approach works:

Texture hikeTexture = new Texture(Gdx.files.internal("hike_btn.jpg"));
Texture hikeTexturePressed = new Texture(Gdx.files.internal("hike_btn_pressed.jpg"));
hikeButton = new ImageButton(
    new TextureRegionDrawable(new TextureRegion(hikeTexture)),
    new TextureRegionDrawable(new TextureRegion(hikeTexturePressed))
);
hikeButton.setPosition(60, 300);  //hikeButton is an ImageButton
stage.addActor(hikeButton);

I currently use this code in the show() method of a class that implements Screen, and it works as desired.