Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Peter Duniho
On Nov 30, 2009, at 11:27 AM, Brad Gibbs wrote: Hi, I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object

Re: Thread Safety - A Theoretical Question

2009-10-12 Thread Peter Duniho
On Oct 12, 2009, at 1:47 PM, André Berg wrote: [...] My class internally doesn't use any threads at all (well apart from an NSTask ivar and readInBackgroundAndNotify). The only scenario I can think of that would be dangerous is if in the calling code (the code from the user of my class)

Re: Need simple port scan

2009-09-07 Thread Peter Duniho
On Sep 7, 2009, at 1:56 PM, Ashley Perrien wrote: I'm very new to networking via cocoa and need to develop a small port scanner application. The core of it is very simple, is address 1.2.3.4 listening on port X. I've done a bit of looking on NSStream, pipes, tasks and such but hopefully

Re: Format not a string literal and no format arguments

2009-08-29 Thread Peter Duniho
On Aug 29, 2009, at 10:36 AM, Quincey Morris wrote: On Aug 29, 2009, at 05:36, Jonathan del Strother wrote: After upgrading to snow leopard Xcode 3.2, I've starting getting this warning on NSLogs - NSLog(@Hello); // 'Format not a string literal and no format arguments' NSLog(@Hello

Re: [iPhone] get iPhone's IP address...

2009-07-20 Thread Peter Duniho
On Jul 19, 2009, at 11:51 PM, Kyle Sluder wrote: On Jul 19, 2009, at 11:36 PM, KK kthem...@gmail.com wrote: Does the iPhone have NSURLConnection? If so, you can just point that to www.whatismyip.com or a similar site, and just parse the information. This is ridiculous. Send an HTTP

Re: GC pros and cons

2009-06-28 Thread Peter Duniho
On Jun 28, 2009, at 4:12 PM, Michael Ash wrote: On Sun, Jun 28, 2009 at 1:17 PM, Quincey Morrisquinceymor...@earthlink.net wrote: I think the answer is in Bill's entirely, above. Without CFMakeCollectable, the final CFRetain will trigger the calling of (a hypothetical) CFDispose with the

Re: GC pros and cons

2009-06-25 Thread Peter Duniho
On Jun 24, 2009, at 9:15 PM, Jeff Laing wrote: 1. If your objects use (scarce) resources that are not themselves subject to GC (file handles, network connections, whatever), you'd be [snip] 2. If you expect objects to be returned to the free memory pool the instant that those objects aren't

Re: GC pros and cons

2009-06-25 Thread Peter Duniho
On Jun 25, 2009, at 7:37 AM, Michael Ash wrote: That may be the theory, Apple's ObjC collector does *not* trigger on allocation errors (at least not reliably or sufficiently, and as such it is possible to outrun the collector by creating a large number of objects in a tight loop. Well, as far

Re: GC pros and cons

2009-06-25 Thread Peter Duniho
On Jun 25, 2009, at 12:11 PM, Kyle Sluder wrote: [...] .NET users often call Dispose() explicitly, because it is useful in situations other than inside using blocks. Though, to be clear (lest the tendency to want to put down the other be allowed to go too far)... The requirement in .NET

Re: Question about notifying KVO observers of changes to a property.

2009-05-21 Thread Peter Duniho
On May 21, 2009, at 11:33 AM, Morales Vivó Óscar wrote: I have an cocoa controller object with a property that is actually read from another, C++ object. It works fine when updating or reading the value, but sometimes other C++ parts of the program will change the value of the property and

Re: Question about notifying KVO observers of changes to a property.

2009-05-21 Thread Peter Duniho
On May 21, 2009, at 5:43 PM, Morales Vivó Óscar wrote: On May 21, 2009, at 16:34 , Peter Duniho wrote: On May 21, 2009, at 11:33 AM, Morales Vivó Óscar wrote: I have an cocoa controller object with a property that is actually read from another, C++ object. It works fine when updating

Re: Daylight Savings Time

2009-04-15 Thread Peter Duniho
On Apr 15, 2009, at 11:53 AM, Greg Robertson wrote: I have put together some code from various sites such as this one: http://blog.coriolis.ch/2009/02/20/relative-date-to-now/ Basically I would like to display records for a week duration but I am unsure how to handle daylight savings time. Is

Re: Best way to get a non-repeating random number?

2009-04-14 Thread Peter Duniho
On Apr 14, 2009, at 1:32 PM, Eric E. Dolecki wrote: My apologies - what I meant to type was that I AM doing this: int tmp = (arc4random()%10)+1; while (tmp == activeTarget) { tmp = (arc4random()%10)+1; } activeTarget = tmp; So, you are generating a random number between 1 and 10,

Re: MacRoman - UTF8 [solved]

2009-03-22 Thread Peter Duniho
On Mar 22, 2009, at 5:22 AM, Uli Kusterer wrote: On 22.03.2009, at 12:22, Michael Ash wrote: Just a general request for the list here: could we not add [solved] to the topic when the problem is solved? It breaks threading and causes confusion. Just stick it into the original thread. The act of

Re: Enforcing trial software on Mac

2009-03-16 Thread Peter Duniho
On Mar 16, 2009, at 6:18 PM, Chris Idou wrote: Is there any accepted, or preferred or standard way of enforcing a trial software period for a program on Mac, so that people can't just delete their preferences or something and start the trial again? Or does every developer hack their own

Re: Syntax errors, undeclared variables

2009-02-06 Thread Peter Duniho
On Feb 6, 2009, at 6:51 PM, Kevin Walzer wrote: [...] I'm not sure what is causing these errors. Line 11 is set up like this: -(int)switchIcon (ClientData cd, Tcl_ip *ip, int objc, Tcl_Obj *objv[]); The error is because your method prototype syntax is completely wrong. You should

Re: Read lines from very large text file

2009-02-02 Thread Peter Duniho
On Feb 2, 2009, at 6:56 PM, Kenneth Bruno II wrote: On Feb 2, 2009, at 9:29 PM, Peter Duniho wrote: Is there not a Cocoa class that handles character encoding and line- based reading from files, streams, etc.? And an equivalent one for writing? That seems like an odd omission

Re: Read lines from very large text file

2009-02-02 Thread Peter Duniho
On Feb 2, 2009, at 7:50 PM, Joar Wingfors wrote: How do you know what delimiter string to use? Another thing that you'd have to determine, guess or be told, right? In general I would guess that it in this case almost always would be impossible and / or inappropriate to attempt to determine

Re: maximum theoretical speedup with dual quad processors

2009-02-02 Thread Peter Duniho
On Feb 1, 2009, at 8:37 PM, Michael Ash wrote: Thanks to both you and Rob for repeating the experiment. Interesting that it's so variable. On my computer it would occasionally require several million to crash, but most of the time it explodes within the first few hundred thousand. I've been

Re: Need some advice on multithreading

2008-11-24 Thread Peter Duniho
Mike already gave a bunch of good advice, so I'll just try to usefully expand on that (but I also have one sort-of disagreement I'll mention :) )... Date: Mon, 24 Nov 2008 01:06:17 +0100 From: WT [EMAIL PROTECTED] [...] 2. continuously running the simulation engine, at a rate that can

Re: Need some advice on multithreading

2008-11-24 Thread Peter Duniho
Date: Mon, 24 Nov 2008 11:35:42 +0100 From: WT [EMAIL PROTECTED] Hi Peter, thanks for answering my post. Happy to. :) [...] While it may wind up making sense to put the simulation engine in a separate thread, I would recommend _not_ trying to adjust the simulation rate to account for the

Re: Implementing isEqual: and hash

2008-08-23 Thread Peter Duniho
Date: Sat, 23 Aug 2008 12:05:44 -0700 From: Adam R. Maxwell [EMAIL PROTECTED] [...] - (BOOL)isEqual:(id)other { if ([other isKindOfClass:[self class]] == NO) return NO; return ([ivar1 isEqual:(Test *)other-ivar1] [ivar2 isEqual: (Test *)other-ivar2]); } - (unsigned)hash { return [ivar1

Re: Implementing isEqual: and hash

2008-08-23 Thread Peter Duniho
Date: Sat, 23 Aug 2008 17:52:21 -0700 From: Adam R. Maxwell [EMAIL PROTECTED] Well, if your hash values collide, they collide regardless of the hash table. As long as you've got a well-distributed hash function, any collisions generated by the hash table implementation should be

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 12:09:05 + From: Trygve Inda [EMAIL PROTECTED] I am seeing a deadlock I think... It works in the debugger, but hangs when running alone. The killThread is called as part of the applicationWillTerminate delegate method. My thought is that somehow after blocking to

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 12:29:55 -0600 From: Scott Ribe [EMAIL PROTECTED] ...but it would surprise if you have to take the lock just to inspect the condition (per the threadMustExit method). That part is correct, as it's the entire point behind conditions, atomically check a condition and

Re: Thread deadlock?

2008-08-11 Thread Peter Duniho
Date: Mon, 11 Aug 2008 21:15:27 + From: Trygve Inda [EMAIL PROTECTED] The real issue here is that I need to use [self performSelectorOnMainThread:@selector(doUnsafeStuff) withObject:nil waitUntilDone:YES]; Which blocks until the method completes, so I need a way to end the

Re: Garbage collector vs variable lifetime

2008-06-08 Thread Peter Duniho
Date: Mon, 9 Jun 2008 01:03:16 -0400 From: John Engelhart [EMAIL PROTECTED] On Jun 7, 2008, at 10:10 PM, Michael Ash wrote: If you don't like undefined behavior, then C-based languages are a poor choice. If you don't like nondeterministic object lifetimes, then garbage collection is a poor

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Peter Duniho
Date: Sat, 7 Jun 2008 15:31:43 +0100 From: Hamish Allan [EMAIL PROTECTED] On Sat, Jun 7, 2008 at 2:18 PM, Michael Ash [EMAIL PROTECTED] wrote: The business about scanning the stack is essentially an implementation detail; the promise that is being made is that objects which you're still

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 12:38:14 -0700 From: Bill Bumgarner [EMAIL PROTECTED] This comes up time and time again -- Why did Apple choose Objective-C vs. Language X? That is off topic for cocoa-dev and, thus, not a useful direction for taking this particular conversation. I agree. In spite of

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 14:08:46 -0700 From: Bill Bumgarner [EMAIL PROTECTED] On Jun 7, 2008, at 1:54 PM, Denis Bohm wrote: That is handled by the Java example above (via the Object... args). A method with any number of arguments can be passed to registerUndoWithTarget. So you could do

Re: Garbage collector vs variable lifetime

2008-06-07 Thread Peter Duniho
Date: Sat, 7 Jun 2008 23:24:22 +0100 From: Hamish Allan [EMAIL PROTECTED] Whenever you write documentation in a natural language, there is scope for ambiguity. This particular technical specification is only mentioned in a single sentence: The root set is comprised of all objects reachable from

Re: Java and Objective-C

2008-06-07 Thread Peter Duniho
Date: Sat, 07 Jun 2008 17:16:13 -0700 From: Bill Bumgarner [EMAIL PROTECTED] On Jun 7, 2008, at 4:16 PM, Peter Duniho wrote: As I pointed out in my other replies, implementing something like NSUndoManager is trivial in C#. It would only be slightly more so in Java, and only because

Re: running an external app

2008-05-27 Thread Peter Duniho
Date: Tue, 27 May 2008 16:48:23 -0400 From: Andy Lee [EMAIL PROTECTED] On May 27, 2008, at 4:15 PM, Peter Duniho wrote: Date: Tue, 27 May 2008 14:57:09 -0400 From: Andy Lee [EMAIL PROTECTED] Also, when we *do* ask to see people's code (which also happens), it's not because the code

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Peter Duniho
On May 21, 2008, at 12:01 AM, j o a r wrote: On May 20, 2008, at 9:52 PM, Peter Duniho wrote: The goal is not for every language to mimic C++/C#/Java. I never said that was the goal. Different languages serves different purposes and there is no single best language. I agree. So

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Peter Duniho
On May 21, 2008, at 1:42 AM, Hamish Allan wrote: I'm getting lost as to whether your main objection is about Apple not providing anything other than Objective-C / Cocoa to develop apps on the Mac, or whether it's just that you think their documentation could be improved. Sorry, that's fair.

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Peter Duniho
Date: Wed, 21 May 2008 15:14:24 -0400 From: Jeff LaMarche [EMAIL PROTECTED] Pete - you complain that people should treat newcomers better, yet here you are characterizing what many of us have said in a blatantly antagonistic way. Riff-raff? We like that it's keeping you out? Nobody said any such

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Peter Duniho
On May 21, 2008, at 12:27 PM, Sherm Pendley wrote: On Wed, May 21, 2008 at 1:30 PM, Peter Duniho [EMAIL PROTECTED] wrote: My _main_ objection is how newcomers to Mac development are treated. Please, when someone new to the current Mac development environment brings up one or more

Re: Cocoa et al as HCI usability problem

2008-05-21 Thread Peter Duniho
Date: Wed, 21 May 2008 16:33:29 -0700 From: William Turner [EMAIL PROTECTED] - too much cocoa is wonderful vs. not enough dry detail So several people have alleged. Looking at the documentation, I'm not finding anything that seems to qualify as hype. Could you provide some links? For what

Re: Cocoa et al as HCI usability problem

2008-05-20 Thread Peter Duniho
Date: Tue, 20 May 2008 04:26:08 +0200 From: Andreas Mayer [EMAIL PROTECTED] Am 19.05.2008 um 22:36 Uhr schrieb Peter Duniho: But not the sort of compelling we really need the language to be this way otherwise it just doesn't work example I was hoping for. There is no such example

Re: Cocoa et al as HCI usability problem

2008-05-20 Thread Peter Duniho
Date: Mon, 19 May 2008 19:18:30 -0400 From: Andy Lee [EMAIL PROTECTED] [...] When you are accessing only the public API for a class, C#'s extension methods provide the same sort of syntax, but via static methods that the compiler handles so as to make them look like they are part of the

Re: Cocoa et al as HCI usability problem

2008-05-20 Thread Peter Duniho
Date: Tue, 20 May 2008 01:34:32 -0700 From: G?rard Iglesias [EMAIL PROTECTED] [...] It is a question of intellectual curiosity I believe, maybe you are too old and tired to take new risk and have more fun ? Yup, that must be it. I'm too old to get Objective-C. After all, it's technology

Re: Cocoa et al as HCI usability problem

2008-05-20 Thread Peter Duniho
Date: Wed, 21 May 2008 08:33:40 +0800 From: Michael Ash [EMAIL PROTECTED] On Tue, May 20, 2008 at 4:07 PM, Peter Duniho [EMAIL PROTECTED] wrote: But personally, it makes me nervous to have a language that allows the implementation of a class to change according to other code not related

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
On May 19, 2008, at 1:19 AM, ben syverson wrote: On May 19, 2008, at 12:03 AM, Peter Duniho wrote: From: ben syverson [EMAIL PROTECTED] This is going to sound bitchy, but it's hard for me to have any sympathy for vague complaints about the docs or the usability of Cocoa. That does sound

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 02:35:12 -0400 From: Erik Buck [EMAIL PROTECTED] [...] It comes up once in a blue moon, but not with the reliability I've seen here, nor is there nearly the kind of practiced, organized defense seen here (which again suggests a certain regularity to the complaints).

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
On May 19, 2008, at 3:26 AM, Jean-Daniel Dupas wrote: That'd be great for the Mac, but not so great for the Cocoa evangelists. It's hard to understand the neglect Java has seen on the Mac, except as a way to try to steer more people towards Cocoa. Cocoa is a framework, Java a language.

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 19:50:57 +0800 From: Michael Ash [EMAIL PROTECTED] [...] the existence or even the volume of these complains is not evidence of anything other than that this platform actually attracts programmers who aren't using it just because it's hard. The platform attracts

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 09:32:01 -0400 From: Jeff LaMarche [EMAIL PROTECTED] Subject: Re: Cocoa et al as HCI usability problem [...] In many ways, Cocoa/Obj-C is an oddity, and certainly the approaches that Microsoft, Sun, and Apple have taken with their development tools is different.

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 11:42:39 -0500 From: Alex Kac [EMAIL PROTECTED] Subject: Re: Cocoa et al as HCI usability problem [...] I agree with much of what Peter wrote in his post, though not his conclusion that Cocoa can't be fun. I hesitate to even mention this, as I've written tons already and

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
On May 19, 2008, at 10:48 AM, Greg Titus wrote: You've translated the Objective-C syntax into C# syntax, but the point of the question is to think about what prepareWithInvocationTarget() does. How would you write that method in C#? Well, it was a poorly stated question then. His

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
On May 19, 2008, at 11:21 AM, Greg Titus wrote: [...] I've worked in Java quite a bit in the past, and I disagree, but more to the point: I've never done significant work in C# before, so if that's an environment you are familiar with and you are willing, I'd very much like to see what

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 20:31:02 +0200 From: Andreas Mayer [EMAIL PROTECTED] This is (part of) a method that handles an AppleScript command send to the application. One possible argument is the color to be used for display: - (id)handleDisplayCommand:(NSScriptCommand *)command {

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
On May 19, 2008, at 2:20 PM, Jean-Daniel Dupas wrote: And as we are here, note also that Key-Value-Coding uses dynamic properties of the language. Yes, it does. OK, implementing valueForKey: and setValue:forKey: is probably easy using introspection. Likewise reflection. And in .NET,

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Peter Duniho
Date: Mon, 19 May 2008 15:51:07 -0400 From: Andy Lee [EMAIL PROTECTED] * Objective-C allows you to create categories, effectively modifying a class's interface at runtime. C# provides partial class implementations for when you want to split functionality across multiple module files (one

Re: Cocoa et al as HCI usability problem

2008-05-18 Thread Peter Duniho
From: ben syverson [EMAIL PROTECTED] This is going to sound bitchy, but it's hard for me to have any sympathy for vague complaints about the docs or the usability of Cocoa. That does sound bitchy. I mean, it's fair enough to say that people ought to be providing specific feedback and