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
# In the bailbloc repo, you can find the prebuilt XMRig binaries in: | |
# | |
# bailbloc/desktop/miner_binaries/ | |
# | |
# This command is derived from the file: | |
# | |
# bailbloc/miner.js | |
# | |
# Donate level is automatically set to 5% if not specified, but you can reduce it | |
# to 1% if you want the maximum amount of time going towards bailbloc. |
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
ls Movie_Part_1.mp4 Movie_Part_2.mp4 | perl -ne 'print "file $_"' | ffmpeg -f concat -i - -c copy Movie_Joined.mp4 | |
ffmpeg -i input.mp4 -ss 00:00:30.0 -c copy -t 00:00:10.0 output.mp4 | |
ffmpeg -i in.mp4 out.webm |
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
extern crate futures; | |
extern crate tokio_core; | |
extern crate tokio_uds; | |
use std::io; | |
use std::io::{Error, Write}; | |
use std::io::ErrorKind; | |
use std::io::Read; | |
use std::net::SocketAddr; | |
use futures::Future; |
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
#![feature(zero_one)] | |
use std::cmp::Ord; | |
use std::num::Zero; | |
use std::ops::{Neg, Add}; | |
fn largest_contiguous_sum<T>(slice: &[T]) -> T | |
where T : Neg + Add<T, Output = T> + Zero + Ord + Copy | |
{ | |
let mut maxnow = T::zero(); |
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
#![feature(str_char)] | |
use std::ascii::AsciiExt; | |
use std::usize::MAX; | |
fn is_palindrome(s: &str) -> bool { | |
assert!(s.is_ascii()); | |
let mid = s.len() / 2; | |
let mut left_ptr = if s.len() % 2 == 0 { mid - 1 } else { mid }; |
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 std::collections::VecDeque; | |
pub struct SlidingWindowMaximumIterator<'a, T : 'a> { | |
ascend: VecDeque<&'a T>, | |
slice: &'a [T], | |
sizek: usize, | |
index: usize | |
} |
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
pub fn print_matrix_diag(mm: &[&[usize]]) { | |
assert!(mm.len() > 0); | |
let xdim = mm[0].len(); | |
let ydim = mm.len(); | |
let maxdim = xdim + ydim - 1; | |
println!("---"); | |
for i in 0..maxdim { | |
print_el(mm, i as isize, 0, xdim, ydim); |
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
#![feature(unicode, str_char)] | |
#![allow(deprecated)] | |
fn max(l: usize, r: usize) -> usize { | |
if l > r { l } else { r } | |
} | |
pub fn lcs(s0: &str, s1: &str) -> usize { | |
let s0_tlen = s0.width(false); | |
let s1_tlen = s1.width(false); |
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
#![feature(box_syntax)] | |
use Tree::{Leaf, Node}; | |
#[derive(Debug)] | |
pub enum Tree<T> { | |
Leaf, | |
Node(Box<Tree<T>>, Box<Tree<T>>, T) | |
} |
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
#![feature(box_syntax)] | |
use std::collections::{LinkedList, VecDeque}; | |
use Tree::{Leaf, Node}; | |
pub enum Tree<T> { | |
Leaf, | |
Node(Box<Tree<T>>, Box<Tree<T>>, T) | |
} |
NewerOlder