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
- (void)changeStatusOfObject:(PCHousemasterObject *)object toValue:(float)value | |
{ | |
NSArray *groupAddressArray = [object.groupAddress componentsSeparatedByString:@"/"]; | |
NSString *groupAddressBaseTwo = [NSString stringWithFormat:@"%@%@%@",[self convertToBinary:[groupAddressArray[0] integerValue] padding:5],[self convertToBinary:[groupAddressArray[1] integerValue] padding:3],[self convertToBinary:[groupAddressArray[2] integerValue] padding:8]]; | |
NSString *groupAddressDecimal = [NSString stringWithFormat:@"%ld",strtol([groupAddressBaseTwo UTF8String], NULL, 2)]; | |
NSString *message = [NSString stringWithFormat:@"1|%@|%i\0",groupAddressDecimal,(int)(value * 100)]; | |
NSLog(@"%@",message); |
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
// | |
// PCCountedObjectContainer.h | |
// Slingshot | |
// | |
// Created by Maximilian Mackh on 02/02/14. | |
// Copyright (c) 2014 Professional Consulting & Trading GmbH. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
// | |
// NSObject+Notifications.h | |
// InstaPDF | |
// | |
// Created by Maximilian Mackh on 18/09/13. | |
// Copyright (c) 2013 mackh ag. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
- (BOOL) isBetweenBeginDate:(NSDate *)beginDate endDate:(NSDate *)endDate | |
{ | |
return ([self compare:beginDate] == NSOrderedDescending || [self compare:beginDate] == NSOrderedSame) && ([self compare:endDate] == NSOrderedAscending); | |
} | |
- (NSInteger)distanceInDaysToDate:(NSDate *)anotherDate | |
{ | |
NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit fromDate:self toDate:anotherDate options:0]; | |
return components.day; |
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+Hash.h | |
// Orbitink | |
// | |
// Created by mmackh on 5/3/13. | |
// Copyright (c) 2013 Professional Consulting & Trading GmbH. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
- (void)loadCommentsOnStoryWithID:(NSString *)storyID result:(void(^)(NSArray *results))completionBlock | |
{ | |
NSString *queryURLString = [NSString stringWithFormat:@"https://news.ycombinator.com/item?id=%@",storyID]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:queryURLString] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:10]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) | |
{ | |
NSMutableArray *comments = [NSMutableArray new]; | |
NewerOlder