I feel like I’m just waking up from an awful nightmare. Actually “waking up” might not be the right expression since I haven’t slept in 30 hours but you get my point. Let me tell you my little story.

2 years ago, when the iPhone 3G came out in Belgium, I had been waiting for an iPhone for so long that I simply couldn’t help being there on the first day. So when Mobistar launched a small marketing stunt by starting selling the iPhone at midnight, I decided to wait in line. And I did. From 4pm the day before until I received the iPhone 3G number 50 for all Belgium at 2am in the morning. The experience was painful at the end, especially because I had totally forgotten to bring a chair. But overall it was very rewarding and I was very positively surprised by the way Mobistar had organized the whole thing.

Last year, I completely missed the iPhone 3GS launch so I had a few hard weeks trying to find one.

That’s why this year, for the iPhone 4, I decided to go wait in line in the biggest Apple Store in France, in Paris, at Carrousel du Louvre. Oh my! What a disappointment! Just to sum it up so you can imagine what mood I’m in: one sleepless night, more than 300 euros in train and parking tickets, 15 hours in line including 8 hours standing, hence 2 feet hurting like hell… and not one single iPhone 4.

I was there at 9pm yesterday. Everything started nice. I was only the tenth in line. I had just bought myself one of these very comfortable and robust camping chairs. I had my iPad and some WiFi. I enjoyed it. And then things progressively but rapidly went very wrong. In front of me, there was a bunch of Russian guys who started drinking uncontrollably, and since there was simply no organization whatsoever, nothing prevented their Russian friends to join them late in the night, without any respect for the guys who had been waiting here for long hours. Then the rumor started to spread that the Carrousel galleries would open at 4am exceptionally. So when 2 security guards approached the door, no barrier, no Apple guy, nothing or no one prevented the line to turn into a big compact crowd where last come became first served. And we waited there for nothing to happen, standing, from 4am to around 6am. Eventually the security guards ended up opening the door. In fact not THE door we were all anxiously waiting in front of. No! Too easy! Another door on the side of the gallery, resulting in a chaotic and unbelievable crowd movement that finished up the last bits of line order there was.

So it was around 6am when other security guards started to appear, and those guys obviously had no clue how to handle a crowd, let alone an international one (have you ever tried to reason with a drunk Russian guy?). They just yelled at us, ordered us to move backwards and then forwards again, a couple of times, and at 7 am we had yet another differently ordered “line”, standing. But at least the security guards managed to maintain some sort of discipline by filtering who could enter the queue right in the middle for some reason. An Estonian guy behind me successively introduced his wife and his girlfriend. Of course, once they were in the line, they couldn’t care less about the dude.

And then around 7:30am, guards started disappearing again, obviously called to greater ventures down in the galleries, and chaos came back until they started letting people in, in small groups, a little before 8am. We thought “that’s great, they’re letting people in at the rate the Apple Store can process their purchases.” There were around 150 people in front of me (remember, I was 10th in line at the beginning), so I figured I might be able to execute my plan and catch my train back at 9:25am. How foolish of me!

There was another line inside the gallery! So the small groups who were let in all started running in order to win a few precious ranks (remember, I had not slept in 24 hours at that time, very practical to run like crazy!). But wait, it gets worse, there was not one line inside the gallery. There were 2!!! One for us fools who hadn’t reserved our precious little one. And one for those who reserved it online and just came to pick it up. Wait! What? Pick it up! Why aren’t those guys just waiting at home for the postman to come by and bring them the precious little one in the comfort of their home? What the heck is this pick-up thing? And soon we realized that they were letting people inside the Apple Store in a proportion of 8-9 reservations for 1-2 people without reservation. Wait! What?! What the hell is the rationale about that? At most, reservation is supposed to guarantee that you will have one, not that you will have one before everyone else!

