Thursday, December 18, 2008

When too much is too much ... #2

I'm finally putting the final touches to my NSKeyedArchiver/NSKeyedUnarchiver replacement. It's not that it's a complex things to do really, it's just that finding the time to do it with a 4 weeks old baby around is I found, a major challenge. Overall, I'm satisfied by how my archiver is doing since it's packing that simple object (1 uint + 1 float) I was talking about in my previous post into 44 bytes instead of the wasteful 232 bytes of NSKeyedArchiver (while still supporting keyed encoding, of course). That 44 bytes include a preamble which ,when needed, could be skipped, for example when storing a collection of objects into a same file, so the archived object really only take 35 bytes, which isn't bad all considered :-)

Monday, December 15, 2008

Mars Pathfinder

11 years ago, like many other space geeks, I was captivated by the Mars Pathfinder mission. It was the very first mission to have an Internet coverage (If I'm not mistaken), and it was also (of course) the first mission to feature a rover (only 10kg, compare this to MSL's 900kg!). Looking back at the mission pictures, it's amazing how we have grown accustomed to high-res imagery from the twin MER, to the point that pictures from their older cousin seems amateurish (likely your cell phone, an iPhone hopefully, as now a better resolution than Pathfinder's cameras had).

Anyhow, I'm talking about this today, 'cause I stumbled on a couple of YouTube videos, which are part of a 35 minutes documentary on the mission, which I though was good enough to share. So here are, in order, the 4 segments:





Thursday, December 11, 2008

From Newton to iPhone ...

As nicely pointed out by John Gruber on his blog, Deep Green is back (from the dead)! As soon as I saw that, I rushed to the App store and grabbed it (for it's introductory price of $4.99) mostly for pure nostalgia reason since I had it on my trusty Newton, even though I'm not a big Chess player (I do play occasionally). The iPhone's version, which is coming out 10 years after the Newton's version, is seriously beautiful and sports a nice minimalist UI. Well done Joachim Bondo! I'v got to said that it is nice to see a Newton old-timer transitionning to the platform :-)

Wednesday, December 10, 2008

When too much is too much ...

To store the data generated with my iPhone application, I have been using the facilities provided by the NSCoding protocol in cooperation with a NSKeyedArchiver, and it works quiet well even if it is likely not what I should be using since it force all my data to be saved or loaded all at once. Nevertheless at this stage in the development process, this is a good enough solution since my data-set is relatively small (less than 30 items). The whole concept of archiving object isn't new to me since I was using it back in my BeOS days (BMessage with the BArchivable class), however the NeXT's take on this old favorite is a little much more handy to use, thanks to Objective-C dynamic nature (compared to C++ more rigid nature) . Since the name of the class is archived at the same time than the object data, it can be later used to recreate the object automatically (granted that the executable unarchiving your object knows about that particular class).

Unfortunately, there is (of course) a price to paid for using NSKeyedArchiver. The end result bytes consumption is criminally high. For example a simple NSObject derived class, encoding a uint and a float, requires a 232 bytes long buffer. 8 bytes of real data (not counting the class name), flattened into 232 bytes ... So obviously, lots of the overhead won't be duplicated if I was encoding more than a single object, but if you want to archive a single object for transmission or storage (bytes oriented kind of storage), the cost is a little too high.

Hopefuly, since the NSCoding protocol is based on using the abstract class NSCoder, one could create its own archiver, with hopefully similar capabilities, but lower memory footprint. I know, I shouldn't waste my (limited) time making my own, and instead focus on the app, but I can't help ...

Tuesday, December 9, 2008

Happy b-day, Mouse!

Well, the mouse is officially turning 40 years old today. Well, to be exact, it's a little more than 40 years old, since it was first publicly demonstrated 40 years ago by Douglas Engelbart during what is now known as the Mother of all Demos. If you have 74 minutes to spare, make sure to watch the video of that demo from some pretty cool stuff ... that is if you are digging computing archeology ;-)

While, I'm on the subject, I'd like to point out also, an interesting interview of the legendary John Draper, which was recently published on Stories of Apple. The interview mainly focus on the early days of Phreaking and Apple, but here's an excerpt related to the main preoccupation of this blog (no, it's just not about weird music!):

"Yeah, it’s wired up, man. Fuckin’ wired up man. [...] It was borrowed from NeXT. Jobs owned all the code from NeXT, he brought it in to Apple. It’s part of Xcode, part of Cocoa."

Monday, December 8, 2008

Über fiasco ...

