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
| for ( y = 0; y < rows ; y++) | |
| { | |
| for ( x = 0; x < cols ; x++) | |
| { | |
| number[y][x] = (rand() % 10001 + 5); | |
| if(hi < number[y][x]) hi= number[y][x]; | |
| count++; | |
| avg-=avg/(float)count; | |
| avg+=number[y][x]/(float)count; | |
| } |
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 <sys/inotify.h> //filesystem events | |
| class tinyListener { | |
| public: | |
| string name, list_name; | |
| void addListener(string s) { | |
| list_name = s; | |
| } | |
| bool good() { | |
| return (list_name == name); | |
| } |
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
| // the compile args -- gcc version 4.6.3 // | |
| // g++ this.cpp -Wall -fexceptions -std=c++0x -g -lpthread // | |
| ////////////////////////////////////////////////////////////// | |
| #include <iostream> | |
| #include <thread> | |
| #include <mutex> | |
| using namespace std; | |
| mutex mx; |
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 <cstring> | |
| #define _missingFile 0x601DE0 | |
| using namespace std; | |
| class fileListener | |
| { | |
| private: | |
| struct stat st; | |
| public: | |
| class file_ |
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
| /* Using 'wait();' and an '__EXIT_STATUS' makes sure we don't have zombies or a race condition */ | |
| #include <stdio.h> | |
| #include <sys/types.h> | |
| #include <sys/wait.h> | |
| #include <signal.h> | |
| void child(int*); | |
| int parent(int); | |
| int main(void) | |
| { | |
| pid_t pid=1; |
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 <stdio.h> | |
| #include <sys/types.h> | |
| void child(int*); | |
| int parent(int); | |
| void main(void) | |
| { | |
| pid_t pid; | |
| int n=0, i=0; | |
| do { | |
| if (pid == 0) |
NewerOlder