Skip to content

Instantly share code, notes, and snippets.

(60*30).downto(0){|i|puts sprintf("%02d:%02d", i/60, i%60);sleep 1}
NSMutableIndexSet* targetIndexes = [NSMutableIndexSet indexSet];
NSUInteger index = 0;
for(HogeView* aHogeView in aHogeViews) {
CGPoint center = aHogeView.center;
if(center.x < MIN){
[targetIndexes addIndex:index];
[aHogeView removeFromSuperview];
}
index++;
}
#!perl
use strict;
use warnings;
use utf8;
NSLog(@"max = %f", [[arrayDistance valueForKeyPath:@"@max.floatValue"] floatValue]);
#import <Cocoa/Cocoa.h>
int main(){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray * array = [NSArray arrayWithObjects:
[NSNumber numberWithInt:333],
[NSNumber numberWithInt:555],
[NSNumber numberWithInt:444],
[NSNumber numberWithInt:222],
[NSNumber numberWithInt:111],
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
const CGFloat NEAR = 0.1f;
const CGFloat FAR = 10.0f;
const CGFloat FOVY = 90.0f;
const CGFloat ASPECT = backingWidth / backingHeight;
CGFloat scale = NEAR * tan(FOVY * 0.5f * M_PI / 180.0f);
CGFloat x = scale * ASPECT;
CGFloat y = scale;
#import <Cocoa/Cocoa.h>
int main(){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello");
[pool release];
return 0;
}
#import <Cocoa/Cocoa.h>
int main(){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello");
NSDate *now = [[NSDate date] retain];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
//ロケールを設定
#ifdef DEBUG
# define TRACE(fmt, ...) NSLog((@"%s(%d) " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define TRACE(...)
#endif