autotool とか久しぶり。
$ ./autogen.sh
$ make
$ make check
enum Trampoline<T> { | |
More(Box<dyn FnOnce() -> Trampoline<T>>), | |
Done(T), | |
} | |
impl<T> Trampoline<T> { | |
fn call(mut self) -> T { | |
loop { | |
match self { | |
Self::More(f) => self = f(), |
Gnome のカレンダーや util-linux の cal
コマンドは週の始まりを locale の設定に従って決めているので、週の始まりを決める個別の設定は存在しない。
/etc/locale.conf
や環境変数では「どの国の」基準に従うといった設定しかできないので、標準外の設定をしたい場合はシステム管理のファイルを変えないといけない。
変える場合は /usr/share/i18n/locales/ja_JP
の LC_TIME
に以下を追加する:
first_weekday 2
以下の二つの crate を使って簡単なものを書いた:
あまりちゃんとした事はやってなくて、とりあえず入力されたキーを別のキーに変換できるか試してみた程度。
#include <libevdev/libevdev.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
/* cc $(pkg-config --cflags --libs libevdev) fetch_events.c */ | |
/* borrowed from https://gitlab.freedesktop.org/libevdev/libevdev/blob/master/tools/libevdev-events.c */ | |
int main(int argc, char *argv[]) | |
{ |
We cannot connect to the Extensions Marketplace at this time
って出てきて使えなくなってる。
~/.vscode-oss/argv.json
に以下を追加する (参考)
"enable-browser-code-loading": false,
つまり以下の変換
Vec<Option<T>>
-> Option<Vec<T>>
Vec<Result<T, E>>
-> Result<Vec<T>, E>
Rustのイテレータの網羅的かつ大雑把な紹介 - Qiita にあるように collect
すればいい。
ドキュメントは以下:
2020年9月に Telepresence が version 2 になったそう。 https://www.telepresence.io/announcing-telepresence-2/
アーキテクチャが変わってコマンドの使い方も変わった。
https://www.telepresence.io/docs/latest/install/migrate-from-legacy/ に曰く:
pub struct Defer(fn () -> ()); | |
impl Drop for Defer { | |
fn drop(&mut self) { | |
(self.0)(); | |
} | |
} | |
fn main() { | |
println!("before defer"); |