Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Keary Suska
On Aug 11, 2014, at 2:52 PM, Dave wrote: > On 10 Aug 2014, at 16:16, Keary Suska wrote: > > >> I don't think so, although I would expect a C lib somewhere to address it. >> Anyway, isn't easier to just always abs(x)%y? >> > > >> abs(x)%y > > Doesn’t give the same result, it’s one off: >

Re: Bindings in Swift

2014-08-11 Thread Quincey Morris
On Aug 11, 2014, at 16:14 , Greg Parker wrote: > Do you have an example? For example (beta 5), enter some source that uses type “Array”, then command-click on “Array”. (I don’t know how to get Xcode to display the resulting file directly, so I’ve been using this technique. I don’t know if the

Re: Bindings in Swift

2014-08-11 Thread Roland King
> On 12 Aug 2014, at 7:14 am, Greg Parker wrote: > > On Aug 10, 2014, at 3:00 PM, Quincey Morris > wrote: >> There’s also something going on with the silly-looking generic specifier >> ‘’ that appears in some of Swift’s internal class >> declarations, but it seems to be meaningful in relatio

Re: How to make a LaunchAgent

2014-08-11 Thread Roland King
> Is it true that this works only with Sandbox? > Is it true that Sandbox works only for paying Mac-Developers? > > If both are true, then I am out of luck. I am a paying iOS developer, but > not a paying Mac-Developers. > I don’t know the answer to this, and a quick flick through the bits of

Re: Bindings in Swift

2014-08-11 Thread Greg Parker
On Aug 10, 2014, at 3:00 PM, Quincey Morris wrote: > There’s also something going on with the silly-looking generic specifier ‘ T where T == T>’ that appears in some of Swift’s internal class declarations, > but it seems to be meaningful in relation to protocols in some non-obvious > way.] Do

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Dave
On 11 Aug 2014, at 22:26, Scott Ribe wrote: > On Aug 11, 2014, at 3:15 PM, koko wrote: > >> When either a or n is negative, the naive definition breaks down and >> programming languages differ in how these values are defined. > > But that is only because what you call the "naive definition"

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Dave
On 11 Aug 2014, at 22:24, Scott Ribe wrote: > On Aug 11, 2014, at 3:03 PM, Dave wrote: > >> My conclusion is (a % b) in C is a remainder operator and NOT modulo >> operator. > > Yes. The first edition of K&R mistakenly referred to it as modulus > (apparently based on the PDP-11 instruction

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Dave
On 11 Aug 2014, at 22:15, koko wrote: > In computing, the modulo (sometimes called modulus) operation finds the > remainder of division of one number by another. > Given two positive numbers, a (the dividend) and n (the divisor), a modulo n > (abbreviated as a mod n) is the remainder of theEuc

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Scott Ribe
On Aug 11, 2014, at 3:15 PM, koko wrote: > When either a or n is negative, the naive definition breaks down and > programming languages differ in how these values are defined. But that is only because what you call the "naive definition" is incorrect. The actual definition is precise and cover

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Scott Ribe
On Aug 11, 2014, at 3:03 PM, Dave wrote: > My conclusion is (a % b) in C is a remainder operator and NOT modulo operator. Yes. The first edition of K&R mistakenly referred to it as modulus (apparently based on the PDP-11 instruction which was similarly misnamed). The second edition lists it in

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread koko
In computing, the modulo (sometimes called modulus) operation finds the remainder of division of one number by another. Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder of theEuclidean division of a by n. For instance, the exp

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Dave
On 10 Aug 2014, at 17:04, Scott Ribe wrote: > On Aug 10, 2014, at 9:16 AM, Keary Suska wrote: > >> I don't think so, although I would expect a C lib somewhere to address it. > > I think the standard C libs only have floating-point versions of mod > functions. (That does seem like an odd omis

Re: Mod (%) function in C/Objective-C?

2014-08-11 Thread Dave
On 10 Aug 2014, at 16:16, Keary Suska wrote: > I don't think so, although I would expect a C lib somewhere to address it. > Anyway, isn't easier to just always abs(x)%y? > > abs(x)%y Doesn’t give the same result: myIndex: -5 myMod: 1 abs(x)%y: 2 myIndex: -4 myMod: 2 abs(x)%y: 1 myInd

Re: How should windowWillUseStandardFrame:defaultFrame: work? With a WebView?

2014-08-11 Thread Ken Thomases
On Aug 11, 2014, at 1:38 PM, Daryle Walker wrote: > I’m thinking of implementing the (optimized) zoom green button. I need to > provide a windowWillUseStandardFrame:defaultFrame: method to do that. I’ve > read that the trial frame space given takes out room for the menu bar and the > dock.

How should windowWillUseStandardFrame:defaultFrame: work? With a WebView?

2014-08-11 Thread Daryle Walker
I’m thinking of implementing the (optimized) zoom green button. I need to provide a windowWillUseStandardFrame:defaultFrame: method to do that. I’ve read that the trial frame space given takes out room for the menu bar and the dock. Does it also remove space for the window’s chrome? That chr

Re: How to make a LaunchAgent

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 17:53, Kevin Meaney wrote: > >> You’re not supposed to start it - launchd/XPC services is supposed to start >> it for you. You’re supposed to register it as a LaunchAgent/Daemon, creating >> the launchd.plist file and when you need the service, it starts and when you >> do

Re: how can i change the UITabBarItem title's color

2014-08-11 Thread David Duncan
> On Aug 11, 2014, at 2:47 AM, bigpig wrote: > > Some method deprecated in iOS 7.0, so i want to know a good way to change the > UITabBarItem title font color which i want to set. I’m not certain what methods you speak of, but deprecated means “no longer recommended” not “no longer works”. H

Re: How to make a LaunchAgent

2014-08-11 Thread Kevin Meaney
> You’re not supposed to start it - launchd/XPC services is supposed to start > it for you. You’re supposed to register it as a LaunchAgent/Daemon, creating > the launchd.plist file and when you need the service, it starts and when you > don’t, it’s stopped again. I keep reading this is all par

Re: How to make a LaunchAgent

2014-08-11 Thread Roland King
> On 11 Aug 2014, at 6:07 pm, Gerriet M. Denkmann wrote: > > I have a Xpc Helper, which is local to my App (that is only my App can talk > to it) which works fine. > > Now I want to convert this Xpc Helper into a LaunchAgent. > > I guess I have to start it via SMJobSubmit(). > But when I do t

How to make a LaunchAgent

2014-08-11 Thread Gerriet M. Denkmann
I have a Xpc Helper, which is local to my App (that is only my App can talk to it) which works fine. Now I want to convert this Xpc Helper into a LaunchAgent. I guess I have to start it via SMJobSubmit(). But when I do this with the existing Helper, it crashes, gets restarted, crashes again, et

Re: Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 16:05, Bavarious wrote: > >> On 11 Aug 2014, at 05:53, Gerriet M. Denkmann wrote: >> >> >> On 11 Aug 2014, at 15:43, Bavarious wrote: >> >>> On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: I am trying to convert: NSString * helperName = @"de.mden

how can i change the UITabBarItem title's color

2014-08-11 Thread bigpig
Some method deprecated in iOS 7.0, so i want to know a good way to change the UITabBarItem title font color which i want to set. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: Converting to Swift

2014-08-11 Thread Bavarious
> On 11 Aug 2014, at 05:53, Gerriet M. Denkmann wrote: > > > On 11 Aug 2014, at 15:43, Bavarious wrote: > >> On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: >>> >>> I am trying to convert: >>> NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; >>> CFDictionaryRef diref = SMJ

Re: Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
On 11 Aug 2014, at 15:43, Bavarious wrote: > On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: >> >> I am trying to convert: >> NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; >> CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, >> (__bridge CFStringRef)h

Re: Converting to Swift

2014-08-11 Thread Bavarious
On 11 Aug 2014, at 05:35, Gerriet M. Denkmann wrote: > > I am trying to convert: > NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; > CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, > (__bridge CFStringRef)helperName ); > NSDictionary *jobDict = (NSDic

Converting to Swift

2014-08-11 Thread Gerriet M. Denkmann
I am trying to convert: NSString * helperName = @"de.mdenkmann.Xpc-Exchange”; CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd, (__bridge CFStringRef)helperName ); NSDictionary *jobDict = (NSDictionary *)CFBridgingRelease(diref); if ( jobDict == n