
Monday, December 03, 2007
Thank you Developers from a Student
As finals are next week for me and I've finished all my work for 1 of my 5 classes this term and I am finally beginning to get some free time as I try and get my work done early, I thought I'd take some time out of my day quickly and express thanks to those developers who have made my life as a student on a Mac much easier.
A BIG thank you goes out to Parallels who makes it possible for me to use Windows only when I absolutely have to ( my teachers haven't discovered I am using Pages or Textmate insead of Microsoft Word on Windows for most of my assignments yet ;)
Thank you to Flying Meat! I had heard of VooDooPad but never really thought of using it till I had many classes this term all requiring a lot of note taking, so being the smart person I am I went right away to Flying meat and bought a copy to organize all my notes like so (and yes I misspelled Intro to Psychology I know, it was Day 1 and I had been up since 5AM)
I can't count all the times I did group projects and I was the one who could always search through all my notes and always find that bit of info we needed to get our project done before the rest of class :D
Another Thank you goes out to the OmniGroup for doing OmniFocus! Since I adopted GTD (Getting Things Done) and started testing the early Alphas and then bought an Educational OmniFocus license at the first chance I could, I've never been more organized and productive in my life! Turning anything that involves more than 1 action into a project and setting goals and due dates, as well as being able to add items into OmniFocus without actually having OmniFocus as the active app ( QuickEntry ) has probably saved me hours and hours of time.
Thank you to the Vienna developers for making an RSS reader that's allows me to keep up to date on all my sites for tech news especially in my E-Commerce course.
Thanks for Quicksilver! Probably my biggest productivity app period. This is the first app that I've used that I just have to have to multitask. Now every mac I touch I expect Quicksilver to be on there, and moan slightly if I discover it's not
Thanks to TextMate and Apple (Xcode) for making my C/C++/Java classes much easier and more productive
Thanks to Inquisitor (yes even on Leopard) for making my searching faster
Thanks to Blizzard for World of Warcaft for giving me something to unwind from my homework on.
Thanks to Unreal Tournament 2004 for another method of unwinding as well especially when Im on restrictive networks that won't allow me to run WoW
Finally the biggest thank you to Apple for Mac OS X of course and everything from Spaces, Mail, Address Book, Time Machine, iCal, Safari, iTunes, iPhoto, Pages, Numbers, Keynote, Xcode, Instruments, Terminal, etc. Thanks for giving us developers a great platform & developer tools to develop these apps on!
I never realized how heavily I depend on Apple and the various indie developers out there to make me productive till I looked back on this and past terms to see how much time I've saved in the process of using your apps. If I didn't have all this I'd probably be going raving mad right now or even worse... I'd be developing apps on Windows
THANK YOU!!!

Monday, October 15, 2007
An Intro to Quartz and the Core Graphics API's (Updated Links)

Wednesday, October 03, 2007
Des Moines CocoaHeads: All about Quartz
The next CocoaHeads meeting will be close to home in Ames @ Iowa State University. I will be giving a presentation about Quartz and specifically using it with Cocoa. Once the meeting is up I will post the Keynote presentation and source code so you can download it.
Reposted from http://cocoaheads.org/us/DesMoinesIowa/index.html
The next CocoaHeads: Thursday October 11, 2007 07:00 PM CST at Howe Hall, Room 1246 - Iowa State University Campus. Directions: Howe Hall is located on the north-west corner of Bissell Rd and Marston Ct Ames, IA 50014 [map] "[Howe] is a big building, glass front, you can't miss it". Parking is available in lots north or south of Howe. [parking options] Agenda: Intro to Quartz: a discussion of the more advanced drawing routines available in Cocoa. And as always, general Cocoa geekyness.
Monday, September 10, 2007
Des Moines CocoaHeads in Ankeny & Contact Info
Info reposted from http://cocoaheads.org/us/DesMoinesIowa/index.html
Schedule:
The next CocoaHeads: Thursday September 13, 2007 07:00 PM CST at Kirkendall Public Library.
Directions:
1210 NW Prairie Ridge Dr
Ankeny, IA 50023 [map]
Note that this is a new location as Panera was a bit noisy. Internet access is available, but the librarians tell me it can be "spotty" in the room we'll be in.
Agenda:
We'll be building a very basic app with XCode and Project Builder to get those who are a little green to the process some idea on how to start. This will undoubtedly progress into Advance tips and tricks as well as a discussion on Objective-C's finer points. We should also have time to discuss any issues people may be having or have overcome (I'm looking at you, Colin:)
And as always, general Cocoa geekyness.
You can also find the Des Moines CocoaHeads @ http://groups.google.com/group/des-moines-cocoaheads
==============
Also wanted to let you know that i've setup a GMail account for e-mail regarding questions of things on this blog, general cocoa topics,etc. The address is on the sidebar to the right. You can email me at cocoasamurai@gmail.com.
Wednesday, August 22, 2007
An Open Letter to Apple
Every time Apple releases a new version of Mac OS X, Developers get shafted a little bit. We develop the apps that complement and enhance Mac OS X and make it great and what do we get for this? Releases of Mac OS X about a month after everybody else. It’s no secret that with paid ADC accounts we get a free copy of Mac OS X as it’s stated clearly on the ADC Site ( http://developer.apple.com/products/ ), which is why anybody who knows they are getting a free copy wouldn’t buy one.
Well I am not here to endlessly bitch about it, I am here to provide an easy to implement solution... certificates. I propose instead of letting developers sit by waiting for Leopard to come a month late and let everybody else get a copy of Mac OS X Leopard when it comes out right away, let developers sign up on the ADC site for certificates for a specific Apple store if you want it. Instead of mass mailing out these certificates to every developer (wether they will be at a Apple store or not, thus potentially leading to some abuse of the system) open a form on the ADC site that checks our credentials (knowing if we have an account with a free copy of Mac OS X (Select, Premier or Student ) or not), and then lets say the form can contain the Apple Store we plan to go to and then give us a printable (or mailed to us) certificate that when we go to the Apple store on Leopards launch date we can redeem for a copy of Leopard.
I am guessing that due to the close time frame of Leopard in October it’s probably too late to create this so that certificates are mailed to us. So I suggest this
- Create a Section on the ADC site that lets developers sign up for a printable certificate (optionally with a serial code pattern unique to the particular apple store) to be redeemed at a specific Apple Store for Mac OS X Leopard
- This form validates our ADC account and when it’s all submitted sends this information to the specific Apple store.
- When Mac OS X Leopard launches developers print this certificate out and go to the Apple store
- When at the apple store the employees scan a barcode on the certificate or enter in some unique serial number/code and in combination with a simple thing like our drivers license for ID, validates us and takes the full price off of leopard and thus developers get a copy of Mac OS X 10.5 Leopard! :D
Wednesday, July 18, 2007
CocoaHeads starting up in Des Moines!
Bout time! :D
The first meeting of CocoaHeads chapter in Des Moines, Iowa is starting up. Im planning on attending and if your in the area come on by!
When: August 2 @ 7-9pm
Where: Panera Bread on 86th in Urbandale
Google Maps Link
Why: Meet local Cocoa developers like you who want to know more about Cocoa and voice your opinion about what you'd like to learn about in future meetings
Thursday, June 07, 2007
Make the most of your time @ WWDC
Monday, June 04, 2007
OMG iPhone SDK!!!
Well the Mac News & Rumor sites are abuzz with news of a potential iPhone SDK at WWDC 07. Personally I never know what to trust when these types of rumors come out. I do believe though that there is usually an element of truth behind the rumors.
Since writing my original iPhone SDK analysis shortly after Steve’s keynote i’ve had some time to reflect on this and I must say I still stand by it. To quickly recap here are some observations I made
- There are no Windows in the iPhone, the entire system appears to revolve around presenting and animating views
- The sheets that animate onto existing views appear to only come from the bottom-up as seen in the keynote
- all views and layers appear to have the ability to become partially transparent including the toolbars and topmost statusbar
- The iPhone shows the same cocoa controls we know with some sporting some theming to blend in with
- the iPhone UI, these controls include NSButton, NSSegmentedControl, NSSearchField, NSToolbar, etc
- The keyboard sheet will probably be a standard sheet you can call for input from any app, gone will be the days where we simply assume users can type something at any time
Monday, April 30, 2007
Wahoo! Finals are over! :: Book & QuietLog
Finals are finally done with, all my big projects are over with, all my homework is turned in I can refocus all my energy again!!! :D Don't' get me wrong I like learning in detail about algorithms and some finite math, but after a few months of doing big projects it gets tiring very fast.
Most importantly im gonna get back on track on writing here regularly.
Advanced Cocoa Book
I don't usually give my thumbs up to something that I haven't completely gone through yet, but i've gotten about halfway through Aaron Hillegass and Mark Dalrymple's Advanced Mac OS X Programming and already I love the book. It's the first Mac Developer book I've personally read that doesn't treat you like a complete newbie to Macintosh Development and instead shows in great detail how Mac OS X works and will even show you some nice unix tools you didn't know existed that can actually be of great help to you. The book covers various topics such as Multi-threading, Interprocess Communication, Networking, Performance Tuning, kqueues, Bonjour, Authentication, Keychain, GCC, GDB, memory management, etc. Really this book is a fantastic book that I would really recommend to all Mac developers out there. It starts you right off showing you in detail how you can work with gcc then goes into libraries, gdb, memory and more. Thank you Aaron and Mark for putting together such a great book!
QuietLog
I also wanted to share something with you that I posted in my personal blog a while ago and recently I've learned it's value as I begin to really use it in my serious projects. And I found it on Borkwares quickies site. To be honest I'm not sure how I came across Borkwares quickies site but I'm glad I found it, if you haven't been there take a minute and open up another tab and go there after you see this.
One problem I have with NSLog is that it can provide you with a ton of information when you just want to print simple statements. Printf can be useful, but it can't handle Objective-C objects. So that's what QuietLog is for...

void QuietLog (NSString *format, ...) { // get a reference to the arguments on the stack that follow // the format paramter va_list argList; va_start (argList, format); // NSString luckily provides us with this handy method which // will do all the work for us, including %@ NSString *string; string = [[NSString alloc] initWithFormat: format arguments: argList]; va_end (argList); // send it to standard out. printf ("%s\n", [string UTF8String]); [string release]; } // QuietLogIt's a nice method that can handle objective-c objects and print them out in a simple manner, you won't notice any difference except the all the preceeding junk you didn't care about. To implement this in a way you can use throughout all your project you just need to do it like so... QuietLog.h
#import < Cocoa/Cocoa.h > extern void QuietLog (NSString *format, ...);QuietLog.m
#import "QuietLog.h" void QuietLog (NSString *format, ...) { // get a reference to the arguments on the stack that follow // the format paramter va_list argList; va_start (argList, format); // NSString luckily provides us with this handy method which // will do all the work for us, including %@ NSString *string; string = [[NSString alloc] initWithFormat: format arguments: argList]; va_end (argList); // send it to standard out. printf ("%s\n", [string UTF8String]); [string release]; }And then import the QuietLog.h anywhere you actually need it and now you have a nice utility to use in your projects. If your curious about the va_* stuff you can find more info here http://www.delorie.com/gnu/docs/glibc/libc_675.html, the va_list is a type that's part of the GNU C Library for obtaining info about the arguments used in calling the method. I could go on more about this but you can read the GNU page if you want to know more about it. Thats it for now. I have some free time now that I have roughly a month free from school and can work on my new pet project RedFlag (hopefully to be a great and elegant Del.icio.us client) and post some more great stuff I've discovered. See you soon! :D
Saturday, February 24, 2007
F-Script : Part I - Introduction

F-Script is an object-oriented scripting programming language developed by Philippe Mougin. In a nutshell, F-Script is Smalltalk with support for Array programming.What does that mean? Well F-Script can do many things. You can use it to create small test apps on the fly, you can take control of your app at run time and browse the state of various objects without using Xcode, the debugger, special frameworks,etc. You can do various tests in F-Scripts stand alone console. Additionally F-Script is Open Source licenced under the BSD license. Syntax First off I should show you what's different between F-Script Syntax and regular Objective-C Braces... Objective-C
*color1 = [NSColor blueColor];F-Script
color1 := NSColor blueColorAs you can see F-Script doesn't use the Objective-C braces Strings F-Script using single quotes for strings instead of Objective-C's @"". Example Objective-C
NSString *string1 = [NSString stringWithString:@"This is a standard string"];F-Script
string1 := NSString stringWithString:'This is a standard string'Assignment As you've noticed above F-Script doesn't use a simple "=" for it's assignment operator it instead uses the colon equals ":=" ie Objective-C
color1 = [NSColor blueColor];F-Script
color1 := NSColor blueColorTypes Lastly you should have noticed that none of the F-Script examples had a type declaration on them. That's because everything in F-Script is of the type id which is to say everything is a generic object. Basic F-Script Components Well when your first starting out with F-Script there are 2 components your primarily concerned about.




"F-SCRIPT CURRENCY CONVERTER (VERSION 1)" "Instantiate and configure a window" window := NSWindow alloc initWithContentRect:(125<>513 extent:383<>175) styleMask:NSTitledWindowMask + NSClosableWindowMask + NSMiniaturizableWindowMask backing:NSBackingStoreBuffered defer:NO. "Put the window onscreen" window orderFront:nil. "Give a title to the window" window setTitle:'Currency Converter'. "Instantiate a form object" form := NSForm alloc initWithFrame:(15<>70 extent:348<>85). "Put the form into the window" window contentView addSubview:form. "Configure the form" form addEntry:'Exchange Rate per $1'. form addEntry:'Dollars to Convert'. form addEntry:'Amount in Other Currency'. form setInterlineSpacing:9. form setAutosizesCells:YES. "Instantiate a decorative line and put it in the window" line := NSBox alloc initWithFrame:(15<>59 extent:353<>2). window contentView addSubview:line. "Instantiate a button, put it in the window and configure it" button := NSButton alloc initWithFrame:(247<>15 extent:90<>30). window contentView addSubview:button. button setBezelStyle:NSRoundedBezelStyle. button setTitle:'Convert'. button setKeyEquivalent:'\r'. "Create the script that will compute the currency conversion" conversionScript := [(form cellAtIndex:2) setStringValue:(form cellAtIndex:0) floatValue * (form cellAtIndex:1) floatValue]. "Make the script the target of the form. The script will be evaluated when the user presses Return" form setTarget:conversionScript. form setAction:#value. "Make the script the target of the button. The script will be evaluated when the user presses the button" button setTarget:conversionScript. button setAction:#value.What's great about this console is that is also comes with excellent code completion. My only complaint is that it doesn't filter on the fly like Xcode, but it's definitely a step up from other code completion systems out there.






- We got a basic intro to what F-Script is
- We saw the basic differences between F-Scripts syntax and Objective-C's
- We learned basic information about F-Scipts 2 major components ( F-Script Anywhere and the F-Script console)
- We learned how to change the state of an object on the fly
Saturday, January 20, 2007
How I think iPhone software works
As I am finishing up my other article I thought id take on a challenge and do what nobody has done yet in doing an in depth analysis of the iPhone software and what it'd take to develop for it should Apple ever allow it. Hey I am up for a good challenge
Ok lets get off on even ground here and briefly cover what Apple has said about the iPhone and Mac OS X on it.
- The iPhone will use a touch screen which leaves it dependent on good touch detection software
- touch screen for controls, ignores unintended touches, multi-finger touches for controls
- iPhone runs Mac OS X (albeit a stripped down version) with Syncing, Networking, Multi-tasking, Low Power (power management), security, video, Cocoa, Core Animation, Graphics, Audio
- Proximity Sensor to detect when objects are near (ie taking a call)
- Ambient Light Sensor
- Accelerometer (for detecting when you've switched from portrait to landscape)
- Added necessary Drivers for the iPhone hardware
- Added necessary utilities for Syncing, Networking, Power Management, Graphics, Audio
- Added Mac OS X Frameworks Cocoa, Core Animation, etc.
- Heavily modified the UI to System to display windows, dialog boxes, etc differently for this smaller interface and created the iPhone SDK
- Wrote a new login sequence to deal with the touch sliding login
- Wrote a Menu screen to show all the apps and have the dock-like app selection at the bottom
- Wrote the iPhone apps
- The iPhone shows the same cocoa controls we know with some sporting some theming to blend in with the iPhone UI, these controls include NSButton, NSSegmentedControl, NSSearchField, NSToolbar, etc
- They all have a top window toolbar and some have a bottom window toolbar that are the same size across the apps (with the exception of Safari allowing a little bit more space at the top for displaying a web page title which suggests they are expandable in size (at least to a degree)). The toolbars appear to be either a grayish blue color or a glossy black with the ability to set the opacity for both the top and bottom toolbars as demonstrated in the Photo app (even the topmost status bar also appears to be able to have it's opacity set as well)
- All sheets that slide in animated onto an existing view come up from the bottom vs dropping down from the top like on the Mac OS X we use currently, all views appear to slide up from the bottom as well.
- Im guessing the keyboard view that pops up is probably something that any app can call and use with the app (like Font Dialog, Color Dialog, etc.)
- There is no dark grey / light grey repeating background pattern anywhere in the UI like in the standard Mac OS X default background. The UI is entirely solid colors or gradient patterns. The New way to build Apps on the iPhone Clearly instead of heavily modifying an existing interface it’s clear that the iPhones approach is a brand new method all together. We can all clearly see that there are no “windows” in this approach, but rather views and ways of switching between views. In the same way that when an app launches on Mac OS X it has a main window that is spawned, the apps on the iPhone has a primary view that is displayed. Clearly in a device such as this your app needs to be very simplistic and get straight to the point of the app right away without cluttering the screen. Another thing to take into consideration are the fonts. In addition to have a very small screen to work with, the fonts on everything are bigger than you’d be used to in developing Cocoa apps on Mac OS X. Many controls and labels shown have bolded fonts, typically these controls appear to be the ones displaying what view your actually in (for ex a label saying Favorites to display that you are in your favorite contacts,etc) while secondary controls actually appear to have a very small, but readable, font. The Screen is another thing to take into consideration. Clearly whoever is using the iPhone can switch the view from portrait to landscape at anytime so your app needs to take advantage of that. Im guessing here 1 of 2 things happens (1) Nothing happens - your view is simply resized and draws again in a different frame size (2) Your app implements a method to do something different when the orientation is changed so you can do something special if need be and is implemented something like
- (void) orientationChangedToLandscape: (NSEvent *)event; - (void) orientationChangedToPortrait: (NSEvent *)event;or
- (void) orientationChanged: (NSEvent *)event { if([NSOrientationCenter viewOrientation] == NSPortraitOrientation) { //we changed to portrait } else { //we changed to landscape } }though I think the first example is the much more likely. So lets explore some theoretical iPhone apps! From all appearances when you begin creating an iPhone app you have the entire screen, minus the top status bar, to work with.




Wednesday, January 17, 2007
I've finally joined the Macintel crowd
