boyfarrell.com Archives: Learning Curve
next page ·
10 June 2008
NSOperation meets the graphics card?
Details released from the WWDC yesterday mention OpenCL (Open Compute Library) as a technology in Leopard:
Another powerful Snow Leopard technology, OpenCL (Open Compute Library), makes it possible for developers to efficiently tap the vast gigaflops of computing power currently locked up in the graphics processing unit (GPU). With GPUs approaching processing speeds of a [...]
continue reading... » 0 Comments
4 April 2008
GNU Scientific Library and XCode 3.1
Assuming you have a working installation of GNU Scientific Library either from source, Fink or MacPorts, this tutorial will show you how to getting a working XCode project. I am currently using XCode 3.1 but this process hasn’t changed much over the last few years, so will work on older systems.
Download a GSL Example project [...]
continue reading... » 21 Comments
17 February 2008
Gnuplot Blue-Green-Red PM3D Colourmap
set palette model RGB
set palette rgbformulae 30,-13,-23
This code will produce a MATLAB like colormap with the default ‘jet’ setting.
continue reading... » 4 Comments
14 January 2008
ChocPlot: First Results
It has been quite slow going with the plotting framework as of late; the trouble with being in the fourth year of a three year PhD! I have decided to rely on Cocoa for as much as possible for the plot above (under the advice of Wil Shipley). I am using NSBezierPath to draw the [...]
continue reading... » 0 Comments
4 September 2007
ChocPlot: Mutable Axis Model
The original AxisModel was quite limited in it’s abilities; it just did everything automatically. Here I introduce the mutable subclass of AxisModel; MutableAxisModel
As this is a subclass it still responds to the same methods defined in AxisModel; -interval, -spacing, -start, -stop, -representation, -description
MutableAxisModel adds additional methods designed to give the user some control over the [...]
continue reading... » One Comment
3 September 2007
Overview of axis rounding
(A pdf version of this discussion with equations, and source code with documentation are available. Alternatively, just the documentation is available on-line.)
Update There were some problems with the original code, but they are all solved now. There were just silly bugs: one variable was a unsigned and should have been an int etc.
I have [...]
continue reading... » 0 Comments
16 August 2007
ChocPlot 1: Axis Model
ChocPlot is my very poorly named framework/application for plotting using Cocoa. It is still very much a work in progress, so far I have written a class called AxisModel. It can be used to generate nicely spacing axis tic marks from just two variables; the start and stop values of the axis.
Please read the on-line [...]
continue reading... » 0 Comments
3 August 2007
Determining Line-Endings
If you need to find the line endings of a particular text file from inside a Objective-C or Cocoa application have a look the example code here:
Line-Endings Xcode Project (24kb)
Un-zip the package on you Desktop, (I have hard coded the link to the test file relative to the users desktop), open the xcode project [...]
continue reading... » One Comment
27 May 2007
Using NSDictionary to store custom classes
If you want to integrate your code with Cocoa, you will sooner or later find yourself wanting to store your objects; or use them as keys, in a NSDictionary. Before they can be use in this way you must first implement two methods that cocoa collection classes expect;
-(unsigned) hash; and
-(BOOL)isEqual:.
Hashing is a [...]
continue reading... » 0 Comments
26 April 2007
Implementing Object Copy
Found a handy little reference today (click link below) about conforming to the NSCoding Protocol:
Apple Conceptual Cocoa Documentation
If you want your objects to be become part of NSDictionary classes then you will need to add the -copyWithZone: method in your class. If your objects only contain primative types such as double, int, BOOL [...]

