Skip to content

Instantly share code, notes, and snippets.

View arnabanimesh's full-sized avatar

Arnab Animesh Das arnabanimesh

View GitHub Profile
@arnabanimesh
arnabanimesh / birthday.py
Created June 26, 2020 19:26
Happy Birthday in python3
from time import sleep as z
def happy_birthday(name):
p, h = [print, 'Happy Birthday to']
d = (h, 'you')
happy = [d, d, (h, name.title()+"!"), d]
[p(' '.join(s)) or z(1) for s in happy]
p('Hip Hip Hooray\n' * 3)
@arnabanimesh
arnabanimesh / tabular.tex
Last active August 3, 2020 22:09
Latex table using tabular
\documentclass[11pt]{article}
\usepackage[screen]{geometry}
\usepackage{titlesec}
\usepackage[dvipsnames,table]{xcolor}
\usepackage{array}
\newcolumntype{x}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
@arnabanimesh
arnabanimesh / README.md
Created August 26, 2020 11:49
Cargo tasks in vscode

Source Repository

VS Code Configuration

Example configuration for debugging programs in-editor with VS Code.

Required Extensions

If you have the code command in your path, you can run the following commands to install the necessary extensions.

@arnabanimesh
arnabanimesh / settings.json
Last active November 20, 2020 17:45
Windows Terminal Settings
// This file was initially generated by Windows Terminal 1.3.2651.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@arnabanimesh
arnabanimesh / player.bat
Created November 22, 2020 20:20
Side by side audioless video player
@ECHO OFF
where /q ffplay
IF ERRORLEVEL 1 (
ECHO ffplay.exe not found.
ECHO Download ffmpeg from https://ffmpeg.org and add the ffplay executable to the PATH
PAUSE
) ELSE (
ECHO Side by side audioless video player
ECHO.
ECHO Enter the names with extension. e.g.: sample video.mp4
@arnabanimesh
arnabanimesh / Cargo.toml
Created December 6, 2020 11:07
Example cairo project
[package]
name = "draw"
version = "0.1.0"
authors = ["author <author@email.com>"]
edition = "2018"
[dependencies]
cairo-rs = { version = "0.9.1", features = ["png"] }
png = "0.16.7"
@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 / 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 / bench.md
Last active April 28, 2022 20:08
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
============================================

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