I was feeling pretty confident when the contractions started to come, because I had my little app on my iPod to deal with them, and somehow help with the excruciating pain which was to build-up over the course of several hours ... that is until I realized, with horror and tremendous shame, that it kept on crashing. Of course, this was purely my fault. Just the day before, we had a perfectly working application. Sure, it was far from perfect, and there was a lot of polishing still to be done, but it had been tested and was fulfilling its purpose. I should have avoid touching anything since we were getting close to the due date, and thus we could need it at any time. And yet, on the morning of the 19th, I decided to start implementing some of the changes Susan and I had talked about. I was so certain that my changes will have minimum impact, and that we will have time to re-test it, that I didn't even register that I was stomping all over one of the most fundamental law in life: "if it ain't broke, don't fix it!". The results of my risky endeavour, was a fiasco (the baby still made it out A-Okay, so not everything bombed).

What is even more annoying, is the cause of the crash was pretty dumb, and only took a couple of second to figure out. If I had run into it while testing the app within Xcode, I will have seen it within the debugger.

Alas ... lesson harshly learned.

Wednesday, November 19, 2008

Über coolness ...

Saturday morning, I managed to get my app on my iPod. I was rather nervous about the whole process after reading various horror stories from fellow iPhone developers, but my worst fears didn't materialize. Lucky me I guess ... I followed religiously the howto sections of the developers' site to provision my device then get my certificate stuff in order and things were going well, until I ran into the first issue: there is no NSCalendarDate on the device (bummer!). Now, this is really my fault since I failed to paid attention to the fact that, as stated in the documentation, that particular class is on its way to be deprecated ... and missing from the iPhone OS. The surprising thing, though, is that that class is available when targeting the simulator ... Anyhow, that wasn't a huge drama and after a bit of cleanup, I was onto the next issues: the dreaded 0xE800003A and 0xE8000036 ... errors :-|

The first one, is easy to fix after a bit of googling as for the second one, it is also kinda easy to fix since it only occurs when I try to install a new built over an older one. When it occurs, which isn't all the time but rather often (read 9 out of 10), I just delete the older version from the home screen, before hitting Build & Go or Go. Which is a bit of a bummer 'cause each time I lose whatever state & data my app was in ... :-(

Anyhow, now that the app is on the device we are finally ready for our big event ... and with enough time to spare so that we have been improving the app ;-)

Monday, November 17, 2008

What the heck are you listening to?

Here's a little something I'd like to share with you (yes, that's you Usman), and for once, it's not something that I have heard on the The Signal, but rather something I stumbled upon in Cult Of Mac of all place. Be ready, though, for some extremely "weird" music:




Unfortunatly, there doesn't seems to be any available audio files on the SLOrk project site ...

Friday, November 14, 2008

Not so fast ...

Well, we finally got approved yesterday afternoon in the iPhone developer program :-) Which is pretty cool, I must confess. I have yet to go trough the (possibly) grueling process of getting the application on my iPod, but I should be doing that this evening (an blogging about it, unfortunatly for you ...).

Susan did a test run of the app using the simulator the other day, and she came up with a detailed list of bugs and changes, which keept me busy over the past 48 hours. It's not that it was much work, really, it's just that I have only a limited amount of hours each days ...

Wednesday, November 12, 2008

Kind of done ...

I sort of completed my first iPhone app yesterday. It's nothing fancy, really, but it's something we were in imminent need for. Since I only applied for enrollment in the iPhone developer program back on October 29th, I have yet to put the app on my iPod touch for testing. I sure hope we get accepted ASAP so that we can do a real life test ...

The experience has been very fun, so far. For a mobile device, the IDE (Xcode) and the API (Cocoa Touch) are pretty good in comparison to what I was used on Symbian (CodeWarrior). Now, to be fair I should mention that the last time I had to use Symbian stuff was back in 2005. Since I haven't followed-up on it since, I shouldn't really compare both experiences ... yet, coding for the iPhone as so far be a real pleasure where Symbian was a major pain (lacking documentation, constant need for tricks & hacks ...). I have yet to explore the whole touch API, but right now it appears to be consistent and well though-out.

I'm not going to disclose just yet what sort of application we are working on. But I believe it should be fairly easy to guess at it. Post your guesses as comments if you'd like, the winner will get a free version (if and whenever it get released) ;-)

Thursday, November 6, 2008

C++ Considered Harmful (?!)

Lately, I have been following an interesting discussion started a some weeks ago by Eric Raymond on his blog. The subject is a very touchy one as the title of the work ESR is working on (and which motivated his post) is : “Why C++ is Not Our Favorite Programming Language”. As anyone could guess, this post have generated a certain amount of reactions over more than a month. It's overall a great read which I strongly recommend for C++ lovers and haters.

Since I'm in no way the C++ guru (although I have been using it for a good 10 years), I'm confining myself to respectfully taking-in comments from both sides. This doesn't mean that I don't have my opinion on C++ and its supposed harmfulness. Is C++ complex and confusing? Yes, some is. Is C++ syntax tricky? Not so much. As much as possible I try to stay away from all the features I found to add more complications that their are really worth (e.g Templates, iostream ...). In fact, I'm really using C++ in the way it first came about : C with objects.

While I'm on the C++ subject, Kevlin Henney recently (March of this year) participated to a Google Tech Talk, in which he talked about C++ Stylistics. A good talk worth watching IMHO:




