Skip to content

Instantly share code, notes, and snippets.

View mrandri19's full-sized avatar
🅱️
All about that Bayes

Andrea Cognolato mrandri19

🅱️
All about that Bayes
View GitHub Profile
@mrandri19
mrandri19 / main.c
Last active July 3, 2022 19:30
main.c: Modern text rendering with Linux: Part 1
#include <stdio.h>
#include <freetype2/ft2build.h>
#include FT_FREETYPE_H
int main() {
FT_Library ft;
FT_Error err = FT_Init_FreeType(&ft);
if (err != 0) {
printf("Failed to initialize FreeType\n");
# From the editor: Ctrl-e to execute, Ctrl-l to clear console (My VsCode custom keybindings)
using Images
using LinearAlgebra
import LinearAlgebra: dot
using StaticArrays
using Printf
const Vec3 = SVector{3,Float64}
abstract type Material end
@mrandri19
mrandri19 / Pascal's Triangle II.py
Last active October 8, 2020 09:58
LeetCode Solutions
class Solution:
from functools import lru_cache
def getRow(self, rowIndex: int) -> List[int]:
# 1 0 0 0 0 0 j
# 1 1 0 0 0 0
# 1 2 1 0 0 0
# 1 3 3 1 0 0
# 1 4 6 4 1 0
# 1 5 10 10 5 1
# i
@mrandri19
mrandri19 / Julia_Plots_Cheatsheet.md
Last active September 20, 2020 20:46
Julia Plots Cheatsheet

Make multiple plots

plot(
  plot(),
  plot(),
  ...
)
@mrandri19
mrandri19 / fourier.html
Created January 23, 2020 22:10
Experiments with the Discrete Fourier Transform
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DFT</title>
<style>
h1 {
font-family: sans-serif;
}
#canvas_container {
@mrandri19
mrandri19 / main.c
Created August 20, 2019 14:23
main.c: Modern text rendering with Linux: Antialiasing
#include <stdio.h>
#include <freetype2/ft2build.h>
#include FT_FREETYPE_H
#include FT_LCD_FILTER_H
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "./stb_image_write.h"
int main() {
I (4863) Pinger: Start pinging
pf->send_count: 1
pf->send_count: 2
pf->send_count: 3
pf->send_count: 4
#include "rapidjson/document.h"
#include <stack>
#include <unordered_set>
#include <vector>
using namespace rapidjson;
using namespace std;
#define PATH "/home/andrea/Desktop/dependencies.json"
import fetch from "node-fetch"
export interface PingData {
total_rows: number
offset: number
rows: Row[]
}
type packageid = string
export interface Row {
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "lwip/sys.h"