Oct 11 2007

Mac OS X Screen Grab

I recently mentioned how to grab a screen shot of an application window on Windows XP. On Mac OS X you can also capture a screen shot of a window but its definitely is not as simple as Windows since it does not come with a Print Screen key. Mac OS X comes with a Grab utility (under Applications | Utilities | Grab) which an capture the whole screen, a selected window, or a selected rectangular area of your screen.

You can also grab a screen shot by using the Preview application. Open the Mac OS X Preview application and select the File | Grab | Window menu to capture a screen shot of a selected application window.

Technorati Tags: , , , , ,

Jul 9 2007

iPhone Dev Camp

iPhone Development

The iPhone Dev Camp started on Saturday by a nice presentation by Chritopher Allen, a MacHack veteran, regarding what is known about the iPhone from a web developer’s perspective. What is known is that the iPhone uses web standards (HTML, XHTML, CSS, JavaScript, PDF and Quicktime). Web 2.0 best practices apply for the iPhone, such as the proper use and sepration of HTML, CSS, and JavaScript. Christopher recommends avoiding the use of Flash, SVG, Java applets, embedded video, custom x.509 certificates, and framesets. Christopher also states the the finger is not a mouse and you need to design accordingly with large enough buttons and links with plenty of space between each other.
Fingers can do more than the traditional point and drag cursor such as double tap, touch and hold, one or two finger drag, flick, and pinch.

It might come as a surprise but many of JavaScript events don’t work, such as onscroll, onkeydown, onkeypress, onmousemove, etc. Some web development recommendations for the iPhone are to use columns and small blocks in the layout, such as floating divs. You should also use the tel: and mailto: protocols in links. You can also integrate with Google Maps simply by adding your location search to maps.google.com/maps? URL.

The current activity on the the iPhoneWebDev Google Groups seems to be focused around iPhone specific development libraries, implementing the infamous back button, debugging JS, optimizing application for low bandwidth, and hacking the viewport. There is also a series of open questions such as, what level of support is there for the canvas tag? What level of persistent storage is available, cookies? The right questions will lead to the right answers. I have also published a great list of available iPhone development resources.

Most of time at the iPhone Dev Camp was spent developing a collaborating for the hack-a-thon. This was a working camp focused on developing some really cool applications on the iPhone.
Continue reading

Jan 10 2007

SF Ruby Meetup

I attended last nights San Francisco Ruby group meet up held at CNET. The theme of last nights meeting was Lightning Talks and Mini Hack Session. I was only able to attend for the Lighting Talks.

Rich Collins started off the lightning talks with a presentation of his new Ruby on Rails plugin Simply Presentable. In the meeting Rich said that Simply Presentable is an alternative to Simply Helpful, and view helpers in general. Simply Presentable introduces Presenter classes in your Rails projects, in addition to the already existing Model, View, and Controller classes. The Presenter class knows how to render the model, an active record instance, based on its state such as is it a new record or an existing record in the database.
Continue reading

Oct 24 2006

RubyConf: Leveraging Mac OS X From Ruby

Laurent Sansonetti of Apple gave an awesome presentation on RubyOSA. RubyOSA is a Ruby/AppleEvent bridge that allows Ruby programs to interact and manipulate Apple applications in the same fashion that AppleScript can. Here is a code sample from the RubyOSA site:

require ‘rbosa’
app = OSA.app_with_name(‘iTunes’)
track = app.current_track
p track # -> #<OSA::Itunes::File_track:0x1495e20>
p track.name # -> “Over The Rainbow”
p track.artist # -> “Keith Jarrett”
p track.duration # -> 362
p track.date_added.to_s # -> “2006-06-30”
p track.enabled? # -> true

According to Laurent, Ruby has been shipped with OS X since 10.2, ‘Jaguar’ which buncled Ruby 1.6.7. Apple packages Ruby as a framework which is easier for Mac development and allows versioning. In addition to Ruby, OS X includes RubyGems and gems like rake, rails and friends (mongrel, capistrano), libxml2, and sqlite3. Laurent mentioned that he is open to suggestions for adding including additional gems into OS X.
Continue reading

May 17 2006

Design This Container

I attended the Creating Professional Swing UIs Using NetBeans GUI Builder (Formerly Code-Named “Matisse”). I been meaning to get started with the NetBeans GUI Builder to become a more productive UI developer. An important point for me is that Matisse supports custom components. This is important for me because at my company we have developed a lot of custom components. The Matisse GUI Builder is a WYSIWYG visual builder with a drag and drop feel which can be used to design an UI as oppose to developing one. Of course UI builders are great to quickly prototype an application.

The NetBeans UI Builder reminds me a of XCode’s Interface Builder. An IDE has context help, and UI Builder, like Interface Builder, have alignment help. With both these tools, UI design becomes an art rather than a science. At the end of the session one of the speakers simple summed up the session as, “Hand coding bad, Matisse good.”

Here is a good design practice when using the NetBeans UI Builder: Design every container as resizable.

Technorati Tags: , , , ,

Apr 23 2006

Hello World Cocoa

Want to be a Mac Developer? Well, OS X and Xcode makes it easy to start hacking your ideas into Apple applications. I started to ‘write’ a Hello World program using Xcode. In less than five minutes and no coding at all I was able to create what I had in mind:

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

   // insert code here...
   NSLog(@"Hello, World!");
   [pool release];
   return 0;

The above code was auto-generated for me by Xcode. Now only if Xcode could auto-generate the code for a new killer app that I been dreaming of.

I also want to note that the above code is a command line, Foundation Tool, application.

The @”Hello, World!” piece of code is a NSString literal. You night also have noticed that there are a lot of types that start with NS. The NS prefix stands for Next Step which is where Cocoa first started out.

Technorati Tags: , , ,