以下是悟訢的留言:
不同步的原因可能是母片格式為 VFR 可變式影格,但是 Aviutl 要用 CFR 固定式影格來編輯。
可以從 Aviutl 的 File > SETTINGS > Import Plugin > L-SMASH,勾選 VFR->CFR,後面設定 30000/1001 代表 30fps,60000/1001 代表 60fps。
感謝悟訢
2017年8月2日 星期三
2017年6月24日 星期六
知識
從前人抄書才能得到書,知識難得但被珍惜,珍惜就明辨,只傳真理好知識
現在人隨手一滑就是訊息,看過即忘,只求快速刺激感官,好壞已混雜難分
上一代人背棄祖傳文化書籍,追求西方空洞文化,新資訊時代又來不及學習
這一代人出生就在學電腦,比上代人了解得快,自然以為比前人優秀,而上一代人
也沒有德行足以使這一代人信服。
現在人隨手一滑就是訊息,看過即忘,只求快速刺激感官,好壞已混雜難分
上一代人背棄祖傳文化書籍,追求西方空洞文化,新資訊時代又來不及學習
這一代人出生就在學電腦,比上代人了解得快,自然以為比前人優秀,而上一代人
也沒有德行足以使這一代人信服。
2017年6月23日 星期五
2017年5月28日 星期日
django debug false 模式下 static 檔案
settings.py
DEBUG=False 的話 Django 就不再處理 static files 了
可以安裝 pip install whitenoise 來協助解決 static files 讀取不到的問題
但是 如果是 media files 如:使用者上傳的圖片 影片等
whitenoise 就無法處理了,然而 media files 本身本來就比較有危險性
常理上來說不該和 Django 放在同一台 server 上,
有看到一個 處理 外部 server 檔案的 django-storages 應該就能處理 media files
DEBUG=False 的話 Django 就不再處理 static files 了
可以安裝 pip install whitenoise 來協助解決 static files 讀取不到的問題
但是 如果是 media files 如:使用者上傳的圖片 影片等
whitenoise 就無法處理了,然而 media files 本身本來就比較有危險性
常理上來說不該和 Django 放在同一台 server 上,
有看到一個 處理 外部 server 檔案的 django-storages 應該就能處理 media files
但我還沒研究,總之目前還是只能用 Debug=True 在 本地端跑了
2017年4月22日 星期六
好用的 css calc() 函式
https://www.w3schools.com/cssref/func_calc.asp
可即時做 + - * / 且不必需同樣單位
ex: width: calc(100%/3 + 20px - 1em)
可即時做 + - * / 且不必需同樣單位
ex: width: calc(100%/3 + 20px - 1em)
2017年2月10日 星期五
mongodb dump 備份資料庫
C:\Program Files\MongoDB\Server\3.2\bin>
mongodump
-h 127.0.0.1:27017
--authenticationDatabase admin
-u root
-p 1234
-d dbname
-o c:\Users\muchu\Desktop\dbname.bson
mongodump
-h 127.0.0.1:27017
--authenticationDatabase admin
-u root
-p 1234
-d dbname
-o c:\Users\muchu\Desktop\dbname.bson
2017年1月13日 星期五
在 windows 安裝 django app channels 1.0.2 失敗解決方法
python 3.4 下執行出現的 exception 為:
ImportError: cannot import name '_win32stdio'
原因是 twisted 套件本身的問題,只要到:
https://github.com/twisted/twisted/tree/trunk/src/twisted/internet
下載兩個原始碼 _win32stdio.py 和 _pollingfile.py
放到 python34 下的 C:\Python34\Lib\site-packages\twisted\internet
並安裝 pypiwin32
python3 -m pip install pypiwin32
即可順利執行
ImportError: cannot import name '_win32stdio'
原因是 twisted 套件本身的問題,只要到:
https://github.com/twisted/twisted/tree/trunk/src/twisted/internet
下載兩個原始碼 _win32stdio.py 和 _pollingfile.py
放到 python34 下的 C:\Python34\Lib\site-packages\twisted\internet
並安裝 pypiwin32
python3 -m pip install pypiwin32
即可順利執行
2017年1月10日 星期二
mongodb 設定 root 帳號密碼
首先一般啟動 db
C:\"Program Files"\MongoDB\Server\3.2\bin\mongod.exe --dbpath "C:\Program Files\MongoDB\Server\3.2\data\db" --bind_ip 0.0.0.0
啟動 mongo shell
C:\"Program Files"\MongoDB\Server\3.2\bin\mongo.exe
在 shell 輸入以下
use admin
db.createUser({user:"root_username", pwd:"root_password", roles:[{role:"root", db:"admin"}]});
關掉 db 再以 --auth 重新啟動 db
C:\"Program Files"\MongoDB\Server\3.2\bin\mongod.exe --auth --dbpath "C:\Program Files\MongoDB\Server\3.2\data\db" --bind_ip 0.0.0.0
之後連線都需要有 root_username 及 root_password
mongodb://root_username:root_password@127.0.0.1/
C:\"Program Files"\MongoDB\Server\3.2\bin\mongod.exe --dbpath "C:\Program Files\MongoDB\Server\3.2\data\db" --bind_ip 0.0.0.0
啟動 mongo shell
C:\"Program Files"\MongoDB\Server\3.2\bin\mongo.exe
在 shell 輸入以下
use admin
db.createUser({user:"root_username", pwd:"root_password", roles:[{role:"root", db:"admin"}]});
關掉 db 再以 --auth 重新啟動 db
C:\"Program Files"\MongoDB\Server\3.2\bin\mongod.exe --auth --dbpath "C:\Program Files\MongoDB\Server\3.2\data\db" --bind_ip 0.0.0.0
之後連線都需要有 root_username 及 root_password
mongodb://root_username:root_password@127.0.0.1/
2016年12月13日 星期二
vmware workstation player 12 guest 3D 設定
假設建立了一個 guest 叫做 windows_7 必須在
該 windows_7 vm 目錄下 windows_7.vmx 加入以下兩行:
mks.enableD3DRenderer = TRUE
mks.enableDX11Renderer = FALSE
2016年12月10日 星期六
使用 complete 呼叫的 jquery ajax polling
(function poll(){
$.ajax({
url: "/poll",
success: function (data) {
do_something_with(data);
},
dataType: "json",
complete: poll,
timeout: 30000
});
})();
2016年12月7日 星期三
進階 jquery polling 即使 request 失敗也不會停止
function doPoll(){
$.post('ajax/test.html').done(function(data) {
/* process */
}).always(function() {
setTimeout(doPoll, 5000);
});
}
$.post('ajax/test.html').done(function(data) {
/* process */
}).always(function() {
setTimeout(doPoll, 5000);
});
}
jquery 簡單 polling 範例
function doPoll()
{
$.post('ajax/test.html', function(data) {
alert(data); // process results here
setTimeout(doPoll,5000);
});
}
2016年12月3日 星期六
如何禁止Vmware同步時間
參考:http://trufflepenne.blogspot.tw/2014/02/vmware.html
如果你有時必須調整VM裡的時間,但重開VM後又恢復現在時間,請利用以下步驟來修改(以windows 2008 R2為例):
停止VMWare tools, Windows Time服務
進入你的VM作業系統,選服務,把VMWare tools, Windows Time停止,並改為手動
取消Internet同步時間
進入你的控制台找到日期時間,進入後將以下取消打勾
修改VMWare configuration檔 (vmx, 跟VM檔案同一目錄)
a. shutdown VM
b. 切到你的VM目錄
c. 打開xxx.vmx
d. 找到tools.syncTime = "XXX" 標籤,刪掉之
e. 在最結尾填入以下
tools.syncTime = "FALSE"
time.synchronize.continue = FALSE
time.synchronize.restore = FALSE
time.synchronize.resume.disk = FALSE
time.synchronize.shrink = FALSE
time.synchronize.tools.startup = FALSE
time.synchronize.resume.host = FALSE
重新進入VM,修改時間,重開機就會看到新設定時間沒被同步
如果要讓VM重開時,都定在固定時間
在xxx.vmx最後加上
rtc.startTime = 1335862800
後面數字是timesatmp, 上面是2012 09:00:00 ,可用以下計算
http://www.onlineconversion.com/unix_time.htm
2016年10月17日 星期一
mysql 與 django 設定 index 欄位注意事項
範例:
strOriginUrl = models.CharField(db_index=True, max_length=255, null=False)
注意:
1. 欄位需使用 CharField 型態
2. 最大長度為 255
3. 指定 db_index=True
2016年10月13日 星期四
[selenium] 讓 chrome 啟動時最大化視窗
chromeDriverExeFilePath = "path-to-executable/chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
driver = webdriver.Chrome(executable_path=chromeDriverExeFilePath, chrome_options=options)
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
driver = webdriver.Chrome(executable_path=chromeDriverExeFilePath, chrome_options=options)
2016年10月3日 星期一
windows 系統下的網頁另存新檔 html 與 _files 的連動關閉
在 windows 下,預設 xxx.html 與 xxx_files 是連動的,
刪除或移動 xxx.html xxx_files 也會跟著刪除或移動
如果需要關閉這一層連動關係,必需修改註冊表:
HKEY_CURRENT_USER - Software - Microsoft - Windows - CurrentVersion - Explorer
建一個新的 DWORD 值
名稱:NoFileFolderConnection
數值: 1
完成後,不需重新開機等動作即可生效。
2016年8月31日 星期三
python3 selenium 移動滑鼠到 element 範例 (hover)
使用 selenium 時,有點要被 click 的元件,可能要先將滑鼠 hover 到某個元件上才會顯示出來
from selenium.webdriver.common.action_chains import ActionChains
可以這樣寫:
假設我們要切換幣別為 USD 但該網站設計,必需先移動到 #currency 元件上 #usd 選項才會出現。
from selenium.webdriver.common.action_chains import ActionChains
eleCurrency = self.driver.find_element_by_css_selector("#currency")
eleUsd = self.driver.find_element_by_css_selector("#usd")
actHoverThenClick = ActionChains(seleniumDriverInstance)
actHoverThenClick.move_to_element(eleCurrency).move_to_element(eleUsd).click().perform()
eleUsd = self.driver.find_element_by_css_selector("#usd")
actHoverThenClick = ActionChains(seleniumDriverInstance)
actHoverThenClick.move_to_element(eleCurrency).move_to_element(eleUsd).click().perform()
2016年8月13日 星期六
python3 在 ubuntu 下安裝 lxml 模組
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
python3 -m pip install lxml
python3 -m pip install lxml
python3 zipfile 解壓縮 zip 檔
from zipfile import ZipFile
with ZipFile("z.zip", "r") as zipFile:
zipFile.extract("file_path_in_zip.xml", "folder_path_to_extract")
with ZipFile("z.zip", "r") as zipFile:
zipFile.extract("file_path_in_zip.xml", "folder_path_to_extract")
訂閱:
文章 (Atom)