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

PHP FAQ: Is there a package manager for PHP?

Answer: Yes, PEAR (the PHP Extension and Application Repository) is what you need. As the website describes it, "PEAR is a framework and distribution system for reusable PHP components."

Here's an example of how I used PEAR to install the HTTP_Request library, showing both what I typed, and the output from PEAR as it performed the installation.

OpenSSO FAQ: Why do I get the following error message after installing the OpenSSO web agent in Apache and then trying to hit a URL on my Apache web server?

In my inaugural PHP entry, an answer to a simple question: Where are PHP libraries installed?

Answer: I just installed a PHP library named HTTP_Request using PEAR (the PHP Extension and Application Repository), and it was installed into the following directory:

My normal Login Use Case -- and what OpenSSO did to it.

When I first start working on a new project, it's often hard to get customers to talk about a new web application. They tend to vaguely know what they want, but when I ask them specific questions things can come to a grinding halt. It's like they realize they need a software application, and they've thought it through partially, but they just don't know how to get started.

Last week I was working with OpenSSO quite a bit, and at one point I just needed a really simple Java servlet that I could first try to run, and then try to secure, using OpenSSO. All I really needed for this purpose was a "Hello world servlet", and that's when I realized I've never put one out here.

So, to fix that problem, here is the source code for a very simple Java servlet that will print "Hello, world" when you access it through a browser. To get started, here's the source code for the servlet:

It's been so long since I create a two-dimensional Java array in I almost couldn't remember how to do it. Fortunately I did, and I thought I'd include my sample code here in case it will help anyone else.

So, in this quick tutorial, I'll show you how to create a two-dimensional array (2D array) of Java String objects, and then I'll show you how to access each element in the array.

How to create a two-dimensional Java array

First, here's how I create the two-dimensional arrays of strings with this code:

I was installing PHP on a CentOS (Linux) server yesterday (using the configure script), and ran into an error related to my libxml2 installation. Here's the complete error message that shows up at the end of the configure script output:

Update: If you're interested in using PHP and MySQL on Mac OS X, these days I recommend skipping this article and using MAMP, which I describe in my Mac OS X MAMP tutorial.

I think Steve Wozniak nailed at least one thing in a recent interview when he was talking about Steve Jobs taking a leave of absence. Woz said that during an extended leave your mind has a chance to wander and think about things differently.

I wholeheartedly agree. In my life I've taken three major sabbaticals in my life since leaving college, and I highly recommend them.

Wow, I was really surprised last week when Steve Ballmer made his statements about Apple being a $500 logo, but now I think it's even more surprising -- and dangerous -- that Microsoft wants to take the Kia/Yugo slant in their advertising.

Their most recent ad with the lady that starts off wanting to buy a Mac and ends up buying a PC because it's cheaper sells one and only benefit:

"Buy our product because we're cheaper."

I just read that Steve Ballmer is now saying that there is a "$500 tax" on the Apple logo, or something similar to that. Huh.

Before I get started here, I'll be the first to admit that I don't like Mr. Ballmer. He always sells FUD instead of features, which I strongly dislike. Now that I have that out of the way ...

Vista and OS X are equals?

In this case I strongly disagree with his basic premise. His statement assumes that the two operating systems -- Windows Vista and Mac OS X -- are equal and interchangeable, which they are not.

This is the second-funniest thing I've seen this week ... from the "Best Practices" section of the Sun document titled "Localizing the Sun OpenSSO Enterprise 8.0 Login Page":

Best Practices

When modifying files, follow these guidelines to achieve the best results:

1) Do not remove or modify the license text in the beginning of source files.

Oh yeah, that's going to make a huge difference in your performance. :)

 

Every year that I see the performance numbers on Mac Pro systems, I wonder why their disk subsystems are so slow compared to iMacs? Looking at these new 2009 performance numbers from Macworld, I'm again amazed that an iMac is faster working on a Zip archive than a Mac Pro is.

Spring JDBC FAQ: How do I retrieve the auto-generated database key for a serial field (also known as an auto_increment field in MySQL) after I perform a SQL INSERT using Spring JDBC?

Should you ever need to edit the hosts file on a Microsoft Windows computer, you'll find it in this directory:

MySQL “DROP TABLE” FAQ: Help, my MySQL database tables have a lot of foreign keys, and as a result it's a pain to use the MySQL DROP TABLE command in my scripts; they keep failing because of all the foreign keys. Is there something I can do to work around this DROP TABLE foreign keys problem?

I just wanted to offer a quick apology to everyone that has sent me emails lately. Yes, I have received your messages, and I will get to them as soon as possible. I'm just a bit swamped right now, so please bear with me, and I'll get to them all as soon as possible.

In the meantime here's a fun exchange from the MySQL support pages:

1) From Person A: It's a bug that I can't write sql/ddl like this:

start_date date not null default now(),

2) Reply from a support person:

I was just chatting with my oldest sister, and we were talking about companies who are currently hiring. While looking at that list, my sister casually mentioned that there is another name for a financial advisor: "thief".

On a whim, I went to Monster.com and typed in "thief", and found these job listings:

Last night I put two recent news articles together, and realized that Apple has nearly one million dollars in the bank per employee(!). Okay, it's actually only $802,857 per employee, but that's still not too shabby. (At the current rate, in another quarter or two it actually will be $1M per employee.)

Well Steve, it's taken seven years, but it's finally come true.

Seven years ago I stood on a stage, taking random questions from an audience, when someone asked what I thought of the new operating system from Apple, Mac OS X. I said "It will be the first operating system my mother and I will both be able to use and enjoy."

This week, when my mom (and my sister and nieces) open the Christmas present shown below -- an entry level iMac -- that statement will finally come true.