This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #include <iostream> | |
| int main(int argc, char *argv[]) | |
| { | |
| std::cout << "Hello World!!!" << std::endl; | |
| return 0; | |
| } |
| #!/usr/bin/perl -w | |
| use strict; | |
| sub trim($) { | |
| my $string = shift; | |
| $string =~ s/^\s+//; | |
| $string =~ s/\s+$//; | |
| return $string; | |
| } |
| import org.apache.hadoop.fs.Path; | |
| import org.apache.hadoop.io.LongWritable; | |
| import org.apache.hadoop.io.Text; | |
| import org.apache.hadoop.mapreduce.Job; | |
| import org.apache.hadoop.mapreduce.Mapper; | |
| import org.apache.hadoop.mapreduce.Reducer; | |
| import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; | |
| import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; | |
| import java.io.IOException; |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| // Define a int variable | |
| int i = 5; | |
| // Declare a pointer which can point to a int | |
| int *i_ptr; | |
| // Make i_ptr point to i | |
| i_ptr = &i; |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int i = 5; | |
| int *i_ptr = &i; | |
| // A pointer to pointer is declared as below | |
| int **i_ptr_ptr; |
| #include <iostream> | |
| #include <cstdlib> | |
| #include <cstring> | |
| using namespace std; | |
| int main() { | |
| // Integer elements to be sorted | |
| int i_arr[] = {5, 20, 3, 96, 37, 12, 2, 56, 39}; | |
| // Integer comparison function prototype |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int numbers[] = {14, 82, 76, 90, 12, 84}; | |
| // Function prototypes | |
| void output_numbers1(int *, int); | |
| void output_numbers2(int *, int); | |
| void output_numbers3(int *, int); |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int i_2d_arr [3][5] = { {4, 2, 7, 8, 1}, | |
| {12, 19, 15, 16, 11}, | |
| {23, 28, 22, 29, 28} | |
| }; |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int i_2d_arr [3][5] = { {4, 2, 7, 8, 1}, | |
| {12, 19, 15, 16, 11}, | |
| {23, 28, 22, 29, 28} | |
| }; |