Skip to content

Instantly share code, notes, and snippets.

View siuoly's full-sized avatar

siuoly

  • Taiwan,Taipei
View GitHub Profile
@siuoly
siuoly / Translated_paper.py
Created April 26, 2022 23:06
Translate the paper txt, needing preprocessing that pdf to word fileformat.
#!/bin/python
###### 英文文本:source.txt , 中文文本:target.txt 逐行對照,放入translated.txt
def main():
sFile = "./source.txt"
tFile = "./target.txt"
with open( sFile, 'r') as f:
source = list( f.readlines() )
source = [ i for i in source if i.strip()]
with open( tFile, 'r') as f:
target = list( f.readlines() )
@siuoly
siuoly / ProcessEx1.py
Last active March 16, 2022 14:10
python process state change example
#!/bin/python
# show process start
import multiprocessing
from multiprocessing import Process
import time
### Test : join(), start(), is_alive, close()
p = Process( target=time.sleep , args=(10,))
print( p ) # show <process name>, <pid> <parent> state=initial
print( p.is_alive() )# False, not start
@siuoly
siuoly / WSL vim translate && pronunciation in vim, 在WSL,vim當中翻譯並且發音.md
Created January 30, 2022 18:54
WSL vim translate && pronunciation in vim, 在WSL,vim當中翻譯並且發音

prerequist

sudo pip install googletrans==3.1.0a0
sudo pip install gTTS

prepare mpg123

vim command

" pronunce the word on the cursor, type 'gsp'
@siuoly
siuoly / window10, WSL play music, WSL撥放音樂.md
Created January 30, 2022 18:43
window10, WSL play music, WSL撥放音樂
@siuoly
siuoly / vcpkg_fist_use.md
Created January 9, 2022 11:38
vcpkg first usage

dowload repo

  1. git clone https://github.com/microsoft/vcpkg
  2. alias vcpkg='your/path/about/vcpkg" # for later frequently call
  3. vcpkg install abseil # here is a example.

skip

here skip basic cmake usage.

make a simple repo

ls

@siuoly
siuoly / F5_chrome.ahk
Last active December 17, 2021 16:48
一鍵刷新瀏覽器 ,不用離開編輯器 Refresh the browser without leaving focus the editor. For wsl Vim.
; reference
; auto hot key, refresh chrome, without leaving the focus of editor
; //www.autohotkey.com/board/topic/113163-refresh-google-chrome-with-a-button-will-pay/?p=661651
; For wsl && vim editor
; how execute windows file on wsl
; https://docs.microsoft.com/en-us/windows/wsl/filesystems#run-windows-tools-from-wsl
; 1. using "convert .ahk to .exe" program, convert this ahk file.
; 2. copy the converted file "F5_chrome.exe" to <your_wsl_path>
@siuoly
siuoly / test.txt
Created July 25, 2021 03:37
testGist
Todo:
1.what is gist
2.ceate a gist
3.fork a gist
4.copy a gist
5.edit a gist
6.delete a gist
Gist in command line:
1.download a gist from command line