Skip to content

Instantly share code, notes, and snippets.

View harieamjari's full-sized avatar

Al-buharie harieamjari

View GitHub Profile
@harieamjari
harieamjari / .gitignore
Last active October 5, 2021 09:35
Assignment research
*.log
*.aux
*.pdf
@harieamjari
harieamjari / calculus101.tex
Created July 8, 2021 04:15
Learning tex language.
\documentclass{article}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{geometry}[top=0.5in]
\title{Basic Calculus \\
Activity II}
@harieamjari
harieamjari / learnt.c
Last active July 17, 2021 14:43
New tricks learned in C
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct vec3D vec3D;
struct vec3D {
float x, y, z;
};
_Static_assert(sizeof(vec3D) == 12, "May not work");
@harieamjari
harieamjari / get.c
Created June 15, 2021 15:17
GET request for a file; download a file using an HTTP request. OpenSSL
/*
* Copyright 2013-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/err.h>
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
#include <stdio.h>
#include <stdint.h>
typedef struct student student;
struct student {
char name[100];
char status;
int id;
};
@harieamjari
harieamjari / heat.c
Created May 3, 2021 12:59
Solving the heat equation
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
double init_fluid(double x) {
return 10.0 * sin(2.0 * M_PI * x / 30.0) + 8.0 * cos(x / 2.0) +
2.0 * sin(x / 2.0);
}
int main() {
@harieamjari
harieamjari / calc.c
Last active May 1, 2021 09:46
Calculator
/* Tiny calc
*
* Copyright (c) 2021 Al-buharie Amjari <healer.harie@gmail.com>
*
* This file is license under MIT license
*
*/
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
double init_fluid(double x) {
return 100.0 * sin(2.0 * M_PI * 0.4 * x) *
pow(M_E, -pow(x - 15.0, 2.0) / (3.6 * 2.0)) / (3.6 * sqrt(2.0 * M_PI));
}
@harieamjari
harieamjari / half.c
Created April 24, 2021 13:58
Integration of a normal distribution from 0 to +inf
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include <stdint.h>
static double derivative(double x){
return pow(M_E, -pow(x, 2.0)/2.0)/sqrt(2.0*M_PI);}
int main(int argc, char **argv) {