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

I’ve watched so many British tv shows, I have a hard time driving on the right side of the road.

The people behind IntelliJ IDEA released their JetBrains Scala developer survey recently.

JetBrains Scala developer survey

Two days ago Google announced their “Principles/Objectives for using AI”:

1. Be socially beneficial
2. Avoid creating or reinforcing unfair bias
3. Be built and tested for safety
4. Be accountable to people
5. Incorporate privacy design principles
6. Uphold high standards of scientific excellence
7. Be made available for uses that accord with these principles

I was reminded of this “If at first you don’t succeed, call it Version 1.0” saying this morning. You can find this t-shirt on Amazon if you’re interested.

If at first you don’t succeed, call it Version 1.0

After watching the movie Powder and hearing an electrical arc device referred to as Jacob’s Ladder, I looked into it and found this Jacob’s Ladder page on the Popular Science website (where this image comes from). I was familiar with the term in a religious context, but I didn’t know that’s what the name for this device is.

Jacob's Ladder electrical arc device

“You have no responsibility to live up to what other people think you ought to accomplish. I have no responsibility to be like they expect me to be. It’s their mistake, not my failing.”

~ Richard Feynman (one of the great physicists of the 20th century)

I like the “No New Rationale” rule, which I learned about in this blog post by Aaron Turon, who writes about the Rust RFC process:

No New Rationale rule: decisions must be made only on the basis of rationale already debated in public (to a steady state).”

“At some point, a member of the subteam will propose a “motion for final comment period” (FCP), along with a disposition for the RFC (merge, close, or postpone). This step is taken when enough of the tradeoffs have been discussed that the subteam is in a position to make a decision. That does not require consensus amongst all participants in the RFC thread (which is usually impossible). However, the argument supporting the disposition on the RFC needs to have already been clearly articulated, and there should not be a strong consensus against that position outside of the subteam.”

Based on his current work in developing Rust, Aaron Turon has a couple of good blog posts on developing/leading open source projects titled, listening and trust, part1, and listening and trust, part 2.

A friend once told me he had no self-confidence. “That’s good,“ I said, “You’re halfway there. All you need now is no no-self-confidence.”

#zen

If you or someone you know has a mast cell disease — a type of autoimmune disease — the tmsforacure.com website has several great infographics. I printed them out so I can take them to new doctors who don’t know me, when I have to go to emergency departments, and for things like my upcoming surgery.

Great printable infographics on mast cell disease

scala-lang.org has an article titled Speeding Up Compilation Time with `scalac-profiling` where they demonstrate how they reduced a project’s compilation time from 32.5 seconds down to 4 seconds. In addition to all of the scalac and profiling details, it demonstrates a nice use of flamegraphs.

In theory this is my biological grandfather, who I was partially named for. We don’t know if actually is our biological grandfather because my dad’s older brothers were about five and a half feet tall and bald, and my dad was 6'3" and wasn’t bald. The man shown in the picture here died in a fire when my dad was six or seven years old, and he said he only knew his adopted father, who was also tall and had some similar features with my dad.

We joked with our dad about this before he died, but he had no way of knowing which man was his biological father, but he did say that his adopted father was the only one he ever knew, and he considered him to be his father. Either way, all of them were Assyrian.

Possibly my biological grandfather

“It is said that if you know your enemies and know yourself, you will not be imperiled in a hundred battles; if you do not know your enemies but do know yourself, you will win one and lose one; if you do not know your enemies nor yourself, you will be imperiled in every single battle.”

~ Sun Tzu

Driving into Boulder, Colorado — the hospital is just a mile up the road on the right — there’s still some snow in the mountains as of June 2, 2018.

Still some snow in the mountains (Boulder, Colorado)

The quote shown comes from an article titled, How your stress turns into sickness. Personally, with the mast cell activation disease I go right to syncope (passing out, unconsciousness), but to each their own.

Mast cell disease, histamine, and how stress turns into sickness

If you want to implement About, Preferences, and Quit handlers with Java 9 and newer on MacOS systems, this example Java source code shows how to do it:

import java.awt.*;
import javax.swing.*;

public class JavaAwtDesktop {

    public static void main(String[] args) {
        new JavaAwtDesktop();
    }

    public JavaAwtDesktop() {

        Desktop desktop = Desktop.getDesktop();

        desktop.setAboutHandler(e ->
            JOptionPane.showMessageDialog(null, "About dialog")
        );
        desktop.setPreferencesHandler(e ->
            JOptionPane.showMessageDialog(null, "Preferences dialog")
        );
        desktop.setQuitHandler((e,r) -> {
                JOptionPane.showMessageDialog(null, "Quit dialog");
                System.exit(0);
            }
        );

        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame("java.awt.Desktop");
            frame.setSize(new Dimension(600, 400));
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        });
    }

}

I just tested this code on MacOS 10.12.x and Java 10, and it works as expected. When you click on the About, Preferences, and Quit menu items, the example dialogs are shown.

Zalando has started their own tech radar list.

Zalando tech radar

Here’s a short list showing the average wages in the United States after taxes vs other countries. I found this list on this tweet, and the data comes from this article.

Average wages after taxes (United States vs other countries)

I just came across a couple more null values out in the wild, this time on the espn.com website.

null values on the espn website