Skip to content

Instantly share code, notes, and snippets.

View Bankers_Algorithm.py
# P0, P1, P2, P3, P4 are the Process names here
n = 5 # int(input('Enter number of process: ')) # Number of processes
m = 3 # int(input('Enter number of resources: ')) # Number of resources
# Allocation Matrix
alloc = [[0, 1, 0], [2, 0, 0], [3, 0, 2], [2, 1, 1], [0, 0, 2]] #
# for i in range(n):
# alloc.append(list(map(int, input(f'Enter {i + 1} allocation: ').split(' '))))
# MAX Matrix
max = [[7, 5, 3], [3, 2, 2], [9, 0, 2], [2, 2, 2], [4, 3, 3]] #
View round_robin.py
class Process:
def __init__(self, pid, at, bt, priority=None):
self.pid = pid
self.at = at
self.bt = bt
self.priority = priority
self.ct = None
self.tat = None
self.wt = None
self.bt_remaining = bt
View srtf.py
class Process:
def __init__(self, pid, at, bt, priority=None):
self.pid = pid
self.at = at
self.bt = bt
self.priority = priority
self.ct = None
self.tat = None
self.wt = None
self.bt_remaining = bt
@Anan5a
Anan5a / ffmpeg.txt
Created October 10, 2022 11:23 — forked from rochacbruno/ffmpeg.txt
FFMPEG
View ffmpeg.txt
#rec
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1600x900 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
###convert
mencoder -oac mp3lame -lameopts cbr=128 -ovc xvid -xvidencopts bitrate=1200 aula3.mkv -o aula3_mencoder.avi
#MERGE
mkvmerge -o complete.mkv part1.mkv +part2.mkv +part3.mkv +part4.mkv
#conv ffmpeg
View relaX-relations
-- this is an example
group: test
Products = {
prod_sl:number, pname:string,cat:number
1,'Pro 1',1
2,'Pro 2',1
3,'Pro 3',3
4,'Pro 4',2
}
@Anan5a
Anan5a / batch_encode_ffmpeg.sh
Last active March 6, 2021 10:14
bash script for transcoding multiple video files in batch using ffmpeg, specifically for Animations/anime
View batch_encode_ffmpeg.sh
#!/bin/bash
# Settings in this script is suitable for animes
####
# To use simply put this script inside the folder where your source files are, edit dest variable to change destination folder
# TODO: add arguments for source and dest
####
# Where to store encoded files
TAG="[Hulk] " #put your own if you like or remove the text
dest=/var/www/ripperR/ripper/files/clannad
View ffmpeg-vaapi-build-script-debian10.sh
#!/bin/bash
# This script is tested on Debian 10 with non-free source added
echo "Building shared ffmpeg executable with vaapi, fdkaac, zimg ..."
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/lib:/usr/lib
echo "Installing build tools ..."
apt -qqy install build-essential autoconf automake cmake libtool git nasm yasm
PROC=$(nproc)
View uuid-intercept.js
/*!
* device-uuid.js v1.0.4 (https://github.com/biggora/device-uuid/)
* Copyright 2016-2017 Alexey Gordeyev
* Licensed under MIT (https://github.com/biggora/device-uuid/blob/master/LICENSE)
*/
/*global
screen, window, navigator
*/
(function (exports) {
'use strict';
@Anan5a
Anan5a / GCD.c
Created February 3, 2020 16:35
Calculate GCD of two number using loop
View GCD.c
#include <stdio.h>
//Anan5a<https://github.com/Anan5a>
int main()
{
int db[1000], da[1000], i, j=1, k, gcd[300], big_da, big_db;
int num, num2;
printf("Enter two numbers: ");
scanf("%d %d", &num, &num2);
View videojs-skin-purple-red.css
.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {
width: 10em
}
.video-js .vjs-controls-disabled .vjs-big-play-button {
display: none!important
}
.video-js .vjs-control {
width: 3em