Tutorials
Links to Tutorial Series
Here is a list of past and present tutorial series featured on MacResearch:
科学者向けのCocoa (part1):ハローブレーブニューワールド
英語チュートリアルの作成日:2006年10月17日
著者:Drew McCormack
翻訳:Ignacio Enriquez
Japanese Version of Drew's Tutorial.
The Dynamics of Scrolling
There has been quite a bit of discussion the last few days about the momentum-based scrolling that Apple uses on the iPhone. The discussion has largely been fanned by John Gruber’s Daring Fireball blog. He has been arguing for some time that one of the reasons web apps feel inferior on the iPhone to native Cocoa apps is that the WebKit-based scrolling doesn’t behave the same. A recent post pointed to a JavaScript framework that Apple is apparently using internally, and which does produce a comparable scrolling experience.
This got me wondering how difficult it would be to reproduce Apple’s momentum scrolling on your own in JavaScript. Is the reason no web developers mimic native scrolling that it is too difficult, or is it just laziness or the expectation that it is very difficult that stops them? Or is JavaScript just not up to the task? To find out, I decided to try. About 3 hours and 100 lines of JavaScript later, I have my answer. Now it’s your turn.
Using VVI for Graphing on iPhone
The following tutorial was produced for MacResearch by VVI.
This tutorial shows how to make an iPhone application that graphs your data. It also provides the fundamentals for incorporating many 2D and 3D graph types in your iPhone applications.
Cocoa for Scientists (XXXIII): 10 Uses for Blocks in C/Objective-C
Snow Leopard brought with it blocks (closures) for the C and Objective-C languages. Blocks at first seem to be nothing more than anonymous, inline functions, but that is only partially true, because they are also a lot like objects, carrying about their context data with them. Once you start playing with blocks, a whole new style of programming opens up to you, and you find uses for blocks in places where you may not have expected them.
This is my list of ten different applications of blocks in C/Objective-C.
OpenCL Tutorial - Shared Memory Kernel Optimization
In this episode we'll go over an example of real-world code that has been parallelized by porting to the GPU. The use of shared memory to improve performance is covered as well as a discussion of synchronization points for coordinated work within a work-group. Source code is provided.
In iTunes, you can subscribe to the podcasts by going to:
Advanced -> Subscribe to podcast
URL: http://feeds.feedburner.com/opencl
Episode 6 - Shared Memory Kernel Optimization (Desktop/iPhone/iPod touch)
Episode 6 - Shared Memory Kernel Optimization (PDF)
Source code for Episode 6
OpenCL Tutorial - Questions and Answers to Episode Four
This episode covers questions hthat were generated from the previous podcast. We'll discuss GPU layout/terminology and bank conflicts resulting from shared memory access.
In iTunes, you can subscribe to the podcasts by going to:
Advanced -> Subscribe to podcast
URL: http://feeds.feedburner.com/opencl
Episode 5 - Questions and Answers to Episode Four (Desktop/iPhone/iPod touch)
Episode 5 - Questions and Answers to Episode Four (PDF)
ChemDoodle Web Components
About the Author
Kevin Theisen is the President of iChemLabs, which funds, develops and hosts the open source ChemDoodle Web Components.
Protein Data Bank Demo and Canvas Technology Analysis
In this article, I provide some background and analysis of the javascript/Canvas technology along with future prospects followed by a step-by-step walkthrough on how to quickly put together a rich web application with the ChemDoodle Web Components. In the walkthrough, I produce a small application that queries the Protein Data Bank (PDB), displays 3D animations of the results, and saves a viewing history. The example is of moderate difficulty, and the reader should have prior knowledge of HTML. Javascript is also important, but those experienced in other programming languages should be able to follow the code with ease.
Cocoa for Scientists (XXXI): All Aboard Grand Central
Author: Drew McCormack
A couple of weeks ago, Apple introduced Snow Leopard, an OS release that left many users cold, but got developers very warm. Snow Leopard has a few new under-the-hood changes that are designed to make the life of a programmer that much easier in the heterogeneous, multi-core society that we now live in.
To begin with there is OpenCL. OpenCL is a technology for computing with heterogenous hardware such as GPUs and CPUs. It is being covered on MacResearch in David Gohara’s excellent series of screencasts.
The other big technology is Grand Central Dispatch (GCD), and that’s what I want to look at in this tutorial. Grand Central is a new approach to parallelism. It does away with the old threaded models, and replaces it with a packet-based approach. In this tutorial, we’ll take a look at how it works, contrast it to other approaches to concurrency, and get our hands dirty in some GCD code.
OpenCL Tutorial - Memory Access and Layout
In this episode we cover some questions regarding function calls from kernels and the use of clFinish. Also, we'll discuss basic GPU architecture, memory layout, shared memory. Thread blocks, warps and efficient data loading will also be discussed.
In iTunes, you can subscribe to the podcasts by going to:
Advanced -> Subscribe to podcast
URL: http://feeds.feedburner.com/opencl
Episode 4 - Memory Layout and Access (Desktop/iPhone/iPod touch)
Episode 4 - Memory Layout and Access (PDF)


