-
Recent Posts
Recent Comments
Categories
Links
Monthly Archives: May 2018
chromium note
https://github.com/henrypp/chromium/releases Chromium各版本build,在自動化處理網頁連線時,不同版本的chrome是需要的, 因為越新的版本對一些html5的API限縮得越多(例如chrome 66後,AudioContext需要user gesture才能正常init), 一般配合selenium WebDriver 或 chrome dev protocol來進行操作 可參考 https://github.com/GoogleChrome/puppeteer
Posted in System Administration
Leave a comment
ffmpeg audio volume adjust
當多媒體檔案聲音大小需要調整時 可參考 https://trac.ffmpeg.org/wiki/AudioVolume get stats ffmpeg -i INPUT_FILE -filter:a volumedetect -f null NUL (NUL or /dev/null) [Parsed_volumedetect_0 @ 000001be4a046040] n_samples: 26064896 [Parsed_volumedetect_0 @ 000001be4a046040] mean_volume: -32.1 dB [Parsed_volumedetect_0 @ 000001be4a046040] max_volume: -5.6 dB adjust volume ffmpeg -i INPUT_FILE -af “volume=5.6dB” … Continue reading
Posted in System Administration
Leave a comment
division & modulus
a / b, a % b 當b為0時, behavior undefined,這邊討論其中一個operand為負數的情況 C89 整數除法(有負數情況下 implementation defined) -9/7 有可能是 -1 or -2 (rounded up or rounded down) 當然此時對應的 % 就會根據除法的結果而不同 (這邊討論整數的modulus,floating point可以參考fmod) 要符合 dividend = divisor * quotient + remainder -9 = 7 * … Continue reading
Posted in C Language, C++ Language
Leave a comment
版本號convention
Microsoft .NET Assembly major.minor[.build[.revision]] major, minor一般做法都差不多 使用API compatibility, feature來分別(major不同則可能破壞backward compatibility) Build: A difference in build number represents a recompilation of the same source. Different build numbers might be used when the processor, platform, or compiler changes. Revision: Assemblies with the … Continue reading
Posted in Tips
Leave a comment
windows git bash
with VC2015 support 先透過command line 執行 “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat” amd64 再進入git bash “C:\Program Files\Git\bin\bash.exe” BAT檔呼叫shell script “c:\Program Files\Git\bin\bash.exe” –login -i -c “COMMAND” 需要注意的地方 一般command line需要傳 forward slash參數時 eg. /help 需要加上 forward slash來escape 例如 //help 參考: https://stackoverflow.com/questions/34647591/passing-windows-slash-based-parameters-to-a-program-from-bash-script
Posted in Tips
Leave a comment