Netbooks are still an underground phenomenon.

December 29th, 2008

With all the talk on the interwebs about netbooks, I had assumed that they had already gone “mainstream”, especially since Amazon is saying that their top sellers are LCD TVs, Netbooks, and the Nintendo Wii.

But, I’ve been using my netbook at our local coffee shop for the last few days, and I’ve found that no one has seen one before, and I’ve had two people spontaneously come up to me and ask me about the machine.  When was the last time you had someone ask you about your computer in a public space?

People are really surprised at the size (about 8″ x 10″), weight (2.2 lbs), battery life (2+ hrs), and price ($350) .  I mention that it’s not the fastest thing, but the general response is: “well, at that price and weight, it’s worth it!” which is exactly how I feel.

To me, this means that netbooks really do have a place in the market, and have a long way to go when it comes to marketing and market penetration.   I think if the marketing engine kicks in on these machines, or if there’s enough word of mouth spreading, that they’ll really begin to take off.

It’s as if people have finally had enough of their 3.2GHz multi-core multi-disk super GPU enabled $3000 machines, and the thought of something small, light, and with a reasonable battery at a reasonable price really strikes true.

Score +1 for common sense!

Image 10,000

December 28th, 2008

As I promised, here’s image number 10,000 from my newest camera:

10,000

10,000

1751 new photos

December 28th, 2008

You’ve probably noticed that it’s been a while since I’ve updated the gallery.  Well, I’ve finally done it, and now I’m done.  1751 photos have been added.  Here’s a tiny sample, and you can click through for more.

Cares Visit

Care's Visit

Half Moon Bay

Half Moon Bay

Pumpkin Patch

Pumpkin Patch

N years ago today for N in 1..14

December 27th, 2008
1 year ago today.

1 year ago today, 12/29/2007

2 years ago today: 12/29/2006

2 years ago today: 12/29/2006

12/27/2005

3 Years Ago Today, 12/27/2005

12/18/2004

4 Years Ago Today, 12/18/2004

12/29/2003

5 Years Ago Today, 12/29/2003

12/22/2002

6 Years Ago Today, 12/22/2002

Priror to 2002, I didn’t have a digital camera, so there aren’t reasonable records of the exact date & times that the photos were taken.  I don’t have many pictures from Decembers in 2001, 2000, 1999, and 1998.  There are a few from earlier:

Some time in december, 1998

11 Years Ago Today, December, 1997

I’m pretty sure that this is Christmas of 1994:

December 1994

14 Years Ago Today, December 1994

And thats about as far back as I can go without breaking open the family photo albums and starting to scan stuff in.

Images by the thousands…

December 27th, 2008

