Skip to content

Instantly share code, notes, and snippets.

View NassimBentarka's full-sized avatar
💭
𝐅𝐫𝐞𝐞𝐝𝐨𝐦 ❤️

Nassim Bentarka NassimBentarka

💭
𝐅𝐫𝐞𝐞𝐝𝐨𝐦 ❤️
View GitHub Profile
@NassimBentarka
NassimBentarka / main.py
Created July 25, 2021 20:11
Random number generator that uses /dev/random as entropy source. Written as part of an experiment on the potential influences of the mind on the randomness of an event: a coin toss in this case.
#!/usr/bin/env python3
import random
import matplotlib as plt
import time
import os
import struct
_random_source = open("/dev/random", "rb")
def random_bytes(len):
@NassimBentarka
NassimBentarka / colebrook.m
Last active October 18, 2018 21:08
Ce script MATLAB permet le calcul du coefficient de friction (Lambda) F selon la corrélation de Colebrook. // A Matlab script to compute the friction coefficient based on Colebrook correlation.
%Auteur: Nassim BENTARKA
%Ecrit le 15/05/2018
%INPUT:
%Nombre de Reynolds: R ; et Rugosité relative: K
%Le nombre d'itérations
%OUTPUT:
%Coefficient de friction lambda: F
function F=colebrook(R,K)
@NassimBentarka
NassimBentarka / Fast-Video-Trim.sh
Last active November 15, 2021 15:08
Trim Videos from any format using FFMPEG in copy-paste speeds!
#!/bin/bash
#Author: Nassim BENTARKA (NBN) @nassimosaz
#You can implement this tool into your system by copying the script into ~/bin/ directory as fast-video-trim
if [ $# -ne 4 ]; then
printf "\n${0}: usage: Fast-Video-Trim.sh [BEGIN_TIME HH:MM:SS:] [END_TIME HH:MM:SS] [INPUT_FILE] [OUTPUT_FILE]\n\n"
exit 1
fi
TIME1=$1
TIME2=$2
IN=$3
@NassimBentarka
NassimBentarka / Fibonacci_Algorithm.m
Last active April 28, 2018 17:40
Computes Fibonacci Numbers using Dynamic Programming Algorithm (Memoization) on MATLAB.
% This technique is mainly used to optimize the running time of the algorithm, it transfoms exponential time caused by the recursion
% into polynomial time.
% Run this file on Matlab (with the csv files in the same dir)
clear
clc
n=input("N= ");
memo=dlmread('data.csv'); %Read memoized values array
memo_index=dlmread('index.csv'); %Read indexes of the memoized values
fib(1)=1;
fib(2)=1;