Posts

A collection of 76 articles

Rust Pin

Pin is an obscure type in Rust because of the naming and indirect concepts. The first indirect concept is pointer. Pin<X> does not guarantee that X will not move. If X is a pointer which target type is T, Pin<X> guarantees that T will not move. The second is “not move”. It really means that the only way to get the mut reference to T is via unsafe interface. The last is the Unpin mark trait. Pin forbids safe interface to get the mut reference to T only when T is !Unpin. In simple words, Pin is a pointer wrapper. When a pointer is trapped inside Pin, and the pointee type is !Unpin, there’s no safe way to get a mut reference to the pointee.

Updated  •  2 min read

How to Download Only Gmail Inbox

I prefer reading my mails in the Gmail web client directly. I rarely send new mails or replies. But when I do, I want to use PGP to encrypt or sign the mail. I have tried two extensions to use PGP in Gmail, FlowCrypt and Mailvelope. But both of them are far from a competent solution for me. GPG Mail in the GPG Suite for macOS is still my preferred way. However, GPG Mail is an Apple Mail plugin, which requires downloading mails first. Based on my scenarios, I only need to download the mails I left in the inbox. But the basic setup of Gmail in Apple Mail will download many mails in the background.

Updated  •  2 min read

Allocate Energy to Categories

I have read the post Get Everything Done & Still Have Time to Play by Jackie Ashton recently and adopted some strategies into my process. Before I plan the tasks daily by allocating them into time slots in a calendar, it is tedious and time-wasting. It messes up my agenda, which is intended only to contain the events that I must do on time. And it makes me nervous and exhausted to follow a pre-defined schedule every day. My new process is much simpler. I review my life objectives first and group them into categories. Then I evaluate their importance in my current life stage and allocate my energy in percentage into them.

Updated  •  3 min read