Erik's Thoughts and Musings

Apple, DevOps, Technology, and Reviews

Back on the Wagon

Just before my daughter arrived, I fell off the wagon. I had been doing a good job of losing weight by both cutting down on my intake of food and getting my butt out and exercising. I lost 30 lbs since May 2008. And then we decided to get the house fixed up. That meant we were eating out more, exercising less because we had contractors at the house, and generally going overboard with food.

Whatever the excuse may be, I gained back about 15 of those lbs. I am happy it wasn't all, but still disappointed that it was so easy to gain back.

So this week I have started back on the routine. My wife has been cooking some healthier dinners. I am walking Barca every day (even in the heat). I am drinking water rather than juices or sodas. And I am skipping the midnight snacks.

Pygmy Review

Last night I finished the novel Pygmy by author Chuck Palahniuk. Palahniuk is the same author of the novel, Fight Club, that the movie is based on.

Since Fight Club (the movie) came out, I have always tried to read everything by Palahniuk. He has a perverse and absurd sense of humor that for some reason makes me laugh even though his books usually have a bunch of dark material. Pygmy didn't disappoint.

The book is a little disconcerting at first because it is written completely in Engrish. The main character, Pygmy, arrives in the midwest US as an exchange student from an indeterminate country. Pygmy is part of a terrorist cell who wishes to carry out Operation Havoc with a group of 12 other foreign exchange students.

Besides the subject of terrorism, the book wanders into the territory of abortion, teen pregnancy, religious hypocrisy, extreme patriotism and gay sex. Pygmy, the character, has a tendency to repeatedly quote communist leaders such as Castro and Mao Tse Tung (who I never knew was the originator of the quote "If you have to fart, fart. If you have to sht, sht.").

The funniest bits in the book have to deal with cultural differences. For example, the spelling bee that goes on for hours because the foreign exchange students know how to spell tough english words better than Americans. The whole chapter on what takes place at the Model UN is laugh out loud funny.

Pygmy is not as good as Choke or Lullaby, but it still is an interesting read. I give it three out of four stars.

Ice Age 3 Review

We saw it last Friday. Soulless, almost humorless, and a big waste of money.

I never saw the second one, but I remember being at least amused by the first one. I looked at the watch at least 3 times in 10 minutes wondering when the mess of a movie would be over.

About the only thing mildly enjoyable was the Boy versus Girl Squirrel in that Road Runner versus Coyote way.

One out of 4 stars.

Up Review

I am a little late with this review.... but what a great movie. Pixar has done it again.

The whole intro with Carl, the main character, meeting his wife-to-be was so well done. Pixar does such a great job at telling a story with nuance without spoon feeding the audience with dialogue like most movies. We totally understand why Carl has to go on the adventure, as crazy as it is.

I also like the contrast between Carl as an elderly person and Russell the energetic "Boy Scout". Carl used to be Russell when he was younger, yet sees Russell as a nuisance at first.

The movie was so special, I really don't want to spoil anything who may have not seen it yet (including my wife :) ).

I give the movie 4 out of 4 stars. I can't wait to buy it on disc.

Transformers 2 Review

I went and saw Transformers 2 today. I guess I have mixed feelings.

I know I am no longer in the Transformers demographic, but I used to be. Transformers used to be my favorite cartoon in the 80s. Some liked Go-bots, some liked G.I. Joe. Transformers was my fave (followed close behind by Star Blazers - aka Space Battleship Yamato). I have seen every Gen 1 episode numerous times (including watching them via Netflix a few years back). I watched the 1986 movie a number of times even though that movie seems to be two movies in one (Before Prime and After Prime). It was great childhood/early teen memories.

The first Michael Bay Transformers movie I gave a lot of slack. I knew it was going to be re-imagined for current times. No space ship crashed into a mountain. No Teletraan-1. Heck, not even Spike. I think Bay captured some of the flavor of the first generation in the first film, due mostly to the fact that they got Peter Cullen to do Optimus Prime's voice.

This second movie I am a little more critical of. The big scene where Prime takes on 3 at a time was great. Even Soundwave being re-imagined as a modern day communication device was pretty awesome (I am glad that wasn't spoiled for me). Ravage was pretty sweet. However the other Decepticons really needed some work design wise. For the most part, their robot forms were all silver/gray. It was really difficult to tell any of them apart with all of the action. Even my son commented on that. I didn't even realize that Megatron could not only transform into a plane, but also a tank. When Megatron changed into a tank I thought I was just looking at a different robot. Confusing.

For the real actors, John Turturro was funny in this movie and I even have to admit that Shia Lebeouf was good, but everyone else was just painful to watch. The whole going off to college plot is so overdone. The only chuckle I got was the conflict that happens when Bumblebee was parked in the bushes in front of the frat house.

Other nits.... The twins' stereotype was just atrociously bad, gold tooth and all. Sideswipe, Arcee, and her twins had their small action scenes, but otherwise throwaway characters. All cars being GM based is lame (Sideswipe was a Lamborghini in Gen 1), but I guess necessary to pay/market the film.

I give it 2 our of 4 stars.

Watchmen Review

This review is very late in coming... I watched Watchmen when I was in San Francisco a month ago. The hotel had it as one of the movies you could rent so I watched it the first night I was in town. With all that happened that week I forgot to post about it.

To start off, the graphic novel that the movie was based on is just amazing. I only read the graphic novel about 1.5-2 years ago when I heard that they were making a movie of it. Rorschach has got to be one of the best anti-hero characters in any kind of super hero based literature. He's coarse, paranoid, delusional, bigoted yet strangely charming. His character translated well to the screen. I know it is just a special effect, but I love how his mask changed. It is almost as if it changed because of the mood, but maybe I am reading too much into it an inkblot. :)

I have to applaud the film makers for not changing the story to fit the times. Yes, 1985 is anachronistic, but on every level it really worked.

Casting wise I think they did a great job, except maybe with Silk Spectre 2. The actress didn't really seem like a kick ass type of girl in the same way Jennifer Garner pulled it off in Alias or Uma Thurman did in Kill Bill. I'd be hard pressed to think of an actress out there who could have replaced her though.

Everyone else was perfectly cast. The Comedian, probably my second favorite character, was straight from the comic. The Vietnam scenes are chilling. The Comedian had a clarity on human nature that showed through. The way he was written, you could understand why a personality like The Comedian played both sides. He wasn't drawn two dimensional in the novel or the movie.

I guess the controversy when the movie was out in the theater was Doctor Manhattan walks around with the full frontal. Maybe it was because I saw the movie on a 35" TV, but that didn't really bother me.

It really is hard to find anything really wrong with the movie. I wish more movies were closer to their source material. Hollywood may find that boring, but a good transfer usually ends up in accentuating the words (and in this case pictures) it is based on.

I give the movie (and the novel) 4 out of 4 stars.

Kitchen Sink Repair

I wake up this morning. Groggy. Go to the kitchen. Turn on the water. Nothing comes out. I go ask my wife about it and she said she had to go under the sink and turn off the water because one of the small copper pipes was streaming out water this morning... Oh great, plumbing.

I look under the sink, turn on the water and I see, drip, drip, drip under the cold water piping. I play with the pipes. Nothing I can do. There looks like a hole in the copper. I start looking at the hot water piping and at the valve I see another drip. Oh great, I have two problems to fix. The cold water piping was soldered on the faucet above, so I quickly realize that I am going to have to get a new faucet and a new valve.

I go to the hardware store about 4pm. I wander around and find a new faucet, new plastic bendable piping and a handy dandy wrench tool that is supposed to be good for getting in tight spaces (Total for all items $200+). I get home and the piping I buy looks to be about 10 inches too long even for a bendy plastic piping, so I am already peeved that I know I have to go back to the hardware store for an exchange.

I start trying to get the nuts off that are keeping the faucet attached to the sink. I get the left one off easy with the new tool. The right one is just rusted in there. I spend about an hour working on it with no luck. Crap. If I am going to get it off I need something with a lot more torque, but the only thing that would fit on there is a deep socket. The two deep sockets I have don't fit, but the 5/8" is really close. So instead of doing something smart and measuring the left nut that I got off, I just immediately assume that I need a 1/2" inch deep socket. Back to the hardware store.

I get back to the hardware store, exchange the piping for something smaller and head over to the tools department and find a deep socket. Crap, I need a driver or an adapter because the only deep socket that is 1/2" needs a 1/2" driver. The problem is I can't remember what my drivers are at home so I say the heck with it and get a 1/2" driver (Total for all items $40+).

I make it home get the driver on the new socket put it up there. You guessed it. It is too big. By this time I am cussing. I think to use the left nut... Measure it against my sockets and it needs a 9/16". The hardware store doesn't take exchanges on tools. Back to the hardware store.

I get the right deep socket (another $8), head home think I am all dandy. Get the socket up there. At first it doesn't go on the nut! The bolt that the nut was on was bended. I straighten the bolt and the socket goes on.. Whew false alarm. So I start trying to turn. Great torque. It feels like it is starting to move. To make a long story short(er), with both my wife and her mom's help (at different times) I get the faucet off in about an hour. I started at 4pm. Now it is a little after 9pm.

I do a little cleanup, break out the directions and start putting the new faucet together. The instructions of course are all diagrams and no words. Items are not marked on the diagram correctly. An item marked J is really K. It is like a big 20 step Lego with messed up instructions. All I can think of to say is "Who did your QA, faucet company?"

11pm comes around and the faucet is plugged in. It is running great. Even the hot water is running OK based on where you turn the valve to. Tomorrow I still need to replace the hot water valve. I am hoping that it is only a 1 hour job, but we will see.

Plumbing really bites.

Rick Steves' Iran

I just got finished watching Rick Steves' Iran on the local public TV station.

I've been DVR'ing Rick Steves' Europe for a little over a month now because if we ever go back to Europe, I'd like to know of some places to visit. The other good thing about Rick Steves is his shows are usually only 30 minutes so I feel some sense of accomplishment if I can get through a show.

Rick is a little bit of a nerd. He also reminds me of someone I used to work with. Coincidentally the same person was the one who first told me about his books, Europe Through The Back Door, when I was first planning a trip over 10 years ago.

Anyway, Rick Steves' Iran was really fascinating, or to use Rick's seemingly favorite term "evocative".

When American's think about a country like Iran they probably think about Ayatollahs or Ahmadinejad. Rick showed what it was like walking through cities like Tehran and Shiraz. Rick even admitted that he was fearful before going there. He didn't know what to expect. However everyone he met was really friendly and smiling... I'd never want to drive in Tehran though. Scary traffic and no traffic lights!

Rick doesn't usually do interviews in his Europe shows except a random shop owner here and there, but on the Iran trip he talked to some people about life in Iran. He tried to ask his guide why Shiite and Sunni muslims are always at odds when they are the same religion (making a point that Protestants and Catholics fought). He asked a young woman about customs like shaking hands. All the time being very respectful of their culture. The same woman was very clear in telling Rick that it isn't the Iranian people that hate Americans it is the Iranian government. That kind of clarity of thought makes me cringe to think that less than a year ago McCain was singing "Bomb, Bomb, Bomb... Bomb, Bomb Iran".

The history parts of the show were interesting as usual. Persian culture is very rich dating over 2500 years. Persepolis would be one of the stops I'd go to if I was ever in the Middle East.

I am going to end this post with a great quote I found on Wikipedia from Rick. It pretty much embodies why I like traveling outside the US:

Travel, like the world, is a series of hills and valleys. If something's not to your liking, change your liking. Travel is addicting. It can make you a happier American, as well as a citizen of the world. Our Earth is home to nearly six billion equally important people. It's humbling to travel and find that people don't envy Americans. They like us, but with all due respect, they wouldn't trade passports.

The Time Machine Review

This is long overdue. When I was traveling to San Francisco at the early part of the month, I read The Time Machine by H. G. Wells in electric form (via Stanza on the iPhone).

I got about 2 chapters in the book and realized that I had already read the book a long time ago, but it was still a pretty fun read. I found it hard sometimes to believe that the book had been written in 1895.

One of the things that I thought was interesting in the book was that the time traveler as the protagonist envisions an ideal future (802,701 AD) where Communism has taken over the world. What seems visionary by Wells is that Communism was in its infancy at the time of writing.

The time traveller thinks there is safety in Communism. That all the world's problems would be solved if all people worked toward a common goal. The protagonist's ideals become quickly shattered. He deduces that Communism succeeds for a time with the Eloi, but is corrupted by forces that don't follow the precepts of Communism (Morlocks).

What I also liked about Wells' writing style is that it was very easy to imagine this machine in your head. The machine feels a bit anachronistic to me without electronics, but in context it totally fits the Victorian age in a steam punk kind of way.

I have already read The War of the Worlds, so the next book I think I am going to read is From The Earth To The Moon by Jules Verne. Free books online are awesome.

Using the Clang Static Analyzer

One of the tools I learned about at both WWDC and in my CS193P class is Clang.

Clang is a front-end processor for a compiler. It analyzes your code and is pretty effective at finding not only compilation warnings and errors, but also difficult to find logic errors like memory leaks in your C or Objective-C code (no C++ support yet).

Since the installation and usage instructions are a little lacking, here are the steps to get it working on one of your projects:

  • Download the Mac version of Clang here.
  • Expand the tarball using StuffIt or one of the built in OS decompression tools. A folder should be created something like "checker-0.211"
  • Open the Terminal.
  • If you are using Bash, edit your .bashrc or .bash_profile in your home directory and add the "checker-0.211" folder to your path. Something like this:
    PATH=$PATH:~/Downloads/checker-0.211

  • Open one of your Cocoa projects in Xcode that has Objective-C or C.
  • THIS IS IMPORTANT: Do a Clean Build.
  • Go back to the Terminal.
  • Change directory to your project folder for the Cocoa project.
  • If you are running it against a Mac application, run the following command:
    scan-build -k -V xcodebuild -configuration Debug

  • If you are running it against an iPhone application, run the following command:
    scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0

  • A full compile will happen with some extra analyze steps. C++ or Objective-C++ files are not analyzed but still compiled.
  • When the build is done, a mini-webserver is kicked off and you get a report. Within the report is a number of line items about potential issues. NOTE: There could be false positives.
  • Clicking on one of the items gives you an HTML view of not only the code in the module, but in-screen warnings, like so:

  • It contains really neat information that could save a user a bunch of time using a tool like Instruments. The best part is that Clang is open source, so ports to other platforms already exist. I can't wait until the C++ processing is working!