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

Mac OS X Finder FAQ: How do I open a new Mac Finder window using the keyboard?

Mac Finder keyboard tips - keystroke to open a new Finder window

To open a new Mac Finder window using the keyboard, make sure a Finder window is currently the foreground application, then press the [Command][n] keystoke. This will open a new Mac Finder window, and is equivalent to clicking the File menu, and then clicking the New Finder Window menu item. (It's also much faster.)

Mac OS X Finder FAQ: How can I delete a file or directory in the Mac Finder using the keyboard (keystroke)?

By now you've probably figured out that you can't just delete a file in the Mac Finder using the delete key. The solution:

Mac OS X FAQ: How can I hide my desktop and desktop icons?

As we all know, our Mac OS X desktop can get a little cluttered from time to time, and it sure would be nice to be able to hide that clutter. As I Googled "hide desktop icons" and "mac hide desktop icons", I realized there weren't any good solutions out there for this problem, so I decided to create my own. This led to the creation of a Mac OS X application I named "Hyde".

SQLite CSV FAQ: How do I import a CSV file into a SQLite database table?

If you’re not using an autoincrement (primary key) field in your database table, importing CSV file data into a SQLite database is straightforward, though you may have to do some work to clean up your data first. Let’s take a look at how this works.

A SQLite CSV import example

As a first example, assume that I have a SQLite database table defined like this:

[toc hidden:1]

SQLite FAQ: How do I create comments in SQLite?

SQLite lets you create comments using two different constructs, either two hyphens in sequence ("--"), or the "/.../" C-style comments. Here are examples of each approach, with the SQLite comments preceding the two database table definitions:

SQLite database FAQ: How do I create a SQLite database?

Creating a new database in SQLite is so easy, it's amazing. Once you have SQLite installed and your PATH set up properly, from your Unix or DOS shell, just issue a SQLite command like this:

SQLite foreign keys FAQ: Can you show me how to define foreign keys in a SQLite database table design?

The SQLite database does support foreign keys, and its foreign key syntax is similar to other databases. Here’s a quick SQLite foreign key example.

SQLite schema FAQ: How do I list the schema for SQLite database table?

To view the schema for a SQLite database table, just use the SQLite schema command, like this:

SQLite autoincrement FAQ: How do I get the autoincrement value from my last SQLite INSERT command?

You can get the integer value of the primary key field from the last insert into an autoincrement field using a SQLite function named last_insert_rowid(), as shown in the example below.

SQLite FAQ - How do I create an autoincrement field in SQLite?

You define a SQLite autoincrement field (also known as a serial, identity, or primary key field) with this syntax:

Summary: A Java MySQL DELETE example, demonstrating how to issue a SQL DELETE command from your Java source code.

Java MySQL FAQ: Can you share an example of a Java MySQL UPDATE example (using a Java PreparedStatement object)?

Summary: This is a Java/MySQL SQL SELECT example, demonstrating how to issue a SQL SELECT command from your Java source code, using a MySQL database.

Java MySQL INSERT example: Can you share a Java MySQL INSERT example, specifically using a Java PreparedStatement object?

Java MySQL INSERT example: Can you share an example of a Java MySQL INSERT example using the Java Statement class?

Ever wonder what it looks like in Alaska at 3 a.m. on June 21st? Keeping in mind that pictures from an iPhone are darker than the actual conditions, especially in lower light conditions, here's a picture from my iPhone at 3:40 a.m. on the morning of June 21, 2010:

Hmm, it looks like there might be more than one reason for Apple retiring their famous Mac/PC commercials -- turns out they've quietly gotten into the malware/antivirus business.

MacWorld reports that Apple has quietly snuck an anti-malware (antivirus) update into the latest round of Mac OS X Snow Leopard updates. An antivirus program was included in Snow Leopard, and last week's Snow Leopard update included an update to the Mac OS X antivirus definition file (a simple Mac OS X plist file).

Drupal block FAQ - How do I create a custom Drupal PHP block, i.e., a Drupal block that is really a snippet of PHP code? (As opposed to plain HTML.)

One of the cool things about Drupal is that you can create and use blocks so easily, including custom Drupal PHP blocks. I use custom Drupal blocks for all sorts of things on my Drupal websites, including rotating Drupal block content, as I'll show in this example.

Mac iTunes keyboard control FAQ: How can I control iTunes from the Mac keyboard (Mac OS X)?

With your basic Mac hardware -- depending on the Mac OS X system you have -- you will be able to control iTunes from the keyboard to varying degrees. For instance, on my Apple Wireless Keyboard, I have the standard "play" and volume controls.

Mac "file copy" FAQ: How do I copy files on my Mac?

When people move from Windows to Mac OS X, a common question is "How do I copy files on my Mac?" I hope this short Mac file copying tutorial will help answer that question.