Skip to content

Instantly share code, notes, and snippets.

View arnabanimesh's full-sized avatar
😎
Working and chilling

Arnab Animesh Das arnabanimesh

😎
Working and chilling
View GitHub Profile
#include <numeric>
#include <string>
#include <ranges>
#include <execution>
#include <iterator>
#include <vector>
struct Output
{
int32_t serial;
@arnabanimesh
arnabanimesh / c99clang.s
Last active September 15, 2024 19:44
run `amicable_num_bench` C code using `-S` and `-fverbose-asm` flags. use gcc 14.2 and clang 18.1.8 on windows 11. Clang uses msvc libraries and lld linker. Optimization level 2 with no lto
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
.set @feat.00, 0
.file "c99.c"
.def strtouint32_safe;
.scl 2;
@arnabanimesh
arnabanimesh / tsp_ortools.ipynb
Last active March 4, 2024 10:31
tsp implementations in or_tools (single core only, ORTools v9.9.3903, Ubuntu 22.04 LTS WSL2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arnabanimesh
arnabanimesh / read_data.c
Last active January 10, 2023 20:59
read a file with three tab separated columns. Ignore the first column, the second column is a string, the third column is a number.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LINE_LENGTH 1024
typedef struct
{
char *SKU;
long *count;

Since we're dealing with simpler AV1 encoding, that does mean we'll be eskewing aomenc-av1, since it requires 2-pass encoding to be able to take advantage of it, and I use it externally since I have access to a special build.

Now, let's get on with the simple guide.

You'll first need to be reasonably competent with command line builds or use a recent up to date ffmpeg GUI with support for SVT-AV1.

As such, I would recommend getting a master git ffmpeg build for the operating system of your choice right here:

https://github.com/BtbN/FFmpeg-Builds

@arnabanimesh
arnabanimesh / bench.md
Last active May 13, 2024 10:51
FISR speed test mentioned in the video: https://www.youtube.com/watch?v=Fm0vygzVXeE

Benchmark sqrt.rs (Command: rustc -O sqrt.rs)

Sanity checks:
============================================
Sqrt = 1000
isqrt = 1000
fisqrt = 998
intrsqrt = 1000
============================================
@arnabanimesh
arnabanimesh / wikipedia31.txt
Created February 23, 2022 02:06
Princeton Percolation Assignment Custom Inputs
31
1 1
2 1
3 1
4 1
5 1
5 2
5 3
5 4
5 5
@arnabanimesh
arnabanimesh / rustlings.cmd
Created January 2, 2021 16:03
Rustlings Windows Runner using VSCode and Windows Terminal
@REM RUSTLINGS Environment variable should point to the Rustlings folder containing the exercises
@echo off
setlocal enableDelayedExpansion
if %RUSTLINGS%==%RUSTLINGS% (
cd %RUSTLINGS%
wt -d . rustlings watch
start "" "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code" .
exit
)
@arnabanimesh
arnabanimesh / knownlines.rs
Last active December 17, 2020 15:09
Multiline rust input with known and unknown number of lines
//https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9cb93f0342793c225be94aa46897c25a
use std::io::{Cursor, BufReader};
// for console input replace the above line with this
// use std::io::stdin;
fn main() {
// simulate stdin in rust playground
let f = Cursor::new("3\n40 3\n30 4\n20 5".to_string());
let input = BufReader::new(f);
let mut vec = input.lines();
@arnabanimesh
arnabanimesh / Cargo.toml
Created December 6, 2020 11:07
Example cairo project
[package]
name = "draw"
version = "0.1.0"
authors = ["author <[email protected]>"]
edition = "2018"
[dependencies]
cairo-rs = { version = "0.9.1", features = ["png"] }
png = "0.16.7"