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

Immediately after I installed iOS4 on my iPhone 3G I reported that it seemed surprisingly fast. However, within two days, whatever pleasant surprise I felt about my iPhone 3G iOS performance came crashing down, and I do mean crashing.

The iPhone iBooks application, for example, crashes, a lot. Try to open a PDF in iBooks? Crash. Try to read a book? Crash. Time to wait for iBooks to open after you've downloaded 10 eBooks? I have no idea, I'm not that patient.

The Facebook app on my iPhone 3G w/ iOS 4? It crashes at least once out of every five startups.

Sorry folks, I hoped to be able to release the source code I created for a Nagios Web Interface, but after starting on it a few hours ago, I'm giving up on this project. The code works just fine, as you can see from the screenshots below.

The problem is the amount of work it will take to make this code "clean" for public release. It currently has my client name all over it, and removing all those references is just going to take too long. (Unless of course an angel investor wants to contribute a few week's pay into my PayPal account.)

I normally don't like to put source code out here that I can't support, but in this case I thought I'd make an exception, because I remember a former co-worker having a really hard time getting this Java Active Directory JAAS code working properly. It's been over two years since I got it working for him, so I don't remember what the problems were. Hopefully if you're trying to get Java working with Active Directory (using JAAS), this example source code will get you pointed in the right direction.

PHP regex FAQ: Can you share some PHP regex examples using the PHP preg_match function?

For a recent PHP program I was writing, I experimented with the PHP preg_match function and some regular expressions, trying to get the behavior I was looking for. Now that they're working properly, I thought I'd share two simple examples of my "PHP regex" preg_match examples/experiments.

Mac Office apps FAQ: I just made the switch from Windows to Mac; what Mac Office software can I use?

One of my family members just wrote and said that despite having a firewall, anti-virus software, and spybot software installed, their Windows computer appears to have been infected for the third time in six months. She asked what they'd be facing if they made the switch to a Mac system, particularly from an "Office" applications standpoint. Here is my reply:

Perl Apache log file FAQ: Can you demonstrate how to read an Apache access log file in Perl (How to parse an Apache access log file in Perl)?

I've provided Perl examples before that can be used to read and parse an Apache log file ("How many RSS feed readers do I have?", "A Perl program to read an Apache access log file"), but to make this code a little easier to find, I'm breaking that code out here.

I've been looking at Google's Go programming language on and off for the last week or so, and though I won't be using it any time soon, it looks like an interesting new language.

In a world full of programming languages, you might wonder why Google programmers have decided to create yet another programming language. The Go programming language authors answer this question in their FAQ:

For years I've wondered why people buy Mac Pro systems at all. As I wrote in early 2009, performance tests show an iMac is faster than a Mac Pro, so given the fact that a Mac Pro system is much more expensive than an iMac, and doesn't include a monitor, why would anyone buy a Mac Pro?

Perl array FAQ: How can I test to see if a Perl array already contains a given value? (Also written as, How do I search an array with the Perl grep function?)

I use the Perl grep function to see if a Perl array contains a given entry. For instance, in this Perl code:

Perl string trim FAQ: Is there something like a "trim" function in Perl, similar to the Java trim function, which trims leading and trailing whitespace characters from a string?

A Perl trim function

My Perl skills aren't exactly up to date these days, but in days gone past there was no Perl trim function, and somewhere along the way I wrote one. Here's the source code for my Perl trim function:

Perl/RSS FAQ: How many RSS subscribers do I have on my website?

Like many other people with a blog or website, I was curious yesterday about how many RSS readers/subscribers the devdaily website has. You can try to get this information in a variety of ways, but the real information is on your server, in your Apache log files.

To figure out how many RSS subscribers your website has, just go through your Apache log file, find all the records that look like this:

I'm going to be starting a new PHP project later this week, and as I don't like to reinvent the wheel, I've been looking around for some decent PHP starter applications, i.e., PHP skeleton applications.

As I've looked around for PHP starter projects, this starter application from Grover Ponders looks the best. It seems well-organized, and you can just download a tar.gz file and get to work.

PHP form FAQ: Can you share an example of a very simple PHP form (a self-processing PHP form)?

Still trying to catch up on a lot of PHP examples I've written but never published, here's the source code for a simple PHP form example. This form posts back to itself, and while I'm generally not a fan of that coding approach, I have used it from time to time for simple tasks.

A simple PHP form example

Here's the source code for this simple PHP form example:

PHP cheat sheet FAQ: Can you share a PHP cheat sheet?

This page is a PHP cheat sheet, but a different kind of cheat sheet. As I go deeper and deeper down the PHP rabbit hole, I found that instead of an over-simplified PHP cheat sheet, I wanted a "starter" page that will point me in the right direction when I'm looking for a PHP function for a task. For instance, if I can't remember how to add an element to a PHP array, I want to be able to search this page and find that easily.

Summary: A Java FileFilter example, including a complete implementation of a Java FileFilter class.

I don't have much time for discussion today, but here's the source code for a Java FileFilter example I created in a text editor I wrote named "Jelly":

Apple minimalist design examples: Over the weekend I finally got around to upgrading my iPhone 3G to the new iPhone operating system -- iOS 4, specifically iOS 4.01. I expected the iOS 4 to be slower than the iPhone 3.x operating system I was running, but to my pleasant surprise, it actually seems faster.

Summary: I'm sharing my Java True License client and server source code. This code is taken from a Java/Swing software application which I successfully licensed and sold using the True License software library.

iPhone photos and Windows XP tip: How to download iPhone photos to a Windows XP computer.

Okay, this was surprisingly hard. I just went to download all my iPhone photos to my Windows XP computer, and assuming this worked with the normal iTunes sync process, I started the 'sync', waited a very long time, and then at the end, all my photos were ... wait ... none of my photos were downloaded from my iPhone to my Windows XP system. What the heck?

I relented to the pressure from several people recently, and reactivated my Facebook account. To my surprise, everyone but the kids seem to have picked up on the privacy and security concerns, and in short, nobody is saying anything.

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: