The Arctic Circle sign off the Dalton Highway in Alaska. If I remember right, this is less than an hour's drive from Fairbanks.

Just a quick note today that now that this website has my name on it (no longer devdaily.com), I'm adding a photo gallery to the site. You can either click on that link to see the gallery, or click the photo below:

Welcome to Talkeetna sign

Enjoy!

In his excellent book, Beginning Scala, David Pollak provides a series of statements that can be considered as a recipe for avoiding the use of null values in your Scala code. I've organized his statements here in the following three sections.

1) General rules about null and Option

We begin with the following general rules regarding the use of null values in Scala code:

A week ago or so, a friend of mine told me about a game called Mindflex where you can use your brain waves to control a styrofoam ball. Ever since then, I've been wondering if you could do something like this with an Arduino.

This video shows an attempt at doing that:

Here's a link to that video:

Way back in late 1998 (think "before Google"), I started devdaily.com in the hope that it would one day grow into a website where authors would offer tips and tutorials for Java, Perl, C, C++, Linux, and any other open source programming language and technology that came along. Then in 1999 I started a company named Mission Data, and I put the dream of devdaily aside.

If you ever want to have a little fun with Scala, try experimenting with the Scala parallel collections. The following example gives you a little idea of what can happen in the most simple case of creating and using a parallel collection:

Summary: A discussion of the Option/Some/None pattern in Scala, and how to use Either/Left/Right instead of Option/Some/None when you need to know why something failed.

A Scala idom is to use the Option/Some/None pattern instead of using exceptions and try/catch/finally (especially using Option/Some/None instead of using null values), but a weakness of this approach is that the Option/Some/None approach doesn't tell you why something failed, that is, why you got a None instead of a Some.

I found a little bit of good news in the mailbox this morning, a little royalty check from the Amazon Kindle eBook publishing program:

The check wasn't for much, but hey, it's a start. If you're new to my website, the check is for my two Kindle eBooks, shown below:

I can never remember the name "unfiltered", so yesterday I kept trying to google for "web service framework", and to my surprise, Google wasn't showing unfiltered. In fact, it didn't show other tools like Scalatra, though it did show Play in the top ten.

So today's post is an effort to help Google out a little bit here. If you're looking for good Scala web service frameworks, check out these tools:

Summary: A look at iPad base stands.

For a while now I've been interested in finding an iPad stand that I can use in my kitchen. The idea is simple: If you're cooking something healthy, it takes a little time, so I'd like to be able to put my iPad in a stand and listen to Pandora or a show on Netflix while I'm cooking, or cleaning the dishes.

Scala SBT FAQ: How do I put SBT into "offline mode" so I can use it while working on an airplane, or any other location where I don't have a WiFi connection?

Use this setting at the SBT command prompt:

> set offline := true

Warning: I honestly don't know how well this works. I have tried it a few times, and I know it prints out a ton of output, but I haven't paid attention to all that output to see exactly what it does.

To reverse the setting, just change it to false instead of true:

I'm not going to take any time to describe the following Scala XML/XPath example, other than to say that when it's run, it produces the following output, which is a simulated receipt for an order at a pizza store:

I ran across the following page in the book Clean Code, and it really caught my attention. In short, there is a programming language named LOGO that apparently used to keyword TO in the same way languages like Scala and Ruby use "def". This is described near the bottom of the page in the following image, in the area I highlighted:

I was doing a little Scala programming this morning, and because I hadn't written any code in a while, I managed to forget how isInstanceOf works with inheritance in Scala.

To refresh my memory, I wrote the following example code:

I'm sorry, I don't know the original source of this image about "delegation" in computer programming (starring Inigo Montoya of The Princess Bride), but it's pretty funny, so I thought I'd post it here:

Delegation, by Inigo Montoya of The Princess Bride

 

(The following content is from an email I sent to a relative about the Arduino. They have a college-age student who we might be interested in this.)

The programmable electronics kit I showed you is named "Arduino". Here's the main URL: arduino.cc

Here are links to some fun Arduino projects:

If you ever need to write some Scala (or Java) code where you add a JSON string to the body of an HTTP POST request, here's a quick example of how to do it using the Apache HttpClient library methods:

My original "Day 1 with Play web services" code is shown a few paragraphs below, but on Day 2, the following code looks like an easier solution to the problem, courtesy of this web page:

I just started using tmux last week, and created a cheat sheet to help me remember the basic tmux commands, and I thought I'd share that here.

The cheat sheet has a few things that are specific to my configuration file, so to begin with, here is my ~/.tmux.conf file:

As a note to self, I'm just recovering from a nasty case of food poisoning.

It all started with some gurgling in my stomach on August 12, 2012, so I tried to eat light that day, though I did exercise pretty hard.

On Monday morning I knew something was very wrong, and by that afternoon I was full blown sick. I quit eating that day, and didn't eat again until I had three saltine crackers on Thursday.