Over the Holidays, I just passed 10,000 images taken on my newest digital camera, a Canon Digital Rebel XTi.  It’s still going strong after about 20 months (That’s 500 pictures/month!)  Here are pictures 1, 998 (# 1000 was very bad), 2000, 3000 … 9000.  I’m pretty sure that nearly all 10,000 photos are available on my gallery.  The gallery currently says that it has a total of 24,295 items, and photos take up 59GB of disk.

The camera resets back to img_0001 when it hits 10,000, and I’m uploading that photo as we speak.  I’ll post it later…

0001

0001

998

998

2000

2000

3000

3000

4000

4000

5000

5000

6000

6000

7000

7000

8000

8000

9000

9000

Spammy calls from 800-219-7425

December 26th, 2008

Ever since we bought our new Toyota Prius from Capitol Toyota in San Jose, CA, I’ve been getting spammy calls from 800-219-7425.

Generally, it says “This is the second notice that the factory warranty on your car has expired.  You still have time to renew it, press 1 to speak with a representative”.

I’ve spoken with them several times telling them to remove my name from the list and stop calling.  They have not.  I saw another missed call from this number today (12/26/2008 - the day after XMas!) and decided to do some research.  I found a couple of interesting websites.  The most interesting is this Press Release from the Missouri Attorney General talking about what they’ve done to try to stop these people.

Additionally, if you’re getting calls from these guys, take a look at telemarketinglawsuit.com, which seems to have some good info on the fact that these guys are a huge scam and are defrauding people left and right, in addition to calling them incessantly and not removing them from their “do not call” lists.

Additionlly, I think that if you have any business with Capitol Toyota in San Jose, CA, that you make sure you get them to sign a release that says that they won’t give or sell your personal information to anyone.  I’m completely positive that it’s their fault for putting me on this list.

On mkfifo and doing the impossible.

December 26th, 2008

In my experiements to make a fast commandline parallel sorting script, I’ve been using the unix command ‘mkfifo’ more than I ever had before, and I’ve learned lots of interesting things about how the bash shell handles pipes and redirects.

On the surface, using mkfifo looks a lot like using pipes, but more verbose. For exmaple, instead of:

# sort foo | uniq -c | sort -k1n > frequencies

you can say:

# mkfifo a b
# sort foo > a &
# uniq -c a > b &
# sort -k1n b > frequencies
# rm a b

On first inspection, this looks just like the pipe example, except a lot more verbose. Is there any use to this verbose syntax? In general, for simple pipes, there is no reason to use FIFOs instead, and in some cases FIFOs cause some issues that are not obvious. I’ll talk about those later.

So, the question then becomes…

When is mkfifo useful?

mkfifo is useful when you want to do something that the pipe syntax is too limited to express. Take the following example:

# sort -k1n inventory > sorted.by.price
# sort -k2n inventory > sorted.by.sales

In the above example, we have an inventory file, and it has 2 numeric fields (price and sales) and we want to produce 2 sorted outputs. If the input file is very large, we may not wish to read it from disk twice. How can we produce 2 output files without reading the file from disk twice? Well, the answer lies in mkfifo:

# mkfifo a b
# cat foo | tee -a a b &
# sort -k1n a > sorted.by.price
# sort -k2n b > sorted.by.sales

But wait, if you’re following along in your shell, you’ll realize that the first sort just sits there, not doing anything, and not sorting. Whats going on? This is where things get a bit complicated…

FIFOs are bufferless

The issue in the above example exposes one of the biggest limitations of FIFOs. They have absolutely no buffering in them whatsoever. The exact bytes that you write() to one FIFO are then read() again by the other. They’re never copied, they’re never buffered. So, why is that sometimes a problem? Well, it means that you can’t write() to a FIFO when someone isn’t already read()ing from it.

So, what happens is that the tee program takes a chunk of bytes, writes it to fifo ‘a’, and blocks. When the 1st sort comes along, it read()s the first few bytes from tee, and then sits there waiting for more. tee has woken up and issued a write() to FIFO ‘b’, but there’s no one reading from ‘b’, so it just blocks, and it doesn’t send any more data to ‘a’. To make this work, we have to run at least one of the sorts in the background:

# cat inventory | tee -a a b &
# sort -k1n a &
# sort -k2n b &

Now, the tee is writing to the FIFOs, and the sorts are reading from them, and everyone is happy. We can produce our outputs in less time than the naive example that just runs 2 sorts in parallel.

What else are FIFOs useful for?

As we saw above, FIFOs can help us do work in parallel, and they can help us express things that can’t be expressed in bash. Here’s a great example:

Imagine you have to compressed files, monday.gz and tuesday.gz. You want to sort them together, into one single file, and compress the output, but you don’t have enough free disk space to store any of the files uncompressed. How do you do this? A naive use would say:

# zcat monday.gz tuesday.gz | sort | gzip > twodays.gz

But you’ll notice that on machine with more than 1 CPU, that this commandline only uses 1 CPU! Thats because the pipeline specifies a single flow of data, so there’s never a way to do 2 things in parallel. Here’s the parallelized fifo example:

# mkfifo a b
# zcat monday.gz | sort > a &
# zcat tuesday.gz | sort > b &
# sort -m a b | gzip > twodays.gz

This will produce identical output, but can do it in significantly less time, since its unzipping and sorting in parallel on your multi-core desktop. The last phase, the ’sort -m’ is a special trick used to merge the 2 sorted outputs. What if monday.gz and tuesday.gz are already sorted? Thats easy:

# mkfifo a b
# zcat monday.gz > a
# zcat tuesday.gz > b
# sort -m a b | gzip > twodays.gz

This runs even faster, and does both unzipping and merging in parallel, never creates a temporary file, and re-compresses on the fly. Sweet!

The holy grail

As I’ve mentioned in the past, the holy grail of shell scripting is a simple non-compiled script built of nothing but standard unix tools, that does what you want, but faster. For example, we could consider the Wide Finder challenge a good example of something that could be parallelized on multi-core machines using mkfifo and the interleave.py script I’ve previously mentioned. All the Wide Finder guys want to do is quickly process an Apache HTTP log and show the most popular URLs. I’ve always done this with a combination of sort & uniq, so I’ll show that simple case here:

# cat access.log | awk ‘{print $7}’ | sort | uniq -c | sort -k1n | head -100

But, we can do this faster using interleaving and parallel sorting:

# mkfifo a b c d e f g h
# cat access.log | interleave.py a b &
# cat a | awk ‘{print $7}’ | sort > c &
# cat b | awk ‘{print $7}’ | sort > d &
# sort -m c d | uniq -c | interleave.py e f &
# sort -k1n e > g &
# sort -k1n f > h &
# sort -m g h | head -100

Author’s Note:  This post ends here — I found this old draft sitting around in my WordPress, so I decided to just publish it as is, even though its not actually done.  I thought it was still a good interesting article on mkfifo.  So, there ya go.

T-Mobile G1 review

December 26th, 2008

Many of my friends know that I’ve had a T-Mobile G1 “Google Phone” for a couple of months now, but I haven’t yet blogged about my experience with it.

For some context, I was already a big “Google” user, with my e-mail through Google Sites, and I use Google Reader daily.  I was once a big iGoogle user, but I sort of tapered down on that and just have e-mail as my “Home Page” on my browser.

So, the great thing about the G1 is the way it sync’s all your e-mail and all your contacts straight from GMail.   When I first got the phone, I transferred all my numbers into the GMail contacts area and the phone automatically sync’d them.  Now, any time I need to add a new number or address, I just use the web interface of GMail.  This is a really nice change.

Notifications on the phone when I get a message to my GMail account are nice, but I actually find that I usually use the phone in “read only” mode.  By that, I mean that I seldomly reply to messages on the phone.  It’s usually because I’m out and about, and not that I don’t want to reply, it’s just that I’m never quite in the right place.   The downside is that the message(s) are left “read” and I then have to sort through them again when I want to really reply.   Nonetheless, just being able to read and archive things on the go is pretty useful.

The web browser is pretty great as well.   The integration with Google is minimal other than the homepage, but the mobile-formatted Google sites are great.  Reader is great, Google News is pretty good, m.reddit.com formats great, etc.  The screen is bright and readable.

For me, there are two big drawbacks of the phone.

First is the touchscreen.  The display is great, but the touch interface is sometimes a bit off.  I’m frequently clicking on the wrong link, or having to use the trackball to navigate where I want, which is usually cumbersome.  Sometimes things at the bottom of the screen are particularly hard to click on.  The “zoom” controls of maps and the web browser are more annoying than useful.

The second biggest drawback is the performance.  For single tasking, the phone works great.  But, when you start switching between e-mail, Web, Maps, and YouTube, it starts to get pretty slow with each switch to a new application.  Sometimes it takes nearly 10 seconds to return to the Home screen, which is pretty annoying.

But, other than those two things, the phone has some really great features.  The app store is simple but effective, and there are some really interesting addon applications.  Compare Everywhere is great, as are lots of other simple tools that let you do things like toggle WiFi, etc.

I’ve also been using Loopt on the phone, which is a location-aware version of Twitter.  I find it pretty neat, and surprisingly accurate most of the time. Rumor sites are reporting on an upcoming “OTA” (Over The Air) software update that will add lots of new features.  I haven’t yet seen it, but it does promise to really fix a bunch of the rough edges, which will be quite nice.

Thats about it.  I’d heartily recommend a G1 to anyone who’s already a big user of Google services, particularly GMail.  If you’re not a big GMail user, or you’re not interested in switching, then it might be a tougher call between the G1 and the iPhone.

Hacker tip: Use fractional point sizes in your terminals

December 23rd, 2008

I just realized last night that with scalable fonts, you can set your font size to fractional values.  This is great news, because I’m always torn between 9 point being “too small” and 10 point being “too big”.  So, I can now use 9.5 point Bitstream Vera Sans Mono as my terminal font, and all is well with the universe.  I think this will also be really useful for setting up my Netbook with some really nice terminal fonts that fit the small screen well.  Here are 3 screenshots.

First, 9 point Vera:

Second, 9.5 point Vera:

Third, 10 point Vera:

Jason Rohrer

December 18th, 2008

I played “Passage” a while back, and wanted to find it again to send it to a friend.  But, it took me like forever to like google search and like find it again.  So, here’s a link.

Jason Rohrer.

It’s that game where you walk to the right through time.