As I have been moving away from C++ (on to Objective-C), I have become a bit more critical of C++ lately. I guess I'm having too much fun with Objective-C and Cocoa to be really language agnostic anymore ... so C++? Yuk!

Monday, November 3, 2008

The other Saturn ...

While most people on Earth have heard of the mighty Saturn V (except maybe the lost tribe of Amazonia ...), very few people (except the space geeks) knows about the Saturn's older sibling: the less mighty (but yet impressive) Saturn I. Check out this video for some incredible (and yet not seen often) footage of the propellant tank, and staging cameras:




Thanks to NASASpaceFlight.com's forum member Proponent, for pointing out that superbe video of the 5th flight (SA-5).

Thursday, October 30, 2008

C'est plein d'Étoiles ...

Now that I'm done obsessing about how soon my MacBook will get to me, it's time to turn to something else to look forward. Luckily for my OCD afflicted mind, the Étoilé team have announced 3 days ago that a new version will be available on the 31st (of this month) with hopefully an easy to install set of packages for the popular Linux distributions. Which is a pretty cool news for me, since I still have a PC (as in IBM clone) at home on which I'd love to put something that look modern (unlike, ahem ... GNUStep) and yet use the very same paradigms that I have been getting use to recently (OpenStep/Cocoa and Objective-C). This could allow for some pretty neafty cross-platform apps.

I meant no offense to GNUStep, of course. It's great to be able to copy code across from a Mac and have it compile and run on Linux (as long as you stay away from things too Mac specific such as Core Graphics). The problem is that the UI layer (NeXTStep's look&feel) is very dated (to say the least). That's why Étoilé is such an interesting project (which btw is not limited to just providing a new UI front-end).

Now, what will be über cool, it's to run that environment on top of PureDarwin, the newest attempt to bring Darwin to the non-Mac users :-)

Monday, October 27, 2008

MacBooking

So the MacBook I ordered back on the 15th finally made it to Vancouver this past Friday after a 7 days journey which took it from the banks of the Yangtze river to the Kansai region, then across the Pacific ocean to Alaska, Kentucky, Ontario, Aberta and finally British Columbia ... Way to keep the carbon footprint low there, UPS 9_9

