CodeShop

Code for all

C++ iPhone development with Bjam

September 28th, 2008

Just got myself an outdated iPhone and a 2nd hand MacBook!

I’ve been toying with these two goodies for the last day and they are some funky goodies to get your hands on. Of course the most fun is to write your own stuff for it.

Part of the challenge is to not use the XCode IDE provided by Apple, but instead use automated command-line tools. Basically I want to stay away from the IDE and the objective-c. We’re going to use the boost-build system (bjam) and use as much plain C++ as possible.

Compiling and linking of an iPhone application is working fine. The next part is to get the application to run on the iPhone Simulator and/or the actual iPhone. The difficult part here is to get all the code signing, provisioning, packaging and copying in place.

I’ll keep you posted. If you’re doing something similar, then drop me a comment.

Arjen

H264 Compressed Meta-Data

September 20th, 2008

We’ve written this nice Lighttpd plugin mod_h264_streaming which is being picked up by numerous sites. It enables progressive streaming and seeking for H264 encoded videos in Flash.

One of the issues raised is that when a user jumps forward in a long video the time it takes to restart the video at that position takes too long. The reason why this happens is that the Flash player doesn’t support seeking into a video which has not been buffered yet and so the plugin sends a newly patched video file. Unfortunately the meta-data can take up quite a bit of space (say 750KB for a 30 minute video), so when your bandwidth is 150KB/s, the metadata alone would take 5 seconds to download.

There are a few things we can do about this, and one is compressing the metadata. This is a perfectly viable option and supported by most tools (Apple Quicktime, mplayer, etc…). So ahead I went and added this feature to the mod_h264_streaming plugin. After successful testing and seeing the metadata shrink by 50% to 75% I was in a really good mood. This meant the seektime of a 30 minute video would go down from 5 seconds to about 2 seconds! A job well done.

Surprise!

The flash player doesn’t support compressed metadata. Time to talk to your local Adobe representative and issue a feature request!

Hungary

September 8th, 2008

Action Man says ‘Long live Apps Hungarian!’ – no arguing with him:

But saying ‘I need the ‘p’ prefix because

1
2
 
if (size == 0) and if (pSize == 0)

are different is wrong: best look @ your variable names …

(The picture came from Sutters blog).

Standards

June 14th, 2008

A note on standards …

These can be discussed for ever, or not at all – this tells you why.

More notes and there’s off course Sutter&Alexandrescu’s book.

And if you really must, boost has a nice summary.

It boils down to:
  • Use the naming conventions of the C++ Standard Library!

Sounds obvious – but what does that mean?

Here’s a few guidelines from that standard
  • Names (except as noted below) should be all lowercase, with words separated by underscores.
  • Acronyms should be treated as ordinary names (e.g. xml_parser instead of XML_parser).
  • Template parameter names begin with an uppercase letter.
  • Macro (gasp!) names all uppercase (and can have a prefix like “MYLIB_”)
  • Choose meaningful names – explicit is better than implicit, and readability counts. There is a strong preference for clear and descriptive names, even if lengthy.
  • Use fixed-width fonts.
  • Use spaces rather than tabs.
  • Limit line lengths to 80 characters.

Japan

May 12th, 2008

Is an amazing place – especially if you have a good friend who speaks japanese to show you around – a small impression …

There’s modern Japan


Backlight Tokyo Tower

Roppongi View on the Rainbow bridge from Chris’ home

But there’s also the more traditional Japan, the gardens and temples:


Sankeien garden


Great Buddha at Kōtoku-in

- and if you’re in for sushi for breakfast, go to Tsukiji fishmarket


My Sushi at Daiwa

And off course, there’s a lot more: Kabukicho, Akihabara, Shibuya, Ueno park, 代々木公園 (Yoyogi kōen) ...

and the zoo – although the panda’s moved on to a better place …