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

When asked, “What is the value of learning lambda calculus,” Gary Bernhardt replied, “My favorite reason to learn a bit about the lambda calculus: it shows us 1) how simple computation is (at first it seems too simple to compute anything ‘real’); and 2) all of our programming complexity is invented by us (for reasons both good and bad).”

I haven’t watched this video from Ruby Conf 2012 by Jim Weirich yet, but if you’re interested in learning about functional programming only for the sake of learning, here’s the description: “One of the deepest mysteries in the functional programming world is the Y-Combinator. Many have heard of it, but few have mastered its mysteries. Although fairly useless in real world software, understanding how the Y-Combinator works and why it is important gives the student an important insight into the nature of functional programming.”

On April 3, 2018 this website suddenly got a ton of spam comments. Fortunately I caught the probably very quickly, and turned off the ability for people to post comments here. When I checked into the problem I found that Mollom — created by the same person who created Drupal — basically went out of business on April 2nd. (I’m sure there was some warning about this decision, but I sure didn’t get it.)

I’m often surprised when people who offer a free service shut down that service without asking a simple question: “Would you be willing to pay for this service, and if so, how much?”

(I’ll re-enable the ability to post comments here when I find a good replacement for Mollom.)

Mollom is out of business

When you look at Functional Programming, Simplified on a dolly, it’s not that big. ;)

Functional Programming, Simplified (on a dolly)

Don’t tell anyone, but my SQL skills are pretty average these days, at best, mostly because I haven’t had to do anything hard in a while. But just now I was happy to write this little SQL SELECT query that does a GROUP BY, an ORDER BY, and a COUNT, yielding the results shown in the image:

select nid, count(nid) from term_node
where tid in (3,1,11,10,9,8,7)
group by nid
order by count(nid) DESC

I’m going to use this query — or one very similar to it — to get a list of nodes (nid) that have the most tag ids (tid) from the list of tid in the query. In theory, the nodes (blog posts) that have the most tags in common should be the most related to each other. So, in my Scrupal6 replacement for Drupal 6, this query is a way to get “related” content for a given blog post. (The tid list shown comes from node id 4, so I need to also exclude nid=4 from the results. I also need to add a limit clause to the query.)

If you ever need to do a group by, order by, and count in one SQL query, I hope this example is helpful.

SQL select, group by, order by, and count (all in one)

“The supermassive black hole lurking at the center of our galaxy appears to have a lot of company, according to a new study that suggests the monster is surrounded by about 10,000 other black holes.” From this story at NPR.

“He realized then that history is a wave that moves through time slightly faster than we do.”

~ from the book, Green Mars

As part of the illness stuff I went through in 2014-2016, I have absolutely no memory of creating this Scala/FP “I can’t believe I used a var” image, but as I just ran across it while working on this website, I thought it was funny. Apparently I created it when I was writing about How to create outlined text using Gimp. (I do remember that someone else created an image of Martin Odersky with the same phrase.)

Polar bear - I can't believe I used a var

When training an adult polar bear, it’s important to let their cub eat on your leg. #protip

(I don’t remember the original source of this photo.)

Training polar bears

A friendly black dog sleeping in the bar area of the Latitude 62, Talkeetna, Alaska.

A black dog in the Latitude 62 bar, Talkeetna, Alaska

Spent the last few hours dreaming of living in a colony on the Moon. Every moment was a new experience – bad pay, canned food, watching a movie in a makeshift theater, but also several different beings and cultures that I found fascinating. Then I suddenly had the idea for a new book that I wanted to call, “Moon’s First Murder.” I started scribbling down some notes, but knew I didn’t know enough about the cultures, so I recruited a friend to help me with that. After a short bio-break I need to go back to sleep so we can get to work on it.

~ a note from April 2, 2014

I saw this quote by Gus Speth on Facebook and Twitter, and wanted to share it here. As Mr. Speth says, the top environmental problems aren’t biodiversity loss, ecosystem collapse, and climate change, they’re selfishness, greed, and apathy (mostly the first two, in my opinion).

Top environmental problems: Selfishness, greed, and apathy

A long time ago — 2005, to be exact — I read this article named Making wrong code look wrong, and it was a big influence on me. These days I don’t know how many people use variable naming conventions, but when working on web applications I still like the “us” (unsafe) and “s” (safe) convention for handling user input. As Joel Spolsky discusses in that article, that convention has a good way of making wrong software code look wrong.

Making wrong code look wrong (Joel on Software)

“The best work that anybody ever writes is the work that is on the verge of embarrassing him, always.” Good advice on writing from Arthur Miller, via the Twitter account of Jon Winokur.

If you want to see a relatively simple ScalikeJdbc example that performs SQL SELECT and UPDATE commands, I hope this example is helpful.

The background for this example goes like this:

I don’t know the original source of this “Please don’t move/observe the coffee machine” image, but I just saw it here on Twitter.

Don't move or observe the coffee machine

Li Haoyi has created a JSON library he named uJSON.

“Rip our your heart and throw it in the bin.” A funny tweet from BBCBigField.

Rip our your heart and throw it in the bin

This is the speed limit sign on the Dalton Highway in Alaska. If I remember right, this is the only speed limit sign you’ll see when headed north from Fairbanks heading towards Prudhoe Bay. (I started off driving about 50 mph, but then after realizing I was the only person on the road, I drove as fast as conditions allowed, typically around 90 mph.)

The speed limit sign on the Dalton Highway, Alaska