This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From: http://lup.lub.lu.se/student-papers/record/9111047 | |
import matplotlib . pyplot as plt | |
import networkx as nx | |
def unimodular ( arr0 , arr1 , arr2 , j , order , edges ) : # use unimodular rules to calculate a new row and connecting vertices of the corresponding polygon triangulation for every 1 in this row | |
arr2 =[] | |
k = 0 | |
for i in range ( order ) : # To calculate the left - most and right - most ones , we need to take care of the index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires https://github.com/sharkdp/fd | |
fdfind Cargo.toml --exec bash -c "pushd {//}; cargo clean" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function displaytime { | |
local T=$1 | |
local D=$((T/60/60/24)) | |
local H=$((T/60/60%24)) | |
local M=$((T/60%60)) | |
local S=$((T%60)) | |
(( $D > 0 )) && printf '%d days ' $D | |
(( $H > 0 )) && printf '%d hours ' $H | |
(( $M > 0 )) && printf '%d minutes ' $M | |
(( $D > 0 || $H > 0 || $M > 0 )) && printf 'and ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yt-dlp -F url > file.txt; cat file.txt | grep "1920x1080" | grep "webm" | sed "s/ \+/ /g" | cut -d ' ' -f6 | rev | cut -c4- | rev | awk '{s+=$1} END {printf "%.0f\n", s}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use rand::prelude::*; | |
#[derive(Clone, Copy)] | |
struct Point2 { | |
x: f64, | |
y: f64, | |
} | |
#[derive(Clone, Copy)] | |
struct Point3 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <cmath> | |
#include <iostream> | |
#include <memory> | |
#include <optional> | |
#include <string> | |
#include <type_traits> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec print_list = function | |
[] -> () | |
| e::l -> print_int e ; print_string " " ; print_list l | |
let bubble_sort l = | |
let n = (List.length l) - 1 in | |
let rec bubble_sort_rec arr res n = | |
match arr with | |
| [] -> if n > 0 then bubble_sort_rec res [] (n - 1) else res | |
| x :: [] -> if n > 0 then bubble_sort_rec (res @ [x]) [] (n - 1) else (res @ [x]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From : https://dev.to/thepracticaldev/daily-challenge-117-minminmax-2kmn | |
Given an unsorted array of integers, find the smallest number in the array, | |
the largest number in the array, and the smallest number between the two array | |
bounds that are not in the array. | |
Examples | |
minMinMax({-1, 4, 5, -23, 24}); //[-23, -22, 24] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLOB sdist-make: /home/dimitri/gits/conan/setup.py | |
full inst-nodeps: /home/dimitri/gits/conan/.tox/.tmp/package/1/conan-1.19.0.dev0.zip | |
full installed: astroid==2.2.5,beautifulsoup4==4.8.0,bottle==0.12.17,certifi==2019.9.11,chardet==3.0.4,codecov==2.0.15,colorama==0.4.1,conan==1.19.0.dev0,coverage==4.2,deprecation==2.0.7,distro==1.1.0,fasteners==0.15,future==0.17.1,idna==2.8,isort==4.3.21,Jinja2==2.10.1,lazy-object-proxy==1.4.2,MarkupSafe==1.1.1,mccabe==0.6.1,mock==1.3.0,monotonic==1.5,node-semver==0.6.1,nose==1.3.7,packaging==19.2,parameterized==0.7.0,patch==1.16,pbr==5.4.3,pluginbase==0.7,Pygments==2.4.2,PyJWT==1.7.1,pylint==2.3.1,pyparsing==2.4.2,python-dateutil==2.8.0,PyYAML==5.1.2,requests==2.22.0,six==1.12.0,soupsieve==1.9.3,tqdm==4.36.1,typed-ast==1.4.0,urllib3==1.25.5,waitress==1.3.1,WebOb==1.8.5,WebTest==2.0.33,wrapt==1.11.2 | |
full run-test-pre: PYTHONHASHSEED='477153901' | |
full run-test: commands[0] | nosetests | |
EE.....................SS..SSSS.............................................................. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <filesystem> | |
#include <fstream> | |
#include <bitset> | |
#include <cstdint> | |
#include <vector> | |
#include <cstddef> | |
#include <fmt/format.h> | |
#include <fmt/color.h> |
NewerOlder