This file contains 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
// date: 2020-01-10 | |
// update: 2024-04-01 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
#![feature(coroutines)] | |
#![feature(coroutine_trait)] | |
use std::ops::{Coroutine, CoroutineState}; | |
use std::pin::Pin; |
This file contains 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
// date: 2019-01-09 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
#![feature(generator_trait)] | |
use std::ops::{Generator, GeneratorState}; | |
use std::pin::Pin; | |
use num_integer::Integer; |
This file contains 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
#!/usr/bin/env python3 | |
# date: 2019-01-02 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
def sha2_iv(n: int) -> int: | |
square_root = pow(n, 1/2) | |
decimal = square_root - int(square_root) | |
return int(decimal * 0x100000000) |
This file contains 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::env; | |
use std::fs::File; | |
use std::io::{stdin, Read}; | |
use crc_all::CrcAlgo; | |
use lazy_static::lazy_static; | |
const BUFFER_SIZE: usize = 1024 * 16; | |
fn crc32sum<R: Read>(r: &mut R) -> u32 { |
This file contains 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/sh | |
# date: 2019-08-02 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
MARK=404 | |
TABLE=404 | |
SETNAME="surfing telegram" | |
VERBOSE=0 |
This file contains 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
// date: 2019-07-12 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
package main | |
import ( | |
"bufio" | |
"golang.org/x/net/context" | |
"google.golang.org/appengine" |
This file contains 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
// date: 2019-07-12 | |
// license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
// author: nanpuyue <nanpuyue@gmail.com> https://blog.nanpuyue.com | |
package main | |
import ( | |
"log" | |
"net/url" | |
"net/http" |
This file contains 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
// Date: 2010-06-21 | |
// Author: Emden R. Gansner | |
// From: [graphviz-interest@research.att.com] | |
BEGIN { | |
double tw[node_t]; // width of tree rooted at node | |
double nw[node_t]; // width of node | |
double xoff[node_t]; // x offset of root from left side of its tree | |
double sp = 36; // extra space between left and right subtrees | |
double wd, w, w1, w2; |
This file contains 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
#![allow(unused_imports)] | |
use std::mem::{forget, transmute}; | |
use std::slice::from_raw_parts; | |
use std::str::from_utf8_unchecked; | |
fn assert_static<T: 'static>(_: T) {} | |
fn main() { | |
let str = { |
This file contains 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::env::args; | |
use std::fs::File; | |
use std::io::{BufRead, BufReader}; | |
use std::str::FromStr; | |
fn main() { | |
let mut args = args(); | |
if args.len() == 3 { | |
args.next(); | |
let interval = u32::from_str(&args.next().unwrap()).unwrap(); |