echo

Using `puts` or `echo` instead of `println` in Scala

As my mind was wandering off earlier today, I started to wonder what it would take to create a Ruby puts or PHP echo statement in Scala. (For some reason my brain can never type “println,” and puts or echo are much easier to type.)

One simple way to mimic a puts or echo method is to use Scala's ability to rename things on import:

scala> import System.out.{println => echo}
import System.out.{println=>echo}

scala> import System.out.{println => puts}
import System.out.{println=>puts}

scala> echo("foo")
foo

scala> puts("foo")
foo

scala> puts(1 + 1)
2

Why Siri is bad (and Apple is behind Amazon and Google)

While it’s old news (March, 2018), I’ve often wondered why Siri seems to be getting worse, and how/why Amazon and Google beat Apple to the market for Alexa-like assistants. MacRumors has this article where they report several of the problems related to Siri’s development. (Their article is based on an article written by The Information, which requires a subscription.)

Alexa has no concept of “current”

In case you’re worried about artificial intelligence (AI), there’s this:

Me: Alexa, cancel the current timer.

Alexa: I don’t have a timer called “current,” but there is one called “Fifteen minute timer.”

Me: *sigh*

How to change the Mac Terminal title from the command line

Mac Terminal FAQ: How can I change the title on the Mac Terminal app from the Mac/Unix command line?

I've been working on a project where I have three Mac Terminal tabs open at one time, and I found it was much easier to work this way when I changed the title on each Terminal window. This helped me easily identify what I was doing in each Terminal window.

Changing the Mac Terminal title

The basic escape sequence you need to change the Terminal title from the command line is this:

Amazon Echo + Akka = Akkazon Ekko

Table of Contents1 - Running Ekko2 - Running Ekko commands3 - Listing commands Ekko understands4 - Written with Akka (and Scala)5 - Next steps6 - Add actors with reflection? (plugins)7 - The source code8 - More ...

I recently started working on a project that may or may not make it into my book on Scala and functional programming. I’m currently calling it “Akkazon Ekko” — or “Ekko” — because it’s a little like the Amazon Echo, but written with Scala and Akka.

How to set the MacOS Terminal title | Mac Terminal titlebar

I like to set the title (titlebar) on the Mac OS X Terminal application so I can tell one tab from another. For instance, I may have the Play Framework running in one tab, SBT in another, Git in another, etc. Setting the title on each Terminal tab makes my life a little easier.

To set the Terminal title, I use a script I’ve named settitle:

PHP printing - How to print variables in a PHP string

Nothing major here, just a quick example of how to print variables in PHP, particularly how to print variables in the middle of a PHP string. When you first get started programming in PHP, how to print variables in a PHP string is a common question, so I thought I'd share some examples here.

There are many ways to print variables in a PHP string, but these are some of the most common approaches: