I saw this definition of type safety yesterday in a book named Programming TypeScript and I thought it was very simple and good:
Type Safety: Using types to prevent programs from doing invalid things.
I saw this definition of type safety yesterday in a book named Programming TypeScript and I thought it was very simple and good:
Type Safety: Using types to prevent programs from doing invalid things.
Kent Beck has a good article on Medium titled, Programmer Test Principles.
I used to use wunderground.com all the time. Then, over time, I noticed that it kept getting slower and slower. Out of frustration I looked around for other good weather websites. Today I use accuweather.com.
On the web and with apps, performance — or lack of performance — is important to acquiring and retaining customers.
XO Play is a “thinking man’s” football game that I created for Android devices. It’s for those of us who enjoy thinking about football strategy, of how to take advantage of our strengths and our opponents’ weaknesses, and how to call plays to win games. If you’ve ever watched a football game and thought, “I can call plays better than this guy,” XO Play is for you.
Version 1.4 introduces four game levels you can choose from:
I’m not sure if this is just a Colorado thing, but there are also a lot of goats around here.
“When the clutter of compulsive thought is cleared away, the light of awareness becomes powerfully bright.”
(Ms. Rasmussen co-wrote the book, Practicing The Jhanas, which is one of my favorite meditation books.)
I remember when the only wind turbines I had ever seen were the ones off of I-65 in Indiana, part of an experiment at Purdue. Now there are over 59,000 of them. I’m not sure why the southeast isn’t participating, but this U.S. wind turbine database is cool.
If you ever need a Java method that returns a boolean value based on a given probability, I can confirm that this method works:
/**
* `probability` should be given as a percentage, such as
* 10.0 (10.0%) or 25.5 (25.5%). As an example, if `probability`
* is 60% (60.0), 100 calls to this function should return ~60
* `true` values.
* (Note that Math.random returns a value >= 0.0 and < 1.0.)
*/
static boolean getRandomBoolean(float probability) {
double randomValue = Math.random()*100; //0.0 to 99.9
return randomValue <= probability;
}
I don’t know what the exact numbers are, but Colorado is growing very rapidly, especially in this area where I live in the cities near Boulder. On a walk today I counted that 66 out of 220 license plates I saw were out-of-state license plates, meaning that a whopping 30% of my neighbors are from out of state and haven’t changed their license plates yet.
Tricycle has a good article titled, Goodnight Metta: A bedtime meditation for children.
In an effort to share some source code (but without taking the time to explain it), here’s some Java source code that I just used to create a JFreeChart chart/graph of some data that I use in my Android football game:
Sometimes when I get really sick with the MCAS symptoms it becomes very hard for me to communicate. If I’m with someone else during those episodes and they look at me struggling I think, “I’m still Al, I’m still in here ... I just can’t get the words out.”
I think sometimes that’s the way it is for people when they get older and slow down, or have dementia, I imagine they have those thoughts as well.
We were in the middle of having some bad storms so I walked up to my living room window to see what they looked like. When I saw the clouds I started to say, “Wow, that’s some nasty looking sh-,” when a close lightning bolt threw me back across the room. Lesson learned: Don’t curse at Mother Nature’s designs.
~ June 28, 2013
Let me start by saying that I don’t know if I’m an “A” Player. In part, that definition depends (a) on what work I’m doing, and (b) who you compare me to. For instance, if you compare me to Linus Tourvalds as a Linux C programmer, I’m very clearly not an A Player. Shoot, I’m not even a player.
But if you were to judge me on other skills, I’d like to say that I’m at least a B Player in the things I care about. As I wrote in my book, A Survival Guide for New Consultants, my superpower as a programmer/analyst is empathy; I care about my work, and about my success and my client’s success. If you pay me $100,000 to do some work, I want you to make at least 2X or 10X or more from my work. I want my clients and sponsors to succeed.
Beyond that care, since I began paying attention to Apple and Jonathan Ive starting back around 2005, I’ve become more interested than ever in quality. When I work on something, I imagine that I’m either working with Mr. Ive, or that I’m going to have him review my work, and I want it to be impeccable.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 14.4, “How to run a shell command from the Scala REPL.”
You want to be able to run a shell command from within the Scala REPL, such as listing the files in the current directory.
Run the command using the :sh
REPL command, then print the output. The following example shows how to run the Unix ls -al
command from within the REPL, and then show the results of the command:
As a little note today, if you ever need to extract a subset of a Java list or array, here are some examples of the Java subList
method:
import java.util.*; public class SubList { public static void main(String[] args) {
List<String> x = new ArrayList<>();x.add("a"); x.add("b"); x.add("c"); x.add("d"); x.add("e"); // `subList(int fromIndex, int toIndex)` // array indexes start at 0. // 1st arg is inclusive (included), 2nd arg is exclusive (not included). List a = x.subList(0,1); // [a] List b = x.subList(0,2); // [a, b] List c = x.subList(0,4); // [a, b, c, d] # same as `x.subList(0,x.size()-1)` List d = x.subList(0,5); // [a, b, c, d, e] # same as `x.subList(0,x.size())` List e = x.subList(0,6); // IndexOutOfBoundsException List f = x.subList(1,1); // f [] List g = x.subList(1,2); // g [b] List h = x.subList(2,5); // h [c, d, e] } }
If you print the results of each line you’ll see the results on the right side of the comments. As shown:
toIndex
is exclusive, meaning it won’t be included in the resultsIndexOutOfBoundsException
x
, you’ll see that it still includes all of the original elementsIf you ever need to extract a subset of a Java list or array into another list or array, I hope these Java subList examples are helpful.
When I first saw this Dr. Seuss cartoon I thought, “That can’t be real.” But Snopes says it is. And apparently in 2019 people are repeating the same dialog from the 1940s. Geez, these are just kids.
I hope some day in the near future people will realize we’re all children of the same planet.
On June 26, 2012, there were several fires in the mountains near Boulder, Colorado.
I first saw this Senility Prayer at my wife’s grandparents’ house many moons ago, and it still makes me smile.
“When we look up at night and view the stars, everything we see is shining because of distant nuclear fusion.”
~ Carl Sagan