Tutorials

Links to Tutorial Series

Here is a list of past and present tutorial series featured on MacResearch:

Cocoa for Scientists (XXX): Developing for iPhone

Author: Drew McCormack

Around a month ago, I published a book on scientific scripting with Python. Nothing unusual, except the manner in which it was published: the book was only made available via the iTunes App Store.

I wrote a short piece announcing the experiment here on MacResearch, and promised to release the source code for those either wanting to do the same or just learn how you write a simple iPhone app. Today, I am coming good on the promise. This tutorial will be an introduction to developing on the iPhone, using the book reader I developed as an example.

Tinkering with Google App Engine

Author: Drew McCormack
Web Site: MentalFaculty.com

In April 2008, Google announced Google App Engine, their long-awaited answer to web services offered by Amazon and others. Google took a different approach to their competitors by including a full application stack for developers. This made App Engine less flexible, by forcing developers to use the programming tools and libraries that Google supplied, but it did have the advantage that you could get your web app up and running very quickly, and easily leverage Google’s infrastructure. An app could scale up with very little work on the part of the developer — in theory.

Although the theory was sound, in practice, developers were quite limited in the resources they had available, and there was no option to increase those resources. Google has now addressed that, allowing developers to pay for resources at rates comparable to Amazon Web Services, so it seems App Engine may finally be ready for prime time.

A couple of months ago, my interest in App Engine was piqued enough to take a closer look. I spent about a week developing a Twitter-like web site called Mental Drain. (The site is fully operational, if a bit rough around the edges. You can try it out by logging in with your Google account.) In the rest of this post, I’ll discuss what’s involved in developing a web app with App Engine, and provide a few examples from the code I wrote for Mental Drain.

A 'Copy Public Link' Menu Item for iDisk

Author: Drew McCormack

Web Site: www.macflashcards.com

I’ve been using Dropbox now for a month or so, and I’ve found it a very useful tool for syncing and sharing files. It’s free, so give it a shot.

One of my favorite features is an obscure contextual menu: if you right click on a file in the Public folder of your Dropbox, there is an item called ‘Copy public link’. This makes it trivially easy to share a file with anyone. You just copy the file to the Public folder, use the contextual menu to copy the link, and paste the link in an email. This very simple piece of functionality makes my life so much easier.

Apple seem to have cottoned on to it too, because yesterday they announced a new feature which allows you to generate a public link for a file on your iDisk. While this is welcome, it still requires you to open the MobileMe web app, which is one step too many in my view. So I guess we have to wait for Snow Leopard to see the feature supported in Finder…or do we?

There really is no reason you can’t generate public links for iDisk via Finder to mimic the way Dropbox does it. All you need to do is convert the local file path into the appropriate URL for the file online. It’s not rocket science, so I took a shot at it using Automator. The rest of this post will be about how you can install the Automator workflow I came up in order to make use of the ‘Copy Public Link’ menu item. I’ll also delve into the code a little to show you how it works.

Interacting with SOAP based web services from Cocoa, part 2.

Author: Alexander Griekspoor
Web Site: www.mekentosj.com

SOAP based web services and Cocoa have never been good friends, and although REST based webservices are fortunately today's standard there are still tons of SOAP-based ones out there. What has always been missing in Cocoa is high level support for interacting with SOAP-based webservices. Here I describe one way in which you can build such frameworks yourself. Last time we started by analysing the webservice calls in detail, in this second part we generate the necessary Cocoa classes for use in a Mac or iPhone application.

Restricted SFTP in Mac OS X Leopard

On occasion you may want to exchange data with someone else. You'd like to grant that person access to your system (or network) but in such a way that the person has limited access to other areas of the system (or general resources on your network). This article will show you how to setup a chrooted jail that restricts the user to only SFTP on Mac OS X Leopard. It further limits the user so that they cannot traverse the filesystem outside the bounds you specify.

Interacting with SOAP based web services from Cocoa, part 1.

Author: Alexander Griekspoor
Web Site: www.mekentosj.com

SOAP based web services and Cocoa have never been good friends, and although REST based webservices are fortunately today's standard there are still tons of SOAP-based ones out there. What has always been missing in Cocoa is high level support for interacting with SOAP-based webservices. Here I describe one way in which you can build such frameworks yourself, starting by analysing the webservice calls in detail in this part 1 and generating the necessary Cocoa classes for use in a Mac or iPhone application next time.

Do-It-Yourself Optical Character Recognition (OCR)

An application that does Optical Character Recognition (OCR) — extracts text from raster images — will usually set you back a few bob, but if you are not averse to the terminal, you can have a sound OCR solution for nothing. It’s all thanks to an initiative of Google to index all of the information in existence. Some information takes the form of text embedded in images; humans can read it without any problem, but computers find it more of a challenge. This has led Google to start up the open-source project OCRopus.

Cocoa for Scientists (Part XXIX): This is the Message

Author: Drew McCormack
Web Sites: www.macflashcards.com, www.macanics.net

In our last installment, we began a journey into the world of lowish-level networking on Mac OS X and iPhone. The first tutorial introduced the topic, and delved into Bonjour, which is a framework that helps devices find each other. In this tutorial, we are going to learn how you can make devices connect and talk to each other after they have been introduced, a process best described as ‘messaging’. We’ll be developing some basic messaging classes that will run on Mac and iPhone.

Cocoa for Scientists (Part XXVIII): Bonjour and How Do You Do?

Author: Drew McCormack
Web Sites: macflashcards.com, macanics.net

Many of you will have noticed that last week Apple lifted their NDA on the iPhone SDK, which means we are now free to talk about it. You will undoubtedly read a lot about what is in the SDK, on blogs, and in Apple’s own documentation, but one aspect of iPhone development that I found to be poorly covered was networking. I don’t mean downloading a web page, or copying files from an FTP server, I mean the low-level stuff. How do you find and talk to another iPhone or Mac? The options available on the iPhone are also available on the Mac, so it seemed like a good topic for this series.