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
// | |
// NSString+MBDialogString.m | |
// TileParser | |
// | |
// Created by Moshe Berman on 9/23/12. | |
// | |
// | |
#import "NSString+MBDialogString.h" |
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
// | |
// Calculates the substring that fits in a frame | |
// | |
- (NSString *) substringThatFitsFrame:(CGRect)frame withFont:(UIFont *)font{ | |
NSString *truncatedString = self; | |
CGSize clippingSize = CGSizeMake(frame.size.width, CGFLOAT_MAX); | |
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 NSDate (timeTravel) | |
- (NSDate *) dateAdvancedByNumberOfDaysAgainstGregorianCalendar:(NSUInteger)numberOfDays; | |
- (NSDate *) dateRewoundByNumberOfDaysAgainstGregorianCalendar:(NSUInteger)numberOfDays; | |
- (NSDate *) dateAdvancedByNumberOfDays:(NSUInteger)numberOfDays againstCalendar:(NSCalendar *)calendar; | |
- (NSDate *) dateRewoundByNumberOfDays:(NSUInteger)numberOfDays againstCalendar:(NSCalendar *)calendar; |
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
// | |
// Widget.cpp | |
// 3-LinkedLists | |
// | |
// Created by Moshe Berman on 12/2/12. | |
// Copyright (c) 2012 Moshe Berman. All rights reserved. | |
// | |
#include "Widget.h" |
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
Stocking 150 at $1 each. | |
Stocking 130 at $2 each. | |
(lldb) c | |
Process 6212 resuming | |
(lldb) p sales | |
(std::__1::vector<Sale, std::__1::allocator<Sale> > &) $0 = size=2: { | |
(Sale) [0] = { | |
(int) quantity = 0 | |
(double) pricePerUnit = 0 | |
} |
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 display() | |
{ | |
// Clear the previous frame | |
glClear(GL_COLOR_BUFFER_BIT); | |
{ | |
glPushMatrix(); | |
glTranslatef(0.5, 0.5, 0); |
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) flipInWithCompletion:(MBTransitionCompletion)completion | |
{ | |
BOOL displayingPrimary = [self isDisplayingPrimaryView]; | |
UIView *frontView = [self frontView]; | |
UIView *backView = [self backView]; | |
UIView *wrapperView = [self wrapperView]; | |
[wrapperView addSubview:frontView]; | |
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
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event | |
{ | |
if ([[self headerView] pointInside:point withEvent:event]) | |
{ | |
return YES; | |
} | |
else if([[self table] pointInside:point withEvent:event]) | |
{ | |
return YES; |
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
// Prototypes: | |
int sum(int, int); | |
/* Main program */ | |
int main() | |
{ | |
int z = sum(1, 1); // z will become 2 here |
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
/* Prototypes */ | |
int sum(int, int); | |
void wrapper(); | |
/* Main program */ | |
int main() | |
{ | |
wrapper(); |
OlderNewer