Anyhow ... So far, I'm extremely pleased with the new MacBook. I was a bit worry when I got home Friday, that I may experience some of the issues I had heard about on the MacRumors.com's forums, but luckily non applied (dead pixels, loose battery cover, scratches, bent screen) to my unit (so far at least). In fact, I'm more than pleased: I love it! .. and for the following simple reasons:
  • Small and yet very usable
  • Sturdy and stylish (feel like a slab of metal)
  • Nice screen (yeah there some reflections but it's not really a major issue for me at least ...)
  • Great battery life
  • Nice keyboard
Now, it's not (yet) all lovy dovy:
  • Hang on me a couple of time
  • Can't seems to be able to get the # character, it keep showing up as £ (WTF?)
  • Plugged an external-screen to it and the MacBook display froze (it was still working but the unit own display wasn't, not was the external display)
  • The trackpad is tricky to use (maybe that's just me)

Thursday, October 23, 2008

Okay, we get it Apple ...

Like many people, I find the Get a Mac ads that Apple have been running since 2006, amusing. Poking fun of Windows and Microsoft while showing the many advantages of the Mac, was a great idea ... The problem is that lately the ads have been solely bullying Vista without showing anything that is related to how the Mac works nor make things easier for its users. Unless I'm mistaken, the last ads to have been really on the subject was "Office Stress", announcing the release of the new version of Office for Mac ... that's 10 ads ago. One may argue that "Off the Air" was kinda on the subject too (4 ads ago) ... but not really. Sure it's great that the Genius in the store can help transfer files from PC to Mac when switching, but that's no big deal (in my books at least).

Monday, October 20, 2008

October 20th, 1997

Today is a big day for the few of us for which this matter ... 11 years ago, to the day, the last of the Apple's Newton (MessagePad 2100) was introduced. Until I got my iPod touch back in June of this year, my trusty Newton had been my main PDA since March 1998. It is by far the oldest piece of technology I own that is still in working order (followed by my old Vaio laptop runing BeOS).

Even tough I like very much the new Apple's mobile platform, I still think that the Newton is, in many ways, still ahead of anything else when it comes to low-power, mobile software usage. I know it's hard to beleive if you have never used one ...

Friday, October 17, 2008

Prepared for Shipment ...

Ok, I'm bound to look somewhat silly (as usual), since just a few days ago, I was mostly hostile towards the new supposed look of the Apple's notebook. I changed my mind and ordered the 2.4Ghz MacBook ... The notebook looked much better during the event and on Apple's official pictures, than it did on the leaked shots ... and this new version is more than ever more akin to a small MacBook Pro than the old MacBook. Since I was on the market to replace our aging iBook G3 ... it looked like a very good deal and the reviews so far are mainly (very) positive. Can't wait to hold it in my arms! ... err, I mean start using it!

Tuesday, October 14, 2008

Pre Apple event blues ...

I have been holding out on replacing my old iBook (2003) with a MacBook (Pro?) since there was a rumor (confirmed last week) of a refreshment of the line. As usual, rumors have gone wild over the couple of days leading to today's event. The latest round of spy-like activities, spured some fuzzy pictures of what is rumored to be the new MacBook Pro ... And I sure hope this is a fake, 'cause I don't like what I see, nor what I read about some models of the line been left un-touched by the update. What kind of #%&@ed-up update will that be?? ... Maybe I should grab one of the current MBP at my local Best Buy before they get replaced by a mobile version of the iMac ...

Saturday, October 11, 2008

@superfluous #2

While I'm in whining mood these days (so it seems), let's me talk about a part of Objective-C which I don't like too much: the lack of namespace. This has a unfortunate effect on the way Cocoa can be confusing at time simply because in order to avoid name collision, everyone is prefixing his stuff with some kind of 2 to 3 letters abbreviation. For example, Apple have been using NS since back in the NeXTSTEP days and thus everything in Cocoa is prefixed as such (e.g NSApplication, NSController ...). And this is the problem since at first glance, there is no easy way to tell what a particular keyword is, unless you already know about it. For example, is NSPoint a class? No, it's a structure. NSNumber? a class, NSInteger? a type ... 9_9

Since namespaces are a relatively recent addition to C++, the fact that is missing from Objective-C isn't much of a surprise. However, one may wonders why it has still not been added. In any case, this is somewhat irrelevant, since it is unlikely that Apple will go over Cocoa (and other framework such as Foundation) and make use of some Cocoa namespace; braking everyone code in the process. Alas, something like NS::TInteger, NS::CNumber will have make the developers life a little easier ...

Like our Hungarian friends like to said: A little prefixing can go a long way ...

Friday, October 10, 2008

@superfluous

A week or so ago, I decided to stop my Cocoa musing and focus instead on properly following Aaron Hillegass' Cocoa Programming for Mac OS X. The idea being that this will give me a more proper initiation to Cocoa, especially on the subject of KVC, KVO and the famous bindings. I started Chapter 8 last night and went through the implementation of the first version of the RaiseMan tutorial. This chapter also introduce the usage of the new Objective-C 2.0 @property, which can be use to automatically create setter and getter methods. Now, it's all good, I don't mind saving some time by writing less code, however I'm running into a bit of a personal conflict with this.

Like many other developers that have been around for sometime, I've grow over the years my own coding style, made up of all the things I have encountered and came to appreciate. One of the thing I find necessary is the prefixing of any variable by a lower case single character which give some clear hint on the origin of the variable (e.g iSomeNumber, aObject, lCount ...). In case you are wondering, I got into that habit from my time on Symbian. Now, there's no problem with using such notation with Cocoa unless you happened to want to define an instance variable as property.

What @synthesize do behind the scene is to generate the setter/getter methods using the name of the instance variable. So far so good. Now, if you happens to name your instance variable something like iSomeSumber, the setter will end up being -setISomeNumber: and the getting -iSomeNumber ... Not very elegant, right? (What I want really is the methods to -setSomeNumber: and -someNumber ... well really, I'd like the getter to be -getSomeNumber ... but that's another issue ...)

Since there is a refactoring tool in Xcode which will generate the setter and getter of a given instance variable, I do find the @property somewhat superfluous (Yes, I do know that the property allow for more than what the current refactoring tool does).

Wednesday, October 8, 2008

Oops .. I did it again ...

Microsoft have yet again release some sort of video and as John Gruber put it : What is wrong with this company? Who authorizes this crap? See this for yourself:


Embarrasing to said the least ... kinda like that LHC Rap video ...

Anyhow, RIM announced yesterday its answer to the iPhone, the BlackBerry Storm. What can I said about it except : "yaaaawn". So yeah it's got some touch-screen (but it's not capacitive) and an AppStore, but it lack the slick UI and the Wi-Fi (it's nowhere on the specs). Yes, that's right no Wi-Fi ... "WTF!" exactly what I'm thinking ... Since I can't find any good reason why something as common these days as Wi-Fi will be left-out of a brand new smartphone (and on an iPhone competitor!), I'm going to assume for now that they just forgot to mention it in the specs ... :-|

Thursday, October 2, 2008

Avkon Touch

Nokia finally announced today their answer to Apple's iPhone, the 5800 XpressMusic. engadget.com has a little blurb about it including several pictures of it. Funnily, the author of the post (Chris Ziegler) asks if anyone remember the 7710 ... and I do since I worked on it at Nokia Vancouver back in 2004 (in case you're wondering, I contributed to the Voice Recorder and Paint applications). That phone never made it (AFAIK) to North America. It went on sale in Europe and Asia for only a short time before the project was canned, and Series 90 shelved. Being a contractor, the whole drama didn't have much impact on me really. It was, however, very instructive on the way things work in a company of Nokia's size.

So about that new Touchscreen smartphone? Yeah, it's stylish (as usual for Nokia) ... not sure I like the UI ... It definitly lack a certain je ne sais quoi (the Apple's touch I guess) and doesn't seems to be all that responsive (from what we can see in the videos) ... Oh and it's running Symbian with likely some sort of Avkon Touch ... Yeeeeeeks! That's a deal breaker as far as I'm concerned ;-)

