2017年1月26日 星期四

取像與處裡與lock

在處理影像同時如果剛好對影像進行更新,有可能會出現錯誤。因為在處裡的時候影像被更新,或是將更新到一半的影像送去處理。
這時候可以用lock

取像與處裡與lock

2017年1月25日 星期三

customize command in fileExplorer address bar

you can run command like
cmd/ powershell/ notepad in window file explorer address bar
but it is possible to run more complex command in that address

customize command in fileExplorer address bar

2017年1月23日 星期一

cmd命令

xxx|clip 把 xxx的output初出到剪貼簿
ex: dir|clip
F7 顯示之前用過的命令
/? -help 取得提示
xxx| find ooo 針對xxx的結果做ooo篩選
ex: dir|find ".exe"
把檔案拖到cmd視窗 在cmd中產生檔案路徑

cmd命令

cmd命令縮寫

在file explorer的address bar中輸入指令(只有開啟程式的指令)相當於在cmd中執行指令(應該是 "指令".exe / .bat? 所以如果是捷徑,副檔名是.lnk不能用)
像是powershell常常想要執行,但指令比較長的可能可以用下面的方法


cmd命令縮寫

2017年1月19日 星期四

powershell

| %{seg A}{seg B} 相當於foreach item用$_表示,{seg A}只在初始化時run
. xxx.ps1 相當於import/include,也是run scrip
Test-Path $profile 確認$profile是否存在
新增powershell指令
$profile是每次runpowershell會先run的ps1,可以在其中用. xx.ps1加入其他ps1
若$profile不存在可以用指令New-Item -path $profile -type file –force新增
Get-Date -f yyMMdd 取得日期

function funName([string]$par1="123",[int]$par2=1){}
在呼叫funName的時候,若未指定猜數,則參數是預設值
指定參數有兩種方式
1. funName "123" 3
2. funName -par2 3

$pwd.Path 目前工作路徑
dir|Rename-Item -path $_.Name -NewName $n;
window有內建power shell ISE

如果要跑外部的script 要先執行 Set-ExecutionPolicy RemoteSigned(要在administrater的權限底下執行,即使已經是管理者帳號,也要用以管理員權限執行來run powershell)

powershell

2017年1月14日 星期六

[audio router]

Audio Router
當DJ的同時又想看電影?用skype?
audio router可以用不同的裝置撥放不同程式產生的聲音(可惜不同的chrome分頁不算不同程式)。
open source的小工具,可以用在win10,免安裝直接使用

[audio router]

2016年12月29日 星期四

[machine learing]交作業

最近用 coursera 學 machine learning ,但遇到用 octave 作業寫完卻無法提交的問題。提交了之後會遇到
!! Submission failed: unexpected error: urlread: Peer certificate cannot be authenticated with given CA certif
icates
!! Please try again later.
的錯誤訊息。

[machine learing]交作業

2016年12月23日 星期五

LoaderLock error

VS2015關閉LoaderLock訊息回報被改到
Debug->Windows->Exception Settings
Managed Debugging Assistants>LoaderLock這個地方
以前版本的VS是在
Debug -> Exceptions
Managed Debugging Assistants>LoaderLock
對於所有遇到的不明loader lock錯誤都可以從這邊關掉。不只在VS裡面,compile出來的執行檔也不會回報這類錯誤。

LoaderLock error

2016年12月21日 星期三

[C#] class/function 前面的方括號

在看ApplicationSetting所產生的code的時候發現一段code

[global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string filePath {
            get {
                return ((string)(this["filePath"]));
            }
            set {
                this["filePath"] = value;
            }
        }
public string filePath{}前面的[]們,原來是Attribute。寫專案還沒時間看,先筆記一下

[C#] class/function 前面的方括號

vs debug 時期路徑

因為debug的時候exe會因為x86/x64....的原因build到不同的位子去
如果有使用相對路徑去讀取檔案就可能會需要很多份
要找Resource們也會很困難
一個簡單的方法是去設定debug的路徑

vs debug 時期路徑

2016年12月16日 星期五

c# constructor 呼叫順序

在繼承關係中,constructor的呼叫順序是
1. 所有參數預設值會先被設定
class MyClass
{
int para1 = 1;...
}
因此在constructor被呼叫時,para1已經是1了
2. 最base的constructor被呼叫
3. 一層層往上呼叫
4. 最derived的最後被呼叫
5. 最後執行Object and collection initializer
(new myClass{para1 = 2; para2 = 3;...})初始會陣列就是用這個操作方式

c# constructor 呼叫順序

2016年12月13日 星期二

用setup.py安裝python模組

如果下載一個python模組,內有setup.py檔案
安裝方式:
在系統管理員權限的cmd底下
cd 到 setup.py所在路徑
python setup.py install

用setup.py安裝python模組

2016年12月8日 星期四

open source等化器 音量放大器

最近開始聽coursera上的Machine Learning課程
但是影片的聲音實在是有點小聲,聲音都開到100%了還是聽不清楚
本來找了一些等化器,但是功能有點陽春介面看起來不夠厲害

open source等化器 音量放大器

2016年12月7日 星期三

[筆記]rope management

跟K在NamPhapayai爬了一條多繩距的Madagascar,五個繩距,難度不難(最多5+)大多數是橫渡(Traverse)。但因為多繩距操作不熟悉搞了很久,而且還時常打結。

[筆記]rope management

2016年12月6日 星期二

Minivan to NamPhaPaYai camp

Minivan to the NamPhaPaYai camp have been moved to Mo Chit Bus Station since this month. THERE IS NO MINIVAN GOING FROM VICTORY MONUMENT  TO KAENG KHOI (CAMP'S TOWN) ANY MORE!!!

The nest way to go Kaeng Khoi by public transport is going by minivan, departing from Mo Chit bus station every hour. But when you arrive Kaeng Khoi, you may still need to take a taxi to the camp, which cost you 400 THB for a ride (no matter how many people) .

Minivan to NamPhaPaYai camp

NamPhaPaYai minibus 前篇

要從victory Monument搭minibus到Kaeng Koi
但Victory Monument好稱有170條minibus路線,真是不知道該從何找起阿@@
有找到網站有列出各區可以去的地方,但上面沒有Kaeng Khoi..
看到有個app ThaiVans 可以去載apk裝在手機上

NamPhaPaYai minibus 前篇

2016年11月29日 星期二

MIL鍵盤事件無法使用

MIL如果用displaySelectWindow將顯示放到panel中,內建的鍵盤事件就會無法使用
主要是因為鍵盤事件沒有被導向到Form中
解決的方法是將SelectWindow導向到Form中,再將Form嵌入Panel上,最後,把母Form中的鍵盤事件導向到DisplayForm中

MIL鍵盤事件無法使用

panel中的鍵盤事件

[WinForm]取消focus狀態

這篇要做的事情跟前一篇的取消textbox輸入狀態不同
textbox只要將form的active control改成null或其他control就可以取消輸入狀態
但如果今天是想取消鍵盤事件對子Control的校果(例如只在特定狀態下讓快捷鍵能對子control作用)就沒這麼簡單
主要的問題是出在取消active control只是讓使用者不會繼續輸入,但是鍵盤事件一樣會被control接收到

[WinForm]取消focus狀態

2016年11月28日 星期一

鎖定combobox

combo box 如果不想讓使用者任意輸入值(其實一般狀況下combo box的操作方式都是這樣),可以把combobox的DropDownStyle改成DropDownList

鎖定combobox