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

tar extract FAQ: Can you demonstrate how to extract (un-tar) multiple files from a tar archive, without extracting all files from the archive?

Sure, here are a couple of examples of how to extract multiple files from a tar archive (un-tar them), without extracting all the files in the archive.

First, if you just need to extract a couple of files from a tar archive, you can usually extract them like this, listing the filenames after the tar archive:

iPhone bedside mode FAQ: Does the iPhone have a "bedside mode" like the BlackBerry bedside mode? If so, how does it work?

The iPhone currently doesn't have a bedside mode like the BlackBerry, but there are some things you can do to get a similar behavior. Here's how I create something like an iPhone bedside mode.

My "iPhone bedside mode" setup

I use my iPhone as an alarm clock, and so I achieve something like an "iPhone bedside mode" as follows:

Drupal query FAQ: How can I run a Drupal query outside of Drupal, i.e., from the command line? (Drupal 6 or Drupal 7)

Last night I was reading the excellent book Pro Drupal 7, and I stumbled on most of the solution for running a Drupal query from the command line. The book was exactly correct, except for one missing step, which may have been something that changed after publication.

PHP PDOException MySQL socket error FAQ: What is the PHP PDOException SQLSTATE MySQL socket error, and how do I fix the problem?

Every time I work with a new web hosting company, I keep running into one variation or another of this PHP MySQL socket error. It's pretty darned annoying, but at least I know how to fix it now.

In short, if you try to access a MySQL database using the PHP PDO library, such as with Drupal 7, which is what I just did, you may get an ugly MySQL socket error that looks like this:

tar extract FAQ: How do I extract one file (or multiple files) from a tar archive without extracting the entire archive (i.e., how do I un-tar files from a tar archive)?

jQuery insert text FAQ: How do I insert text into a section of my HTML page using jQuery?

I ran into a situation recently with my new website (see my new Alaska online store demo) where I couldn't figure out how to do something with a shopping cart tool named Ubercart, so rather than fight it any longer, I decided to just use jQuery to insert text into my HTML document right where I wanted it.

Git export FAQ: How do I export a Git project, like I would do with a "cvs export" or "svn export"?

There is no "git export" command, so instead you use the "git archive" command. By default, "git archive" produces its output in a tar format, so all you have to do is pipe that output into gzip or bzip2 or other.

Git export example

Here's a simple Git export command I just ran. I moved into the root of my Git project directory, then ran this command to create a new file named "latest.tgz":

MacBook battery life FAQ: Can you offer some tips on how to extend MacBook battery life?

I noticed on a few recent trips to Panera Bread, Starbucks, and Barnes & Noble that my MacBook battery life was not what I expected. In fact, it was downright short. I was getting less than an hour out of a single, complete MacBook battery charge, and even though my MacBook Pro is pretty old by now, that is unacceptable.

Unhide Facebook friends FAQ: How do I unhide Facebook friends?

In a hurry recently -- and not wanting to see the output of yet another Facebook game (why can't I hide all Facebook games?) -- I accidentally hid one of my Facebook friends. After poking around for quite a while I finally figured out how to unhide them. Here's how to do it.

How to unhide a Facebook friend

To unhide a Facebook friend, follow these steps:

Drupal help documentation FAQ: Where can I find Drupal help, specifically free Drupal help and support?

Mac CD/DVD backups - After the burn

When I came back from lunch I was very surprised that there was no "Success" dialog to show me that the Mac burn folder/backup process succeeded. However, I was returned to my original Mac burn folder, and there is a new disk icon named "My Data Files" on my desktop, as shown here:

Mac backups - Burning to CD or DVD

Now that I've told my Mac burn folder what files and folders I won't to burn to disk, the next step is to tell the burn folder to burn this data to my DVD. To do this I just click the Burn button on the Mac burn folder, and then my Mac prompts me to insert a disk, as shown in this figure:

Mac burn folders - Adding items to the burn folder

Mac Spaces FAQ: How can I move a Mac Space from one Space to another (swap Mac Spaces)?

Last night I learned quite by accident that you can easily move Mac Spaces, or more accurately swap Mac Spaces. To move a Mac Space from one Space to another, just follow these steps:

Drupal 7 meta tags FAQ: Is there a meta tags module for Drupal 7? (Or, what's going on with the Drupal 7 meta tags module?)

(Note: This article was last updated on March 24, 2011.)

Drupal 7 meta tags module information

Having just gone through the meta tags process with a Drupal 7 website on February 9, 2011, here's what I know:

Linux file copy FAQ: How do I copy Linux files and directories? (Or, Can you share some cp command examples?)

You use the cp command to copy files and directories on Linux systems. Let's look at some copy examples to see how this works.

Using Linux cp to copy files

At its most basic, here's how you copy a Linux file:

The Linux more command lets you view text files or other output in a scrollable manner. It displays the text one screenful at a time, and lets you scroll backwards and forwards through the text, and even lets you search the text.

Looking at a Linux file with the more command

A common way to use the Linux more command is to display the contents of a text file. Where you might normally "cat out" the contents of a text file with the cat command, like this:

The Linux word count command is named wc. The wc command counts the number of characters, words, and lines that are contained in a text stream. If that sounds simple or boring, it's anything but; the wc command can be used in Linux command pipelines to do all sorts of interesting things.

Let's take a look at some Linux wc command examples to show the power of this terrific little command.

Update: Sorry, the Function Point Analysis application that was described in this article is no longer available. I may bring it back to life at some point in the future, but for now it’s offline.

PHP MySQL socket error FAQ: I'm getting a MySQL error like "Warning: mysql_connect(): Can't connect to local MySQL server through socket '/home/lib/mysql/mysql.sock'" when trying to connect to my MySQL database from a PHP application, what can I do to fix this?

I just ran into this problem on a new server I'm using with A2 Hosting, where the exact error I got in my PHP MySQL program is this:

[toc hidden:1]