Wednesday, October 1, 2008

So long NDA ...

Apple has just announced that it was dropping the NDA which have been in effect for the iPhone SDK since it's public release earlier this year. This is a very good news all around :-) And perfect timing for me since I just wrote my first little "application" for the iPhone last night. Nothing very fancy I must confess, just a port of the first Cocoa example from Aaron Hillegass' book (the random number generator). Unsurprisingly, the more I get to use Interface Builder, the less I'm been hostile to it ... Anyhow, now that the NDA is off, I guess I'll be able to include this side of my daily musing as part of this blog :-)

Speaking of Cocoa Touch, Bill Dudney has an interesting piece on why you should really learn Cocoa for OS X before working on an iPhone (the whole post was NDA friendly).

Sunday, September 28, 2008

SECO!

Since I'm also a Space geek, I did not miss the LIVE broadcast of the 4th flight of SpaceX's Falcon 1 launch vehicle ... It was especially important to see it, since they finally made it to orbit! Yahoooo! Here's a recording (on YouTube) of the live feed for your enjoyment :-)


Thursday, September 25, 2008

The Dark Side (TM) clouds everything ...

I have been observing for a while now how things are panning out with Apple and the App Store. Since I haven't started developing for the iPhone yet (but soon! I'm starting a new full time job doing just that in 6 days!!, I can't add anything of value to the on-going discussions, except joining the group of bystanders and shaking my head in disbelieve at each moves Apple made. Even thought I always had a soft spot for Apple since my days on an Apple IIc, I'm not naive enough to believe they can do no evil ... especially since they sort of have a proven track record of not always playing fair and square. Lots of fore front bloggers have commented about the whole situation (e.g Daring Fireball, Wil Shipley ...), including the still standing NDA, which have already caused the publishing of a programming book to be canceled. Now, as long as you can stay anonymous (does that really mean anything on Internet these days?), it is not impossible to post details (including tutorials) on Cocoa Touch. It is a bit of a risky endeavour I must said, but very much appreciated by newbies iPhone devs like myself ;-)

On another subject, but still related ... The Technologizer.com web site has an interesting post with a bunch of old to recent Apple's TV ads, make sure to check it out for a bit of nostalgia.

Wednesday, September 24, 2008

Toying around ... #2

A few pointless posts ago, I was talking about Nibless Cocoa applications, and how Jeff Johnson, had a ready to use solution for us, Interface Builder cheaters. Jeff's elegant solution is build around using Cocoa NSObject's ability to have a class pose as another class (but it must be a parent class). The trick been to make sure that when the application is starting, the NSBundle created to load the main NIB file does not load it, and instead just pretend to have done so. The method works like a charm (granted that the entry NSMainNibFile in info.plist has been removed), however there is just a little problem: the class method poseAsClass has been deprecated in OS X 10.5 and is not even present in 64-bit Cocoa. I have no idea whatsoever this is been phased-out by Apple. Since a similar facility exists in Objective-C and GNUStep, it's not clear at all why this have to go ... Security concern maybe? Whatever the explanation, I'd like to know ...

So ... since I'm interested in a solution that can work from 10.4 and beyond on PowerPC and Intel, 32-bit as well as 64-bit, I had to go back to the drawing board and come-up with an alternative solution, likely something not as elegant. Hopefully, thanks to Objective-C's dynamic abilities, it is possible to replace on-the-fly a method implementation by another function (as long as it have a compatible signature). Scott Stevenson have made a an excellent post on this, which I used as the base of my solution.

The idea is relatively simple: replace the NSBundle's class method loadNibNamed:owner: by my own implementation function and call the original method only in when necessary. Since I wanted to have this automatically done as part of a special type of application, I derived NSApplication in HZNiblessApplication, implementing its object method init to do the dirty work:


- (id) init {
if ((self = [super init]))
{
Method lMethod = class_getClassMethod([NSBundle class],@selector(loadNibNamed:owner:));
if(!lMethod)
NSLog(@"NSBundle+loadNibNamed:owner: not found!");
else
{
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
gDefaultNSBundleLoadNibNamed = method_setImplementation(lMethod,(IMP)loadNibNamed);
#else
gDefaultNSBundleLoadNibNamed = lMethod->method_imp;
lMethod->method_imp = (IMP)loadNibNamed;
#endif
}
}
return self;
}
view rawThis Gist brought to you by GitHub.

