boyfarrell.com

next page · previous page

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 [...]

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 [...]

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 [...]

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 [...]

continue reading... » 0 Comments

26 April 2007

malloc: *** Deallocation of a pointer not malloced: 0×500120; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

I keep on getting this error all afternoon when a Cocoa application. It basically means ‘you are releasing something twice’. e.g. WRONG! … //lovely code … [object release]; … //lovely code making you forget things … [object release]; CORRECT! … //lovely well behaved code … [object release]; … //lovely well behaved code not at all [...]

continue reading... » 3 Comments

10 March 2007

Visual DNA

Here is my VisualDNA from dna.imagini.net/friends. Check out my comments below that will tell you why! Here are my comments for the photos: Art – Reminds me of a Pink Floyd album cover. Music – I’m working on the album (yes still)! Treat – Tea. Landscape – Northern England. Freedom – Some PowerBook based geek [...]

continue reading... » 0 Comments

11 January 2007

evTics.app

A little app for working with wavelength (nm) electron-volt (eV) plots in gnuplot. It will generate a gnuplot command which will place ‘nicely spaced’ electron volt (eV) tic marks on the second x axis (x2) using setx2tics(). Usage 1) Type in the range of you wavelength axis in the start and top fields, then, 2) [...]

continue reading... » One Comment

14 December 2006

Jazz Experiment: One

I have never studied Jazz or a Jazz guitar player, so this is really just me messing around trying to sound, not like me. Here I’m playing in my ‘unknown’ fret positions, hitting notes that I don’t normally hit etc. It starts off quite well but then rapidly deteriorates! Enjoy! Audio Player One Or Download [...]

continue reading... » 0 Comments

3 October 2006

Linked Axes In gnuplot

It is sometimes nice to display two x or y axes, when there is a well defined transformation between the two. For example, it is common to see value plotted against of wavelength (nm) and photon energy (eV) or alternatively wavelength (nm) and photon frequency (Hz). These plots have so called ‘linked axes’. Unfortunately, this [...]

continue reading... » 0 Comments

next page · previous page