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 <python3.8/Python.h> | |
//Run : gcc Cmain.c -I/usr/include/python3.8 -lpython3.8 -o Cmain.o && ./Cmain.o | |
//Full walkthrough : https://leetarxiv.substack.com/p/making-c-and-python-talk-to-each | |
int main() | |
{ | |
printf("Python, you are inside me\n"); | |
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 <assert.h> | |
#define MAX_K 100 | |
unsigned long long BinomialCoefficient(int n, int k) | |
{ | |
if(k > n - k){k = n - k;} | |
unsigned long long result = 1; | |
for(int i = 0; i < k; ++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 <assert.h> | |
#define MAX_K 100 | |
unsigned long long BinomialCoefficient(int n, int k) | |
{ | |
if(k > n - k){k = n - k;} | |
unsigned long long result = 1; | |
for(int i = 0; i < k; ++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 <math.h> | |
#include <stdint.h> | |
#include <gmp.h> | |
#define m32_ENABLE_ERRORS 1 | |
#define m32_TRUE 1 | |
#define m32_FALSE 0 | |
#define PRINT_ERROR(msg) \ | |
do { \ |
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> | |
void BinaryToSternBrocotFraction(int binaryLength, int *binary) | |
{ | |
/* | |
Create the 2*2 identity matrix | |
|1 0| is the matrix {1, 0, 0, 1} | |
|0 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 <stdlib.h> | |
void BinaryToSternBrocotFraction(int binaryLength, int * binary) { | |
/* | |
Create the 2*2 identity matrix | |
|1 0| is the matrix {1, 0, 0, 1} | |
|0 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Asymptotically Fast Factorization</title> | |
<style> | |
body { | |
font-family: "Times New Roman", Times, serif; | |
max-width: 800px; |
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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#include <sys/mman.h> | |
#include <stdbool.h> | |
#include "cJSON.h" | |
#define VOCABULARY_SIZE 50257 |
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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <math.h> | |
#include <sys/mman.h> | |
#include <stdbool.h> | |
#include "cJSON.h" | |
#define VOCABULARY_SIZE 50257 |
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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include "cJSON.h" | |
#define VOCABULARY_SIZE 50257 | |
#define tf_d_vocab 50257 | |
#define tf_d_seq 1024 |
NewerOlder