Facebook asking you to rate Places

I just noticed this, not sure if it’s new or part of their A/B testing. They’ve got a box on the right hand side asking which of two places I have previously checked into was better.

It looks like Facebook are trying to gather information about places so they can provide recommendations, much like foursquare’s Explore tab.

Have any of you noticed this on Facebook? Answer in the comments or on Twitter @arunstephens.

jQuery, posting arrays and square brackets

This is old, but new to me. I guess it shows that I haven’t been doing a lot of front-end work lately.

I am trying to post an array to a server, using jQuery:

$('#fbshare').click(function () {
$.post('url',
{ array: [ 'only one item' ] },
function() {
alert('done!');
}, 'json');
});

It turns out that %5b%5d is URL encoding for []. So jQuery “helpfully” making the arrays PHP-style. I don’t need, or want that, but according to this post on the jQuery forum, you can disable that functionality by setting jQuery.ajaxSettings.traditional = true;. I saw something else about disabling it will mean you can’t do deep nested arrays or some such, but I’ll cross that bridge when I come to it. When I post something, I want the name to be the same, not with square brackets after it!

Google.com from the UK

Today is 4th of July. There’s a Google doodle for it, but you wouldn’t know if you’re from the UK. Google.com is completely different if you are coming from a UK IP address. There is no 4th of July doodle, and what’s worse, you will get entirely different search results, with UK sites having more prominence. The results are slightly different from google.co.uk, as well.

I think it would be better for the regionalised Googles to be the same no matter where you come from, and that includes the US Google.com. What’s the point of the “Go to Google.com” link if going back there isn’t the real American Google?

I haven’t taken a look at Google.cn or Google.com.hk!

Rant over!

Modal view controllers and recursion causing stack overflow

Ironically, it was this post at Stack Overflow that helped me solve this problem!

There appears to be a bug (either in the iPhone SDK or my understanding of it) that if you dismiss a modal view controller with animation using UINavigationController’s dismissModalViewControllerAnimated, it will cause some sort of weird recursion that causes a stack overflow (over 4000 frames were in the stack when it crashed, and it took a split second for it to fill up in the Simulator) if you then want to display the modal view controller again using presentModalViewController.

It turns out it’s the animation on dismissal that’s causing the problem. If I have dismissModalViewControllerAnimated:NO instead of YES, the subsequent redisplay of the view works fine.

OpenID and iPhone apps

I am trying to find an OpenID implementation that is similar to the way that Facebook Connect’s login mechanism works on the iPhone. I can’t find anything, which is very surprising.

Does anybody know of an open source OpenID consumer implementation for iPhone OS? And if you don’t know of one, are you looking for one?

If I can’t find one, I am going to have to write my own, and it’s something that I think would do well to be open sourced, so if you are interested, please post a comment.

Skype for Mac Mood Message Feed

Why isn’t anybody writing about the “Mood Message Feed” in Skype for Mac 2.8? This version appears to have been out for a month now. I Googled it to see whether it was a Mac-specific thing or if the real version has it as well and I just haven’t updated to the latest version. There were 4 results (not including the ones that Google hid).

It says it’s a pseudo chat, showing the mood updates that your contacts make. It’s kind of like the Facebook News Feed (or whatever they are calling the home page this week). The top result talks about sending your mood messages to Twitter, so I guess this Mood Message Feed is a way for Skype to try and stay relevant in the “Twitter age”.

Why is the escape key labelled “esc” on the Mac keyboard but as a circle with an arrow pointing out of it in menus?

I have reluctantly bought a MacBook Pro so that I can develop iPhone applications as well as Android, and was searching for this mysterious key so that I could get Xcode to autocomplete for me.

Turns out the circle with a diagonal arrow pointing out of it key is actually the escape key.

Why make things so difficult, Steve?

Entity Framework 4 many-to-many

I had another problem with EF4 today. Code that worked fine in .NET 3.5 didn’t work after I regenerated the entity model using Visual Studio 2010.

I found an answer, again on Stack Overflow: http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework

It turns out that the generator decided that one of my foreign keys in an associative table should have a StoredGeneratorPattern of Identity, meaning it thought it was an identity column. When it isn’t.

But updating the XML as suggested in the answer above fixed it. So that’s good.