But wait, it gets funny too. Remember those proportions? I said nothing about the rate. According to our estimation, it took somewhere around 15 to 30 f***ing minutes for a blue-shirt-guy to process one customer. 30 minutes! So guess what happened? The line of reservations grew longer and longer with fake reservations, the line of non-reservations turned into yet another big chaotic pack, security guards kept yelling at us, ordering us to move backwards. Yes, backwards! All of that while the Apple store seemed to be able to process somewhere around 20 persons per hour. So the pack I was in moved 10 meters in 4 hours, I kept seeing people without reservations suddenly changing lines magically and getting out with 4 iphones at once. And yes, at 12pm, I gave up!

I decided my body had taken enough stress. I stepped back and realized that an iPhone was not worth that! Especially not a black one anyway! So I just left the queue, went back to the train station, bought another train ticket at an indecent price hoping that I would get back home as soon as possible to spit out this bad nightmare and forget everything about it.

And here we are. It’s 4pm. I don’t have any iPhone 4, I’m frustrated and I’m pissed. I’m so pissed at Apple right now. If someone from Apple is reading this, read it carefully! Not only am I a basic fanboy of yours, but I’m also an iPhone/iPad developer and my 2 modest apps on the App Store participate in the great ecosystem that allows you to sell all those magical devices. And even without all of that, I really expected from you a buying experience at least equal to the one I had with the little Mobistar 2 years ago. And in the end, no organization whatsoever, no one from Apple to handle the logistics in the queue late in the afternoon, no one to give clear and consistent instructions to those security guards, no communication about why things were so slow. And slow they were! And chaotic too. Several people fainted in the line, a lot of people cheated, everyone was pissed off to a point you can’t even imagine. Now let me tell you this and read my lips: if that’s the only possible outcome of your corporate ego going through the roof, if all you can do is treat your most loyal customers like this (check my recent purchase record), then I SUDDENLY FEEL LIKE BUYING AN ANDROID PHONE (and developing for it!). But you don’t care, right? Because so many people are buying it anyway…

I’m exhausted. I’m starving. I’m frustrated. And all I can do right now is spit it out on my blog and laugh at myself for being such an overly optimistic fanboy consumerist. And all I want to do is forget about this day. Apple, you just created the new worst day of my life so far as I can remember. And I don’t thank you for that.

Still one session to attend about closures in Objective-C, and I’ll call it a week. A little bit of shopping this afternoon in order to spend my last dollars and I’ll be ready for take-off tomorrow afternoon. So it’s time for a little summary of this week.

Overall, it was my first WWDC and I’m very glad I did it, but I probably won’t do it again. San Francisco is definitely a very nice city, and seeing Steve in live, even from very far away in the audience was an interesting experience. I also learnt a few very interesting things and psychologically a conference like this always has the same side-effect on me: first I’m depressed and humbled by all the ambient intelligence, but then it motivates me a lot to move forward, learn and do something about it. So it has definitely been a very positive experience.

I have hesitated for a long time… a few hours that is. But given my geek reputation (of which I’m still proud by the way), I could just not avoid it: I have to say something about the iPad. Of course I was following the keynote live yesterday with a bunch of geeks in Café Numérique, in Brussels. And of course I was very excited about it. Now instead of writing long sentences about what I like and don’t like about it, I’ll just go over my impressions quickly:

I don’t really like the name, but iSlate would have been worst and Macbook Touch was clearly not adapted

I love the device itself, and yes I’m gonna get one as soon as it’s released. I’m planning a trip to WWDC in June and hopefully I can bring one back

it really is yet another game changer. Apple did with the iPad to the Tablet PC segment what they did with the iPhone to the smartphone segment: bypass the professional market, make it a general public appliance. Brilliant!

it will create a whole new market for new applications on the App Store, I can think of a few ones myself

I don’t care that it doesn’t have multi-tasking, I’ve never needed it and reactivity is too important for me

demonstrations in a couch, what a great communication symbol!

I don’t care about the batteries being sealed, so long as it gets me more battery-life

