h1

Sometimes things are appreciated in their lack

May 6, 2012

I am super excited to see the clouds today. They indicate that my in-laws were telling us the truth: we have NOT been transported to a world of vast gray nothingness of damp.

I best Boston is prettier in the light. Though the drivers! Talk about stereotypes that are entirely true! Of course, if they had lane markers it might help.

Here is a pic of a pond in Cambridge. You can see the cloud in the upper right corner. Sadly, the prevailing wind seems to be pushing that cloud and all it’s brothers over the sun. But it was nice while it lasted.

20120506-072458.jpg

I know it was a pond instead of a lake because the sign said so. Though, in California, that would totally be a lake.

Update 30 min later: The clouds were burning away, not encroaching. We’ll need sunglasses today! Yay!

h1

Approachable?

May 5, 2012

My sister-in-law’s concert was last night. My goals was simple: make sure none of the normal every day stress touches her. You want cookies? Done! Cheese? Yup! Two dozen mini cupcakes picked up? Oh, you mean for a little reception after… ok, then you’ll want drinks and something to make the table look nice (so much for the flowers we’d thought to get her to hold but as a table ornament they were great). And, to the extent is it within my power, none of the rest of the family will be late, no one will get lost, everyone will be fed… These are all things I’m fairly competent at handling. Other than being bossy and inquisitive, it doesn’t take a whole lot of skill.

Unlike my sister-in-law’s performance. That took a lot of skill. And years and years of practice. Something like thirty years, including the two she’s spent getting her Master of Music degree at Longy School of Music.

When C got his Master’s degree in physics, he had a final oral exam. It wasn’t open to the public. And if it was, he didn’t invite me to watch nor did he have all of his family and most of his friends sitting in the audience, excited and nervous for him.

Minta did. We all watched, the most forgiving audience in the world, but, still, there is nothing like the stress having friends and extended family watching you, many of them musicians themselves. I don’t blame her at all for her nervousness. It was unnecessary because she was so well prepared but I do understand the nerves.

She played beautifully, of course.

The “of course” is a little glib- too easy, it fails to recognize the years and years of preparation at music schools and her own unending practice. Personally, I loved the lyrical beauty of Josh Hummel’s Wu-Wo, flute and piano music representing a traditional Chinese tea ceremony, especially the Peony and Lotus movement. If you were to have expectations for how flute performance should sound, that would be it. (Well, that and the Chinese folks songs that were hauntingly beautiful.) My second favorite was Zoom Tube, a piece written by a flute playing mathematician. In it were all the sounds that an expert can coax out of a flute that are different than what you might expect. It was surprising and humorous, a fun piece.

The jazz ensemble was awesome too but I suspect I would have enjoyed that more if I wasn’t so ignorant. Jazz is often more fun if I understand the original piece and can appreciate the choices the musicians made. (There is a really good Young Indiana Jones episode where Indy learns to play Jazz Sax. It explores the concept vs. reality of jazz music. Sadly, that episode forms the basis of my jazz musical education.)

It was with the final piece that I was once again reminded of C’s physics oral exam. The jazz ensemble did some free improvisation. This isn’t a “start with a jazz standard and wander where you will” sort of improv. C wispered to me that they start with a key and a tempo and truly make it all up as they go along. It was nonsensical to me, both to make music that way and the result.

But if I’d gone to C’s physics oral, would I really have expected to been able to follow what he did? I have more exposure to physics than flute music. I don’t know the language of jazz improv any more than I know how to use a Lagrangian to do anything. And that is ok.

Except, somehow, I think I should be able to “get it” for music even when I don’t feel that way for physics. Oh, sure, it was a public performance and I know my sister-in-law had to choose pieces that showed her artistry and technical expertise while still appealing to a broader audience. I wonder if C could have found physics problems to solve in public that were master’s level and would appeal to his whole family (and satisfy his professors).

Why do we expect all music to be approachable? Sure, it is ok not to like some music but to say “I just don’t get it” feels like a failing I must go out and remedy.

I don’t play an instrument. I didn’t have access to music of my choosing until mid-way through college. (That is a separate story, suffice to say I deeply understand all forms of 80s and 90s country music and just as deeply loathe 90% of it.) Now I have a fairly eclectic music tastes (Ella Fitzgerald, Shawn Colvin, They Might Be Giants, Ramones, Beethoven, etc.) but, like art, I am not good at buying music I will like in a month. I listen to the surface and then get sick of it quickly. Happily, C is better and I listen to his musical acquisition as well (when it isn’t Rush (not that I don’t like Rush, just not as much as C does)).

Anyway, my musical education is sadly lacking, really bottom of the barrel. My enthusiam makes up for some of it. However, enthusiasm couldn’t help someone learn algebra without in-depth instruction of arithmetic. So I’m not going to make that same assumption for music even though I feel that idea around me, that all I need to appreciate complex, historically interesting, technically challenging music is to listen to it. Bunk. Utter bunk.

So, a point, I’m sure I had one. Let’s see. My sister-in-law’s performance was excellent. I’m pleased that I enjoyed almost all of it and disappointed in myself that I didn’t understand the last bit. And a little disappointed in my disppointment but I’m blaming that on society.

 

h1

Yo ho ho and a bottle of rum

May 4, 2012

“I think your book must be doing well, it certainly is well pirated.”

When C said this about Making Embedded Systems, I suppose I was pleased. I mean, it is true that there are many e-copies of my book on the major (and minor) pirate sites. I find it kind of irritating that people can get my book without paying me or O’Reilly. But I doubt anyone gets my book for free without understanding that they are doing something wrong.

Most of the people who would buy my book write software for a living. If they don’t understand how copyright impacts them in the long term, then they aren’t smart enough to write software for long.

So most of the readers who pirate my book are either too dumb to realize it is wrong or too broke to care. These people wouldn’t have bought my book anyway. I don’t feel like I’ve lost out much because of them. And if they get something out of my book, if they manage to get some smarts. solve a problem or find a better way to create embedded systems, well, hey, that is ok. It is ok with me and it is ok with my publisher.

I think there may be a few more folks out there, the ones who want to try it out, to sample the book. I bet they get the book to sample, use it and keep meaning to pay but fail out of laziness. Those are the only group of pirates that truly annoy me.

I knew when I went with O’Reilly that electronic copies of my book with be available without DRM. That was a little scary. I spent a long time writing this book.

People who write technical books don’t do it for the money. We do it because we want to share what we know and ignite the passion of other people (or just make it easier for others than it was for us). Still, almost any one who writes a technical book (especially for O’Reilly) could have made more money doing the work instead of writing about it. For me, it certainly would have been easier. And I didn’t need it as resume filler, my resume is fine, thanks.

So I wrote the book to share. now I just need to share nicely. Today is the Free Software Foundation’s Day against DRM. To celebrate, O’Reilly is offering all of the DRM free ebooks (and that is all of them) for 50% off. But let them tell you:

	In Celebration of *Day Against DRM*
	Save 50% on ALL Ebooks & Videos

	Having the ability to download files at your convenience, store them
	on all your devices, or share them with a friend or colleague as you would
	a print book, is liberating, and is how it should be. If you haven't tried
	a DRM-free ebook of video, we encourage you to do so now. And if you're
	already a fan, take advantage of our sale and add to your library.    

	For one day only, you can save 50% on all O'Reilly, No Starch, and Rocky Nook
	ebooks and videos. Use code: DRMFREE

	Ebooks from oreilly.com are DRM-free. You get free lifetime access,
	multiple file formats, free updates. Deal expires May 4, 2012 at
	11:59pm PT and cannot be combined with other offers.

Go buy my book. Go buy someone else’s. Have a ball! We really appreciate it when you buy our books. And we are happy to share our knowledge, experience and passion with you.

h1

Leaving town

May 4, 2012

“I didn’t even see the basement!” said C as we left his parents Hartford, Connecticut house. He’d woken up last night not knowing where he was. I don’t know why when he wakes up disoriented when I’m asleep, I’m supposed to be coherent.

Plus, he had several of those dreams where he found rooms of our house he’d never seen. I suspect the last night’s tour of the attics did that for him.

However, I slept like a baby.

We are heading to Boston now, meeting up with all the rest of the family. But we needed gas even though (because?) the car’s been sitting in the driveway for days.

335 miles since we got gas (Maryland seems so long ago), 14.21 gallons and $59.68. Great gas mileage on the NJ turnpike: 23.6.

20120504-101234.jpg

h1

Time flies like a banana

May 3, 2012

As we traveled east, many of the gadgets have not done well with the time change. The iPhone, teacher’s pet that it is, offers a near perfect user experience. As we crossed the time zones, the iPhone continues to display local time whatever that is.

For something so seemingly easy, that is incredibly difficult. None of the other gadgets come close.

The iPhone has four sources of time, let’s go through them and work through why the other gadgets don’t work as well. First, the phone, like many gadgets, has a clock. This is a crystal that counts how many ticks since it was booted. The ticks could be from a  32.768kHz crystal (a real-time-clock or RTC component that keeps a slow-for-a-computer heartbeat). Like any watch, all you need to do it tell it what local time is, and the RTC (or other crystal) maintains it. However, it will drift off from the correct time (particularly if it stays in a hot car for a long time or in a particularly cold room). So when your 1984 Star Wars watch would lose a couple minutes a month, that is why. The clock counts ticks from when you set it but if the ticks are off by 0.01%, you end up losing a minute a week.  Temperature extremes makes this worse.

