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 …
The Right Way to Export PATH in Shell
Some people suggest exporting PATH
only in .bash_profile
instead of in .bashrc
(for Bash).
The helps but does not resolve the issue of possible duplicated paths in $PATH
.
The right way is to check for existence of the path in the $PATH
environment variable first,
and add it only when …
Parallel RNGs With Rayon in Rust
The Rust Rand Book - Parallel RNGs has a very good summary about parallel RNGs. It also gives code examples using the rayon library. However, a few things to notice.
-
rand::ThreadRng (obtained by calling rand::thread_rng) is often used in code examples of parallel RNGs as it uses thread-local storage …
Useful Rust Crates for Developing Command Line Apps
Command-line Arguments Parsing
clap
clap is a simple to use, efficient, and full-featured Command Line Argument Parser.
structopt
Parse command line argument by defining a struct.
Terminal Interface
ratatui
RataTUI is a library to build rich terminal user interfaces or dashboards
tui
tui is a library to build rich terminal …
Summary on Random Number Generators
Xoshiro
Xoshiro is a family of fast, space-efficient and high quality PRNGs. It is considered the state-of-the-art (SOTA) family of non-cryptographic pseudo random number generators (PRNGs). The Rust crate rand_xoshiro (which is part of the popular Rust crate rand) has implementations of Xoshiro256Plus and Xoshiro256PlusPlus . Xoshiro256PlusPlus is a very good …
Thread Safe Random Number Generator
In pratice, the approach of separate RNGs with different seeds for threads/processes is widely used (even though theoretically those RNGs might have overlaping sequences, which is undesirable). For more discussions on this approach, please refer to The Rust Rand Book - Parallel RNGs and Seed Many RNGs in Rust . The …