February Melbourne Cocoaheads

Thursday last week was the first Melbourne Cocoaheads meetup of the year. Two talks were given. The first was a talk by Stewart Gleadow on the topic of Frank. Frank is an automated user interface and user acceptance testing toolkit for iOS apps. Embedded below is the video I created of this talk.

Advertisements

My Journey to Programmer.

I grew up in small town New Zealand. I was a geek from an early age.

At the tender age of 10 years my first experience of “programming” was typing out “huge” BASIC programs from old magazines into my Atari 800XL’s BASIC interpreter. At the time I didn’t know what I was doing. I just wanted to play the games described in the magazine. They sounded great, but they rarely worked. My first “debugging” experience was pouring over long dot matrix print-outs of these programs comparing them line by line with the original magazine source code and correcting my typos.

After years of playing video games on my Atari, Sega and then PC, I decided I wanted to learn how these magical things were made. Being pre-Internet at the time, I had very little access to information about how computer software was made.

I came upon the idea of asking Sierra Online, my favourite games company at the time, for help. I did this by sending many letters and faxes to Sierra customer support. Every time I just got back a standard “thanks for being a fan” form letter.

Undeterred, I tried again and again. Eventually deciding I should address the letter to an actual programmer at Sierra. I found the name of the Lead Programmer from the credits of one of my favourite Sierra games and addressed my letter directly to him. I even stamped it “confidential” in bold red lettering with one of my mum’s office stamps.

I got a response! Not from the programmer I had addressed my letter to, but his replacement.

I thank that now forgotten programmer from the bottom of my heart for answering my letter. In his long and detailed response he told me exactly what I needed to know. Learn C/C++ or Pascal.

By reading magazines I went about discovering what these mysterious things were. I learned that I needed a compiler and a book to teach me how to use it.

At 15 years of age I began saving my paper route money as fast so that I could buy Borland C++ 3.1 and the book Mastering Borland C++ by Tom Swan. Even at the academic discount, it required a whopping $600. Not exactly chump change for a teenager in the early 90’s. After months of saving I had my treasure in my hands. Only then did I discover my lowly 286 couldn’t run the compiler. Oh the heartbreak.

So after further furious flogging of my cherished video games, consoles, and even my existing 286 I could afford to buy (with more than a little parental help) a brand spanking new 486SX with 4MB of memory and a 512MB Hard Disk. Four thousand dollars down on some flash new gear so I could run my expensive new compiler.

In Tom Swan’s gentle care I ventured forth into the uncharted territory that was C++. I’ve never looked back.

Apple’s mod_bonjour is broken in Snow Leopard, so I fixed it.

I was playing about with Apache on my iMac and I noticed a little file tucked away in /etc/apache2/other called bonjour.conf.  Intrigued I set about figuring out what it was for.

This file had some directives relating to an Apache module called mod_bonjour.  The purpose of which is to register URLs with Apple’s Boujour service.  This service lets systems and services publish their existence on a local area network so other systems and applications can find them without configuration.  Boujour is just Apple’s marketing speak for Zeroconf style networking.  It is also known as multicast DNS and is common on Linux and Apple systems.

Safari on MacOS even has a Bonjour menu that displays services or devices that are advertising themselves via the Bonjour service.  An example of this is my QNAP NAS.  I can always easily access the Admin interface of my NAS (and other services the NAS provides) because it advertises itself with Bonjour.

I thought that using Bonjour would be rather handy for advertising some web applications I had configured on my iMac to other systems on my home network.  So I added them to the bonjour.conf configuration file like so:

RegisterUserSite customized-users
RegisterResource “Confluence” “/confluence”
RegisterResource “TeamCity” “/teamcity”

Unfortunately after restarting Apache I was dismayed to discover that only the last RegisterResource directive seemed to be working (TeamCity), as it was the only resource showing up in the Bonjour menu in Safari.

However after a quick search for mod_bonjour with Google I discovered two posts detailing the problem.  There is a bug in mod_bonjour.

Joe Maller found the bug and supposedly reported it to Apple in 2007, and Chuck Houpt even created and released a patch for the Leopard release of Mac OS X.

Now I’m running Snow Leopard so I didn’t want to just use the patched binary Chuck provided, so I set about patching the Snow Leopard version of this module.  Fortunately Apple provide the source code to this module on their open source site.  So I took what appears to be the code from Snow Leopard, applied Chuck’s patch and produced a version for Snow Leopard.

In order to share this updated code with the wider Internet I’ve created a GitHub code repository for it.  In order to build this code and update your Mac you will need the Apple Developer Tools installed.

MSBuild, assembly dependencies and the GAC

Today, while doing some .Net development I noticed something about MSBuild that is really annoying.  I’ve seen his before but didn’t know the reason behind it.  Now I do and it is a little frustrating.

If you have assembly A that depends on assembly B that depends on assembly C and assembly C exists in the GAC (Global Assembly Cache).  When assembly B is copied into assembly A’s “bin” directory during build, assembly C is not copied, even if you specify that assembly C is a “private” (copy local) dependency of assembly B.

The problem is that by default MSBuild’s ResolveAssemblyReference task will not copy referenced assemblies that are in the GAC to the build output directory unless the referenced assembly is specifically tagged as “private” by the build project being built.

So even though assembly A doesn’t directly reference assembly C in its code, it only uses C through the intermediate dependency B, you still need to add C to A’s referenced assemblies set for C to be copied into the build output of A.

There is a discussion of this issue here, on Microsoft’s developer forums.

Programmer Humour.

Call:

How do I update controls on my UI thread from the Asyncronous Delegate? I understand it’s not safe to just try to update it directly from the asynchronous thread, but I need to figure out how to update it somehow. Specifically I need to increment a ProgressBar and update text in a Label.

Thanks,
Michael C.

Response:

My name is Tyrone Hernandez. I grew up on the streets, so I’m familiar with this kind of shiznit. I am down with this, and I’m going to keep it real by top-posting.

In my hood, I have a homie named Shaniqua and some times she calls me on the phone in an asynchronous fashion. Now I’m hip to her jive, so I don’t wanna just hang up. If I feels like talkin to Shaniqua, I talk to her. If not, I use my power of “Control” to check “IsInvokeRequired” and if it is, I call Control.BeginInvoke() to upgrade my progress bar.

Well, I’d be likin’ to talk more, but my crack dealer is here so I’m going to call some of his methods. Peace out!

Made me laugh. And he’s correct. Found, here.

Heroes over Europe appears on shelves.

It is very weird to see a product you had a hand in creating appear on shelves in a local brand name retailer.

I randomly went into EB Games on Swanston Street tonight, just around the corner from my apartment, and saw this on the shelves.

Heroes over Europe on display.

Admittedly these are just empty promo boxes but it is still weird to see Heroes Over Europe on shelves.  Especially since the project has been a marathon effort from hell for all those involved.

For better or worse I played a large part in the creation of the mission editor for this game. So if the missions suck, I’m at least partly to blame.  My heart goes out to all my awesome ex-coworkers at Transmission Games who are feverishly beavering away to finish it.

Essential Web Design Tool: CSSEdit

Lately, in my “free” time, I’ve been doing web-development work in PHP.  A bit of a change from the usual .Net application hacking I do.  A tool I’ve been using that has been saving me loads of time has been MacRabbit CSSEdit.  I don’t know how I previously lived without it.  If your a web-designer or CSS hacker it is definitely worth the €30 it costs.  Check out the trial on the MacRabbit website if you don’t believe me.