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 OSCObserver : NSObject | |
@property(nonatomic, copy) NSString *path; | |
@property(nonatomic, assign) id object; | |
@property(nonatomic) SEL selector; | |
@end | |
@implementation OSCObserver | |
@synthesize path, object, selector; | |
+ (OSCObserver *)observerWithPath:(NSString *)path object:(id)object selector:(SEL)selector { | |
OSCObserver *ret = [[self alloc] init]; | |
ret.path = path; |
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
NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
df.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'sssZ':00'"; | |
df.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]; | |
df.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"]; | |
NSDate *d = [df dateFromString:@"2011-08-15T20:13:00.003+02:00"]; | |
NSLog(@"%@ - %@", d, df.timeZone); |
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)setPubDate:(NSString *)dateAsString { | |
if(dateAsString == pubdate) | |
return; | |
[pubdate release]; | |
pubdate = [dateAsString copy]; | |
static NSDateFormatter *df = nil; | |
if(!df) { | |
df = [[NSDateFormatter alloc] init]; | |
df.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]; |
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
#define StartRecordTime( start ) \ | |
__asm mov saved_ebx, ebx \ | |
__asm xor eax, eax \ | |
__asm cpuid \ | |
__asm rdtsc \ | |
__asm mov start, eax \ | |
__asm xor eax, eax \ | |
__asm cpuid | |
#define StopRecordTime( 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
static vec2_t bezier_firstDerivative(bezier_t curve, float t) | |
{ | |
vec2_t out; | |
vec3_t derivControlPoints[3]; | |
derivControlPoints[0] = vec3_sub(curve.controlPoints[1], curve.controlPoints[0]); | |
derivControlPoints[1] = vec3_sub(curve.controlPoints[2], curve.controlPoints[1]); | |
derivControlPoints[2] = vec3_sub(curve.controlPoints[3], curve.controlPoints[2]); | |
float mt = 1.0f - t; | |
float coef0 = powf(mt, 2.0f); |
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
static vec3_t *bezier_getPoints(bezier_t curve, float dirChangeThreshold, int *outCount) | |
{ | |
dirChangeThreshold /= 100.0f; | |
int capacity = 32; | |
int count = 0; | |
float t = 0.0f; | |
float interval = 0.05; | |
vec3_t *out = malloc(sizeof(vec3_t)*capacity); | |
out[count++] = bezier_getPoint(curve, t); |
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
static void bezier_getLineSegments(bezier_t curve, int count, vec3_t *outPoints, float *outLengths, float *outDeltas, float *outTotalLength) | |
{ | |
vec3_t points[count]; | |
float lengths[count]; | |
lengths[count-1] = 0.0f; | |
float deltas[count]; | |
float totalLength; | |
float t = 0.0f; | |
float interval = 1.0f/(float)(count-1); |
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
tell application "Xcode" | |
set proj to last project | |
set conf to build configuration "Debug" of proj | |
build proj using conf with transcript | |
-- Just returns a 'missing value' | |
end tell |
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
let mapleader = "," | |
set nocompatible | |
set backspace=indent,eol,start | |
set number | |
set ruler | |
syntax on | |
set encoding=utf-8 |
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
let mapleader = "," | |
set nocompatible | |
set backspace=indent,eol,start | |
set number | |
set ruler | |
syntax on | |
set encoding=utf-8 |
OlderNewer