Your eyes don't deceive you, that is a 5 1/4 inch drive - the processor direct slot has an Apple // card in it (which was designed for the LC, which my parents bought it with, but it works great in the Colour Classic).
Apple Push Notifications Talk—Screen/Audio recording now available
Quickly add PDFs to iTunes/iBooks
For any non-PDF document, you can print to PDF and open it in iTunes. But you can collapse that with this neat tip from MacWorld.
If you want to quickly add a document or a web page to your 'Books' collection in iTunes, all you need to do is to create an alias of iTunes and drag it to ~/Library/PDF Services. Now, when you're browsing the web or viewing documents and you decide that you want to read them later on a portable Apple device just hit Print, click the PDF button on the bottom left corner of the window and choose iTunes. iTunes will launch and receive the PDF. Next, sync your device and you're ready to go.Source
But what about when you've got a PDF already open in Preview (say you clicked a PDF download link)? Sure you could save to desktop, drag into iTunes, delete it. Or find 18e3764.pdf in your download folder etc. But if you're any kind of Mac commandline nerd, you will already have DTerm installed (if you don't - do yourself a favour and go check it out).
So you have a PDF open in Preview (or any other PDF app) - just hit your DTerm shortcut key combo (mine is Command-Shift-Enter), then type open -a iTunes then hit Command-Shift-V. (this pastes the path of the current window's file into the DTerm commandline) and hit Enter.
Now your PDF is in iTunes, already highlighted ready for you to change the title if needed.
Debugging release/autorelease issues in Cocoa
(gdb) x/s $ecx 0x980530c4: "release"you can see that the selector in the second argument is "release". Now we're getting somewhere, we know an already freed object is trying to be released. Since there is none of our code in the stack trace it's a fair bet that it's happening when the autorelease pool is releasing.
There are a few tricks in your toolbox for tracking down over-released objects. There's the NSZombieEnabled, NSAutoreleaseFreedObjectCheckEnabled and other environment variables which will give you better logging rather than just crashing.
I've found this is not always reliable (logs from the above builtin debug options showed that the over-release was on an NSCFDate object, when in fact it was an NSNumber). Sometimes you also just want to trace through exactly what is happening with your retain/release/autorelease cycles. That's what we're about to achieve here.
Ok, so you have a unit test that replicates this problem right? I use the excellent GHUnit by Gabriel Handford. If not you'll have to play around a bit to narrow down your problem code. In my case, I wanted to confirm that a particular unit test was failing during the autorelease pool release. Best way is to wrap the offending code in a new autorelease pool. Then it will be freed inside your code, which you will see in the stack trace, and confirm you have found the reason. My unit test now looks like:
(Note that the code examples, embedded in github gists, are not showing up in my RSS feed. I'll fix that later, but for now please read the original post)
Now when I fail with EXC_BAD_ACCESS my stack trace looks like this:
Where line 91 of CJTestCJCard.m is the [pool release] call above. So something is being added to the autorelease pool, and is *also* being fully released, or maybe it's being added to the pool more times than it is being retained. There doesn't seem to be a way to interrogate the contents of the autorelease pool (which is a shame) but we log some really useful info by overriding a few methods, like NSObject's release and autorelease methods, so we can see when things are being added to the pool and when things are being released. This is some funky stuff, but since we're only doing it in our unit test class, not code we're going to release you can sleep soundly at night. Here's how I effected logging in release and autorelease.
Add this to the top of your unit test class, before your current @implementation:
Now in your unit test class @implementation, you can use the setupClass method to effect the method implementation switcharoo:
Now your log will be filled with log lines like:
This can help when tracking down tricky releasing bugs. Note that not all classes seem to comply. For instance I see plenty of log lines for NSCFString, but never any release lines. I assume that NSCFString release implementation is a bit different since it's a toll free bridged object - getting that to log is an exercise left for the reader!
If you're interested in the functions I used above to interact with the runtime, check out the Introduction to The Objective-C Programming Language and Objective-C Runtime Reference. Note that the code above works fine in the iPhone simulator. It should be fine on 64 bit Mac apps, but you may need to diddle the method structs manually in 32 bit Mac apps since they use the legacy Objective-C runtime (which you can read about in the Objective-C 1 Runtime Reference).
Also note it won't work on the iPhone itself, so to save constantly commenting out code, you can wrap the offending code in #if TARGET_IPHONE_SIMULATOR #endif pairs.
I was *really* hoping that the "Nitro stabilisation" improvements would resolve that.
Adding Apple Remote Support to your Cocoa App
Here is the presentation I gave at last month's CocoaHeads:
CocoaHeads Sydney - May 7th 2009
Last month at CocoaHeads Sydney I gave a lightning talk showing how to add Apple IR support to your Cocoa app. I have uploaded the slides to the files section of the google group. In the presentation I also showed how I used the LaTeX beamer class to make pdf slides, and I used the open source SplitShow application to give the presentation (using my Apple IR support of course!) You can get SplitShow from the google code project but you'll have to build from the trunk to get the IR support which has not yet been included in a release.
We also had Ben Hill show us the impressive prototype of an OpenGL iPhone game he put together using cocos2d.
This month our very own Jude Sutton will be giving us a presentation on the Authorisation Services and related APIs.
This month's details:
All details are published monthly on the CocoaHeads AU google group.
Hope to see you there!
CocoaHeads Sydney - March 5th 2009
André's talk last month was an interesting delve into Objective-C internals and creative ways to make use of that knowledge. (slides).
This month I am pleased to announce that Nathan Day, who was in our meeting last month, will be presenting something that instead saves you from having to know about some of the nastier internals of the Cocoa framework—his extensive collection of public frameworks.
Nathan was guest speaker at Brisbane CocoaHeads last Thursday and has agreed to make a repeat performance for us.
The location will again be UTS although the room may be different as the semester is approaching, stay tuned for details.
There are details about subscribing to the google calendar on a page in our group: http://is.gd/kEtW
Or you can use this link to add the March meeting to your own calendar: http://is.gd/kEud
I'll update the calendar meeting with the room details etc. when I have them and will also email the cocoadev list etc. closer to the day. Looking forward to seeing you all there!
Native MacOS Umbrello in KDE4
It has, though, been tough to build on MacOS even just under X11 (as witnessed by the long list of comments on my earlier blog with various configure recipies). KDE4 promises to resolve that with the native MacOS Qt support allowing Mac native applications.
The Mac KDE project has beta downloads of the (nearly) full KDE environment for Mac. All the bits you need are at http://mac.kde.org/ but note they are hosted on an ftp server that allows you to only download one file at a time, so let one finish before you start the next. No compilation or commandline trickery needed - just installing normal MacOS packages.
After installing the various bits you will find a KDE4 folder in your Applications folder. Here's Umbrello running on my Mac:
There are a few oddities - I could maximise the window, but not drag the window size to anything other than the original or the maximum, but otherwise it seems quite solid.
The most awesome case mod ever
Such an awesome idea. You could shoe-horn all sorts of awesome things into a Disk ][ case. The working In Use light is a nice touch, but I bet it doesn't make the right sound :)
Via: Cult of Mac.
25 years of Macintosh--illustrated timeline
I have owned or used every item in this picture except for the Lisa and Macintosh Portable (though I have seen both of them at one stage). I even have the eWorld disks still and DB has a copy of the (pictured) MacWorld edition 1.
MacBook (Nvidia) video flicker or "tearing" on scroll/video
After sleep/wake it is really bad—to the point that it distracts. It is in multiple applications (Safari, Xcode) so I assume it is a video driver issue. Some 'net reports for MacBook Pro users say that it is not an issue if you choose the faster GPU on that laptop (the GeForce 9600M GT) suggesting that it is a driver/chipset issue with the Nvidia GeForce 9400M.
I found one tip that improved the situation, when you get the problem you can force some sort of vido reset by pressing Control-Shift-Eject (you might need to hit a key or wiggle the mouse to wake the screen back up again).
It doesn't completely eliminate it, but at least in normal non-video use you don't notice it so much.
Since a reset of some sort improves it, I assume it is something to do with the way the chipset is brought up after sleep so hopefully either a driver or firmware update should be able to either resolve it or if it is a chipset issue at least work around it.
CocoaHeads Sydney - February 5th 2009
After the very successful, and inaugural, Christmas beers event held by Sydney CocoaHeads in December, our first meetup for 2009 will occur on Thrusday February 5th.
What is CocoaHeads?
CocoaHeads is a global collection of groups devoted to discussion of Apple Computer's Cocoa Framework for programming on MacOS X. During monthly meetings, members present on their projects and offer tutorials on various programming topics.
There is also a calendar you can subscribe to:
Or add just this upcoming meeting to your calendar:
heads up 'tunes featured on iLoveMacApps.com
I'm not sure where the slowdown he is seeing is coming from so I'll quiz him on that, but clicking the song and hiding the dock icon are good ideas.
He has a pretty eclectic playlist :)
Unibody MacBook VGA = sucky
Then I connected it to my venerable (but still awesome) Silicon Graphics 22" CRT monitor with the mini displayport -> VGA adapter.
I knew the maximum resolution supported via VGA was going to be 1600 x 1200 from the manual (p66) which was fine with me since that is the resolution I usually use.
What the manual and tech specs page gives no mention of is that the highest refresh frequency you can run at 1600 x 1200 over VGA is 60 Hz. That's enough flicker to drive you mental immediately (and give you a headache in about a quarter hour).
The next resolution down offered is 1400 x 1050 at 85 Hz. Plenty fast enough, but that's 450,000 less pixels. No thank you.
Thankfully, with the magic of DisplayConfigX you can change the refresh/resolution combinations MacOS X will offer you. You can't squeeze any more bandwidth than the hardware maximum, but you can make different compromises. I figured I can run 1600 x 1200 at 65 Hz (too flickery), 1536 x 1228 at 67 Hz (still too flickery) or 1472 x 1177 at 69 Hz. This last combo is just about palatable as long as I boost the brightness a little (to increase phosphor persistence) and degauss regularly.
DisplayConfigX is $12 USD, but that's easily worth the 26,2544 pixels I have reclaimed thanks to its flexibility.
Of course Apple's tech specs and docs should have provided the relevant detail. Not that that would have changed anything (other than a frustrating discovery) since to my mind the 15" laptops are just a shade too big and heavy (I am upgrading from a PowerBook 12" remember...).
What? No new Mac Mini?
No mention of Snow Leopard either - I guess the new hardware and Snow Leopard go hand in hand, so look for a "special event" at 1 infinite loop sometime this quarter I guess...
Now what do I do? I need to replace my broken 15" PowerBook media centre, but I'll die if a new mac mini comes out after I buy the current one :(
Retro Mac nerd alert
The eWorld app is mind-bendingly cool. And if you leave it alone you get flying toasters.
Installing avrdude via MacPorts
Trying to install the current avrdude via MacPorts can hit a snag though, because there is a flex source file (lexer.l) which won't compile with the version of flex that MacPorts installs (if you have ever installed flex via MacPorts).
The Apple supplied flex is fine, so the Portfile just needs a little addition to point the ./configure in the right direction.
Edit the portfile:
And add the following line to the end:
Now you just need to rebuild:
sudo port clean avrdude
sudo port install avrdude
Welcome to Macintosh - the documentary
Christmas present idea if anyone's listening :)
Welcome to Macintosh —the documentary for the rest of us.
Blog Categoriessoftware (41)
..heads up 'tunes (5)
..black and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
Book Review (2)