
Saturday, April 18, 2009
Distributed Version Control & Git [Part 2]

Posted by
Colin Wheeler
at
8:34 PM
4
comments
Monday, April 13, 2009
Distributed Version Control & Git [Part 1]

Posted by
Colin Wheeler
at
7:56 PM
6
comments
Thursday, March 26, 2009
Global Keyboard Shortcuts with Carbon Events
If your new to Cocoa you've probably not heard of Carbon, on the other hand if you've been developing for the Mac for a while now you've probably at least heard of Carbon and if you're really experienced you've probably used carbon. If you've used carbon at all this article really isn't for you. What I want to do is gently introduce you to carbon events, the 1 scenario where we'd use it for in terms of cocoa apps, why Cocoa Events can't handle this one scenario and why Carbon Events can, and how to implement it in a Cocoa Application. Why Carbon Events There is a specific scenario I had in mind as to why you would use Carbon Events ( actually if you have a Cocoa app it's a you have to use Carbon Events), the scenario is this: you have a Cocoa application and you know your customers will be running it but it will not be the active application running in the foreground, your customers may be looking at Mail, NetNewsWire, Xcode, etc basically some other application than yours and yet you still want to receive a keyboard shortcut key pressed event. How do you do this? Not with Cocoa, in its current form it's literally impossible. Here's why Cocoa Events works as such, according to the Cocoa Event Handling Guide it says "In the main event loop, the application object (NSApp) continuously gets the next (topmost) event in the event queue, converts it to an NSEvent object, and dispatches it toward its final destination. It performs this fetching of events by invoking the nextEventMatchingMask:untilDate:inMode:dequeue: method in a closed loop. When there are no events in the event queue, this method blocks, resuming only when there are more events to process." It then goes on "After fetching and converting an event, NSApp performs the first stage of event dispatching in the sendEvent: method. In most cases NSApp merely forwards the event to the window in which the user action occurred by invoking the sendEvent: method of that NSWindow object. The window object then dispatches most events to the NSView object associated with the user action in an NSResponder message such as mouseDown: or keyDown:. An event message includes as its sole argument an NSEvent object describing the event."


Posted by
Colin Wheeler
at
9:17 AM
14
comments
Sunday, March 15, 2009
Book Review: Pragmatic Thinking & Learning
In what may be become the first in a series of reviews, I thought i'd share some of my thoughts and some insights into various Computer Science/Programming/Developer related books. I am always reading something so I thought i'd provide some thoughts on these books as I read them.
Pragmatic Thinking & Learning is a book that I came across in an unusual way, basically Bill Dudney said he was reading it on twitter, posted a couple updates on his progress and then never really mentioned it again. I was getting done reading Predictably Irrational and the book left me very fascinated about Psychology. I have taken Psychology class, but Predictably Irrational brought it down to a practical level and showed how it applied in the real world with behavioral economics. In that same spirit Pragmatic Thinking & Learning is to Programming & Learning what Predictably Irrational is to behavioral economics.
It's a fascinating journey through behavioral theory, cognitive science, neuroscience and some psychology, all while you are learning how your brain is wired and how it all works. Don't let these science terms make you think it's some boring study on how our brains work, as the title says it's Pragmatic Thinking & Learning. In essence it takes you through how your brain works and then quickly applies it to the real world and offers more of a framework for how you can begin to apply the principals presented. Through the tips and studies in this book you gain a lot of unique insight into problem solving, for example how do you teach someone how to play tennis with only 20 minutes of time? One of the things that makes this book somewhat unique is that it forces you to stop every so often and do an activity or think about something. For example I meditated for 5 minutes today, where I don't think I've really ever been instructed on meditation, and I liked doing it so i'll probably continue trying meditation for a while and observe what differences it makes in my day.
It's also not just the author making a case for an opinion, there are many citations throughout the book to external resources or studies on a particular subject. It offers some very good tips on things from how to keep yourself organized, how to think out solutions to problems, how as a developer you can try and recover from being interrupted when your in "the zone" and many other things like that. I was surprised when I saw the Rubber Duck debugging technique online one day and then came to read about it later that evening in the book. The book presents a case for something and then tries to get you thinking and get you involved in actively applying that to your situations.
My only complaint is the author mentions using a personal wiki to keep things organized and keeps showing he is on a mac and never mentions VooDooPad which I use everyday. I got started using VooDooPad as a way to keep my School notes organized and now I use it for a lot more things, including notes about Cocoa, specific Classes, personal things,etc, it's essentially a Wiki in a convenient self contained document.
Overall it's a nice collection of information on how our brains work, techniques to solve problems, how you can learn information or a skill faster and find techniques that work better for you individually. It's been a surprisingly good read and I am glad I bought it because Im sure I'll reference it from time to time from now on.
Posted by
Colin Wheeler
at
10:25 PM
0
comments
Labels: Book Review
Wednesday, February 25, 2009
On Safari 4's Tab Design & UI




Posted by
Colin Wheeler
at
12:02 PM
7
comments
Labels: UI Design
Wednesday, February 18, 2009
NSConference

Posted by
Colin Wheeler
at
9:10 AM
0
comments
Labels: NSConference
Thursday, January 22, 2009
Late Night Cocoa: DTrace
Last week I recorded an episode of Late Night Cocoa with Scotty in which I discuss DTrace (why it was created & how it works) and reveal the origin of the name "Cocoa Samurai", you can listen to it here: http://www.mac-developer-network.com/podcasts/lnc/lnc038/ I realize listing to my conversation I left 1 big thing hanging. Mainly I mentioned that it'd be great if the OmniGroup had DTrace probes in their apps (they do, not USDT's as far as I know, just standard ones) and if I could trace that, what I meant is that its great from a pro-user/consumer perspective if say OmniFocus acts up on me one day and I can use DTrace to trace OmniFocus and give them tracing information to help them fix the bug, I am against using ptrace() on an app because it stops me from helping you debug your apps with DTrace, especially when it's not too much trouble for me to gather this information and send it to you to help you. Also for those of you asking... Yes I am considering writing a DTrace/Cocoa book to give this subject the justice is deserves. I've got some ideas, and as soon as I get settled into my last school term (for real this time) I'll think about this in more detail, but for the moment I am fairly busy.
Posted by
Colin Wheeler
at
8:59 AM
1 comments
Labels: Debugging, DTrace, Late Night Cocoa, Mac Developer Network

