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
//Compile: gcc main.c -lm -o main.o && ./main.o | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <math.h> | |
#define FIXEDPT_BITS 32 | |
#include "fixedptc.h" |
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 <math.h> | |
#include <assert.h> | |
#include <dirent.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
#define MAX_LENGTH 256 | |
//Ben |
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 <math.h> | |
#include <assert.h> | |
#include <SDL2/SDL.h> | |
#define SAMPLE_RATE 44100 | |
#define CHANNELS 1 | |
#define BUFFER_SIZE 4096 | |
#ifndef AUDIO_F32SYS | |
#define AUDIO_F32SYS 0x8120 |
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 <assert.h> | |
#include <math.h> | |
int partitionMaxSum = 0; | |
typedef struct partition_struct Partition;struct partition_struct{int index; int number; int partitionLength; int *partition;}; | |
int PartitionCompareNumber(const void *a, const void *b) {return ((*(Partition *)a).number - (*(Partition *)b).number);} | |
Partition *CreatePartition(int partitionArrayLength,int partitionLength, int numberBase) | |
{ |
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> | |
#define BASE 5 | |
#define LENGTH 5 | |
#define MAX_SUM (BASE * LENGTH - 1) | |
// Define a structure to hold index, number, and sum of digits | |
struct NumberInfo { | |
int index; |
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
def base2_to_base10(binary_string): | |
return int(binary_string, 2) | |
def base10_to_base256(decimal_number): | |
return decimal_number.to_bytes((decimal_number.bit_length() + 7) // 8, 'big') | |
def base256_to_base10(byte_array): | |
return int.from_bytes(byte_array, 'big') | |
def base10_to_base2(decimal_number): |
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
//sudo apt-get install libgsl-dev | |
link using -lgsl |
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
// CPP program to generate all unique | |
// partitions of an integer | |
//https://www.timvanerven.nl/assets/publications/2010/PhDthesis-TimvanErven.pdf | |
//https://luna.informatik.uni-mainz.de/mod2-21/slides/S06-Information.pdf | |
//Bayesian updates the model given past data. i.e the probabilities change whenever new information is given | |
//I'm a frequentist. Honestly, I don't even think probabilites exist. Probabilities are like astrology signs - super mainstream but | |
//Meme probability to day trade is similar to astrology girl angry because mercury is in retrograde | |
#include<iostream> | |
using namespace std; |
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 <math.h> | |
void FindResult(int *X, int *Y,int *XR, int *YR,double *affineMap, int XYLength) | |
{ | |
for(int i = 0; i < XYLength; i++) | |
{ | |
XR[i] = (int)round(affineMap[0] * (double) X[i] + affineMap[1] * (double)Y[i] + affineMap[4]); | |
YR[i] = (int)round(affineMap[2] * (double) X[i] + affineMap[3] * (double)Y[i] + affineMap[5]); | |
printf("(%d,%d) to (%d,%d)\n",X[i], Y[i],XR[i],YR[i]); |