Ok, so that is old, old method for doing it. But if you have nothing else, a gadget with a crystal will keep time reasonably well. Though, it can’t tell if you’ve crossed timezones. That is why we had to reset the car’s digital clock every day or two.

The iPhone also has a GPS which isn’t only for location. GPS provides very accurate time information. However, the time is not local time but UTC (Coordinated Universal Time) which, for this purpose, is the same as GMT (Greenwich Mean Time, from when Greenwich, England was the center of the world). In California, we were GMT-8. Well, sometimes; California has daylight savings time so the offset shifts depending on the season.

This is (nominally) to reduce energy consumption as people tend to be clock based. The time shifts so the bulk of the daylight is after people wakeup. Sunlight at 4am in’t that useful but by shifting the clock, that sunlight moves to 5am and the evening light moves from 7pm to 8pm, a reasonably big win for folks stuck in 9-5 jobs.

Gadgets hate daylight savings time. Well, the programmers of gadgets hate DST.  Not everywhere in the US has daylight savings time (ahem, Arizona!). So now, a gadget using GPS time needs to know how to map from location to time and whether that place uses daylight savings time. It also needs to know when DST begins and ends, which can change (thank you, President Bush), causing devices that you (the customer) end up having to change 4 times every year (correct DST, gadget’s faux correction; forward and back). Oh, but there are some counties in the US that vote on whether to do DST each year so it isn’t enough to just use the current protocol.

GPS provides a signal that is both good and bad: it is very accurate (the gadget can know how long a second is to nanosecond precision) but not very precise (the gadget can be hours off of local time but it would always know what time it is in Greenwich (gee, thanks, England!)). Since it is very accurate, I’ve used it in devices to time how long something took, was it 0.00011 seconds since the system heard a gunshot or 0.00013 seconds? As a stopwatch, the GPS clock is fantastic.

A GPS can also be used to keep a a crystal real time clock accurate. Every time GPS updates the time (every second), the gadget (microprocessor) counts how many ticks the RTC had. Now, it can predict for the next second how many ticks there will be (the drift associated with the crystal is relatively slow so this works well).

The user still has to set the time. And reset the time for daylight savings time. And change the time when the user moves to a new timezone. The GPS gave us accuracy but didn’t solve any of the other problems.

Ok, so the iPhone also has WiFi which can help with some of these. It can use the internet to contact a mainframe server and ask, “what time is it?” The gadget doesn’t really need a GPS for accuracy, it can use the standard servers and Network Time Protocol (NTP) to get accurate timing information (or Simple Network Time Protocol to get reasonably accurate time information). Unfortunately, this is UTC as well so it has all the disadvantages of GPS: it has to ask the user for their offset (usually they ask you to select a nearby city and the gadget figures it out; and all of the daylight savings time complexity). NTP is a general internet service, available using different servers. A gadget manufacturer can instead have the gadget call home to their own server which can provide more information than just NTP.

However, if the gadget has WiFi and GPS, it can contact a server with a query that essentially says, “I’m here, what time is it?”  The GPS isn’t completely necessary for the WiFi phone-home method to work. There are databases of WiFi networks and their location (the iPhone uses those to help locate you!) so the gadget can phone home with the WiFi network and probably get the time that way.

The server can have a much larger daylight savings time database than the gadget (and one more easily updated with the vagaries of humans). The weak point of this plan is the server… if the gadget can’t get there, it will act stupid.

In the car, the gadgets don’t have WifFi so things like the iPad don’t get updated until we get to a hotel and log on. Then, the iPad, disconcertingly, loses an hour sometime between I get used to it being wrong and when I look at it again and wonder how it got so late.

There isn’t  a standard for how to do this conversion from location to local time. Well, there is the Network Identity and Time Zone protocol but if you go look at that you’ll notice is isn’t exactly a networking protocol with the ubiquity of NTP. Instead, it is phone based.

The iPhone is actually a cell phone (yes, I know it is a somewhat terrible phone but it has cellular technology so we’ll give it the benefit of the doubt). As this gadget moves, it connects to the cell towers and asks, “Beg pardon, but do you have the time?” and changes to the new time if the cell towers give something different than the device’s current time.

So, all a gadget needs is a cellular modem and a contract with one of the major cell phone vendors. Then it can function as a reasonably accurate clock, always updating to local time.

Or the gadget can just assume its customer never leaves their home time zone and make them set the initial time. And then it can use a crummy real time clock and let the time drift. Not that big of a deal, the clock will be correct-enough 99% of the time. Since we want our gadgets to be cheap, not many things can afford to have all the supporting hardware.

(Thanks to Christopher White who complained enough about broken gadgets that I put this together._