I hope there will be an Apple Care on this one

Absence of SMS and phone capabilities: it’s not a phone anyway

No front camera: who really uses video-conference in the general public anyway? Video-conference in a couch? Come on!

The price tag is just awesome. The top one is cheaper than my 3GS

I’m so glad I didn’t get a Kindle DX or a Nook as I intended to. By the way, even though e-ink is more comfortable to use, I think the generic aspect of the device and the availability of the iBooks store are going to marginalize specialize eBook readers

Stop it with the “giant iPhone” complaint. And laptops are mini-desktops, so what?

Now in parallel to all those impressions, I couldn’t help to see those floating images in my head, of websites with big blank areas and a blue logo, I could even hear those blank areas whisper in my ears: “No Flash support…. ouuuuuuuuhh… No Flash support”. Yes, I know, I’m going nuts. My first thought was “how are you going to explain your daughter that she cannot use the iPad to access her favourite color painting site with her fingers because there’s no Flash?” For such a general public family appliance, it just doesn’t make sense.

But then I started reading blog posts and comments about the announcement, and the frustration turned into anger. Anger against Apple and Adobe who can’t seem to find a common ground on this issue. But more importantly angry against all those self-proclaimed death prophets, all those open standard ayatollahs claiming that they don’t care about Flash since Flash is dead anyway, and Flash is closed and proprietary, and Adobe is all evil, and HTML5 is going to rule the world. And it kind of woke up the Flex developer beast in me, I turned all green, I tore my shirt apart, going all…

FUCK HTML5 !!!

And then I started punching around.

First off, Flash has evolved a lot in the past few years: Flash is not just used for ads anymore. It powers the vast majority of videos on the web, plus a lot of multimedia websites that we love and use everyday (Deezer for example, Google Finance, etc.)

Second, Flash is not completely open, but it is far less closed than what a lot of people know: Tamarin, the Flash virtual machine, the basis of the Flash plugin, has been donated as Open Source to the Mozilla foundation 3 years ago, SWF (Flash file format), AMF (Flash remoting protocol), RTMP (Flash realtime communication protocol) are all open specifications that allow anyone to write their own Flash plugin (with a licence, but still) or generator. Plus Adobe has gone a long way in opening up its tools and processes for the Flash platform as a whole by open sourcing the Flex SDK, creating the Open Screen Project, and I could go on and on. I’ve met some of the openness evangelists inside Adobe and I can tell you that they’re doing a great job opening up what used to be a very protective and old-school company. And it’s just the beginning.

Third: being an open standard is not a f***ing feature for Steve’s sake! If using committee standards means I have to wait for 10 years before any evolution becomes available (how long has W3C been working on HTML5? how long before it is finalized), if it means going back in time on problems we thought had been solved for good (like the video codec hell coming back from the dead), if it means having to spend hours tweaking my web applications so that they look and behave the same in all browsers, then I don’t give a sh*t about open standards. Where is the added value?

Fourth, I can already hear you yell at me about the last argument: “we just can’t let one (evil) company have so much control about a web technology!”. And still that’s exactly what Sun has been doing with another omnipresent web technology: Java. And very few people ever complained about it. And what about Google with Android? The truth is that, from a developer standpoint, having one company orchestrating the evolution of such a huge technology is very good: it guarantees a certain level of consistency, so that we don’t have to deal with compatibility issues between different implementations. It’s also a good point for stability, knowing that you will always have backwards compatibility and professional support on the long term, and that you can invest safely in the technology. And of course it’s excellent for efficiency, because they don’t have to waste time on endless arguments about who’s got the bigger video codec or whatever, so it evolves fast.

So that’s it. I hate HTML, Javascript and CSS, I do it when I have to, but it’s not development, it’s tinkering. And I hate all those people spreading FUD about Flash without knowing what they’re talking about. And I love the Flash platform, and what Adobe is doing with it. I just hope Adobe and Apple will eventually reach an agreement to bring Flash to the iPhone and iPad. And I hope Adobe will do some PR to fix their image because there’s a big problem there.

