I am starting NSCoder night in Ames, IA. The first meeting will be at The Stomping Grounds at 7pm on Tuesday the 23rd. If people want the location can change, just email me or tell me in person at the first NSCoder Night in Ames. Come and bring your Cocoa Projects and I'll see you then. Here is a link to the NSCoder Night site explaining what NSCoder Night is about: http://nscodernight.com/
Monday, September 22, 2008
Announcing the First NSCoder Night in Ames
Posted by
Colin Wheeler
at
1:24 PM
2
comments
Labels: NSCoder Night
Tuesday, August 19, 2008
Xcode Shortcuts: Original Documents now Creative Commons Licensed
I am hardly one to hold something back from the Mac Developer Community when I think I have something that will benefit everybody. As such I am finally doing something I've wanted to do for a while. My Xcode Shortcuts guide has a ton of downloads and is one of the most popular articles of all time on my site, and I think many people would like to use the content in various different formats to suit their needs so I don't want to hold you all back. As such I am releasing the Xcode Shortcuts guide under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License. In essence you can share and modify the work as you please as long as you attribute me as the author somewhere in the work, don't use it for Commercial Purposes and share the modified works under a similar License. The Xcode Shortcuts guide was created with Pages '08 and thus you need it to modify the document, though I have included a copy of the document exported to Rich Text format for some compatibility though the document looks like one big mess when I open it in Text Edit. The only thing I've done from the Guide I released is to remove the Xcode Icon just for legal reasons. If you want it's easy to paste it back in there. Although it's not required, if you modify and use the Xcode Shortcuts Guide leave a comment here or send me a quick email letting me know. Thanks! Have Fun! Right Click on the link and select "Save Linked File to 'Downloads'" Xcode Shortcuts Guide CC Licensed
Posted by
Colin Wheeler
at
10:15 AM
3
comments
Labels: Keyboard Shortcuts, Xcode
Sunday, August 03, 2008
I Agree with Gus: VMware Mac OS X Virtualization rocks!
Recently Gus Mueller posted about how VMware with a virtualized instance of Mac OS X is a dream come true for him. It's also a dream come true for me. The ability to run Mac OS X on a virtual machine instance has been something that's been on my wish-list for a while now. Backing up all my data and reinstalling all my apps so that I can install the current version of Mac OS X and then create another partition for the developer seed of Mac OS X is a pain in the butt and overall wiping my HD and reinstalling Mac OS X is something I only like to do when a new major revision of Mac OS X comes out like 10.5, 10.6, etc to avoid any problems and clear out the clutter. Also if I have to reboot to boot into a different version of OS X I feel like it requires a lot of planning to decide when I should boot into the other version of OS X, how long I should spend in it and what exactly I am working on when in the new version of OS X (not to mention you don't have your regular apps,etc), however with virtualization I can multitask and work on 2 things at once or switch between the 2 versions of Mac OS X more flexibly. I'd like to use this as a means to install say Snow Leopard and develop on that which can fit into my workflow very easily as it could fit in its own space and thus I can keep developing on Leopard and then switch to a space running Snow Leopard. I can only imagine the possibilities if I became a Mac Indie of how VMware with virtualized instances of Mac OS X could fit into my workflow with features like snapshots. This also takes VMware from being that app you have to run in order to run Windows XP/Vista so you can do your homework or just work on it because there's not a Mac version of that app or your client/teacher has to run your work on XP/Vista to a true Mac app. It's no longer a "this thing runs Windows" app it's a "this thing runs another instance of Mac OS X on Mac OS X!" which sounds a 1000x more exciting. I do also agree with Gus that Apple should allow the Mac OS X Client Versions to be virtualized as well and not just the Mac OS X Server version, but that is up to Apple legal. When I was flying back from WWDC, I got on my plane and a woman came to me frantically saying that she had a ticket for another better seat and wanted to trade seats with me so she could be with her children. I agreed and got bumped up to Economy Plus with plenty of leg room and more importantly sat right next to some guy working for VMware. To my surprise he was running Mac OS X Leopard Server in VMware, however I was tired and at the time I think I remember hearing something about how Apple was allowing this, so I thought "huh that's nice." He asked me if I had my snow leopard DVD on me so he could try that out, but I believe I put it in my checked luggage so I didn't get to see that, which is a shame because I think I'll try that soon and see if it works. After I got back and had time to rest I soon realized just how significant seeing Mac OS X virtualized was. All in all the future for Mac Developers working on 2 versions of Mac OS X is just looking better and better thanks to developments like this. By the way, a big Thank you goes out to all the twitterers who suggested that I go with VMware, i've been very much enjoying it ever since I switched from Parallels. Update: Heres a Blog Entry from VMware about Leopard Server virtualization and here is a YouTube Video showing it in Action
Posted by
Colin Wheeler
at
12:30 PM
5
comments
Labels: VMware
Thursday, June 19, 2008
One GIT Build Script to Rule them all
There seem to be at least 2 camps of GIT Users on OS X, those who installed git with the Mac OS X Package installer and those who installed it from Mac Ports. On my new project Gitty (a Git Repo inspector/manager just beginning development), I didn't want to discriminate, but at the same time I didn't know perl well enough to modify Marcus Zarra's Build Script beyond changing /opt/local/bin/git to /usr/local/git/bin/git. However one of my followers on Twitter was kind enough to modify the perl build script that sticks part of the GIT Hash in the about box to search for both locations and use which ever one you have installed so that it is now GIT Location Agnostic. It looks for the standard install location first and then if It can't find that searches for the MacPorts git install location and uses that. This works great for me and so i thought i'd share... enjoy. Thanks
# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Updated to use git in the Standard Install Location or the MacPorts
# install location by Patrick Burleson
use strict;
# Get the current git commit hash and use it to set the CFBundleVersion value
my $REV = "";
if( -e "/usr/local/git/bin/git" )
{
$REV = `/usr/local/git/bin/git show --abbrev-commit | grep "^commit"`;
}
elsif ( -e "/opt/local/bin/git" )
{
$REV = `/opt/local/bin/git show --abbrev-commit | grep "^commit"`;
}
else
{
die "Git not found";
}
my $INFO = "$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Contents/Info.plist";
my $version = $REV;
if( $version =~ /^commit\s+([^.]+)\.\.\.$/ )
{
$version = $1;
}
else
{
$version = undef;
}
die "$0: No Git revision found" unless $version;
open(FH, "$INFO") or die "$0: $INFO: $!";
my $info = join("", <FH>);
close(FH);
$info =~ s/([\t ]+<key>CFBundleVersion<\/key>\n[\t ]+<string>).*?(<\/string>)/$1$version$2/;
open(FH, ">$INFO") or die "$0: $INFO: $!";
print FH $info;
close(FH);
Posted by
Colin Wheeler
at
11:30 AM
4
comments
Saturday, June 14, 2008
To all those who said hi during WWDC...
Thank you! I meet up with a bunch of people who actively follow me on this blog and on twitter and it was great to talk to every one of you from all over the world. You guys are what made WWDC great for me this year. I myself finally got to meet up with some people who i've been talking to for a while like Scotty, Scott Stevenson, Deric Horn and all the great people in Apple Developer Technical Support. I am amazed at how many people recognized me from such small pictures on my blog/twitter. Im normally a shy person (even though I try not to be), so this was a great experience to meet people left and right. Thanks to talking to some people I got some good ideas and requests of things to cover next here on Cocoa Samurai, as always if you have any requests feel free to write in any time. I'll start work on them right after I get caught up on my homework post-WWDC :\
Posted by
Colin Wheeler
at
9:09 PM
0
comments
Tuesday, May 27, 2008
DTrace for Cocoa Developers
Update: Sorry people I didn't know the default Viddler downloading permissions. If you logged in and tried to download the video and couldn't before, login again and you should be able to download it now.
So in this Screencast Im going to show you how to use DTrace and how to ultimately turn that knowledge into a custom DTrace Instrument for Instruments. Honestly I would login and download the full quality version of this from Viddler. I apologize for the hisses in the s's that I make, I was slightly tired and trying to control that. As always if I said something wrong and made a mistake please let me know right away and i'll make a correction here.
DTrace Examples in the movie
Example #1
colinw$ sudo dtrace -n 'syscall:::/execname == "Safari"/{@num[probefunc] = count();}' -q ^C
lstat 2 sigaltstack 2 sigprocmask 2 stat 2 getuid 16 mmap 32 munmap 36 geteuid 94 gettimeofday 128 stat64 248
Example #2
colinw$ sudo dtrace -n 'syscall::*open*:entry{printf("%s %s",execname,copyinstr(arg0));}' dtrace: description 'syscall::*open*:entry' matched 7 probes CPU ID FUNCTION:NAME 0 17604 open:entry mds . 1 17604 open:entry nmbd /private/var/samba/browse.dat. 0 17604 open:entry Safari /.vol/234881026/1644952 1 17604 open:entry mdworker /private/var/samba/browse.dat 1 17604 open:entry mds . 1 17604 open:entry Safari /.vol/234881026/230745/QuickTime Preferences ^C
Example #3
colinw$ sudo dtrace -n 'syscall:::/execname == "Safari"/{@num[ustack()] = count();}' -q Password: ^C
libSystem.B.dylib`sendto$UNIX2003+0xa CoreFoundation`__CFSocketEnableCallBacks+0x255 CoreFoundation`CFSocketEnableCallBacks+0x4f CFNetwork`_SocketStreamRead+0x5e5 CoreFoundation`CFReadStreamRead+0x1dd CFNetwork`httpRdFilterRead+0x5ef CoreFoundation`CFReadStreamRead+0x1dd CFNetwork`httpStreamRead+0x2aa CoreFoundation`CFReadStreamRead+0x1dd CFNetwork`httpReadStreamCB+0x94 CoreFoundation`_CFStreamSignalEventSynch+0x89 CoreFoundation`CFRunLoopRunSpecific+0xca8 CoreFoundation`CFRunLoopRunInMode+0x58 Foundation`+[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]+0x140 Foundation`-[NSThread main]+0x2d Foundation`__NSThread__main__+0x134 libSystem.B.dylib`_pthread_start+0x141 libSystem.B.dylib`thread_start+0x22 2
Example #4
sh-3.2# dtrace -n 'objc16675:NSMutableArray::entry{@num[ustack()] = count();}' dtrace: description 'objc16675:NSMutableArray::entry' matched 24 probes ^C
CoreFoundation`+[NSMutableArray arrayWithCapacity:] Keynote`0x201ab Keynote`0x35289 Keynote`0x9d981 AppKit`-[NSWindow makeFirstResponder:]+0x12e Keynote`0xa1b29 AppKit`-[NSWindow sendEvent:]+0x1505 Keynote`0x18c7e7 AppKit`-[NSApplication sendEvent:]+0xadc SFApplication`-[SFAppApplication sendEvent:]+0x283 Keynote`0x26d69 AppKit`-[NSApplication run]+0x34f Keynote`0x352f Keynote`0x34a5 Keynote`0x4cc36 Keynote`0x4cb5d 0x2 1
Useful DTrace Links Solaris DTrace Guide (PDF) from Sun Solaris DTrace Guide (HTML) from Sun DTrace Review (Google Tech Talk) MacTech: Exploring Leopard with DTrace
Posted by
Colin Wheeler
at
7:42 PM
4
comments
Labels: DTrace, Instruments, NSOperation, Objective-C
Friday, May 09, 2008
I am on the Mac Developer Roundtable 007 Source Code Management
I was an invited guest on the Mac Developer Roundtable and came on to talk Source Code Management and to advocate for GIT. It was my first time ever on a podcast and I was a bit nervous, still listening to the first part of it right now, but it sounds pretty good so far. Please forgive all the "uhs" I do, Im normally a lot more confident speaking publicly, but I didn't know what to expect on the podcast. Give it a listen and let me know what you think. Be gentle, it's my first time :P ... Mac Developer Roundtable Episode 007 - Source Code Management My Recommendations from the podcast F-Script If I remember correctly, I think I just glanced over F-Script and didn't give it much explanation. Im a huge fan of creating experimental projects and playing around with API's and that's one reason Im a fan of F-Script because then I don't have 30 small projects cluttering up my desktop or a temp directory and so now I do much less tiny projects in Xcode and use F-Script to see how the API's work. You can start F-Script up in a console and create an app from scratch or just create temp objects and see how they work and play around with Cocoa in a way that's not possible in Xcode without creating loads of small projects. You can download F-Script from http://www.fscript.org/ though if you are on Leopard you will need to download and install a special version of FScript Anywhere from http://osiris.laya.com/blog/?p=24 Mac OS X Internals Mac OS X Internals is a great book explaining the guts of Mac OS X and its individual components to you in how they work and comes with many source code examples to demo what's going on. It's a very big book, but it's well worth it for the content it offers you. The books website is at http://www.osxbook.com/
Posted by
Colin Wheeler
at
8:16 AM
2
comments

