Struggling with Distributed Version Control Systems, e.g. git

I’ve been using subversion for version control on just about all my projects for years, whether they were my own projects or for clients. It worked well and I got very used to it. Recently I’ve been put on projects that use distributed version control systems and have also been working on some open source projects that use it as well. Several of my projects use Mercurial, but most are using git.

As my work on the Mercurial projects has been quite limited, I’ve fumbled my way through using it without really learning about it. MacHg has been good enough for me to work on the projects. However, one of my projects relies heavily on git, so I’ve been trying to learn it. I’ve read a number of tutorials, watched videos, read through Pro Git twice, and still don’t feel comfortable with it. After talking with some other developers, I’m not alone in being lost with git.

I consider myself a fairly intelligent person that can learn new technologies. I’m not sure why it has been so hard for me to learn git, but I’m starting to see some of the benefits of it. Another developer I work with has cursed git because he just wanted to look through a snapshot of a source tree, but with a distributed version control system, he had to download the entire repository in order to browse the code (he didn’t have access to export the source without the rest of the repository). When he first told me about this, I completely agreed with him on how ridiculous this aspect was, but the more I read (read the same material, that is), the more I’m starting to get how powerful git is.

While git is quite powerful, it is going to require me to change my workflow as git seems to encourage creating branches for every little thing. Branching code, to me, has always been avoided as it was a royal pain and merging was unpleasant. Merging can still be unpleasant with git, but everything I’ve read seems to indicate it is painless. We shall see.

I wasn’t until I found the Git Reference website that the pieces started to make sense. I’m not sure why every other tutorial doesn’t make things this clear. Maybe this should be everyone’s starting point in learning git.

I’m comfortable with command line tools, but prefer a GUI if at all possible. With subversion, I used to use Versions, but switched to Cornerstone after I tried it and found that it showed diffs right in the app without requiring an external application. Now that I’m using git, there are a number of GUI tools for it, but I’ve found that Tower is the only git app out there for the Mac that currently has diffs right in the app, so that’s my app of choice. There are some things I don’t like about it, for instance I like a list of repositories on the left side. However, it’s helping me become more comfortable with git.

Maybe I need to write an idiot’s guide to git. If a reasonably good developer like me is struggling with git, how can it become widely adopted? Is it that other developers aren’t as entrenched in subversion as I? I kind of feel like I’m missing something in how much time I’ve spent in trying to learn git.

Suggestions for the TSA

I’ve ranted a number of times about the TSA, so I’ve decided to offer the TSA some suggestions on how to handle airport security. I ask for nothing in return, even though I’m sure my ideas would be worth millions if I was contracted to do an overhaul of it.

In no particular order:

  • Redeploy military personnel to patrol the airports with M-16 machine guns. The wars overseas are not winnable, so put the soldiers in our all volunteer military (not the national guard troops) to work at the airports. The machine guns and troops in fatigues is at a minimum an excellent deterrent. Having flown within the months after 9/11, it was almost comforting to see the military there. The TSA officers at the checkpoints are not very menacing and aren’t even armed.
  • Bring in bomb sniffing dogs. They’ll likely be able to detect explosives more efficiently than the full body scanners or the random swap testing. In addition, if someone is nervous, dogs will make them even more nervous.
  • Profile people. This seems obvious, but train personnel to be more observant and watch people that fit certain profiles.
  • Watch behaviors. Train all the personnel to watch passengers’ behaviors.
  • Get rid of the full body scanners. They’re a waste of time and money. Return them and get our taxpayer money back.
  • Stop the 3-1-1 rule for liquids. Confiscating a bottle of hair spray is ridiculous.
  • Do the full body pat downs on people that show signs of being uncomfortable or are acting in a way out of the ordinary; don’t do a full pat down on a child that doesn’t fit a profile.
  • Stop confiscating nail clippers, nail files, etc. If you can get a knife inside of security like I had used for dinner last week, nail clippers aren’t going to hurt anyone. Also, look at maintenance workers that have all kinds of tools that could be used as weapons.
  • Tighten up perimeter security. There was a story the other day about a castaway in a wheel well that got onto the tarmac.

There are a few things that I don’t mind that have been done:

  • Reinforcing the cabin doors.
  • Prohibiting lines from forming outside the cabin door.
  • Taking off shoes; while a little inconvenient, I can handle it.

Let’s get real TSA and start being smarter about how the billions of dollars are being spent. The costs can be cut tremendously if we didn’t waste it on useless screening techniques.

Storing User Data in Application Support

I recently switched to a new MacBook Pro and decided to piecemeal move my data over so that I wouldn’t bring over old crusty preferences and files like that. This has worked quite well, but in two cases today, I found that some user data was stored in the Application Support folder. Since I hadn’t copied this directory over, when I ran the apps, I had no data and had to dig through an old Time Machine backup to find the data. To make matters worse, I’m storing my personal data on an encrypted disc image and in order to get the apps to run, I had to create a symbolic link to my disc image’s directory that contains the data.

Apple explicitly states in the developer documentation that the Application Support directory:

Contains application-specific data and support files such as third-party plug-ins, helper applications, templates, and extra resources that are used by the application but not required for it to operate. This directory should never contain any kind of user data. By convention, all of these items should be put in a subdirectory named after the application. For example, third-party resources for the application MyApp would go in Application Support/MyApp/. Note that required resources should go inside the application bundle itself.

In ReceiptWallet 1.0, I made this mistake for ease of use and stored user data in this directory, but when I moved to a document based app, I rectified this issue.

Developers, please read Apple docs and store user data in a user defined location or in Documents; Application Support is the wrong location for this data.

Review: Sony Cyber-Shot DSC-WX9

As I wrote a few weeks ago, I enjoyed editing video on my iPad 2 in iMovie which got me started on putting all my video in a format that the iPad could read without conversion. While our Canon PowerShot SD960IS wrote video in h.264, a format that the iPad can read, the audio was a PCM format that the iPad didn’t like and therefore iTunes wouldn’t put the video on the device and using the camera connection kit, I still couldn’t get the iPad to play it. If my dream of taking an iPad on vacation to edit a movie while still on the vacation using video shot during the trip, I had to find a compact digital camera that output the video in an iPad compatible format. I wasn’t convinced that just reading the specs would ensure compatibility, so I decided I was going to look and buy locally in the event I had to return the device.

About 2 weeks ago, I was going to go to Best Buy, but due to a cranky child, I didn’t make it. The following day, I saw some cameras in the Best Buy ad, so I looked up specs on a few of them. I decided to take a shot on the Sony Cyber-Shot DSC-WX9
. Normally I’m not a huge Sony fan because of their insistence on using Memory Sticks, but a friend of mine told me that starting in all their cameras from last year or maybe earlier, the cameras also accepted SD cards.

Best Buy was sold out of the camera (it was on sale for $199, $20 less than normal) so I ordered it with free shipping and received it last Friday. After reading and re-reading the specs, I absolutely couldn’t wait for it.

The first thing I did when I got it was find the setting to capture videos in mp4 format in 720p. After doing this, I shot a video, took the card out and placed it in the camera connection kit on my iPad. The iPad imported and played the video without problems. That pretty much sealed the deal for me to keep the camera; the rest of the features were gravy since the camera already did more than my Canon.

The Sony almost has too many features to be usable, so I’ve tried to learn a few ones that are useful to me. First off is panorama mode. I’ve used stitching programs before, but due to them not being convenient, I think I have 1 wide picture in my collection. This mode makes it simple to capture a very wide picture that looks great. It’s easy to use and one feature that I’ll be using again.

The next feature that amazes me is the smile shutter. You turn it on and it detects when someone smiles in order to snap the shutter. In my testing, it works quite well if there is only one person in the picture; if there is more than 1 person, it’s only going to focus the detection on one of the subjects. However this could be used for self portraits and getting in the picture by having everyone frown until the photographer gets in the picture then everyone smiles. It should also be great at getting pictures of my son when he’s smiling even when he’s not really a happy camper.

The 16 megapixel resolution is a bit overkill, so I scaled it down to 10 megapixels and the images still look great. The Carl Zeiss lens and 5x zoom seem to perform better than the Canon.

While flipping through the options, I saw it mentioned Eye-fi and I had to dig into the docs which are inconveniently only on the CD and not the website (they’re in HTML and I prefer PDF since I can put them in Paperless and even put them on my iPad for easy access on my next vacation) to figure out what this meant. Basically there is an icon which tells you when the Eye-fi card is uploading and you have the ability to turn off the uploading to conserve battery.

I almost fell over when I saw that it charges over USB. Unfortunately one end of the cable is a Sony proprietary connector. The good news is that as long as I remember the cable, it is pretty easy to find a USB port for charging. One caveat is that it appears to draw a little too much power to charge from one of my chargers. Using an adapter I recently got for my XPal Power battery to charge my iPad, I can get the camera to charge on that charger. The large battery charges the camera without the adapter.

The one major downside I found to the camera is that the colors on the LCD are pretty awful. The images look washed out, but viewing pictures on my computer or iPad show that the colors are properly represented in the actual images.

Pros

  • Records movies in a format the iPad can read directly (720p, mp4 format; this is not the default).
  • Easy to use panoramic mode.
  • Smile shutter is pretty good at detecting smiles.
  • USB Charging.
  • Indicator for Eye-fi uploads.
  • Pretty sharp pictures.
  • Accepts a variety of formats including SD, SDHC, and SDXC.
  • Burst mode to capture 10 images in rapid succession is easy to use and works well.

Cons

  • Proprietary cable for charging.
  • Display makes pictures look wasted out.
  • Manual is delivered as HTML instead of PDF. However, using wkhtmltopdf and some command line magic, I was able to create a PDF of the HTML documentation.
  • Too many features! I haven’t been able to dig into everything and I’m not sure I can remember how to use everything even if I understood it all.

Summary

Like most of my reviews, this one is pretty favorable because I did my homework to find a product that met my needs. I’m extremely pleased that the device records video that is directly readable on the iPad; just about everything else is gravy to me. The cost of digital cameras has come down so much, that in the $200 price range, there are so many choices. Deciding on which one to get is extremely difficult. So far, I like the camera and it is taking pretty good pictures.

I don’t think that people can go wrong with this camera. If you’re looking to display your videos on an iPad and don’t want to have to deal with conversions, this camera fits the bill. (Note, however, that the 1080i default video format cannot be read on the iPad.)

Traveling without a laptop

Ever since I bought my first laptop well over a decade ago, I think that I’ve taken one on every trip with a few exceptions. With the rise of the iPad, no longer do all my trips necessitate me taking a laptop. In the last year, I’ve been on 2 trips with just my iPad, a Bluetooth keyboard (to make it easier for me to blog :-)), and a MiFi for connectivity. The first trip my wife forbid me from taking my laptop and I survived; the second trip which was last month I actually didn’t want to travel with my laptop.

The iPad 2 has pretty much sealed the deal that I don’t have to travel with a laptop on non-work trips. Now that I’m a salaried employee and actually get time off where people are bugging me, I don’t feel compelled to fix bugs, write code, tweak a server, etc. Also the power of the iPad to edit videos makes it an ideal device to take on a vacation where I can take pictures and shoot video, then assemble a movie while still on vacation (the catch here is that our digital camera has to store the video in a format that the iPad can read when I put the SD card in the camera connection kit; I’ll address this in another post).

The “limited” abilities of the iPad are a huge plus to me as there is no way that I can write code on it and I don’t feel guilty about it. There is no doubt in my mind that on my next vacation, my laptop will be left at home.

Are we safer?

Every time I fly, which isn’t all that often, I feel compelled to write something about the sorry state of the TSA. In the last 6 months, I’ve flown 3 times and on 2 of the legs, I was supposed to go through the full body scanners (in 1 case everyone had to go through), but opted out as I believe the government needs to be a bit more honest with the public on the safety of the devices by letting the FDA monitor them and by performing regular maintenance on them (they’re used far more than any x-ray machine in a medical facility). While the officer explained the process, it was a complete waste of time.

This past trip, at the San Diego airport they were only putting select people through the full body scans, but for some reason that didn’t speed things up. I arrived at the airport at 5:30 am for a 6:40 am flight, but by the time I made it through security at 6:10 am, everyone that wasn’t stuck at security was already on the plane. The screening process is getting longer and longer and I don’t think we’re any better off than years ago. All the statistics say that air travel is safer than driving. Many experts say that we need to profile, but this would be considered discriminatory. It’s easy for me to say we should do this as my physical characteristics wouldn’t make me a candidate for profiling.

While in the Portland airport, I had dinner at a restaurant past security. I was given a knife for my meal. While the knife wasn’t all that sharp, it was a piece of steel and as anyone that has watched a movie or TV show knows, pretty much any flat object can become a weapon.

We have spent far too much money on this ridiculousness that isn’t making us safer and is wasting our time. To be comfortable, I’m going to have to arrive at the airport an extra half an hour early in case the TSA decides to frisk everyone; for this trip, it would have meant getting up at 4 am! Uggh!

Amazing advancement in digital video

Over the last few years, the advancements we’ve seen in digital video absolutely amazes me. Since I recently converted all my videos to a format that can be displayed on the iPad, I’ve been watching a bunch of video with my son as he loves watching videos of our dog. Using AirPlay on the iPad streaming to the Apple TV, we can watch the videos on our 37″ TV.

As we watch the movies, I can clearly tell which camera we used to take the video. Some of the older video is just awful and is quite grainy like half of the videos we seen on the news from people’s cellphones.

My first modern day digital camera that I bought in 2003 was an Olympus Digital Stylus 300 that shot 3 megapixel still pictures with no ability to shoot video. My next camera that I bought in 2005 was a Pentax Optio S5i that shot 5 megapixel still pictures and 320×240 video. Since the 320×240 video was pretty awful, I had a Panasonic Mini DV camera which shot video about 4 times the resolution of the Pentax (720×480). However, the Mini DV camera became a pain to carry and a second device just wasn’t convenient. So when I saw the Flip that shot at 640×480, I bought one as I wanted to capture all the moments of my son’s life (like any good parent). The Flip worked well and we took a lot of video, but like the Mini DV camera, carrying a second device basically proved to be the end of the Flip.

As I wanted better video, in 2009, I went with a Canon PowerShot SD960IS which takes 12 megapixel still images and 720p video. 720p is 4 times the resolution of the Flip and 16 times the resolution of the Pentax! This increase in resolution is amazing and makes a huge difference in the experience of watching video.

In just 8 years we’ve seen compact digital cameras go from having no capability to shoot video to overpassing standalone consumer video cameras. The consumer cameras we see today in some ways are better than commercial video cameras of just a few years ago.

Is there such a thing as too many features?

I recently bought a new Sony Cyber-Shot DSC-WX9 and after scouring the manual, I have to ask is there such a thing as too many features? The main feature I was looking for in a new compact digital camera was the ability to record videos in a format that the iPad could directly read.

The Sony has all the buzz words and more; it has image stabilization, 3D shooting, 1080i video recording, motion detection, background defocus, iSweep Panorama, backlight correction HDR, and something called Smile Shutter technology (which is actually quite cool where it takes a picture when it detects the subject smiling). I’ve figure out how to use a few of the features, but how am I going to remember to turn on a feature when I want to take a picture? I have no idea. Worse, I have to explain to my wife how to use it and use some cool features.

Does the average non-techie person figure out how to use 1/4 of the features of the devices? Should manufacturers reduce the number of features and make them easier to use? I doubt this will happen as features sell devices even if people don’t use them.

Broken Xcode 4 project templates

The other day I received a crash report from one of my projects that included a symbolicated crash log. This was very strange as I’ve never received a symbolicated crash log for an iOS project; I’ve always had to match it up with the dSYM file that I’ve stored away. After a little research, I found that some settings in the project didn’t strip out the debug symbols. I found an older article on Apple’s developer site that seemed to address this. I flipped on the switches and the project size dropped by 500K which would make sense.

The next step was to see how I missed these switches. The default Xcode 4 template for an iOS navigation based app has the following:

STRIP_INSTALLED_PRODUCT = YES

for the release build. However, the article above indicates that the following flag must also be on for the above one to have any effect.

Xcode provides several built-in options for stripping executables of their debugging symbols. One of these is the Strip Linked Product build setting. While typically set, it has no effect unless the Deployment Postprocessing setting is also set. Deployment Postprocessing is a master switch that enables the action of a host of other build settings. It’s approximately analogous to running the xcodebuild tool with the install command.

DEPLOYMENT_POSTPROCESSING = YES

Unfortunately it’s a bit hard to test with a basic project as the file size is too small. However, I opened the CTPageViewer sample app and tested with DEPLOYMENT_POSTPROCESSING on and off and with it off, the file size was definitely larger indicating that the flag must be set to YES.

So, did Apple mess up the default project? If you have your own template (which I might cover in another most), you can change the settings. If Apple didn’t mess up, what am I missing?

The end of a long (banking) relationship

Almost 20 years ago, I opened a bank account with Security Pacific right before I started college. Security Pacific merged with (the now) Bank of America while I was still in college, so I became a Bank of America customer. I continuously had an account with Bank of America since then, but last year I moved all of my accounts as my free account was going away (it was tied to my mortgage that I moved). I hung onto a free account to keep the ability to have a safe deposit box there.

The other day I received a letter from Bank of America saying that my free account would cost $12 per month unless I kept a minimum balance of $1500, something that I have no interest in doing as I already moved my funds somewhere else. My choices of finding a bank with a free account in order to have a safe deposit box are pretty limited, unfortunately. My current bank doesn’t offer safe deposit boxes (in fact only has 1 financial center in the county, but will be adding another that will just be a financial center). I’ve heard ads for San Diego County Credit Union on the radio all the time, so I decided to take a look. All they require is a $50 opening balance for a savings account with no monthly fee. In addition, the safe deposit box prices are lower than Bank of America. The only downside to this switch is the location isn’t as convenient as the Bank of America down the street (it now will take me about 10 minutes to drive to my box).

Next week I’ll be closing out my Bank of America account and ending almost 20 years dealing with them. Of course, no one cares about it, but it seems to me that companies would make some effort to keep customers instead of driving them away with fee after fee after fee. Our tax dollars helped bail out banks and they repay us customers by charging us more. While I’m just starting with a safe deposit box at the credit union, who knows what the future may bring. Their auto loan rates are pretty good and I’d consider a mortgage with them if the rates are good.