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

This article is now part of my new eBook, which is only $2.99 on Amazon.com:

You want me to do what? A Survival Guide for New Consultants

I hope you enjoy my book, and more than that, I hope it helps you have a very profitable and rewarding career.

 

Java Refactoring FAQ: Can you provide an example of the Extract Interface refactoring process?

While working on a Java Swing development project recently, I had written a couple of controllers (as in controllers from the Model/View/Controller pattern), and I was about to write some more, when I realized that if I refactored my Java source code I would have a much better design -- source code I code more easily maintain.

The pattern I saw repeated in my Java controller classes was that they all had similar method names, something like this:

I took a little time today to add some new features to my "JustWrite" text editor, and one of the features I'm experimenting with is an animation similar to the current horizontal scrolling area shown at the top of Apple's Mac web page. When you first hit that page the scrolling area is offset a little bit, and then in an animation the scrollbar moves more to the center of the scrolling display area.

The Chain of Responsibility Pattern is a design pattern whose intent is to avoid coupling the sender of a request to its receivers by giving more than one object a chance to handle a request. The Chain of Responsibility works like this:

Summary: A Java "extract method" refactoring example is demonstrated.

If you don't own a copy of Martin Fowler's Refactoring book, I highly recommend it. The basic idea of refactoring source code is that the code "smells" in one way or another, and there are a variety of ways to improve smelly code. More specifically, Mr. Fowler describes refactoring as this:

A few weeks ago when I upgraded my iPhone 3G to iOS 4, I hooked up my iPhone to my old Windows computer, where it was originally sync'd. Downloading my iPhone photos onto my Windows XP computer was a pain, and worse than that, in the process, the iPhone photos were pulled off the phone in some random order, so all the photos are completely out of order when I look at them in the Windows Explorer or the Mac Finder.

Just some quick note here today as I dig into the Java 5 concurrency classes and utilities. Mostly, I just wanted to save a few good links I've found related to Java concurrency and multi-core programming:

Summary: A Java “Command Pattern” example is demonstrated.

If you've ever seen Java source code that looks like this:

Java Swing FAQ: Can you provide a complete example of how to use the Java Action interface and the Java AbstractAction class?

The Java Action interface and AbstractAction class are terrific ways of encapsulating behaviors (logic), especially when an action can be triggered from more than one place in your Java/Swing application.

Summary: The Iterator Pattern is demonstrated using Java source code examples.

The Iterator Design Pattern is one of the most simple and frequently used design patterns. The Iterator Pattern lets you sequentially move through a collection of objects using a standard interface, and without having to know the internal representation of that collection.

[toc hidden:1]

iPad backup/restore FAQ: How do I make an iPad backup? Also, how do I restore an iPad backup?

When it comes to making backups, the iPad is a curious device. The iPad isn't like a traditional computer where you say, "I want to backup folders X, Y, and Z." Curious about Apple's thinking, I've dug into the iPad backup and restore topic, and here's what I've found.

This web page is the resumé for Alvin Alexander, the creator of this website. Mr. Alexander occasionally provides software consulting services to select clients, including business analyst and computer programming services. He currently resides in Wasilla, Alaska (and is preparing to move to Palmer, as of August, 2010). Both cities are just north of Anchorage, Alaska.

Like a lot of other people, I've had a problem with my 2006 Toyota RAV4 which can best be described as a throttle lag, hesitation, low power, acceleration, or stalling problem. In short, you press on the gas, and nothing happens, and in fact, the car seems to lose power or "bog down."

A second problem that may be related is that when I turn left or right through a large intersection, the RAV4 has the same lag/hesitation/stall/low-power problem.

If you want a little insight into the Oracle lawsuit against Google, take a look at James Gosling's blog, where you'll find all sorts of great tidbits.

Oracle puts their name on Java, and apps quit running

He starts with this humorous post of the funniest thing he's read all week, which includes this note, which originally came from Slashdot:

A little disappointed that I couldn't find some content on my own website, this article is essentially just a pointer to another article, so ...

iPad Pages document sharing FAQ: How do I share iPad Pages documents?

After working with a friend's iPad lately -- specifically the iPad Pages application -- I asked him how you go about sharing iPad Pages documents. We did a little research, and found at least three ways to share/export an iPad Pages document.

Summary: This article presents a discussion of the Template Method Pattern, using Java source code examples to explain it.

As a quick followup to my earlier gallstones diet advice article, after I lost a lot of weight recently — 38 pounds in less than 12 weeks — I started suffering from long boughts of feeling light-headed and dizzy, almost like I was drunk, with the room spinning around me. Thinking I might be dehydrated, I started drinking a lot of fluids, but that only helped a little bit, barely enough to keep me from another trip to the ER.

Summary: This blog post shares some source code for a Java Month class that you can use in your applications, such as a Java calendar applications.

I was just cleaning up some old bits, and ran across a Java Month class that I've used on several calendar-related projects. If you happen to be working on a Java calendar application, and need a class to represent the months in a year, this source code may be helpful, so I thought I'd share it here.

iPhone/iPad display specifications FAQs: What is the display resolution of the iPad, iPhone, or iPod? How large are the screens (pixels, or ppi)?

I've been doing a lot of work lately converting my DVD movie collection into digital movie files that I can watch on my iPhone, and as part of converting these DVD movies into digital movie files, I needed to learn about the iPhone, iPod, and iPad specifications, in particular their screen/display specifications.