As your can see, the method basically retrieve the method within the NSBundle class, and swap its implementation with a function called loadNibNamed. Since we need to call the original method to perform its duty when there is a need to load a bundle, we save the pointer to the function in a global variable named gDefaultNSBundleLoadNibNamed. Let's have a look now on how that replacement function is implemented:


BOOL loadNibNamed(id aObject,SEL aSelector,NSString *aNibNamed,id aOwner)
{
if (!aNibNamed && aOwner == NSApp)
return true;
else
return (BOOL)(*gDefaultNSBundleLoadNibNamed)(aObject,aSelector,aNibNamed,aOwner);
}
view rawThis Gist brought to you by GitHub.

From there, all that is needed is to replace the value of the NSPrincipalClass key in the application's info.plist by HZNiblessApplication and get your application delegate to fill in the Application menu from -applicationWillFinishLaunching: ... Okay, yeah I'm simplifying a bit here, but you get the point I'm sure :-P

As you have noticed, I finally figured a way of putting neatly formatted code (hmm ... at least on Firefox) on this blog, courtesy of github.com.

Friday, September 19, 2008

Am I a PC?

Microsoft has released yesterday its new series of ads, replacing the series started a couple of weeks ago with the comic duo Gates & Seinfeld. I think they are not that bad. Sure, it doesn't said much of why using a PC (instead of a Macintosh) is better, but at least it's not as wild as the previous ads. See for yourself:




Rogue Amoeba's developer Mike Ash, has added an interesting post (one of many in fact) on his blog, regarding his iPhone development story. Very interesting and a little bit scary ... Hopefully for him, what he shared won't fall under the infamous NDA, causing him to loose his developer program seat.

Wednesday, September 17, 2008

iCapricious

There has been a lot of talks on the Apple and iPhone developers communities lately about the issue of what application get to be on the App Store or be rejected from it ... The folks behind The Joy of Tech have summed-up in their hilarious (and yet lovely) usual way:

So far, since there has been only an handful of rejected applications, I don't think it is fair to Apple to said that they are abusing their gate keeper role ... however, since not all developers may be has vocal about their rejection as Podcaster's author ... who knows really?

Tuesday, September 16, 2008

The Force is weak with this one ...

The Force Unleashed has been out since yesterday for iPhone/iPod, and without much surprise it's really a huge disappointment, gameplay wise. Don't believe me? Check out this video provided by TouchArcade.com:




Yep ... and it get worst, people that reported having purchased it, said that they were able to complete it 90 minutes ... Sure it's only 10 bucks, but still ... Ah well, what can we do except skip it and spend more time playing with Enigmo ... Now, that's a fun (and yet very geeky) game :-)

Friday, September 12, 2008

Goofing around?

As I was watching the second of the new Microsoft's Ads last night, I came to realise to my uttermost surprise that I was enjoying it. Yeah, you read it right, I just said that I enjoyed it. Sure, I did find it a little long (over 4 minutes), and I still have no idea where this is all going, but I thought it was goofy and not without a certain charm. Still that won't get me running to my local electronic shop and getting a new PC, nor a copy of Vista ... But maybe that's not the goal of the campaign? What if the intent was to make Microsoft appears less of the evil juggernaut we have come to believe it is? Meditate on this, I will.

Wednesday, September 10, 2008

One less thing ...

Since I'm waiting for an update to the MacBook, and that none was announced yesterday, I can't help but feeling disappointed by yesterday Let's rock event. Sure, funky color Nanos and the touch finaly getting a speaker and a physical volume control are good news, but still this was in no way the big deal event which was announce by the PR (how typical ...). Yet, the 2.1 firmware update was released (minus the pre-announced push capability, what happend to that?) and that's a good thing. This time around, Apple was less stingy with details on the update, and so far I have found the UI to be a bit snappier, however 3rd party applications still take, like, ever to load ...

Monday, September 8, 2008

The force (un)leashed

Like most Star Wars fan that happens to own an iPhone or an iPod touch (my case), I was looking forward to September 16th release of The Force Unleashed. However, after watching a video showing the gameplay ... I'm bitterly disappointed. I was hoping for something similar to Jedi Knight 2 where I could play as Darth Vader's secret apprentice (real name Galen Marek) ... instead it looks like the game will be cinematic and mainly finger gestures based. What's the point of carrying a cool looking light saber around if it's only used to return laser blast? ... Okay so yeah, FPS friendly controls on a device such as this is tricky, but not impossible ...

While I am on this subject, I should mention that I been reading Timothy Zahn's first sequel to Episode VI: Heir to the Empire. So far it is okay ... nothing exceptional really, but it's not too bad either. It is the first time that I'm reading a Star Wars expanded universe book. Since I had some downtime between Dune's universe books I thought I gave that a try.

Wednesday, September 3, 2008

The bleh 2

I was saving this post for some report on my Cocoa progress, but instead I feel like I should add my voice to the many that have commented on the new CBC Radio 2, which launched yesterday. I have to admit that I had missed the announce of the changes to come from a few months ago, so I only noticed that something was coming up over the week-end. Since the start of September is a common time for program changes on Radio (or TV) I wasn't too surprise ... but I wasn't really expecting the only radio I have been listening to since I moved to Canada 5 years ago, to change so much ... and not for the best, sadly.

So what happened you may ask? Well ... to sum-up, Radio 2 which use to be mainly Classical and Jazz, got stuffed with a large part of the Radio 3 playlists. Now don't get me wrong, there nothing wrong with Radio 3, in fact I have enjoyed it since the very first podcast of Grant Lawrence back in 2005, and I was also very disappointed when the fun take-over of Radio 2 airwaves by Radio 3 was terminated over a year ago (Saturday nights).

What's wrong then with Radio 3 taking over Radio 2? Simply put: wrong crowd, wrong time. Let's face it, the large majority of Radio 2's audience isn't the kind that will enjoy The New Pornographers at 7 in the morning ... I can understand that they will have wanted to expose the listeners to some of the new Canadian music, but a better approach will have been, IMHO, to bring minor tweaks to the programing by adding a single show composed of the usual Radio 3 playlist (e.g by shortening Canada Live) ... one hour will have been enough. In fact, the old Radio 3 show on Radio 2 (which I talked about earlier) was perfect to get folks introduced to the new Canadian music tree. Instead, we have 7 hours of it, and Radio 2 now just sounds like any other FM radios ... minus the ads that is.

At least, we still have The Signal ...

Friday, August 22, 2008

Toying around ...

I purchased on the App Store the game Toy Bot Diaries from local company (Vancouver!) IUGO, after reading the review posted on touchArcade. I can only agree with the author, it's a very sweet deal (nice gaming, low price). Best of all, the game take advantage of the controls native to the platform, and it work out pretty well, except if you are trying to play while lying down ... In this setup, I found the control to not work too well. No big deal really, I shouldn't be playing right before sleeping anyway ... ;-)

Meanwhile, I have been continuing my Cocoa musing without Interface Builder, and banging my head on the (one will think) simple issue of filling the application menu. Hopefully for ma sanity, I came accross Jeff Johnson's blog which have a serie of great posts (and a sample XCode project), on how to create a Nibless application. Turns out it's not as simple as it should be. It's also more akin to hacking the framework than using it ... anyhow it does work.

Before I sign-out, I will like to point to a video from the lastest iPhoneDevCamp, which feature Neil Young's (no, not the singer) keynote on the iPhone as a gaming platform.

Wednesday, August 20, 2008

Blast them again!

I just realized that I forgot to talk about the opening of the Clone Wars. Like any other geek watching the show, I was expecting the standard opening of a Star Wars movies with John Williams music and scrolling text ... So I was surprised and somehow deeply disturbed to see the opening not conforming to the canon. In fact, it reminded me a lot of the TV news broadcast in the opening of Starship Troopers ...

Blast them!

So I went to see the Clone Wars animation last night with an old friend, and I don't know why the "critics" are so harsh about it, 'cause we both enjoyed ourselves (along with the other 10 adults and 25 younglings present). Of course, it probably have to do with the fact that combined we have the mental age of a 12 years old, but still .... it was a fun 90 minutes, filled with lots of action and ... yes, a simple story line. I think it is clear, that the movie was targeted to an audience much younger than the usual Star Wars crowds. As for the CG and animations? Well, it's definitely no Pixar movie, but I do think it was alright even if at time the characters motions were a little stiff.

Speaking of animation movie, I noticed something interesting on the Bagelturf blog, a link to an animation created by a group of student of the French art school Gobelins. Oktapodi is not only funny (in a Pixar shorts sort of way) but also well done, check it out on YouTube:


Tuesday, August 19, 2008

2.0.2

Apple blessed us, iPhone and iPod touch owners, yesterday, with a new update. The release note is as usual a trove of details: "Bug fixes" 9_9 ... I seriously don't understand why they can put a bit more details so that people can have an idea of what got fixed or not. We all know, heck, the all world know that 2.0 OS was a very buggy release. Issues have been discussed all over the web! But I guess very few (if any) were acknowledged by Apple. The usual obscurantism at its best.

Once the placebo effect recessive in a couple of days, I'll be able to take note if downloading around 250Mb (!!?) was worth it. But right now, the UI seems a little snappier than it was. However, I haven't noticed any improvement during application launches :-|

Saturday, August 16, 2008

NSApplication and delegate #2

