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 string,csv | |
c,h,n,o,p={9:"HT",10:"LF",11:"VT",12:"FF",13:"CR",32:"SP",34:"QT",44:"CM",96:"BT",124:"VB"},['dec','hex','chr'],'ascii',lambda x:ord(x[1]),string.printable | |
csv.writer(open(n+'.csv','w')).writerow(h),csv.writer(open(n+'.csv','a')).writerows([[str(j[0]),hex(j[0]),'<'+c[j[0]]+'>']if j[0]in c.keys()else[str(j[0]),hex(j[0]),j[1]]for j in sorted([[ord(i),i]for i in p],key=o)]),open(n+'.md','w').writelines(['|'+'|'.join(h)+'|\n','|'+'|'.join(["---"for i in range(len(h))])+'|\n']+['|'+'|'.join([j[0],j[1],'\\<'+j[2]+'>'])+'|\n'if int(j[0]) in c.keys()else'|'+'|'.join(j)+'|\n'for j in[[str(j[0]),hex(j[0]),c[j[0]]]if j[0]in c.keys()else[str(j[0]),hex(j[0]),j[1]]for j in sorted([[ord(i),i]for i in p],key=o)]]) |
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
float fast_inverse_sqrt(float input) { | |
long i; | |
float x2, y; | |
const float three_half = 1.5F; | |
x2 = input * 0.5F; | |
y = input; | |
i = * ( long * ) &y; | |
i = 0x5f3759df - ( i >> 1); | |
y = * ( float * ) &i; | |
for (int i = 0; i < 10; 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
[1, 3, 5, 7, 2, 4, 6] | |
[1, 3, 6, 2, 7, 5, 4] | |
[1, 3, 7, 6, 4, 2, 5] | |
[1, 4, 2, 7, 6, 3, 5] | |
[1, 4, 6, 3, 2, 7, 5] | |
[1, 4, 7, 2, 6, 5, 3] | |
[1, 4, 7, 3, 6, 2, 5] | |
[1, 4, 7, 5, 3, 2, 6] | |
[1, 5, 2, 6, 3, 7, 4] | |
[1, 5, 4, 2, 7, 3, 6] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
char get_translated_char(char key, char plaintext) { | |
return (char)(((tolower(key) + tolower(plaintext) - 194) % 26) + 97); | |
} | |
char* get_translation_key(size_t key_length, char *key, size_t plaintext_length, char *plaintext) { |
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 <stdlib.h> | |
typedef struct __modal_node_wo__ { | |
int data; | |
size_t count; | |
}* modal_node_wo_t; | |
typedef struct __modal_node__ { | |
int data; |
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 <stdlib.h> | |
#include <string.h> | |
#define CONFIG_ARGUMENT_FLAG "-C" | |
char* get_config_by_name(FILE *config_file, char *config_name) { | |
char *config_property = (char*)malloc(sizeof(char) * 40); | |
char *config_value = (char*)malloc(sizeof(char) * 40); | |
while(!feof(config_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
#!/usr/local/bin/python3.7 | |
def multiplicative_persistence(number, verbose = True): | |
count = 0 | |
if verbose == True: | |
print('pass ' + str(count) + ': ' + str(number)) | |
while len(str(number)) != 1: | |
product = 1 | |
for i in [int(j, 10) for j in list(str(number))]: | |
product *= 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
typedef enum coin { | |
HEAD = 0, | |
TAIL = 1 | |
} coin_t; | |
int randomRange(int lower, int upper) { |

NewerOlder