Jul. 20, '10


by Mark Eirich

Cure flat forehead phenomenon in 10 minutes

If you get stuck on a problem in your HTML, JavaScript, CSS, or other code, stop banging your head on it and ask for help. With the wildly popular website Stack Overflow, it’s faster than ever to get the answer you need. Gone are the days when you have to slog through page upon page of mailing list archives to find, finally, that the problem remained unresolved.

The genius of Stack Overflow is that it rewards those who give great answers. Programmers race to answer a question faster and better, receiving “reputation points” when you accept their answer.

Many questions are answered within minutes of being posted, and some get their first response within a matter of seconds. In some cases, however, a question will go unanswered for a long time. Here’s how to get answered quickly:

  1. Use the search box at the top of any page on the site to see if the question has already been asked.
  2. Log in. OpenID is supported, so you can use your Gmail or Yahoo! account to log in.
  3. Carefully write the title. Remember, people are racing to find questions that they think they can answer, so make it specific and concise.
  4. Describe exactly what you have tried, and include code snippets. The person attempting your question should be able to use the code you provide to reproduce the problem on their own computer.
  5. Format your code snippets. Indent the code four spaces, and it will appear in a gray box with syntax highlighting. Use the preview pane below the question box to check if your question is easy to read.
  6. Describe the symptoms. Never, ever say “it’s broken” or “it doesn’t work.” Instead, describe precisely what you expect to happen and what is happening instead. Include all error messages and any other clues.
  7. Help them help you. If an answer isn’t helpful, add a comment describing why. People are likely to revise their answer to make it more helpful if they think they can.
  8. Ignore jerks. Resist the urge to comment on rude comments or answers. If an argument starts, people are more likely to join the argument, rather than answer your question.
  9. Mark your favorite answer. The person who wrote it will then get a reward of 15 points, and you’ll get 2 points. Otherwise you’ll get a low “accept rate,” which reduces the chance that anyone will answer your future questions.

Jul. 13, '10


by Mark Eirich

Easily test websites on the iPhone / iPad Simulator

Read this article if:

  • Your client wants the website to work on the iPhone or iPad but you don’t own one yet.
  • You’ve been testing on an iPhone but would like to speed things up by using a keyboard and mouse.

iPhone Simulator can simulate both the iPhone and the iPad, and comes with Mobile Safari. In this article, I’ll show you how to install it.

Before you start, make sure that you are running Mac OS X version 10.6 (a.k.a. Snow Leopard) – click the Apple icon on the menu bar, then click “About this Mac.” Unfortunately, I’m not aware of a way to run iPhone Simulator on 10.5 (Leopard).

  1. Register as an Apple Developer (if you haven’t already)
  2. Follow links to “iPhone SDK.” If you are already logged in, this link will take you there.
  3. Click a link similar to “Xcode 3.2.3 and iPhone SDK 4” to download the SDK. It is a large file, so have your newspaper or knitting at the ready.
  4. Once the download is complete, expand and install it.

Unfortunately, the iPhone Simulator is difficult to find. Here’s how to add it to your Applications folder:

  1. Open Finder
  2. Press Command+Shift+G and enter “/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/” in the blank. This will take you directly to the folder containing “iPhone Simulator.app”
  3. Control+click on “iPhone Simulator.app” and click “Make Alias”
  4. Single-click on the alias and press the Return key. Type “iPhone Simulator” to rename the alias and press Return.
  5. Drag the alias and drop it on the Applications folder in your dock.

Now you can easily run iPhone Simulator from your Applications folder. For a great article describing how to use it, see Using iPhone Simulator from the iPhone Development Guide.

Please comment if these instructions don’t work for you.