Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on visualize-sqlite

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

visualize-sqlite is a Rust crate for creating simple visualizations of SQLite databases in GraphViz dot format.

Installation

wajig install libsqlite3-dev graphviz
cargo install visualize-sqlite

Usage

visualize-sqlite your_sqlite_database.db | dot -Tpng -Gfontname …

Tips on the tar Command in Linux

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

--strip-components

--exclude

tar --strip-components=1 -C /usr/local/bin/ -zxvf sccache-v0.4.0-pre.8-x86_64-unknown-linux-musl.tar.gz */sccache

Progress Bar in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

There are a few crates in Rust which provide terminal progress reporting functionalities. The indicatif crate is the best one to use. The linya crate is a simple no-deps alternative to …

Expected Time to Hit Zero

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Let \(DU(0, n)\) be the discrete uniform distribution on \(0\), \(1\), ..., \(n-1\). Define random variables as below.

$$X_1 \sim DU(0, n)$$
$$X_{i+1} \sim DU(0, X_{i …

Useful Rust Crates for GraphQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

TrustFall

If GraphQL were more like SQL: a query language for any combination of data sources.

Debug a Rust Application

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Debugging Rust in VSCode

  1. Install the extension CodeLLDB .

  2. Uncheck "Pause on panic" (checked by default).

Debug Rust Using rust-gdb

Debug Rust Using rust-lldb

Debug Rust Using rr

is a lightweight tool …