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
/* Prototypes */ | |
int sum(int, int); | |
void wrapper(int, int); | |
/* Main program */ | |
int main() | |
{ | |
wrapper(1,1); // We pass in the two values instead. |
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
/* Prototypes */ | |
int sum(int, int); | |
int wrapper(int, int); | |
/* Main program */ | |
int main() | |
{ | |
int x = wrapper(1,1); // We pass in the two values instead. |
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
main(int argc, char* argv[]) | |
{ | |
// Generate a random number between MINFORKS and MAXFORKS | |
unsigned int seed = generateSeed(0); | |
int n = rand_r(&seed) % MAXFORKS + MINFORKS; | |
// Time elapsed | |
long time = 0; | |
time = elapsedTime((int)time); | |
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
int | |
main(int argc, char* argv[]) | |
{ | |
// Wire up the timer | |
long time = elapsedTime(0); | |
/* Generate a random number between MINFORKS and MAXFORKS | |
*/ | |
unsigned int seed = generateSeed(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
/* | |
* Loop through the processes and wait for them | |
* to terminate. Then print the childid, and the | |
* the pid. | |
*/ | |
int status = NULL; | |
for (int i = 0; i < n; i++) | |
{ |
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
main(int argc, char* argv[]) | |
{ | |
// Wire up the timer | |
long time = elapsedTime(0); | |
/* Generate a random number between MINFORKS and MAXFORKS | |
*/ | |
unsigned int seed = generateSeed(0); | |
int n = rand_r(&seed) % MAXFORKS + MINFORKS; |
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
// Code: | |
#import "ArrayDictionaryArray.h" | |
- (void)sampleConversion | |
{ | |
NSArray *array = @[@"Hello", @"I", @"Am", @"Deep", @"Blue"]; | |
NSDictionary *dictionary = [array dictionary]; |
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
import os | |
import keyword | |
import sys | |
class Toodles: | |
def walkAndList(directory): | |
for dirname, dirnames, filenames in os.walk(directory): |
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)applyLegacyBoundries | |
{ | |
/* In iOS 7, UIKit will automatically | |
* put content beneath navigation bars. | |
* It also tries to pad scroll views | |
* and table views to make them | |
* scroll nicely beneath them. | |
* | |
* These two checks will fix them. | |
* |
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
/** | |
* This class extends the Stack | |
* so that there's a pushdown(i) | |
* method which copies the elements | |
* at index 0 and inserts it and index i. | |
* All items beneath index i are pushed down. | |
* | |
*/ | |
import java.util.Stack; |