Yesterday evening has been quite a night. I was watching a movie with a friend of mine when my cell phone rang, with a US number on screen.

Hi, I’m calling from Apple. I’m finishing the review of your MooPlan app. But I just miss a few things before it can go on sale.

I sent the application for review about a week ago, and 24 hours after that, I received feedback from Apple requesting me to modify 2 icons that infringed Apple’s trademark. No big deal, the app was resubmitted with the hour. And then I didn’t have any news for a whole week, and I was not worried because I had read so many people complain about the slow review process and the impossibility to get in touch with anyone inside Apple.

And then BOOM! A guy from Apple calls me twice the same evening, just to get my application in store as fast as possible. And a few minutes after the second call, TADAAAA! MooPlan 1.0 is ready for sale. Isn’t it great?

So ladies and gentlemen, it’s my pleasure to announce that my first iPhone application is on sale, and you can get it here for $0.99 or €0.79. If you want to know more about what it does, head to the official website.

Just a few thanks:

Special thanks to Groovy and Grails communities for producing such a great productive Java platform that allowed me to focus on the iPhone side of things. Grails was really ideal for me: RESTful services are so easy to build, and scaffolding is just great to quickly produce an administration interface. And it was so fast to learn! I didn’t know anything about Groovy and Grails 6 months ago. And thanks also to Guillaume Laforge and his buddies for the tweets.

Have you ever tried to organize a meeting or a gathering of some sort, whether it be for business, a birthday party or something like that? Well, if you have, you have certainly experienced the pain of finding the right moment when everyone is available at the same time. When one is available, another one is not, and vice versa, and then people change their mind. Really painful.

Fortunately for us, there are solutions on the web. One of them, and the one I use all the time, is called Doodle. Basically, what Doodle allows you to do is to set up some sort of a quick poll, saying “I want to organize such event and I propose a few time slots”. When your poll is created, you send an email to all the people you want to invite, with a link to your online poll. Invitees go there, check boxes to say if they are available or not on each slot, and once everyone has answered, you can determine which slot is the best option. All good, right?

Well, this solution is better than nothing, but it still has 2 major shortcomings. First off, it’s not integrated with anything like your mailbox, your address book or your agenda, which means you have to enter all the information manually, and invitees have to check their agenda manually too. Second, it’s on the web, which means that you can only organize meetings or check your availabilities when you are connected. Those shortcomings have a very important consequence: it can take an awful amount of time to get everyone to reply and send the final invitation, which means that the first invitee to answer might not be available anymore by the time your send him the final date… and we’re back where we started.

I use Doodle a lot, for business meetings, for Poker games with friends, and so on, and I’ve seen that happen a lot. And boy it’s frustrating. Then a couple of months ago, I was playing with my iPhone and I thought “Wait a minute! I have my calendar, my emails and my address book in there. Wouldn’t it be nice to integrate all of that to make it easier to set up gatherings?” Guess what! That’s what MooPlan does now!

The organizer sets up a meeting, gives it a title, a description, invites a few people from his address book and proposes a few time slots. Then he sends all of that to MooPlan which dispatches invitation emails to everyone.

Every invitee gets an email with a link inside. If they are reading the email on an iPhone, they can click a link to install MooPlan application from the App Store, if they have not already done so. If they have, they can just click the other link to open the invitation directly into MooPlan. They click on the slots on which they are available, and they reply.

Back to the organizer, who sees how many people have already replied. And when enough people have, he just chooses a time slot, clicks “Send Final Invitation”, and BOOM! All the invitees get another email with the final date, location, and all the details of the event.

