I hereby claim:
- I am jault3 on github.
- I am jault (https://keybase.io/jault) on keybase.
- I have a public key ASAZmQI0Zv6Q2DZn4d9Hyemb0A0Q37BSy7CyJGD46a2Sfgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go | |
index 7a4b571..0355eca 100644 | |
--- a/src/syscall/exec_linux_test.go | |
+++ b/src/syscall/exec_linux_test.go | |
@@ -169,9 +169,9 @@ func TestUnshare(t *testing.T) { | |
origLines := strings.Split(strings.TrimSpace(string(orig)), "\n") | |
cmd := exec.Command("cat", path) | |
- cmd.SysProcAttr = &syscall.SysProcAttr{ | |
+ /*cmd.SysProcAttr = &syscall.SysProcAttr{ |
[_healthStore requestAuthorizationToShareTypes:writeTypes readTypes:readTypes completion:^(BOOL success, NSError *error) { | |
if (!success) { | |
NSLog(@"You didn't allow HealthKit to access these read/write data types. In your app, try to handle this error gracefully when a user decides not to provide access. The error was: %@.", error); | |
} | |
}]; |
- (NSSet *)dataTypesToWrite { | |
HKQuantityType *heightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight]; | |
HKQuantityType *weightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; | |
HKQuantityType *heartRate = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; | |
HKQuantityType *walkingRunningDistance = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning]; | |
return [NSSet setWithObjects:heightType, weightType, heartRate, walkingRunningDistance, nil]; | |
} |
- (NSSet *)dataTypesToRead { | |
HKQuantityType *heightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight]; | |
HKQuantityType *weightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; | |
HKQuantityType *heartRate = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; | |
HKQuantityType *walkingRunningDistance = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning]; | |
HKCharacteristicType *biologicalSex = [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]; | |
HKCharacteristicType *birthday = [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth]; | |
return [NSSet setWithObjects:heightType, weightType, heartRate, walkingRunningDistance, biologicalSex, birthday, nil]; |
HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning] | |
predicate:[HKSampleQuery predicateForObjectsWithNoCorrelation] | |
limit:20 | |
sortDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:HKSampleSortIdentifierEndDate ascending:NO]] | |
resultsHandler:^(HKSampleQuery *query, NSArray *results, NSError *error) { | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
_runLogs = [NSMutableArray arrayWithArray:results]; | |
[_tblRunLog reloadData]; | |
}); | |
}]; |
HKUnit *bpmUnit = [[HKUnit countUnit] unitDividedByUnit:[HKUnit minuteUnit]]; | |
NSDate *startDate = (NSDate *)[_data objectForKey:kStartDate]; | |
NSDate *endDate = [NSDate date]; | |
NSMutableDictionary *metadata = [NSMutableDictionary dictionary]; | |
[metadata setValue:[NSNumber numberWithDouble:_txtBeginningHeartRate.text.doubleValue] forKey:kBeginningHeartRate]; | |
[metadata setValue:[NSNumber numberWithDouble:_txtEndingHeartRate.text.doubleValue] forKey:kEndingHeartRate]; | |
// send the heart beat off to Catalyze and HealthKit |
double weight = _txtWeight.text.doubleValue; | |
HKUnit *poundUnit = [HKUnit poundUnit]; | |
HKQuantity *weightQuantity = [HKQuantity quantityWithUnit:poundUnit doubleValue:weight]; | |
HKQuantityType *weightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; | |
NSDate *now = [NSDate date]; | |
HKQuantitySample *weightSample = [HKQuantitySample quantitySampleWithType:weightType quantity:weightQuantity startDate:now endDate:now]; | |
[self.healthStore saveObject:weightSample withCompletion:^(BOOL success, NSError *error) { |
double height = _txtHeight.text.doubleValue; | |
HKUnit *inchUnit = [HKUnit inchUnit]; | |
HKQuantity *heightQuantity = [HKQuantity quantityWithUnit:inchUnit doubleValue:height]; | |
HKQuantityType *heightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight]; | |
NSDate *now = [NSDate date]; | |
HKQuantitySample *heightSample = [HKQuantitySample quantitySampleWithType:heightType quantity:heightQuantity startDate:now endDate:now]; | |
[self.healthStore saveObject:heightSample withCompletion:^(BOOL success, NSError *error) { |
HKQuantityType *weightType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; | |
// Since we are interested in retrieving the user's latest sample | |
// we sort the samples in descending order by end date | |
// and set the limit to 1 | |
// We are not filtering the data, and so the predicate is set to nil. | |
NSSortDescriptor *timeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:HKSampleSortIdentifierEndDate ascending:NO]; | |
// construct the query & since we are not filtering the data the predicate is set to nil | |
HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:weightType predicate:nil limit:1 sortDescriptors:@[timeSortDescriptor] resultsHandler:^(HKSampleQuery *query, NSArray *results, NSError *error) { |