Little League Spirit Day

04 25 2009

Our friends Erik & Emily’s two oldest kids play in Fremont’s American Little League (Minor-B). Today was the league’s Spirit Day, where all three teams played each other for two innings each. The fields were decorated for the occasion, with different themes for each team, and the fans (aka parents) were very enthusiastic. I came because I wanted to take pictures and because it sounded like a lot of fun. Caroline, Mai, and Caroline’s parents (who are visiting us for a week) came for the third game, and then we all (along with Emily’s parents, who are also visiting this week) went to lunch at the nearby Olive Garden for lunch.

I’d never photographed a Little League game before, but I think I picked it up pretty quickly. I did end up borrowing Emily’s 75-300 lens because my longest lens (18-200) was not long enough. The downside of the 75-300 lens is that it’s very slow to focus and doesn’t have the best optics, so some of my photos are a bit softer than I would prefer. (Memo to self: save up for the 28-300L). The day started out cloudy (yay, perfect for photography!) but it cleared up quickly and was sunny for the rest of the morning, making the photography much more challenging. (Rule 1 of outdoor photography: don’t take pictures in direct bright sunlight if you can avoid it.)

Overall I think the photos came out pretty well, though I’m hoping next year’s photos be even better, and will be taken with a 5D Mark II and the 28-300L lens.

Here are some of my favorites:

You can see the rest at http://photo.oscarc.net/gallery/8010840_CSG5E.



Product Shortages and the Supply Chain

04 19 2009

Recently I decided to purchase a new camera, the Canon 5D Mark II. It has received excellent reviews from just about everyone who’s used it, and seemed like the appropriate upgrade from my Canon 40D. I quickly discovered that even though the camera has been out for over six months, it’s still very hard to find. Most major online sites list it on back-order, and Amazon.com doesn’t even sell it except through third-parties.

When there are shortages of consumer electronics product such as the 5DII or the Nintendo Wii for long periods of time, conspiracy theories are inevitable. Perhaps the manufacterer is deliberately keeping supplies low to maintain an image of popularity or exclusivity? Or perhaps there are quality control issues? While these are all possiblities, they’re not very likely. At Handspring and Palm, I saw first-hand how difficult it is to have the right amount of product available at all times, and some of the reasons why there can be long-lasting shortages of a consumer electronics product.

Before getting into specifics, it’s first important to note one thing: having too few of a product is much preferred over having too much. Of course, having exactly the right amount is ideal, but in the real world forecasts are always going to be slightly off, so it’s better to estimate low. Why? Because inventory is bad, especially in consumer electronics. Having a warehouse full of product that the company has already paid for but hasn’t sold is a drain on operating cash. It also puts pressure on the company to lower prices, reducing profits. Low inventory means stable pricing, solid margins, and strong cash flow. Shortages mean a company is making money, but could be making more. A glut can reduce prices to the point the company isn’t making any money.

So what would prevent a company from building enough of a product to meet demand? The obvious answer is of course  shortages of one or more parts. If your product has an LCD screen, and there’s a worldwide shortage of LCD controllers, you probably won’t be able to get enough LCD controllers to build the number of units your customers want. Worse, if you’re a small or medium company, the LCD controller manufacturers are likely going to favor their best (AKA biggest) customers, with any leftovers going to smaller companies. If you’re a big company, while the LCD controller manufacturers may be filling a larger percentage of your requests, because your orders are so big, a small percentage shortfall is still large in absolute numbers.

Some parts also have very long lead times, with six to nine month lead times not unheard of. Since Christmas stock is built in fall, by February or March you need to decide how much your customers will want in December. If you guess wrong, you’re either going to have a shortage or a glut. Manufacturing decisions that look dumb today may have been made 6 months ago, and may have seemed like a good idea at the time. Keep in mind that shortage is preferred over glut.

Even if with enough parts on hand, a manufacturer may be limited by their product assembly line capacity. It’s easy to say, “why don’t they just bring up another assembly line?”, but it’s not that simple. Bringing up an assembly line is a long-term investment that is very time consuming and expensive. If an assembly line is brought up and then idled a short time later, the company will lose a lot of money. Therefore, a company will need to be 100% sure demand will stay high enough to require the additional line. Again, shortage is preferred over glut.

Finally, an international company like Palm needs to decide where to send product after its been built. If every geographical region’s requests can’t be met due to a shortage, HQ needs to decide who gets priority. This decision can be made a variety of ways, including deciding which regions are most strategic, which regions are most profitable, or which retailers are screaming the loudest. In the case of the 5dII, the US dollar is pretty weak right now, leading me to speculate that Canon is allocating fewer units to the US because they are less profitable than units sold in Asia.

So while it’s possible a company is deliberately building too few devices, it’s much more likely that someone, somewhere in the supply chain, made a wrong decision based on available data a few months ago.



Kickstart Installs From A USB Drive

04 13 2009

When installing a lot of identical or near-identical systems, having an installer answer file makes things go much quicker. By eliminating the need to manually select the same values over and over again, an answer file saves time and minimizes human error. Linux distributions with the Anaconda installer, like RedHat and CentOS, using a kickstart file for this purpose.

The challenge with kickstart files (and other installer answer files) has always been how to provide the file to the installer application. Since the OS media is generally read-only, the file has to be made available somewhere else.

In the olden days, kickstart configuration files were copied onto a floppy. That was simple and easy, but floppies were slow and had limited storage capabilities. As networks got faster, network-based installs became the leading installation method of choice, and floppy disks slowly disappeared from systems.

While network-based installation is still the best choice in most situations, it’s not feasible in situations where you have little control over the network infrastructure. Since floppy drives are extinct, the obvious next choice is to install from a USB drive (flash or hard disk). However, there’s one big gotcha: By default, Anaconda installs Linux onto all available drives, including the USB drive you’re trying to install from. Worse, most kickstart files uses the “clearpart” option, which erases the partition table on all drives, also including the USB drive you’re trying to install from. Not good.

If all your hardware is the same, there’s an easy solution: hard-code the disk drive device name into your kickstart file. That way, Anaconda won’t touch the USB drive you’re installing from. For example, if your target disk drive is /dev/sda:

clearpart –all –drives=/dev/sda –initlabel
part / –fstype=ext3 –size=75 –ondisk=/dev/sda

But what if your hardware isn’t all the same and the target disk drive name varies? Managing multiple kickstart configuration files that are identical except for the disk drive device name is a big headache. There has to be an easier way.

%pre sections to the rescue! The %pre section of a kickstart configuration file contains a script that is run before Anaconda begins the OS installation. At first glance this may seem a bit useless — why run a script before the OS is installed? The answer is that the true power of %pre is to generate parts (or all) of your kickstart configuration dynamically, at install time. In this case, a script in the %pre section can figure out the correct disk drive device to install to, and then generate the appropriate kickstart configuration. For example:

%include /tmp/partitions

%pre
#!/bin/sh

# find the first drive that doesn’t have removable media and isn’t USB
DIR=”/sys/block”
ROOTDRIVE=”"
for DEV in sda sdb sdc sdd sde hda hdb hdc hdd hde; do
  if [ -d $DIR/$DEV ]; then
    ls -l $DIR/$DEV/device | grep -q /usb
    if [ $? -ne 0 ]; then
      REMOVABLE=`cat $DIR/$DEV/removable`
      if (( $REMOVABLE == 0 )); then
        if [ -z $ROOTDRIVE ]; then
          ROOTDRIVE=$DEV
        fi
      fi
    fi
  fi
done

# Check for RAID controller disks
if [ -z $ROOTDRIVE ]; then
  for DEV in c0d0 c0d1 c0d2 c1d0 c1d1 c1d2; do
    if [ -d $DIR/cciss!$DEV ]; then
      if [ -z $ROOTDRIVE ]; then
        ROOTDRIVE=cciss/$DEV
      fi
    fi
  done
fi

cat << EOF > /tmp/partitions
bootloader –location=mbr –driveorder=$ROOTDRIVE
clearpart –all –drives=$ROOTDRIVE –initlabel
part /boot –fstype=ext3 –size=75 –ondisk=$ROOTDRIVE
part / –fstype=ext3 –size=4096 –ondisk=$ROOTDRIVE –asprimary –grow
part swap –size=2048 –ondisk=$ROOTDRIVE
EOF

This %pre section scans for the first non-USB, non-removable-media disk drive on the system, and then dynamically generates the kickstart partition directives hard-coded to that device. This ensures that Anaconda will not install to or erase the USB drive.

One side note: the “removable” flag in Linux is set for devices with removable media (e.g. DVD drives); it is not set for devices that are themselves removable/hot-swappable (e.g. USB drives). This is why the %pre script above checks explicitly for USB devices.