Re: why use pow(x, 2)?

2009-11-02 Thread Bob Smith
On Nov 2, 2009, at 11:38 AM, Luke the Hiesterman wrote: On Nov 2, 2009, at 11:36 AM, Sherm Pendley wrote: On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne ar...@phasic.com wrote: That said, the original question is a good one. Using x*x instead of pow(x,2) would be quite a bit faster Are you

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Bob Smith
When I find myself in the situation you describe, my first instinct is to re-examine the basic design to see if the code can be re- structured. In your case, a better approach might be to have two separate methods, one which just returns the string, and another which takes a string as

Re: if statement

2008-05-27 Thread Bob Smith
A way to help yourself with this (which I used to forget all the time too), get in the habit of placing the constant on the left side of the comparison, as in (1 == OB) instead of (OB == 1). Then if you forget and use a single = the compiler will remind you, since (1 = OB) is invalid and

Re: Can't understand what's causing NSRangeException

2008-05-07 Thread Bob Smith
On May 7, 2008, at 8:56 AM, Vinayak Suley wrote: Hi, I'm new to objective-C so this might be elementary for some, but I can't seem to figure out why this is happening. Here's two code samples: ONE: SpectralData* spectrum = [selectedLightSource spectralPowerDistribution];

Re: Immediate memory release

2008-04-29 Thread Bob Smith
Use a local autorelease pool, like this: - (IBAction)Generate:(id)sender { // some code for (i = 0; i count; i++) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSImage *tempSource = [NSImage imageWithContentsOfFile:sPath[i]]; // some code [pool

Problem with bindings to user defaults

2008-04-26 Thread Bob Smith
I have an array of simple values, i.e. NSStrings or NSDates, and I want to store that array in user defaults. I also want the array to be editable in the preferences UI. I set up a single-column table and bind the table column to an NSArrayController instance that is bound to the

Re: QTMovie grabing while playback

2008-04-25 Thread Bob Smith
the words right out of my keyboard... ;^} Have you taken a look at the QCTV sample code? It does almost exactly what you want. regards, douglas On Apr 24, 2008, at 9:16 PM, Scott Anguish wrote: On Apr 24, 2008, at 9:05 PM, Bob Smith wrote: In my case all I want to do is be able to add

Re: QTMovie grabing while playback

2008-04-25 Thread Bob Smith
On Apr 25, 2008, at 7:41 AM, douglas a. welton wrote: Bob, re: Quartz Composer Did you check the Asynchronous Mode checkbox on the Movie Loader patch's Settings panel? This box is specifically available to allow for playback of streaming material. Eh? I don't see a patch called Movie

Re: QTMovie grabing while playback

2008-04-24 Thread Bob Smith
On Apr 23, 2008, at 1:08 PM, douglas a. welton wrote: Bob Randall, If all you want to do is slap some arbitrary text over a movie, I would suggest that you take a look at using QTMovieLayer and CATextLayer as the mechanism for doing this. I don't have any code that I can share with

Re: QTMovie grabing while playback

2008-04-24 Thread Bob Smith
On Apr 24, 2008, at 4:03 PM, Uli Kusterer wrote: Am 24.04.2008 um 22:14 schrieb Bob Smith: In my case all I want to do is be able to add a scrolling text overlay to whatever video is being played. My app is an informational video kiosk display driver, it's meant to run mostly unattended

Re: QTMovie grabing while playback

2008-04-23 Thread Bob Smith
On Wed, 23 Apr 2008 20:15:39 +0200 Jean-Daniel Dupas [EMAIL PROTECTED] wrote: Le 23 avr. 08 à 19:58, Randall Meadows a écrit : On Apr 23, 2008, at 11:30 AM, Bob Smith wrote: On Apr 23, 2008, at 10:05 AM, douglas a. welton wrote: QTMovieView has a delegate method - (CIImage*) view

Re: running out of NSPipes

2008-04-19 Thread Bob Smith
On Apr 18, 2008, at 9:58 PM, justin webster wrote: I'm pretty sure I've got all objects alloc'd and released correctly. this example is the broken one: - (NSString *)myShellFunction:(NSString *)PID { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSTask