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
@interface ExtendedManagedObject : NSManagedObject { | |
BOOL traversed; | |
} | |
@property (nonatomic, assign) BOOL traversed; | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (ExtendedManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; |
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
@interface UIImage (Resizing) | |
- (UIImage*) resizedImageWithSize:(CGSize)size; | |
@end |
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
#import "UIImage+Resizing.h" | |
@implementation UIImage (Resizing) | |
/** | |
* Creates a resized, autoreleased copy of the image, with the given dimensions. | |
* @return an autoreleased, resized copy of the image | |
*/ | |
- (UIImage*) resizedImageWithSize:(CGSize)size | |
{ |
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
#import <CoreData/CoreData.h> | |
@interface Photo : NSManagedObject { | |
} | |
@property (nonatomic, retain) NSString * imagePath; | |
@property (nonatomic, retain) NSString * thumbnailPath; | |
@property (nonatomic, retain) UIImage* image; | |
@property (nonatomic, retain, readonly) UIImage* thumbnail; |
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
#import "UIImage+Resizing.h" | |
@implementation Photo | |
@dynamic imagePath; | |
@dynamic thumbnailPath; | |
static const CGFloat kThumbnailWidth = 75.0f; | |
static const CGFloat kThumbnailHeight = 75.0f; | |
static const CGFloat kJPEGQuality = 0.85f; |
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
#import <SenTestingKit/SenTestingKit.h> | |
@interface AsyncTests : SenTestCase { | |
NSCondition* condition; | |
BOOL operationSucceeded; | |
} | |
@end |
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
// | |
// Singleton.h | |
// | |
#import <Foundation/Foundation.h> | |
@interface Singleton : NSObject { | |
} |
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
#import <Foundation/Foundation.h> | |
@interface Stopwatch : NSObject { | |
// Name to be used for logging | |
NSString* name; | |
// Total run time | |
NSTimeInterval runTime; | |
// The start date of the currently active run |
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
#import <Foundation/Foundation.h> | |
/** | |
SaneRSA abstracts away the gory details of the RSA algorithm and exposes a clean, minimal interface | |
to the outside world. The only data that needs to be fed into a SaneRSA instance is the desired RSA | |
key size and the remote end's RSA public key (which obviously needs to have the same key size). | |
*/ | |
@interface SaneRSA : NSObject | |
@property (nonatomic, readonly) NSData* publicKey; |
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
public Vector3 VectorAt(float x, float y, float z) { | |
if (x < 0f) x = Mathf.Abs(x); | |
if (y < 0f) y = Mathf.Abs(y); | |
if (z < 0f) z = Mathf.Abs(z); | |
int floorX = Mathf.FloorToInt(x); | |
float tx = x - floorX; | |
floorX %= Dimension; | |
int ceilX = Mathf.CeilToInt(x) % Dimension; |
OlderNewer