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
// This code is pretty old so there might be very useless/wrong stuff. | |
#include <stdio.h> | |
#include <time.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <conio.h> | |
#include <windows.h> | |
struct Team { |
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> | |
struct DynamicArray { | |
int* arr; | |
unsigned short size, cursor; //To track cursor's position | |
}; | |
int main() { | |
struct DynamicArray arrays[3] = {NULL, 0, 0}; | |
unsigned short i, j; //Loop counters |
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 fibonacci (int n); // Calculates the n'th fibonacci number | |
// main function | |
int main (void) { | |
int n = 1337; | |
printf ("Fibonacci Number Calculator - Tolga Ay - 13011057\n\n\n\nEnter a negative number or zero to quit.\n\n"); | |
while (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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct COORDS { | |
int r; | |
int c; | |
} COORD; | |
void erase (char s[], int idx); //Erases the given element of the string |
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
// This code walks through text files which including "marks", calculates average of them in threads | |
#include <pthread.h> | |
#include <dirent.h> | |
#include <regex.h> | |
#include <stdio.h> | |
// Walks through all files, counts them and saves the directories to fileNames list | |
int getFileNames(const char* dir, const char* pattern, const char** * fileNamesOut, short* fileCountOut); | |
// Error Codes |
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 <string.h> | |
#include <stdlib.h> | |
typedef struct Character { | |
unsigned char val; | |
int freq; | |
} CHARACTER; | |
struct TREENODE { |
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> | |
// FILE INPUT INFO | |
#define N 2420 // Number of words | |
#define WORD_LEN 5 // Character count of a word | |
// INPUTS | |
#define VALIDATE_GRAPH_CREATION 1 | |
#define SRC_WORD "prove" // Word to start searching | |
#define DEST_WORD "guess" // Word to find |
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 <stdlib.h> | |
#include <memory.h> | |
#include <string.h> | |
#define PASSWORD_TO_CRACK "vK6b" | |
// Increment the lowest digit by 1, check if it passed the last character in the char set | |
int incrementPass(char* password, int maxChar, int currLength) { | |
++password[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
inf="input_list.txt" # this file has lines like [201504695,ASLI,ASLAN,[email protected],CS101,89,2] | |
outf="list.txt" | |
sep=',' #define seperator | |
#filter the list | |
list=$(cat $inf ` | |
`| egrep "2015.*(CS101|CS102),([6-9][0-9]|100).*" ` # filter with CS101 OR CS102, 2015 and 60 <= mark | |
`| sed 's/-//1' ` # remove - from the number | |
`| awk -F $sep 'int($7)==2' ` # second time they take the lesson | |
`| awk -F $sep 'int($6)<90' ` # mark < 90 |
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
// You need to uncomment and comment some blocks in order to benchmark, it is not full automatic. | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
// Inputs | |
#define ARRAY_SIZE 1000 | |
#define LOGS_ON 0 |
OlderNewer