This file contains 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
// MyOperation.h | |
@interface MyOperation : NSOperation | |
@end | |
// MyOperation.m | |
@implementation MyOperation | |
- (void)main { | |
if ([self isCancelled]) { | |
NSLog(@"** operation cancelled **"); |
This file contains 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
- (void)attachMetadata | |
{ | |
DLog(@"EXIF data is %@",self.exifData); | |
[self.exifData setObject:@1 forKey:@"Orientation"]; | |
NSData *jpeg = UIImageJPEGRepresentation(self.image, 1); | |
CGImageSourceRef sourceRef = CGImageSourceCreateWithData((__bridge CFDataRef)jpeg, NULL); | |
NSMutableData *dest_data = [NSMutableData data]; | |
CFStringRef UTI = CGImageSourceGetType(sourceRef); | |
CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)dest_data,UTI,1,NULL); |
This file contains 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
+ (NSDate *)dateFromRFC3339String:(NSString *)dateString | |
{ | |
NSDate *date = nil; | |
if (dateString) { | |
NSDateFormatter *dateFormatter = [self internetDateTimeFormatter]; | |
NSString *RFC3339String = [[NSString stringWithString:dateString] uppercaseString]; | |
RFC3339String = [RFC3339String stringByReplacingOccurrencesOfString:@"Z" withString:@"-0000"]; | |
if (RFC3339String.length > 20) { | |
RFC3339String = [RFC3339String stringByReplacingOccurrencesOfString:@":" |
This file contains 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
- (NSArray *)lastWordOfEachLine | |
{ | |
NSMutableArray *wordArray = [@[] mutableCopy]; | |
UITextPosition *firstRowStart = self.myTextView.beginningOfDocument; | |
UITextPosition *rowEnd = [self.myTextView.tokenizer positionFromPosition:firstRowStart | |
toBoundary:UITextGranularityLine | |
inDirection:UITextLayoutDirectionRight]; | |
BOOL done = NO; |
This file contains 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
UITextPosition *firstRowStart = self.myTextView.beginningOfDocument; | |
UITextPosition *firstRowEnd = [self.myTextView.tokenizer positionFromPosition:firstRowStart | |
toBoundary:UITextGranularityLine | |
inDirection:UITextLayoutDirectionRight]; | |
NSString *lastWord = nil; | |
while (!lastWord) { | |
UITextRange *range = [self.myTextView.tokenizer rangeEnclosingPosition:firstRowEnd | |
withGranularity:UITextGranularityWord |
This file contains 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
At Vokal our engineering interview process is pretty simple. Before we get emotionally attached | |
to any candidate we meet with them for two coding challenges. Candidates solve these contrived | |
coding conundrums with members of our team. During the challenge candidates are encouraged to | |
check documentation, google for help, and talk to their proctor. The exercise is not about | |
brain teasers, but how candidates work with people to solve a novel problem. Most of our | |
challenges require manipulating basic data structures. The work is completed in a collaborative | |
text editor. Often the most difficult part for candidates is working without autocomplete. | |
We've often asked ourselves what we want from candidates in these programming exercises. In short, | |
we're trying our best to notice the idiosyncrasies of a good engineer. There are small things like, |
NewerOlder