Now I know what you’re thinking. How is that better than Doodle? Well first, it works on your phone, natively, without any weird web interface, so it’s very easy to use, and you can organize meetings and reply to invitations on the go. Second, it’s already integrated with your address book and your emails. Now of course it still misses integration with the most important part: your calendar. Wouldn’t it be awesome if MooPlan could automatically check your availabilities, or create events in your calendar? Sure it would, and the good news is that MooPlan will do just that… once those capabilities are available for iPhone native applications. And with all the fuzz going around concerning the next version of iPhone internal software, good stuff is coming, that’s all I can say for now. This is just a first version.

When is it going to be available? Well, not tomorrow. I’ve just completed the first full cycle, but there are still a few things to fix, and a lot of testing to do. I don’t think I will be adding any new features in this release, even if I have plenty of ideas. Hopefully, I’ll be able to send it to Apple by mid-April. So stay tuned…

Fortunately, I stumbled upon this great blog with plenty of very complete and up-to-date tutorials. There is this especially this TodoList example that taught me how to do most of the things I couldn’t figure out by myself just by reading the code of the Books sample.

But at the end of that tutorial, I realized that a very important part of my code was made of boilerplate and ugly ANSI-C code to setup database stuff, like in the old days of JDBC. Google was my best friend and allowed me to find SQLitePersistentObjects. And boy it works great! And it makes the code so simpler. Make your own mind:

This used to be the application launching code:

- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self createEditableCopyOfDatabaseIfNeeded];
[self initializeDatabase];
// Configure and show the window
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
// Creates a writable copy of the bundled default database in the application Documents directory.
- (void)createEditableCopyOfDatabaseIfNeeded {
// First, test for existence.
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"todo.sqlite"];
success = [fileManager fileExistsAtPath:writableDBPath];
if (success) return;
// The writable database does not exist, so copy the default to the appropriate location.
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"todo.sqlite"];
success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&amp;amp;amp;error];
if (!success) {
NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
}
}
// Open the database connection and retrieve minimal information for all objects.
- (void)initializeDatabase {
NSMutableArray *todoArray = [[NSMutableArray alloc] init];
self.todos = todoArray;
[todoArray release];
// The database is stored in the application bundle.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"todo.sqlite"];
// Open the database. The database was prepared outside the application.
if (sqlite3_open([path UTF8String], &amp;amp;amp;database) == SQLITE_OK) {
// Get the primary key for all books.
const char *sql = "SELECT pk FROM todo";
sqlite3_stmt *statement;
// Preparing a statement compiles the SQL query into a byte-code program in the SQLite library.
// The third parameter is either the length of the SQL string or -1 to read up to the first null terminator.
if (sqlite3_prepare_v2(database, sql, -1, &amp;amp;amp;statement, NULL) == SQLITE_OK) {
// We "step" through the results - once for each row.
while (sqlite3_step(statement) == SQLITE_ROW) {
// The second parameter indicates the column index into the result set.
int primaryKey = sqlite3_column_int(statement, 0);
// We avoid the alloc-init-autorelease pattern here because we are in a tight loop and
// autorelease is slightly more expensive than release. This design choice has nothing to do with
// actual memory management - at the end of this block of code, all the book objects allocated
// here will be in memory regardless of whether we use autorelease or release, because they are
// retained by the books array.
Todo *td = [[Todo alloc] initWithPrimaryKey:primaryKey database:database];
[todos addObject:td];
[td release];
}
}
// "Finalize" the statement - releases the resources associated with the statement.
sqlite3_finalize(statement);
} else {
// Even though the open failed, call close to properly clean up resources.
sqlite3_close(database);
NSAssert1(0, @"Failed to open database with message '%s'.", sqlite3_errmsg(database));
// Additional error handling, as appropriate...
}
}

And this is just one example. All the CRUD operations are so much simpler. And I didn’t even need to create the SQLite database. It’s almost a shame Apple didn’t include such a framework in the SDK. For your curiosity, you can download the project here.

I love it! Now I should be able to get my hands dirty with my real project. More on that later ;o)