This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)zoomToCurrentLocation:(id)sender | |
{ | |
NSLog(@"zoomToCurrentLocation"); | |
//Start updating location because we want it... | |
[_myLocationManager startUpdatingLocation]; | |
NSLog(@"lat: %f", _myLocationManager.location.coordinate.latitude); | |
NSLog(@"long: %f", _myLocationManager.location.coordinate.longitude); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSString *)reusableIdentifierForPinColor :(MKPinAnnotationColor)paramColor | |
{ | |
NSString *result = nil; | |
switch (paramColor) { | |
case MKPinAnnotationColorRed: | |
{ | |
result = REUSABLE_PIN_RED; | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apachectl stop | |
$ sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *str = @"product.orderEntryListItem.orderItem.caseDiscount"; | |
BOOL found = [str rangeOfString:@"Discount"].location != NSNotFound; | |
NSLog(@"%d", found); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float toRound = 0.999322; | |
short precision = 3; | |
NSDecimalNumberHandler *handler = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundPlain | |
scale:precision | |
raiseOnExactness:YES | |
raiseOnOverflow:YES | |
raiseOnUnderflow:YES | |
raiseOnDivideByZero:YES]; | |
float rounded = [[[NSDecimalNumber decimalNumberWithString:[[NSNumber numberWithFloat:toRound] stringValue]] decimalNumberByRoundingAccordingToBehavior:handler] floatValue]; | |
NSLog(@"%f", rounded); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_group_t group = dispatch_group_create(); | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(10); | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
for (int i = 0; i < 100; i++) | |
{ | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
dispatch_group_async(group, queue, ^{ | |
NSLog(@"%i",i); | |
sleep(2); | |
dispatch_semaphore_signal(semaphore); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class Box<T> { | |
let unbox: T | |
init(_ value: T) { self.unbox = value } | |
} | |
struct Notification<A> { | |
let name: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *const cellContactIdentifier = @"ContactInfoCell"; | |
static NSString *const cellCompanyIdentifier = @"CompanyCell"; | |
static NSString *const cellDeleteIdentifier = @"DeleteCell"; | |
static NSString *const cellDatePickerIdentifier = @"DatePicker"; | |
static NSString *const cellAddPhoneIdentifier = @"AddPhoneCell"; | |
static NSString *const cellAddressIdentifier = @"AddressCell"; | |
static NSString *const cellCommentIdentifier = @"CommentCell"; | |
static NSString *const cellMobilePhoneIdentifier = @"MobilePhoneCell"; |
OlderNewer