Archive for the ‘mac’ Category

A common purpose

Thursday, June 19th, 2008

Ian Robinson posted a callout to any Cocoa developers in Northern Ireland (and wannabees, I presume). He wants to form a group to get together in order to dicuss Mac and iPhone development. Great stuff.

However, there’s another fledgling group of misfits meeting under the banner of Xcake.

Let’s get together, and code ! (You kinda have to sing that so it doesn’t sound *too* silly)

Snakes and cats

Tuesday, April 22nd, 2008

I have a VM running Linux on my MacBook. The main reason being that I could never get mod_python to install into Apache on Leopard. I followed all the instructions I could online. I could always get it compiled, but Apache would always puke when I tried to restart it with the module loaded.

Tonight, the breakthrough.

There are countless blog entries on building mod_python on Leopard, but why not add another one?

  • Get the source (3.3.1 is the newest at the time of writing)
  • When uncompressed, run
    ./configure --with-apxs=/usr/sbin/apxs
  • Open src/Makefile in your favourite text editor
  • Add “-arch x86_64″ to the end of line 27
  • Change line 49 to read “(APXS) $(INCLUDES) -c -Wc,”-arch x86_64″ $(SRCS) $(LDFLAGS) $(LIBS)”
  • Do the make/sudo make install dance
  • Root edit the file /usr/apache2/httpd.conf
  • Uncomment line 116 which should load mod_python.so, however, check that the module is loaded as ‘python_module’

(Update: I think line 116 was there from my last failed attempt at installing mod_python on this machine.)

The last point was the important one for me. There was a default of ‘mod_python_module’ there. Once I changed that, it all worked. I may be talking from my proverbial, but give it a go and tell me how it goes.

Back from the brink

Friday, April 4th, 2008

I don’t know what it is, but I can never be satisfied with just having something, and using it, and leaving it alone, and being content. No, I have to mess.

My iPod touch has been jail broken several times. Every time it worked, eventually. Then came pwnage.

I can’t blame the tool for what happened next of course. It was my own fault. I didn’t pay attention to the firmware I had downloaded to use. It turns out your iPod touch can’t pretend it’s an iPhone, no matter what firmware you (try) to throw at it.

Anyway, I ran the tool and everything was going swimmingly. I knew as soon as it didn’t turn back on immediately that something had gone slightly awry. So, as the first wave of panic and nausea passed, I tried what I’ve always tried in situations like this, I tried the old two finger salute, hold own the home and power buttons for ten seconds and you’ll drop into DFU. iTunes will then tell you that you need to restore your iPod, and you go to bed saying a little prayer to his Jobness, repenting from your sins and promising you’ll never try anything like that again.

Not this time.

Nothing worked. The iPod showed no sign of life. No Apple. No reassuring ping. I’d have chewed an arm off just for a beachball. By this stage, I was trying to get my story straight for Apple. Would they believe that the iPod had played the Last Stand and simply keeled of its own volition?

All the forums were ablaze with people weeping and gnashing their teeth about how they had bricked themselves (some of them really had by the sound of it), and lots of other people telling the first crowd that they were idiots and should never breed.

The general consensus is that you cannot brick an iPod touch. But here I was with one that would not boot, which the computer could not see, and which consistently refused to acknowledge the two finger salute. Then, lo and behold, as I was now trying to get my story straight for Apple and the missus, a final stab at the TFS saw iTunes burst into life.

Now I know for sure that the iPod firmware has a built in idiot-cac-himself feature designed to stop the less gifted from messing and simply being happy with having a fully working iPod:

Get RANDOM_NUMBER
If how_many_tfs != RANDOM_NUMBER then ignore_tfs
Else oh_alright_then_but_dont_do_it_again_you_little_rascal

Dear Jobiness, forgive me, for I have sinned. No, I will never try it again.

Travelling between fromValue and toValue

Thursday, April 3rd, 2008

Last night at XCake showed me just how much catching up I have to do if I’m going to be an active (useful) member of the MacHack community here.

So, I started with Bill Dudney’s Core Animation for OS X tonight.

I’ve only got through the first chapter so far, and one very tiny code example, but already I’m looking forward to getting deeper into the book and the subject.

The very first code example shows the way things are going. The author provides a little project that moves a picture from one point in a window to a new point, on a keypress. Then, with one change in the code, the image is animated along the path, rather than simply disappearing from one and appearing in another.

Like most things that Apple dream up, it’s all magic, and yet all perfectly logical. Instead of dealing directly with the thing you want to animate, you request it’s animator proxy. Then, instead of telling the window to move, you tell its proxy, and it’s the proxy’s job to interpolate everything from the start position to the end within the time alloted to the animation. Simple!

Actually, the animator proxy delegates (it’s amazing how often that word crops up in Mac development) the actual interpolation to an implementation of CAAnimation. The animator proxy looks up the implementation for the specific action you’re attempting (setFrame: for instance) and it does the interpolation between the fromValue (usually the current position) and the toValue (the argument passed to setFrame: in this case). Brilliant!

The intriguing part will come later when the book goes on to talk about how you write your own CAAnimation implementations are make them available to the animator proxies.

We’ll see how it goes from here (to there).

Update: Isn’t amazing how boring I can make such an exciting subject sound? Maybe I should’ve followed a career in higher education.

All I know is that I know nothing.

Wednesday, April 2nd, 2008

I’ve just come from the inaugural meet of XCake, here in Belfast. The plan is to get together and discuss Mac and iPhone coding over cake and coffee.

The only problem with getting together with smart people is that you can come away feeling that, no matter how much you think you’ve picked up in the last two weeks, you really know very little. I suppose it’s how you react to the realisation that you know nothing: give up on the idea that you’ll ever learn anything ever, or get the head down and start learning …

I’ve just bought the Core Animation book from Pragmatic Programmers.

So, you’re a Mac fanboy now?

Wednesday, March 26th, 2008

It’s been a little over a week since my MacBook Pro arrived. I knew, more or less, what to expect. It’s not my first Mac, and the week has thrown up no surprises so far. It’s all good. The PC is being reformatted and donated to the Receiver of All Tech Handmedowns, my mum.

This machine is primarily a development machine. That’s the plan anyway. It gives me the chance to finally dive into the iPhone SDK (the other Mac in the house is a G5 iMac, a no-go for the Intel only SDK). I’m also interested in looking at the unofficial toolchain. Hopefully more posts will follow regarding my many coding adventures in both.It was great to see the latest Python installed along with setuptools, which really surprised me. I’ve lost all interest in following Java developments, so, it’s of no real concern to me that the version of the JDK installed is a little behind the times.

I’ve installed Linux in a VM to have a local mirror of my VPS. Other than that, it’s a still a pretty vanilla OSX install. That’s bound to change.

The big question now, of course, is should I buy a Time Capsule? The bug has bitten. 

(BTW - the title comes from the first thing a friend said when he heard I’d bought the notebook. Why do people have reactions like that to Apple hardware? Would he have said “So, you’re a Dell fanboy now?”)