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
CGRect _f = CGRectMake(0, 0, 200, 200); | |
CGFloat xPosition = CGRectGetWidth(self.view.frame) - CGRectGetWidth(_f); | |
_f.origin = CGPointMake(ceil(xPosition), 0.0); |
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
// .h | |
@interface NSNumber (Ranges) | |
- (NSRange)to:(NSNumber *)rangeEnd; | |
- (BOOL)isInRange:(NSRange)range; | |
@end | |
// .m | |
@implementation NSNumber (Ranges) |
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
#define POP_ALERT(title, msg) [[[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]autorelease] show] | |
/* | |
Usage: | |
POP_ALERT(@"Title Here", @"Message Here"); | |
*/ |
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)viewDidLoad { | |
[super viewDidLoad]; | |
UIView *holderView = [[UIView alloc] initWithFrame:CGRectMake(50.0f, 50.0f, 200.0f, 200.0f)]; | |
CAEmitterLayer *emitterLayer = [CAEmitterLayer layer]; | |
emitterLayer.frame = CGRectMake(0.0f, 0.0f, 200.0f, 200.0f); | |
emitterLayer.emitterSize = CGSizeMake(20.0f, 20.0f); | |
emitterLayer.emitterPosition = CGPointMake(90.0f, 90.0f); | |
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
class SaveCancelToolbar < UIToolbar | |
attr_writer :delegate | |
def initWithFrame frame, andTitle: title | |
super | |
items = [] | |
spacer = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:nil, action:nil) | |
@cancel_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemCancel, target:self, action:'on_cancel:') |
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 *const ASMultipleAssignmentException = @"Multiple Assignment Exception"; | |
#ifndef CHECK_FOR_MULTI_ASSIGN | |
#define CHECK_FOR_MULTI_ASSIGN(ivar) \ | |
do { \ | |
if (ivar) { \ | |
NSString *AS_reason = @"Cannot assign to " #ivar " more than once"; \ | |
@throw [NSException exceptionWithName:ASMultipleAssignmentException \ | |
reason:AS_reason \ | |
userInfo:nil]; \ |
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
#include <Time.h> | |
/* | |
I have an accelerometer plugged into pins A0, A1 and A2 of an Arduino, | |
and I'm writing a CSV file (well the line breaks are wrong) to serial. | |
It depends on the time library (http://www.arduino.cc/playground/Code/Time), | |
which you install by extracting the download in the arduino `libraries` | |
directory and restarting arduino. (This actually provides three libraries.) |
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
class SaveCancelToolbar < UIToolbar | |
attr_writer :delegate | |
def initWithFrame frame, andTitle: title | |
super | |
items = [] | |
spacer = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemFlexibleSpace, target:nil, action:nil) | |
@cancel_button = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemCancel, target:self, action:'on_cancel:') |
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
<p><a href="http://www.visionmobile.com/blog/2012/08/the-rise-of-the-new-app-economy/" mce_href="http://www.visionmobile.com/blog/2012/08/the-rise-of-the-new-app-economy/"><img src="http://www.visionmobile.com/uploads/infographics/8/VMInfographic_DE12_800.png" mce_src="http://www.visionmobile.com/uploads/infographics/8/VMInfographic_DE12_800.png" border="0" alt="Developer Economics 2012 - The Rise of the New App Economy" /></a></p> |
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
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main () | |
{ | |
pid_t child_pid; | |
child_pid = fork (); | |
if (child_pid > 0) { |
OlderNewer