Fix Tab Focus in Xcode Debugger

My friend Alaric showed me something great today in Xcode preferences that makes debugging a little less painful. Alaric wrote an awesome HDR video app for the iPhone called Flare. You should get it, seriously.

As for Xcode, one thing that can be annoying is when you’re working in one of your tabs and you start debugging. As soon as you hit a breakpoint, the tab you are on changes focus to the breakpoint. Over time, you’ll find you have several tabs of the same file open, and you end up losing your sense of place.

No more!

You can fix this problem by changing behaviors in Xcode preferences. All you need to do is turn on Show Tab for Run Pauses and Run generates output behaviors. Screen shots below:

Run Pauses behavior settings

Ren generates output settings

New Rackspace Cloud iPhone Server View

I’ve redesigned the Rackspace Cloud Server view for our iPhone/iPad app, and I’d like to talk about the design and solicit feedback.

Rackspace Cloud iPhone Server View from Michael Mayo on Vimeo.

First, you’ll notice that the view has three layers to it. The bottom layer is a standard grouped table view with details and actions. The middle layer has two buttons: Reboot and Ping IP. I chose these because these are the most common actions you’ll probably want to perform on your Cloud Server while you’re on the go. The top layer shows the name of your server and its current status. The color of this layer is tinted based on the status. If you’re in a failure state, it pulsates red. If something is happening, it pulsates orange, and if the server is ACTIVE, it’s a non-pulsing green.

The next element of this new UI is how it scrolls. I’m considering the layers to be sorted in 3D space by order of importance. The status is most important, rebooting and pinging are the next most important, and the details and other actions are the least important.

So, to emphasize the importance, the name and status layer scrolls slower than the other layers, and the reboot and ping layer scrolls slower than the details layer (which scrolls at the standard speed).

How I Smoke Memphis Style BBQ Pork Ribs

When I moved from Memphis to San Francisco two and half years ago, I quickly discovered that California BBQ restaurants were woefully inferior to anything I’ve ever had in the South at a restaurant or competition, so I decided to build a Backwoods Smoker and learn how to do it myself.

Luckily I have family and friends on multiple Memphis in May  BBQ teams.  My sister is in Boar’s Night Out, my late cousin was in 10 Bones BBQ, and a friend of mine is in Pork U.  I’m also a Racker, so I’m sure quite a few of my Texas based coworkers will give me some great advice in the years to come.

After several conversations, competitions, online research, a great smoker, and some experimentation, I’ve put together a nice and easy way to make fantastic ribs.  Since I make a living writing open source software and believe information should be shared as freely as possible, I’m going to share it all here.

Also, in the spirit of open source, I’ve put this up as a Github Gist.  Fork and improve it!

Things you’ll need:

  1. A high quality smoker.  Cheap smokers don’t hold consistent temperatures, and that’s the most important variable in cooking ribs
  2. Baby back ribs.  In San Francisco, I’ve found Golden Gate Meat Company to be the best butcher around.  Wherever you live, try to find the best meat source you can.
  3. A box or bag of apple wood chips.  Apple tastes better than hickory or mesquite, and you don’t have to worry as much about over-smoking your meat.  I hear pecan wood is also good, but it’s not readily available in California, so I’ve had no experience with it.
  4. Saran wrap
  5. Toothpicks
  6. A spray bottle
  7. Apple juice
  8. Charcoal.  I prefer natural lump charcoal.
  9. A chimney to light your charcoal and a newspaper.  Lighter fluid is gross and smells bad.  Use the newspaper!
  10. Dry rub and sauce.  I prefer Willingham’s Original rub and Sweet and Sassy sauce.  It’s so good that I haven’t bothered taking the time to learn how to make my own yet.
  11. A large disposable casserole dish.  (This isn’t required, but it’s worth it to simplify cleanup when you’re done.)
  12. Brown sugar

How To Do It

The night before you’re smoking ribs, take the ribs and liberally apply your dry rub to all sides of your baby back slabs.  Try your best to entirely cover the entire surface.  Don’t rub it in, though, just cover it.  Wrap each slab in Saran Wrap and put it in your disposable casserole dish.  When you’ve rubbed all of your slabs, put the dish in the fridge.  If you didn’t buy a casserole dish, use the lowest shelf in your fridge, because juices are going to drip all over the place.

Go to sleep.

When you wake up, take your ribs out of the fridge and place them on the counter.

Start heating up your smoker.  I light charcoal in the chimney and boil water to put in the water pan.  You don’t have to boil the water, but it will save a little time.  Also, don’t completely fill your water pan, because you may want to use some cold water later to bring the temperature down if your smoker starts getting hotter than you want it to.

Unwrap your ribs and apply another coat of dry rub the same way you did the night before.

Now, take your spray bottle and fill it halfway with water, and then fill the rest of it with apple juice.

Ribs taste best when you cook them between 200 and 225 degrees Fahrenheit for several hours.  Keep in mind, however, that your ribs will be a little cold when you put them in the smoker, so get your smoker a little bit hotter than that so that you reach your target temp quickly when you put the ribs in the smoker.  If I’m cooking 6-8 slabs, for example, I get the smoker to about 240-250 before putting the ribs in.

Once you have the ribs in the smoker, it’s time to apply smoke.  Smoke works best at the very beginning of the cook.  After a couple of hours, the surface of the ribs will harden a little and smoke will not penetrate the meat as well.

Throw a handful of wood chips in your firebox and enjoy the smell.  When you see less smoke coming out of your smoker, add another handful.  Keep an eye on your smoker temperature, because the wood will heat it up some.  If it starts to get too high, close the vents on your smoker or add some cold water to the water pan.  Don’t open the chamber too much, though, because your temperature will vary too much.

After about an hour, stop adding wood.  If you smoke the entire time, your ribs will have a bitter ashy taste.

Now that you’ve been smoking for an hour, open your cooking chamber and spray the ribs with your apple juice + water combo.  This helps the meat from drying out and also makes for a nice bark.  You should spray your ribs every hour.

For the last hour or two, you can get a nice subtle sweetness to the bark by sprinkling brown sugar over the top of your slabs.  The brown sugar will melt and caramelize.  Trust me, it’s good!

For the last 30 minutes, mop your sauce over the top of the slabs.

Some people like to wrap ribs in foil at the end with apple juice to add a little moisture.  I’ve found this step to be unnecessary and too labor intensive, so I don’t do it.  Some people also like to put the ribs on a hot grill for about five minutes at the end, but I find that step also unnecessary.  But you might as well try it out and see how it works for you.

My total cooking time tends to be between 5 and 6 hours.  Your mileage may vary, but I find the easiest way to test without breaking off pieces is to do a toothpick test.  It’s basically the same technique people use when baking cakes.  Stick a toothpick in the cake, and if it comes out clean, the cake is done.  For ribs, it’s a little different.  Take the toothpick and place it in the ribs from the side between two bones, and pay attention to the resistance.  If you can insert the toothpick with little to no resistance, your ribs are ready to eat.  If it’s stiff, keep cooking.  If you’re paranoid after that, take a rib off and see how it tastes!

Enjoy!

A Simple Wrapper Around the iOS Keychain

If you’re saving passwords or other sensitive data in your iPhone or iPad app, you should use the built in Keychain.

Unfortunately, the Keychain is slightly painful to use. I found a nice wrapper by Dylan Barrie, and I’ve simplified it to make it even easier to use and more generic. To use, you need to include the Security framework in your app (right click Frameworks and choose Add Existing Framework…).

This is used in version 2.0 of the OpenStack/Rackspace Cloud app.

Example usage:


[Keychain setString:@"my obscure password" forKey:@"password"];

// later on…
[Keychain getStringForKey:@"password"];

Code is here:
https://github.com/rackspace/rackspace-ios/raw/master/Classes/Keychain.h

https://github.com/rackspace/rackspace-ios/raw/master/Classes/Keychain.m

iPhone OS on Apple TV

Today TechCrunch posted an article speculating about an iPhone OS powered Apple TV, and said it could be a problem for developers because they would have to deal with another (even variable!) screen resolution.

I’m an iPhone/iPad developer, and I have to admit that before the iPad I would use hard-coded pixel values when building apps. I knew it was a bad idea, but there was only 320×480, and I was in a hurry to publish. With the iPad, I don’t think that way anymore.

The bigger challenge for an iPhone OS Apple TV, in my opinion, is that iPhone OS is designed for multitouch interfaces, and the current Apple TV is designed to be used with a (very) basic remote control.

If I were Apple, I would build a new Apple TV that has no remote control. Instead, it would be controlled by an iPhone, iPod Touch, or iPad. Touch the screen on your mobile device and then show a pointer on the TV, sort of like a Wii. This could make for some amazing user interfaces and take Apple one step further to living room / home domination.

Anyway, that’s my $0.02. Back to coding (I released an RSS parser for Cocoa today).

Best Day Of My Life

I drove a Maserati:

Mike Mayo in a Maserati

and I’m about to go on a BBQ journey:

Memphis in May BBQ Fest

Awesome Kentucky Derby Party Hat

At the party, I’ll be drinking my regular libation, which is the official bourbon of the Kentucky Derby: Woodford Reserve. I got the hat at Goorin Brothers in the Upper Haight in San Francisco.

Mike's Kentucky Derby Hat

Control Z Order of Views in Android’s LinearLayout

Unfortunately, LinearLayout in Android does not provide easy access to a z-index property for views.

So, if you want to control the z order, you need to order your views properly. The z-index of views goes up as views are added.


<ImageView
android:id="@+id/view_server_os_logo"
android:layout_width="700dip"
android:layout_height="700dip"
android:adjustViewBounds="true"
android:layout_gravity="left"
android:src="@drawable/ubuntu_large"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dip"
android:layout_marginTop="-700dip"
android:text="Server Name"
/>

In this case, I move the TextView up 700 pixels and it will sit on top of the ImageView because it comes after the ImageView in the layout XML.

Remove Expect header in Android’s org.apache.http

The removeHeader() call won’t work for you. You have to remove a request interceptor.


DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.removeRequestInterceptorByClass(
org.apache.http.protocol.RequestExpectContinue.class);

This took me a while to track down, unfortunately, so I’m blogging it here so others can hopefully save some time.

Rackspace Cloud Pro 1.1

Today I’m submitting the first update to the Rackspace Cloud iPad app.

New features include:

  • longer timeouts
  • password lock
  • multiple user accounts
  • minor bug fixes
  • email cloud files as attachments
  • email links to cdn-enabled cloud files
  • ping IP address uses web view in the app

Multiple User Accounts
Settings Screen
Email Files as Attachments
Ping IP Addresses