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

IMHO, this article on Seeking Alpha by Chuck Carnevale is one of the best short articles you can read about stock market investing in general, and Walmart (as of January, 2016) specifically.

So I don’t forget about it, here’s a link to a series of tutorials titled, 31 Days of Android, by Chris Risner.

Android FAQ: How can I create a Color from a hexadecimal color string in Android?

The Android Color.parseColor method

Solution: Use the Android Color.parseColor method, like this:

int color = Color.parseColor("#519c3f");

I just used it like this in my code, where I directly set the Paint color:

paint.setColor(Color.parseColor("#519c3f"));

The string shown is a hexadecimal/HTML color string which represents a light shade of green. The important part of this is that I liked that color in a prototype, then got the HTML/hexadecimal color string using Gimp, and then could use that string directly in my Android/Java application to create a color, without having to manually convert the color string to RGB.

Using an alpha value with Color.parseColor

To add an alpha value, just add two more hex values at the front of the string. This alpha setting (FF) means the color is “fully on,” i.e., it is not transparent at all:

paint.setColor(Color.parseColor("#ff519c3f"));

This alpha setting (22) means the color is almost fully transparent:

paint.setColor(Color.parseColor("#22519c3f"));

Standard Android colors (Color class docs)

For the record, the full package for the Android Color class is android.graphics.Color. Also, those docs state:

Supported formats are: #RRGGBB #AARRGGBB or 
one of the following names:
 
'aqua'
'black'
'blue'
'cyan'
'darkgray'
'darkgrey'
'fuchsia'
'gray'
'green'
'grey'
'lightgray'
'lightgrey'
'lime'
'magenta' 
'maroon'
'navy'
'olive'
'purple'
'red'
'silver'
'teal'
'white'
'yellow'

Creating Android colors using RGB values

Also, while I’m in the neighborhood, this is one way to create an Android Color instance using RGB values:

g.setColor(Color.rgb(130, 130, 130));

These screenshots show the UI for the third version of my XO Play Android football game. The UI for when I’m playing offense is shown on the left, and the UI for when I’m playing defense is shown on the right.

The defense is pretty limited — you can only choose from three current defensive plays — but that actually inspired me to show the history of previous plays called by the computer on the lower-right of that screen, which can be useful to see the computer’s tendencies.

I’m still not blown away by the UI, but it is getting better. I like the idea of having the “Hike” button close to the playing field, as that’s where your eyes will want to be when the button is pressed, but I’m not blown away by my implementation.

I’m not an expert on this subject just yet, but if you want the source code for an Android method to center text that you want to use with the drawText method of the Canvas class, I know that this code works in two places in my current Android app:

This page is a little unusual for me; it’s basically a terse summary of what I know about Android. I created it because I tend to (a) work with Android for a few weeks or months, and then (b) get away from it for several months, so this page helps me reload everything into my brain.

This SO tip on how to automatically remove/delete all files from a Git repository that you have already deleted on disk is a real timesaver. Of course it’s a wee bit dangerous (and probably won’t work on Windows), but that’s part of its charm.

One thing I learned last night about my XO Play football game is that even in a “thinking man’s game” like this, visual perspective is important. I thought I would like the game as I showed it yesteday, as if you were looking at it from a coordinator’s box or sideline seat, but even though this image is a poor mockup and the perspective isn’t great, I like it better. (And of course now this makes me want to show real players (with depth) instead of Xs and Os.)

For many months now I have been wondering why countries keep pulling so much oil out of the ground as oil gluts get worse and oil/gasoline prices plummet. This CNBC article explains it a little bit, and shows what’s happening in a few charts like this.

In my “free time” lately I’ve been working on an Android football game that I’ve named XO Play. Earlier today I launched an Indiegogo project to see if people are interested in funding further development of the game. Please see that web page for more information and details.

Having written some crappy code myself, I always chuckle a little when I see computer intelligence “fails” like this. Personally, I don’t see any relationship between Guns n’ Roses and Adele, other than they both play music and have made a lot of money.

Adam Gase was hired to be the head coach of the Miami Dolphins today, and Peyton Manning refers to Gase as a “grinder,” a word that is used a lot in sports lately to mean “hard worker.” (Image from this espn.com page.)

I just read about this “Totality Rule” in functional programming on this Meetup page.

While I’m writing abou FP, I encourage you to check out LambdaConf 2016, which will be held here in Boulder, Colorado from May 26-29, 2016.

The Remix Mini is billed as “the world’s first Android PC.” I don’t know if that’s true or not, but at about $70 on Amazon, if you like Android, you just might want to check it out. Android + multitasking sounds pretty cool to me.

This image comes from this cnn.com story about an 1871 Arctic shipwreck that NOAA archaeologists are now able to get to, thanks to global warming/climate change. The original story is here at noaa.gov.

Jon Pretty (@propensive) has put together a nice “manifesto” for his Rapture open source project. At the very least, what he has put together is a good example of the things that are needed to make an open source project successful.

Volkswagen made news in 2015 for an emissions scandal where they knowingly and intentionally do damage to Earth’s atmosphere, but hey, this all-electric concept minivan is interesting. The simplicity of the interior is striking. (Image comes from Mashable.)