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

Web browser privacy FAQ: Can you share some internet/web browser privacy tips? (i.e., What can I do to improve my web browser privacy and security?)

With the latest Adobe Flash security snafu (see my uninstall Mac Flash article), I'm again reminded of the topic of internet web browser privacy and security. I've written about browser privacy before, but this time I thought I'd take a different tact and share the things I know and do to help have a modicum of web browser privacy.

Apple's recent announcement that Mac Java support is deprecated inspired me to look at the so-called "Apple Tax" -- the premium price tag you're going to pay when buying an Apple computer, whether that be a MacBook, MacBook Pro, iMac, or Mac Pro instead of a Windows PC.

I just ran a comparison of a base model Apple MacBook versus two different Dell Windows notebook PCs, and the numbers are pretty scary:

The Apple Tax on a base MacBook is a whopping $219 to $299
more than faster, better-equipped Dell notebook models.

As part of my work on my Mac speech recognition software, I've been digging into the use of an iPhone as a Mac remote control. While that hasn't been much of a success yet, I did stumble across the Apple iTunes iPhone/iPad remote app.

This iTunes/iPhone remote app is a free app from Apple that lets you control some iTunes functions. Apple's iTunes remote control app doesn't blow me away, however; for me, it has many flaws, including:

I'm not sure why Apple has suddenly decided to make the future support of Mac Java uncertain (see "Mac Java deprecated; Did Apple just kill Mac Java?", and "Mac Java is deprecated: What it means"), but if I'm a CIO or CTO working at a company that has invested any money at all in Java development, Apple just sent a very clear message:

Don't buy any more Mac computers in the enterprise.

As I think about this latest Flash security vulnerability (see How to uninstall Flash on Mac OS X), I'm reminded of Steve Jobs Thoughts on Flash memo. As he wrote earlier this spring about Flash security:

"Third, there’s reliability, security and performance.

Mac Flash FAQ: How do I uninstall Flash on Mac OS X (10.4, 10.5, or 10.6)?

Adobe just announced a critical Flash security flaw (and in Adobe Reader and Acrobat 9.x applications) that makes all operating systems vulnerable to attack, including Windows, Unix, and Mac OS X systems. While it may be an overreaction to the problem, I just investigated what it would take to uninstall Mac Flash (Flash on Mac OS X), and the operation is pretty simple.

While replying to a comment on an earlier Mac Finder new folder keystroke article, I found a bug in the Mac OS X Finder that I thought I'd mention here as well to make it easier for people to find. In short, the keystroke you can normally use to create a new Finder folder is:

[Shift] [Command] n

Mac CPU and memory usage: Can you recommend any products to easily monitor Mac CPU usage (and Mac memory usage)?

One cool thing about having a good Mac CPU and memory usage monitor is that you can watch it while an application is running. I was just taking a break and watching last night's World Series game on MLB.com, and I happened to look up and see that both of my Mac CPUs were very active. They weren't pegged to the needle like they are when I'm ripping a DVD on my Mac, but they were pretty busy.

AppleScript for loop FAQ: How do I use an AppleScript for loop? (Also, how do you use an AppleScript while loop?)

This is actually a bit of a trick question, as there is no AppleScript for loop or while loop syntax. Instead you use the AppleScript repeat command, as shown in the following examples.

AppleScript for loop examples

Where you might expect an AppleScript for loop to iterate over a list, you use the AppleScript repeat with syntax:

AppleScript list FAQ: How do I iterate/loop over an AppleScript list?

As I continue to work on my Mac speech recognition software projects, I've often found the need to loop over an AppleScript list. One way to loop over an AppleScript list is to use the AppleScript repeat with syntax:

AppleScript list FAQ: How do I get the AppleScript list size, i.e., the size of an AppleScript list (or number of items in a list)?

To get the count of the number of items in an AppleScript list, use this syntax:

set myList to {"Problem", "There was a problem", "Bummer"}
set listSize to count of myList

The variable listSize will now contain the AppleScript list size (the number of items in the AppleScript list named myList).

Mac/AppleScript random FAQ: Can you share some AppleScript “random list” item examples?

While working with some Mac speech recognition software I originally didn’t know how to do something with a random item from an AppleScript list, so my first AppleScript random script attempt looked like this:

-- my applescript list
set myList to {"Problem", "There was a problem", "Bummer"}

-- get the list size
set listSize to count of myList

-- get a random number
set randomNumber to (random number from 1 to listSize)

-- get the random item from the list
set reply to item randomNumber of myList

-- say the string
say reply

However, after some digging around, I was able to find this more concise AppleScript random syntax:

set myList to {"Problem", "There was a problem", "Bummer"}
set theItem to some item of myList
say theItem

As you can see, with or without the comments that second AppleScript random syntax is much more concise.

AppleScript “waiting until completion” example

While I’m in the neighborhood, I should also mention that the initial AppleScript random example I found had this extra syntax at the end of the script:

set myList to {"Problem", "There was a problem", "Bummer"}
set theItem to some item of myList
say theItem displaying theItem with waiting until completion

As you can see, that last line is different, and I’ve found that the “with waiting until completion” is helpful when you’re telling an AppleScript script to say something while you’re also working with the Mac speech recognition software.

AppleScript “list” FAQ: Can you share some simple AppleScript list examples?

Sure. As I've been doing a lot of work with Mac speech recognition software lately I've been working a lot of with AppleScript lists. Let's take a look at some common AppleScript list examples (and programming needs).

How to create an AppleScript list

A simple AppleScript list can be created like this:

AppleScript time FAQ: Can you share an AppleScript example that shows how to work with the current time?

If you ever need an AppleScript current time example, or an AppleScript to parse and format the current time, I hope this following script will be helpful. This AppleScript script gets the current time, formats it, and then speaks the current time back to you in a human-friendly format:

Mac speech recognition software FAQ: Can I add my own commands to the Mac speech recognition software system, and if so, how?

While the built-in Mac speech recognition software doesn't recognize voices nearly as well as Sphinx-4, it does have one virtue: You can add custom commands to it fairly easily, as long as you don't mind writing a little AppleScript.

The short story is that if you go to this folder:

Mac speech recognition software FAQ: Can you recommend any Mac speech recognition software packages?

Yes I can, but the answer depends on your needs, and whether you are a Mac consumer, or a Mac programmer. Let's take alook at the options.

I thought my Mac voice recognition software project might get a little old after the initial excitement wore off, but I'm pleased to say it's still very interesting. It's extremely nice to be getting ready to go for a walk, and simply say, "Computer, current weather", and it responds with the latest weather information. Some of my Mac voice recognition software tasks still need some work, but basic voice commands like this are wonderful.

Gimp circle FAQ: How do I draw a circle in Gimp?

As I can never remember obscure things, here's my tip on how to draw a circle in Gimp (a Gimp circle).

To draw a Gimp circle follow these steps:

Mac mouse/keyboard battery FAQ: How can I check the battery level of my Mac mouse or Mac keyboard?

The easiest way I know to see the Mac keyboard/mouse battery level is to put the Bluetooth menu on your Mac menu bar, and check it from there. This menu will be in the upper-right corner of the Mac menu bar, and it looks like three small dashes with some other figure behind those dashes. (This is something like the normal Bluetooth icon, but a little different.)

After responding to a recent comment about how to map keys/keystrokes on an Apple/Mac keyboard, I thought I'd share a list of Mac keyboard utilities I found. But first, before looking at paying for Mac utilities for your keyboard/keystroke mapping, it's important to know that you can perform some keyboard mapping functions using System Preferences. Just follow these steps: