Date   

Re: APFS & FileSystem attributes

2551phil
 

I’ve heard it *rumoured* (YMMV) that the public release of HS will only support bootable APFS on SSD-only machines - no support for platters or even Fusion platter/ssd drives. 

That’s a step-back from the latest beta, so perhaps there are some irresolvable issues about using APFS on spinning metal. 


Best


Phil



On 23 Aug 2017, at 01:22, Alex Zavatone <zav@...> wrote:

James, I’ve got time this afternoon to help on this front if you want.  Please contact me offline if you’d like.  

Cheers.

On Aug 22, 2017, at 1:03 PM, James Walker <list2@...> wrote:

On 8/21/2017 8:44 AM, 2551phil wrote:
On 16 Aug 2017, at 09:42, Sean McBride <sean@...> wrote:

You could presumably test it in a VM, or using a spare old external drive or USB key, or even just create a disk image.  You don't need an extra Mac whose boot disk can be wiped.
You do if you want to test APFS, which is only available for SSD or Fusion disks the last time I checked. 

Admittedly, I haven’t yet checked the release notes for the most recent beta, but I've been having problems getting previous betas of HS to install on Parallels anyway. 

I was able to make a disk image with APFS format, and it wasn't in the latest beta.  I didn't try making an APFS boot disk, which you might need for some kinds of testing.



Re: Problems registering AppID on the Apple Developer Site

Alex Zavatone
 

On Aug 24, 2017, at 10:59 AM, Dave <dave@looktowindward.com> wrote:

Hi,

I need to registers 6 Apps on the Apple Developer Site.

I’ve done 3 ok, there are LTWiPhoneAppX, LTWiPadAppX and LTWMacAppX these 3 all use GameKit and In-App Purchase and they are enabled ok.

The other 3, LTWiPhoneAppY, LTWiPadAppY, and LTWMacAppY do not use GameKit or Purchase, but when I come to create one of them, it won’t let me un-check these options on the Apple Developer Site. I created the App ID anyway and then tried to edit it, but again it won’t let me?

Why is this and how can I disable these options?
Yes, Apple won’t let you. Yay, Apple!

As long as they are not enabled in the Capabilities part of your project settings, you should be OK.

I have felt your pain many many times, good sir. You are not alone at being baffled as to why this is done.

GL and Godspeed, young Jedi.

Alex Zavatone


Problems registering AppID on the Apple Developer Site

Dave
 

Hi,

I need to registers 6 Apps on the Apple Developer Site.

I’ve done 3 ok, there are LTWiPhoneAppX, LTWiPadAppX and LTWMacAppX these 3 all use GameKit and In-App Purchase and they are enabled ok.

The other 3, LTWiPhoneAppY, LTWiPadAppY, and LTWMacAppY do not use GameKit or Purchase, but when I come to create one of them, it won’t let me un-check these options on the Apple Developer Site. I created the App ID anyway and then tried to edit it, but again it won’t let me?

Why is this and how can I disable these options?

All the Best
Dave


Re: iOS Reachability

Alex Zavatone
 

There are much newer versions of this. Check on Apple’s sample files and on Github. Stay away from the old copy that you have.

On Aug 24, 2017, at 5:03 AM, Dave <dave@looktowindward.com> wrote:

Hi,

A while back I included some code from a sample project that setup Game Center/Kit. This code used a Class called “ Reachability”:

Copyright (c) 2011, Tony Million.
All rights reserved.

From looking at the code it looks quite old and I’m not sure how “right” it is. Is there another version of “Reachability” that I should be using?


When I Compile/Analyse the project, I get warnings on these statements:

+(Reachability*)reachabilityWithHostname:(NSString*)hostname
{
SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
if (ref)
{
id reachability = [[self alloc] initWithReachabilityRef:ref]; //**********************Potential Leak

#if __has_feature(objc_arc)
return reachability;
#else
return [reachability autorelease];
#endif

}


+(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
{
SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
if (ref)
{
id reachability = [[self alloc] initWithReachabilityRef:ref]; //**********************Potential Leak

#if __has_feature(objc_arc)
return reachability;
#else
return [reachability autorelease];
#endif
}

return nil;
}











Re: iOS Reachability

Nimesh Neema <nimeshneema@...>
 

On 24 August 2017 at 15:33, Dave <dave@...> wrote:
Hi,

A while back I included some code from a sample project that setup Game Center/Kit. This code used a Class called “ Reachability”:

 Copyright (c) 2011, Tony Million.
 All rights reserved.

From looking at the code it looks quite old and I’m not sure how “right” it is. Is there another version of “Reachability” that I should be using?


When I Compile/Analyse the project, I get warnings on these statements:

+(Reachability*)reachabilityWithHostname:(NSString*)hostname
{
    SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
    if (ref)
    {
        id reachability = [[self alloc] initWithReachabilityRef:ref];                   //**********************Potential Leak

#if __has_feature(objc_arc)
        return reachability;
#else
        return [reachability autorelease];
#endif

    }


+(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
{
    SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
    if (ref)
    {
        id reachability = [[self alloc] initWithReachabilityRef:ref];                   //**********************Potential Leak

#if __has_feature(objc_arc)
        return reachability;
#else
        return [reachability autorelease];
#endif
    }

    return nil;
}













iOS Reachability

Dave
 

Hi,

A while back I included some code from a sample project that setup Game Center/Kit. This code used a Class called “ Reachability”:

Copyright (c) 2011, Tony Million.
All rights reserved.

From looking at the code it looks quite old and I’m not sure how “right” it is. Is there another version of “Reachability” that I should be using?


When I Compile/Analyse the project, I get warnings on these statements:

+(Reachability*)reachabilityWithHostname:(NSString*)hostname
{
SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
if (ref)
{
id reachability = [[self alloc] initWithReachabilityRef:ref]; //**********************Potential Leak

#if __has_feature(objc_arc)
return reachability;
#else
return [reachability autorelease];
#endif

}


+(Reachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress
{
SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
if (ref)
{
id reachability = [[self alloc] initWithReachabilityRef:ref]; //**********************Potential Leak

#if __has_feature(objc_arc)
return reachability;
#else
return [reachability autorelease];
#endif
}

return nil;
}


Re: How to store C Arrays as a Property or iVar?

 



On Aug 23, 2017, at 3:28 AM, Dave <dave@...> wrote:

It recurses through the cells in the Array and there could be around 7000 iterations, so I’d rather stick with normal integers.

The time to read and unwrap an integer from an NSArray is probably under a microsecond, so it's unlikely to be a performance problem.

But there's nothing wrong with using a C array. It's what I'd do, personally.

One thing I was going to ask is that, the value range on each cell is 0 to 10, at the moment its using an “int” to hold this (which I assume is 32 bits), would there be a speed impact if I made it int16 or int8?

Yes, because the array will be smaller so it will take up less space in the CPU cache, causing fewer cache misses. But here the difference will be a few nanoseconds.

—Jens


Re: How to store C Arrays as a Property or iVar?

Dave
 

Hi,

It recurses through the cells in the Array and there could be around 7000 iterations, so I’d rather stick with normal integers.

One thing I was going to ask is that, the value range on each cell is 0 to 10, at the moment its using an “int” to hold this (which I assume is 32 bits), would there be a speed impact if I made it int16 or int8?

All the Best
Dave

On 22 Aug 2017, at 12:01, Dave <dave@...> wrote:

Hi Jens,

You solved two problem in one with your last post - thanks a lot!

I had some other information that was being passed back and forth and creating a structure allowed me to solve the Array copying problem and I could add the extra information fields to the struct!

Thanks again,
All the Best
Dave

On 18 Aug 2017, at 22:04, Jens Alfke <jens@...> wrote:


On Aug 18, 2017, at 12:07 PM, Dave <dave@...> wrote:

But I get an error if I try to assign or read it, as in:

myArray = _mArray;

You can't assign (or compare) arrays in C/C++. You have two options:

(a) Call memcpy:
memcpy(&myArray, &_mArray, sizeof(myArray));

(b) Wrap a struct around the array, since structs are copyable. Drawback is that you now have to refer to the array as a named field of the struct.
typedef struct {
int [10][10]  a;
} MyArrayType;
MyArrayType myArray;
_mArray = myArray;

(This is a pure C issue, so a book like K&R would be helpful.)

—Jens



Re: How to store C Arrays as a Property or iVar?

Dave
 

Hi,

It recurses through the cells in the Array and there could be around 7000 iterations, so I’d rather stick with normal integers.

One thing I was going to ask is that, the value range on each cell is 0 to 10, at the moment its using an “int” to hold this (which I assume is 32 bits), would there be a speed impact if I made it int16 or int8?

All the Best
Dave

On 
On 22 Aug 2017, at 17:47, Jens Alfke <jens@...> wrote:


On Aug 18, 2017, at 2:38 PM, Alex Zavatone <zav@...> wrote:

In that light, is my suggestion useless overhead?

(IIRC you suggested using an NSMutableArray of NSNumbers?) Honestly, it depends. It does have overhead, although not as much as it used to, since NSNumbers of reasonable-size integers don't allocate any memory (they're just tagged pointers.) On the plus side, you get array bounds checking, and it's easy to grow the array dynamically if you ever need to.

If you don't need high performance (e.g. you're not doing math-y stuff with these arrays) and you're not allocating millions of these, NSMutableArray is reasonable. Especially for those who aren't super comfortable with C.

—Jens


Re: APFS & FileSystem attributes

Alex Zavatone
 

James, I’ve got time this afternoon to help on this front if you want.  Please contact me offline if you’d like.  

Cheers.

On Aug 22, 2017, at 1:03 PM, James Walker <list2@...> wrote:

On 8/21/2017 8:44 AM, 2551phil wrote:

      
On 16 Aug 2017, at 09:42, Sean McBride <sean@...> wrote:

You could presumably test it in a VM, or using a spare old external drive or USB key, or even just create a disk image.  You don't need an extra Mac whose boot disk can be wiped.
You do if you want to test APFS, which is only available for SSD or Fusion disks the last time I checked. 

Admittedly, I haven’t yet checked the release notes for the most recent beta, but I've been having problems getting previous betas of HS to install on Parallels anyway. 

I was able to make a disk image with APFS format, and it wasn't in the latest beta.  I didn't try making an APFS boot disk, which you might need for some kinds of testing.


Re: APFS & FileSystem attributes

James Walker
 

On 8/21/2017 8:44 AM, 2551phil wrote:

On 16 Aug 2017, at 09:42, Sean McBride <sean@...> wrote:

You could presumably test it in a VM, or using a spare old external drive or USB key, or even just create a disk image.  You don't need an extra Mac whose boot disk can be wiped.

You do if you want to test APFS, which is only available for SSD or Fusion disks the last time I checked. 

Admittedly, I haven’t yet checked the release notes for the most recent beta, but I've been having problems getting previous betas of HS to install on Parallels anyway. 

I was able to make a disk image with APFS format, and it wasn't in the latest beta.  I didn't try making an APFS boot disk, which you might need for some kinds of testing.


Re: How to store C Arrays as a Property or iVar?

 


On Aug 18, 2017, at 2:38 PM, Alex Zavatone <zav@...> wrote:

In that light, is my suggestion useless overhead?

(IIRC you suggested using an NSMutableArray of NSNumbers?) Honestly, it depends. It does have overhead, although not as much as it used to, since NSNumbers of reasonable-size integers don't allocate any memory (they're just tagged pointers.) On the plus side, you get array bounds checking, and it's easy to grow the array dynamically if you ever need to.

If you don't need high performance (e.g. you're not doing math-y stuff with these arrays) and you're not allocating millions of these, NSMutableArray is reasonable. Especially for those who aren't super comfortable with C.

—Jens


Re: How to store C Arrays as a Property or iVar?

Dave
 

Hi Jens,

You solved two problem in one with your last post - thanks a lot!

I had some other information that was being passed back and forth and creating a structure allowed me to solve the Array copying problem and I could add the extra information fields to the struct!

Thanks again,
All the Best
Dave

On 18 Aug 2017, at 22:04, Jens Alfke <jens@...> wrote:


On Aug 18, 2017, at 12:07 PM, Dave <dave@...> wrote:

But I get an error if I try to assign or read it, as in:

myArray = _mArray;

You can't assign (or compare) arrays in C/C++. You have two options:

(a) Call memcpy:
memcpy(&myArray, &_mArray, sizeof(myArray));

(b) Wrap a struct around the array, since structs are copyable. Drawback is that you now have to refer to the array as a named field of the struct.
typedef struct {
int [10][10]  a;
} MyArrayType;
MyArrayType myArray;
_mArray = myArray;

(This is a pure C issue, so a book like K&R would be helpful.)

—Jens


Re: Understanding NSNetService and peer-to-peer streaming

Graham Cox
 

On 21 Aug 2017, at 12:12 pm, Alex Zavatone <zav@mac.com> wrote:

This. This. This. This.

Create a VM of your current OS. Duplicate it as needed and make changes to each OS image to suit your needs.

Yes, this makes total sense. I guess I just had a blonde moment (I’m not even blonde) and didn’t think of it.
I do use VMWare for testing, though unfortunately I need to pay for the upgrade to support Sierra.

—Graham


Re: Understanding NSNetService and peer-to-peer streaming

Graham Cox
 

On 22 Aug 2017, at 2:46 am, Jens Alfke <jens@mooseyard.com> wrote:


On Aug 20, 2017, at 7:00 PM, Graham Cox <graham@mapdiva.com> wrote:

If I send two ‘messages’ too quickly, they get concatented on the stream, and the receiver can’t tell where the boundary is between the two (or more) messages.
This is a classic newbie networking mistake. (No offense I hope!)

None at all! I have very little experience in this area.


TCP is a stream, and there is absolutely no delimiter between writes, and no association between the number of bytes written vs. the number read at the receiver. It's true that if you only intermittently send bytes, the receiver will usually receive the same number of bytes from its read call … but not always, depending on circumstances, because the data can get broken up at arbitrary locations.

To send and receive messages you have to delimit them somehow. The classic ways are to prefix every message with a count, or to have a reserved byte sequence that denotes end-of-message. (Pascal strings and C strings, anyone?) The former is better as long as you know the message length ahead of time.

So for example, on the sending end just write a 32-bit byte count (big- or little-endian, pick one), then the message. On the receiving end, have a resizable read buffer (an NSMutableData works well) and keep reading bytes into it, growing if necessary. After each read decode the message length at the start, then check if you have that many more bytes in the buffer; if so, hand the message to the higher-level code, then delete the count and the message from the buffer, so what remains starts at the next message boundary. Then check if you've got another complete message, and when you don't, issue another read.
Great, I was hoping someone would help me in exactly this way. I thought the length field approach would work, but those with more experience may steer me in a better direction. Good to know I was thinking along the right lines.

The data I’m sending is actually a plist. I am using [NSPropertyListSerialization writePropertyList:toStream:…], which is very convenient. But call it twice and the other end gets confused. It surprised me a little bit because I would have thought that having provided such a convenient method for writing a plist to a stream, the apparently equally convenient inverse method would be able to sort this problem out for itself. But no, it appears not. Which makes me wonder in what case it is useful.

I have a protocol/framework called BLIP that's basically this to the nth power. It does message queueing, multiplexing, high/low priority, message headers (like HTTP), etc. Might be overkill for your needs, but check it out.
I definitely will!

many thanks,

—Graham


Re: Understanding NSNetService and peer-to-peer streaming

 


On Aug 20, 2017, at 7:00 PM, Graham Cox <graham@...> wrote:

If I send two ‘messages’ too quickly, they get concatented on the stream, and the receiver can’t tell where the boundary is between the two (or more) messages.

This is a classic newbie networking mistake. (No offense I hope!) TCP is a stream, and there is absolutely no delimiter between writes, and no association between the number of bytes written vs. the number read at the receiver. It's true that if you only intermittently send bytes, the receiver will usually receive the same number of bytes from its read call … but not always, depending on circumstances, because the data can get broken up at arbitrary locations.

To send and receive messages you have to delimit them somehow. The classic ways are to prefix every message with a count, or to have a reserved byte sequence that denotes end-of-message. (Pascal strings and C strings, anyone?) The former is better as long as you know the message length ahead of time. 

So for example, on the sending end just write a 32-bit byte count (big- or little-endian, pick one), then the message. On the receiving end, have a resizable read buffer (an NSMutableData works well) and keep reading bytes into it, growing if necessary. After each read decode the message length at the start, then check if you have that many more bytes in the buffer; if so, hand the message to the higher-level code, then delete the count and the message from the buffer, so what remains starts at the next message boundary. Then check if you've got another complete message, and when you don't, issue another read.

I have a protocol/framework called BLIP that's basically this to the nth power. It does message queueing, multiplexing, high/low priority, message headers (like HTTP), etc. Might be overkill for your needs, but check it out.

—Jens


Re: APFS & FileSystem attributes

Steve Mills
 

On Aug 21, 2017, at 10:46 AM, Alex Zavatone <zav@...> wrote:

What is HS?

I'm guessing High Sierra, macOS 10.13. Yet another reason why people should use version numbers and not these silly, meaningless code names.

Sent from iCloud's ridiculous UI, so, sorry about the formatting

 


Re: APFS & FileSystem attributes

2551phil
 


On 21 Aug 2017, at 22:45, Alex Zavatone <zav@...> wrote:

What is HS?


High Sierra. 


Re: APFS & FileSystem attributes

Alex Zavatone
 

What is HS?

On Aug 21, 2017, at 10:44 AM, 2551phil <2551phil@gmail.com> wrote:



On 16 Aug 2017, at 09:42, Sean McBride <sean@rogue-research.com> wrote:

You could presumably test it in a VM, or using a spare old external drive or USB key, or even just create a disk image. You don't need an extra Mac whose boot disk can be wiped.

You do if you want to test APFS, which is only available for SSD or Fusion disks the last time I checked.

Admittedly, I haven’t yet checked the release notes for the most recent beta, but I've been having problems getting previous betas of HS to install on Parallels anyway.


Best


Phil
@sqwarq




Re: APFS & FileSystem attributes

2551phil
 

On 16 Aug 2017, at 09:42, Sean McBride <sean@rogue-research.com> wrote:

You could presumably test it in a VM, or using a spare old external drive or USB key, or even just create a disk image. You don't need an extra Mac whose boot disk can be wiped.

You do if you want to test APFS, which is only available for SSD or Fusion disks the last time I checked.

Admittedly, I haven’t yet checked the release notes for the most recent beta, but I've been having problems getting previous betas of HS to install on Parallels anyway.


Best


Phil
@sqwarq

1241 - 1260 of 1454