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
#include <stdio.h> | |
int main() | |
{ | |
char string1[50] = "This is a character array, it can be 50 characters."; | |
char string2[50]; | |
char* ps1 = string1; | |
char* ps2 = string2; |
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
char *strcpy(char *dest, const char *src) | |
{ | |
char *save = dest; | |
while(*dest++ = *src++); | |
return save; | |
} |
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
#include <stdio.h> | |
#include <math.h> | |
struct point { | |
float x; | |
float y; | |
float z; | |
}; | |
#define PI 3.14159265 |
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
#include <stdio.h> | |
#include <math.h> | |
struct point { | |
float x; | |
float y; | |
float z; | |
}; | |
#define PI 3.14159265 |
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
#include <stdio.h> | |
void fizzbuzz(int start, int end) | |
{ | |
int flag = 0; | |
if (start > end) return; | |
if (start%3 == 0) | |
printf("Fizz"), flag=1; | |
if (start%5 == 0) | |
printf("Buzz"), flag=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
- (void)startSplash { | |
[[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubview:self]; | |
splashImage = [[UIImageView alloc] initWithImage:self.image]; | |
if (self.animationIn == SplashViewAnimationNone) | |
{ | |
[self addSubview:splashImage]; | |
} | |
else if (self.animationIn == SplashViewAnimationFade) | |
{ |
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
... | |
// To use, place this code somewhere in your View Controller, | |
// all you need it to do is give it a size and an array of | |
// data. | |
NSMutableArray* data = | |
[[NSMutableArray alloc] initWithObjects: | |
@"Andy",@"Erik",@"Aaron",@"Frank",@"Will",@"Joe",nil]; |
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
- (id) init { | |
if (self = [super initWithFrame:CGRectMake(0, 0, 94, 27)]) { | |
[self initCommon]; | |
} | |
return self; | |
} |
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 kBatchSize 20 | |
// This could take a while. | |
+ (void) recalculateAllStats { | |
MyAppDelegate *myAppDelegate = (MyAppDelegate *) | |
[[UIApplication sharedApplication] delegate]; | |
NSManagedObjectContext *moc = | |
[myAppDelegate managedObjectContext]; | |
NSEntityDescription *entity = | |
[NSEntityDescription entityForName:@"Entry" |
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 streamFileCommands() { | |
boolean skip; | |
// Keep sending commands until the last command is sent, or the | |
// character buffer is full. | |
while ((this.commandBuffer.currentCommand().isSent() == false) && | |
CommUtils.checkRoomInBuffer(this.activeCommandList, this.commandBuffer.currentCommand())) { | |
skip = false; | |
GcodeCommand command = this.commandBuffer.currentCommand(); |
OlderNewer