Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Working with Spreadsheet in Python

It is suggested that you avoid using Excel files (or other spreadsheet tools) for storing data. Parquet file is currently the best format for storing table-like data. If you do want to interact and manipulate your data using Excel (or other spreadsheet tools), dump your data into CSV files and …

Seed Many RNGs in Rust

There are different ways to seed many RNGs (for parallel RNGs). Below summarizes 3 popular ways. Seeding RNGs using std::collections::hash_map::RandomState or rand::thread_rng is preferred.

Seed Using System Time

use std::time::{SystemTime, UNIX_EPOCH};
use rand::SmallRng;

fn main () {
    let seed = SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_nanos …