Re: How to count Atoms

2016-10-07 Thread Gerriet M. Denkmann
> On 8 Oct 2016, at 11:22, Quincey Morris > wrote: > > On Oct 7, 2016, at 21:06 , Gerriet M. Denkmann wrote: >> >> But, alas, it is also much slower: overhead almost 40 sec (whereas my >> admittedly rather hackish way took less then

Re: How to count Atoms

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 21:06 , Gerriet M. Denkmann wrote: > > But, alas, it is also much slower: overhead almost 40 sec (whereas my > admittedly rather hackish way took less then half a second). That may indicate a lot of contention — e.g. you were running multiple copies of

Re: How to count Atoms

2016-10-07 Thread Gerriet M. Denkmann
> On 8 Oct 2016, at 05:01, Quincey Morris > wrote: > > On Oct 7, 2016, at 07:49 , Gerriet M. Denkmann wrote: >> >> Is there a better way than this: >> dsema = dispatch_semaphore_create( 0 ); >> >> some loop to be counted

Re: Logging in macOS 12

2016-10-07 Thread Gerriet M. Denkmann
> On 7 Oct 2016, at 23:18, Jens Alfke wrote: > > >> On Oct 7, 2016, at 7:56 AM, Gerriet M. Denkmann wrote: >> >> Some app with NSLog (not running in Xcode) does not show anything in >> Console.app. >> Only when Iog in as administrator I can see the

Re: progress bar not updating

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 02:28 , J.E. Schotsman wrote: > > It isn’t mentioned in the NSProgress Overview though. You are correct about that, which makes me wonder how much of my understanding I simply dreamed. Looking at the documentation a bit more carefully, though, I think

Re: How to count Atoms

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 15:37 , Dave Fernandes wrote: > > But I don’t see how incrementing it after creating it is any different from > creating it with a non-zero count. Either way, if you have resources > available, the count will be non-zero, and you will crash if you

Re: Directory enumeration gives wrong file type for aliases

2016-10-07 Thread Gabriel Zachmann
Thanks a lot or your quick response! >> I would at least attributesOfItemAtPath:error expect to show >> NSFileTypeSymbolicLink for the aliases and symlinks. > > No, aliases are files, not symbolic links. Symbolic links are a special > category of file system objects in a Unix-compatible file

Re: How to count Atoms

2016-10-07 Thread Dave Fernandes
> > In practice, you’d actually initialize the semaphore like this: > >> dsema = dispatch_semaphore_create (0); // start with a zero count >> dispatch_semaphore_signal (dsema); // increment to the number of >> resources in the pool. > > That’s because if you create the semaphore with

Re: Directory enumeration gives wrong file type for aliases

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 08:21 , Gabriel Zachmann wrote: > > [NSNumber numberWithBool: YES] == [fattrs objectForKey: NSFileExtensionHidden] Also, this is really bad. These are objects, and there’s no guarantee that the object pointers are identical, which is what you’re testing

Re: Directory enumeration gives wrong file type for aliases

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 08:21 , Gabriel Zachmann wrote: > > I would at least attributesOfItemAtPath:error expect to show > NSFileTypeSymbolicLink for the aliases and symlinks. No, aliases are files, not symbolic links. Symbolic links are a special category of file system

Re: How to count Atoms

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 07:49 , Gerriet M. Denkmann wrote: > > Is there a better way than this: > dsema = dispatch_semaphore_create( 0 ); > > some loop to be counted > { > dispatch_semaphore_signal(dsema); > …. > } > > NSUInteger counter = 0; >

Directory enumeration gives wrong file type for aliases

2016-10-07 Thread Gabriel Zachmann
I am trying to enumerate the contents of a directory (aka folder) using NSDirectoryEnumerator. My problem is that the file attributes always returns NSFileTypeRegular, no matter whether it is an alias/symlink or a regular file. You can see my code below. I have tried to retrieve the file

Can a Spotlight search follow aliases / symlinks?

2016-10-07 Thread Gabriel Zachmann
I am doing Spotlight searches using the NSMetadataQuery API. Usually, my search is limited to a specific folder. Is it possible to make it follow aliases (and symlinks) that might exist in that folder? I am especially interested in aliases/symlinks that point to other folders. Or do I have to

Help - Epic Browser SPDY Encrypted Proxy Failing in Sierra

2016-10-07 Thread alok
For some mysterious reason our SPDY encrypted proxy fails in our chromium based browser only in Mac OS X Sierra. It works fine in every other operating system. We're getting a "CERTIFICATE_INVALID_ERROR" even though our certificates are of course fine. If you have any idea what's causing this,

Re: How to count Atoms

2016-10-07 Thread Kyle Sluder
On Fri, Oct 7, 2016, at 11:24 AM, Jens Alfke wrote: > > > On Oct 7, 2016, at 1:14 AM, Quincey Morris > > wrote: > > > > One straightforward way is to use dispatch_semaphore. IIRC it’s lightweight > > unless it blocks (that is, unless its count is zero

Re: How to count Atoms

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 09:24 , Jens Alfke wrote: > > IMO dispatch_semaphore is overkill for this; it’s not just an atomic counter, > it’s also got blocking behaviors for use in e.g. managing a pool of resources. I wasn’t suggesting using dispatch_semaphore itself as the atomic

Re: How to count Atoms

2016-10-07 Thread Jens Alfke
> On Oct 7, 2016, at 1:14 AM, Quincey Morris > wrote: > > One straightforward way is to use dispatch_semaphore. IIRC it’s lightweight > unless it blocks (that is, unless its count is zero when you wait), so it’s > good for this situation where actual

Re: Logging in macOS 12

2016-10-07 Thread Jens Alfke
> On Oct 7, 2016, at 7:56 AM, Gerriet M. Denkmann wrote: > > Some app with NSLog (not running in Xcode) does not show anything in > Console.app. > Only when Iog in as administrator I can see the NSLog lines. Huh, you’re right… The Console app’s help has a link to developer

Re: How to count Atoms

2016-10-07 Thread Alastair Houghton
On 7 Oct 2016, at 08:19, Gerriet M. Denkmann wrote: > So what is the proper way to count something atomicly and undeprecatedly? or is the approved source for this kind of thing. In C++, you might write #include std::atomic counter; then you can just do

Logging in macOS 12

2016-10-07 Thread Gerriet M. Denkmann
Some app with NSLog (not running in Xcode) does not show anything in Console.app. Only when Iog in as administrator I can see the NSLog lines. Is this working as expected? Can anything be done to make common people see the NSLog lines too? Gerriet.

Re: How to count Atoms

2016-10-07 Thread Gerriet M. Denkmann
> On 7 Oct 2016, at 15:14, Quincey Morris > wrote: > > On Oct 7, 2016, at 00:19 , Gerriet M. Denkmann wrote: >> >> So what is the proper way to count something atomicly and undeprecatedly? > > One straightforward way is to use

Re: How to count Atoms

2016-10-07 Thread Gerriet M. Denkmann
> On 7 Oct 2016, at 15:43, Ken Thomases wrote: > > On Oct 7, 2016, at 2:19 AM, Gerriet M. Denkmann wrote: >> >> I need (just for debugging purposes) to count something in a thread safe >> way. >> […] >> So I tried OSIncrementAtomic. >> Now I get:

Re: deleting connections in .xib

2016-10-07 Thread J.E. Schotsman
> On 07 Oct 2016, at 11:37, dangerwillrobinsondan...@gmail.com wrote: > > Go to the inspector palette on the right side. > With the relevant item selected you will be able to disconnect things. Oh, I see. You just need to hit the the little cross. BTW I meant editing the xib file of course.

Re: deleting connections in .xib

2016-10-07 Thread dangerwillrobinsondanger
Go to the inspector palette on the right side. With the relevant item selected you will be able to disconnect things. Sent from my iPhone > On 7 Oct 2016, at 18:31, J.E. Schotsman wrote: > > Hello, > > I haven’t found a way yet to delete actions, outlets etc. using the

deleting connections in .xib

2016-10-07 Thread J.E. Schotsman
Hello, I haven’t found a way yet to delete actions, outlets etc. using the xib interface. I’ve resorted to editing the project bundle with a text editor. Surely that isn’t the way this is supposed to be done? Any pointers appreciated. Jan E. ___

Re: progress bar not updating

2016-10-07 Thread J.E. Schotsman
> On 06 Oct 2016, at 22:43, Quincey Morris > wrote: > > Well, Apple has. NSProgress is a multi-purpose class, one of whose purposes > is to provide a thread-safe way of trampolining the progress completion > reports from a background worker thread to

Re: progress bar not updating

2016-10-07 Thread J.E. Schotsman
> On 06 Oct 2016, at 20:46, Ken Thomases wrote: > > When you are using bindings, you must ensure that changes to the properties > to which UI is bound happen only on the main thread. Depending on your > design, you can often do something like: > >

Re: How to count Atoms

2016-10-07 Thread Ken Thomases
On Oct 7, 2016, at 2:19 AM, Gerriet M. Denkmann wrote: > > I need (just for debugging purposes) to count something in a thread safe way. > […] > So I tried OSIncrementAtomic. > Now I get: "Implicit declaration of function 'OSIncrementAtomic' is invalid > in C99" and the

Re: How to count Atoms

2016-10-07 Thread Quincey Morris
On Oct 7, 2016, at 00:19 , Gerriet M. Denkmann wrote: > > So what is the proper way to count something atomicly and undeprecatedly? One straightforward way is to use dispatch_semaphore. IIRC it’s lightweight unless it blocks (that is, unless its count is zero when you wait),

How to count Atoms

2016-10-07 Thread Gerriet M. Denkmann
I need (just for debugging purposes) to count something in a thread safe way. This works, but is deprecated: SInt32 counter; - (IBAction)doSomething:sender { counter = 0; some loop { IncrementAtomic( );// 'IncrementAtomic' is

Re: MLMediaLibrary sometimes does not call my KVO

2016-10-07 Thread Gabriel Zachmann
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: