Posts

Showing posts from April, 2019

Convert PDF to searchable PDF

For Chinese: ``` ocrmypdf -l chi_sim --deskew --title "yingshaoxo's pdf" --jobs 3 --output-type pdfa input.pdf output_searchable.pdf ``` For English: ``` ocrmypdf -l en --deskew --title "yingshaoxo's pdf" --jobs 3 --output-type pdfa input.pdf output_searchable.pdf ```

Golang for Android Development

It’s good to write Golang for producing binary file, then use it everywhere Cython could do the same thing by convert python to c, then c to binary. First, you should write a program at ~/go/github/yingshaoxo/hi/main.go package greeting func SayHi() string { return "Hi!" } Capitalize the function name, so golang would treat that function as public. Then, compile it to a binary file go get golang.org/x/mobile/cmd/gomobile gomobile init gomobile bind -target=android If it ask for NDK, install it and make sure the Environmental-Variable was set right. #add the following to your `~/.bashrc`: export ANDROID_HOME= $HOME /Android/Sdk export ANDROID_NDK_HOME= $ANDROID_HOME /ndk/ 21.3 . 6528147 export PATH= $PATH : $GOPATH /bin: $ANDROID_HOME /platform-tools/ If everything was right, you’ll get two files: greeting.aar and greeting-sources.jar Let’s import it to Android Studio Project Let’s assume you have a project which was named A

Quickly start to use vifm

` vifm ` is awesome! Use `tab` to switch tab Use `za`  to show or hide hidden file Use `? regular_expression` to find a file at current list Use `:find *.jpg` to find a file at sub directory recursively Use `yy` to copy file, `p` to paste Use `dd` to delete or move a file Use `cw` for renaming Use `:touch hi.txt` to create a new txt file Use `:shell` to enter shell Add `filetype * nohup gnome-open >/dev/null 2>&1 & ` to the top of `~/.config/vifm/vifmrc`, so it can know how to open a file with default program