The only reason for that yucky thing I could think off, is that they wanted to save people from having to define and implement all 14 methods each time a NSApplication delegate was needed, even if only one of them was needed. Since the concept of optional method in a Protocol was only introduced recently in Objective-C 2.0, using a protocol for the NSApplicationDelegate (or for NSApplicationNotifications) was I guess not a solution back when NeXTSTEP was been designed and implemented. Still, having to define and implements a bunch of methods isn't much of a huge burden (copy&paste), likely only a couple of them are going to have a real implementation, and the number of application delegate class per application is mainly, well ... one.

I'm aware that adding methods in Objective-C isn't as costly as adding a virtual method to a C++ class, but still ... this is not a very elegant solution. As this thing used all over the place? I'm a little scare to find out ...

BTW, sorry for the sloppy code formatting on my previous posts. I still haven't figured a nice way to present it with proper indentation. Syntax highlighting will be nice too.

Friday, August 15, 2008

NSApplication and delegate

Last night, I finally restarted my Cocoa learning effort, by looking at how I could write an application without using Interface Builder. IB is so vastly used that there isn't as much details available on the web on how to go about with it, nevertheless, there is enough to get started. And in fact, it is relatively easy, at first.

A Cocoa application, in its simplest expression, is composed of a single NSApplication object and one (or more) NSWindow object(s). Overall, it doesn't take much boiler code to get something going, which is good:
int main(int argc, char *argv[])
{
NSWindow *lWindow;
// create an auto-release pool
NSAutoreleasePool *lPool = [[NSAutoreleasePool alloc] init];

// initializes the display environment and connects to the window server
// and display server
[NSApplication sharedApplication];

// create a window
lWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(10,10,320,240)
styleMask:kStyle
backing:NSBackingStoreBuffered
defer:NO];
// set the window's title
[lWindow setTitle:@"Hello world!"];
// show the window and move it foreground
[lWindow makeKeyAndOrderFront:nil];

// start the application run loop
[NSApp run];

// release the window
[lWindow release];

// release the pool
[lPool release];
}

The Application object gets a bunch of notification from the system during its life-time. If I wanted to perform some actions in some of them, there is two ways of doing it: I could subclass NSApplication and implement the corresponding methods, which is the usual way of doing it in 99% of the toolkits out there ... or, I could follow the Cocoa way and use a delegate instead. Since the later is what Apple encourage developers to do, the NSApplication class is built to support the addition of a delegate by sending it a setDelegate message.

Now, as expected, this message take as single argument: the object to be the delegate. So far so good. However, instead of defining the argument with a specific class, for example something like said NSApplicationDelegate, it is defined as an id (meaning any kind of object). Since I'm still more of a C++ kind of guy than an Objective-C dude, I found myself a little puzzled by this but still decide to move forward by searching in NSApplication.h (since I didn't see anything in the class documentation) for the delegate class I am expecting to have to subclass, or some sort of protocol definition.

In the header file, I was nicely surprised to see that NSApplicationDelegate does exists, but in a way I was not expecting, at all: @interface NSObject(NSApplicationDelegate). Yep, that's right. A category ... meaning that any object with NSObject for root parent, can be the application delegate ... Since 99% of all Cocoa's classes have NSObject as root, any objects can be the delegate .... including widgets! If this isn't yucky, I don't know what is! Why on earth didn't they use a protocol!??

Wednesday, August 13, 2008

I want(ed) to believe!

No really, I want to believe so much the up-coming Clone Wars movie isn't going to sucks that I'm ready to like, totaly, forgot about the review published then retracted by Ain't It Cool News. Also, I won't even think about, nor mention the low 44% on the Tomatometer, given by the Rotten Tomatoes self proclamed critics. I found their lack of faith, disturbing. Instead, I'm going to be watching over and over the trailers, and the videos available on the movie site. Since I already watched (by-myself mostly) Episode 1 & 2 this past Sunday afternoon, my Star Wars geek-o-meter readings are off the chart! I can almost feel the force ... can you?

Sunday, August 10, 2008

2.0.1

So I upgraded my iPod touch yesterday morning from 1.1.4 to 2.0.1 ... Since I had a jailbroken unit, I was a bit worry that I may encounter some issues, but the whole process went pretty smoothly. All I had to do was to hit the restore button in iTunes, which installed 1.1.5 and whipped all the apps and data I had installed (no big deal). Once that was done, I bought the 2.0 update from iTunes and that was it.

2.0 OS has been discussed a lot since it came out, so I'm not going to get into any details, I'll just said that, yes the unit does feel more sluggish than 1.1, and yes there's a lot of so-so apps on the App Store. I wishs there was a way to download demo version of some of the game. For example, I bought Crash Bandicoot Nitro Kart 3D, and I regret it 'cause I don't like it that much (there goes 10 bucks ...). Some of the apps, are very familiar to me, since they have been available on jailbroken devices for months, such as Vladimir Kofman's Converter ($1). It's a cool app, which doesn't seems to have changed a lot ... except that now it's much slower to start than before :-\ Hopefully Apple can fix that up in the up-coming 2.1 update .... 9_9

Bottom line, was it worth upgrading? Not really.