Scala, Java, Unix, MacOS tutorials (page 133)

I’m reminded of this story today:

Back in 2005 I used to walk over to a bar that was across the street from my apartment. One night I was talking to a waitress and wondered out loud whether I’d be happier working a job that I enjoyed that might only pay $30K to $40K per year — as opposed to my current job, which paid a lot more but wasn’t making me happy.

She said, “Don’t look at me honey, I don’t make that kind of money,” then turned and walked away.

The image shows a couple of good quotes from Niels Bohr about quantum mechanics. I like this one as well:

An expert is a person who has made all the mistakes that can be made in a very narrow field.

Niels Bohr on quantum mechanics

I also ran across an old business card this morning. I didn’t remember that our address was, “1 NASA Drive”, that’s cool. The blurry stuff in the upper-left says, “Gencorp Aerojet”.

“I believe the key to self-sufficiency is breaking free of the mindset that someone, somewhere, owes you something and will come to your rescue.”

“Self-sufficiency,” wrote Epicurus, “is the greatest of all wealth.” Epictetus added that “wealth consists not in having great possessions, but in having few wants.”

~ two quotes from this Farnam Street blog post

“If somebody is a problem for you, it’s not that they should change, it’s that you need to change. If they’re a problem for themselves that’s their karma; if they’re causing you trouble that’s your problem with yourself.”

and also this:

“If I’m not appreciated, that’s your problem that you don’t appreciate me. Unless I need your love, then it’s my problem. So my needs are what is giving you the power over me.”

~ from Ram Dass post, A Heavy Curriculum

In my own experience I can say that when you’re with your soul this is true; and when you’re with your ego you can’t understand this.

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)

It feels like my SQL skills are pretty average these days, but that’s only 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) as 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

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

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 Scala ScalikeJdbc example that performs SQL SELECT and UPDATE commands, I hope this example is helpful.

The background for this example goes like this: