Wednesday, October 29, 2008

Linking iPhone/iPod Touch with Xcode

I just spent the last hour or so trying to get my iPod touch working with Xcode so I could debug on the device

If you are having trouble after you have followed the instructions on Apples developer site, here's what to do:

In Xcode, right click the info.plist file and select open as text file. This will open the bundle as a plain text Xml file.

Find the Key:
CFBundleIdentifier
and below it will be a string element. Change the text between the element to your AppId minus the 10 digit number and the dot.

So for example if your appId is 1234567890.com.mycompany.myApp then change it to com.mycompany.myApp

Easy thing to do, but hard thing to solve.

Hope that saves someone the hours of frustration I had.

Tuesday, October 28, 2008

20 Second SQL tip

If you restore from a backup with NORECOVERY from the GUI it sometimes doesn't bring the database back online, even if the restore succeeds.

So if you are stuck with a database that no matter how long you give it, the status is restoring, or loading the following command should work:

RESTORE DATABASE databaseName WITH RECOVERY

Thursday, October 23, 2008

StackOverflow: the good, the bad, the ugly

The eternal dilemma for developers is finding the answer to their specific question. There are a number of sites on the web that try to help, some free, some not.

Stackoverflow is the latest attempt to create an ultimate resource for answers to programmers questions. It is the brain child of notable (or notorious depending on your view) doyens of the development community, Jeff Atwood and Joel Spolsky (who has Kiwi heritage).

The actual site is a work of genius. It is clean, clear and crisp and is, without a shadow of doubt, the best website engine of it's kind. Period.

I have been a member since the very early beta days. (User Tag is KiwiBastard BTW) In the early days there was a limited number of people on the site, but even so, questions where answered in quick time, and a question would stay on the front page a good amount of time, so that people had a chance to offer a reasoned answer.

Since then the private beta has gone public, the noise to signal ratio has increased. Post are only on the front page for a limited time. The questions are generally still answered but because there is more traffic, people rush an answer. It also appears that people won't bother answering a question once it has had a few answers. The reason for this is both the pro and the con of the site. The site is driven by a points and badge system.

Basically, you get points in a number of ways:

- Getting your answer upvoted
- Getting your question upvoted
- Getting your answer accepted

There are other subtle ways to get points, but it becomes addictive and like a game. So you find people don't bother answering a question that has been answered, because the chance of getting points is lower than answering a question that has no or few answers. While this is good because it means new questions get answered, it also means sometimes a question never gets a CORRECT answer. This is of course a problem.

The argument is, with more people, then there should be more eyeballs on each question so the net is the same as when it was a smaller audience. This argument seems to work in theory, I am finding in implementation it doesn't. The turnover of question is such that, a question just doesn't stay on the front page very long.

The other issue I am finding, is the tolerance for newbies is very low. People seem to get down voted if they ask a seemingly stupid question. Seemingly stupid to experienced developers, but we were all noobs once. I try to show tolerance to these people and answer their question the best I can, and maybe point them in the right direction. It's the fair thing to do, and I'm sure that Atwood and Spolsky would prefer this approach to down voting and alienating new developers.

Aside from the minor gripes, it is a great site. It will become the go to site for developers. Of that there is no doubt. I just hope that over time, newbies become better accepted, and people get use their upvoting ability a little more.

Tuesday, October 21, 2008

Nice Gmail Tip: plus-addressing

I was digging around the Gmail docs just to see what new stuff they've been throwing in there and came across something useful that I hadn't come across before.

A lot of people I know have multiple mail accounts some of which they use when signing up for stuff just in case for whatever reason that address gets "accidentally" sold to an organisation that will spam you silly. What Gmail does is provide a feature called "plus-addressing", which allows you to insert useful but ignored stuff into your Gmail address.

As an example:

If your mail address was myname@gmail.com (Apologies to Myna Me if you have an account) and you were signing up for something at "dodgysite.com" then you could supply the mail address in the subscription form as:

myname+dodgysite@gmail.com

The mails will still be routed to your account but if you start to get spammed and that address is being used then you have an idea of where they got your address from.

It's quite a nice feature and when used with filters can also be used to manage mail too so you could possibly give plus-addressed addresses to everyone and include some identifiable word in the address.

One thing to be aware of is that at some point if people start using this a lot then the spammers will start to circumvent it by striping out the +x part, but that doesn't seem to be the case at the moment.

EDIT: Nic points out quite rightly that this isn't strictly a Gmail feature but is part of the mail specs such as RFC5233 and yes, it is dependent on the site you're supplying the address to actually accepting a "+" (the latest version of Fring on iPhone doesn't even allow "."!!!!)

Thursday, October 09, 2008

Useful Vista Tip: Open Command Window

Windows 2000 and XP had a bunch of power tools that had great, but little enhancements to Windows that made doing geeky things just a little easier. Unfortunately, there are no power tools for Vista. The most useful power toy I found was the ability to open a shell command window from an explorer window, by right clicking in the window and selecting the "Open Cmd Window" option.

Well, it turns out this feature is baked into Vista, but hidden away behind the scenes. To get it to work you simply hold down SHIFT, while right clicking in the Explorer Window.