我喜歡設計,我喜歡創造,我喜歡美 不論軟體設計,不論介面設計,不論產品規劃設計,我都很有興趣 一直希望能能用這份專長,好好發揮在職場上。讓我做的快樂。 不論寫程式,或是做美工,我都很喜歡,希望我可以有機會雙線。兩種都很擅長。
2019年4月6日 星期六
漂亮好用的UI套件,FREE
https://flawlessapp.io/designtools?fbclid=IwAR2JsSAJEAxAf9UNL2JY0ilPbzHsmhn0QvB3NVSdTYQGehuZyAN8AuVM9Kk
2018年6月10日 星期日
2017年8月14日 星期一
RadGrid 的 ItemDataBound 事件使用簡介
每個觸發事件的帶入參數 GridItemEventArgs 都是一個 Row ,所以包含每個 Column先用 if 判斷是什麼 Item 觸發的,有可能是 Header 也可能是 Data之後透過轉型,就可以直接對該 Cell 進行操作
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
string CategoryName = item["ColumnUniqueName"].Text;
item["ColumnUniqueName"].Text = "";
item["ColumnUniqueName"].ForeColor = Color.Red;
item["ColumnUniqueName"].Font.Bold = true;
}
else if (e.Item is GridHeaderItem)
{
GridHeaderItem header = (GridHeaderItem)e.Item;
header.Height = Unit.Pixel(40);
}
}
2015年10月23日 星期五
亂數的使用簡介
在C#中,要使用亂數產生器是非常容易的
他的建構子有兩種,一種是有參數的,一種是沒有參數的,沒有參數的就會拿時間來當作亂數種子來產生亂數,有參數的則會拿該數值跟種子來產生亂數。
所以如果在非常短的時間內,連續要產生器吐出亂數出來,就要注意種子的給法,不然就會出現一堆都是相同的亂數,因為即便你用了無參數的建構子,他用了「時間」來當參數,但是程式跑得太快,時間還沒有變動下,出來的亂數就會一樣了。
所以建議自己傳入參數,而且每次產生亂數產生器的時候,都給一個當下時間+不定變數,比方給loop的i加上時間的Millisecond或者更複雜等等。
Random RandNum = new Random();
Random RandNum = new Random( DateTime.Now.Millisecond + i );
他的建構子有兩種,一種是有參數的,一種是沒有參數的,沒有參數的就會拿時間來當作亂數種子來產生亂數,有參數的則會拿該數值跟種子來產生亂數。
所以如果在非常短的時間內,連續要產生器吐出亂數出來,就要注意種子的給法,不然就會出現一堆都是相同的亂數,因為即便你用了無參數的建構子,他用了「時間」來當參數,但是程式跑得太快,時間還沒有變動下,出來的亂數就會一樣了。
所以建議自己傳入參數,而且每次產生亂數產生器的時候,都給一個當下時間+不定變數,比方給loop的i加上時間的Millisecond或者更複雜等等。
Random RandNum = new Random();
Random RandNum = new Random( DateTime.Now.Millisecond + i );
2015年8月17日 星期一
OPC 協會所定義的 OPC Server and Client簡述
OPC DataAccess Server is comprised of several objects: the server, the group, and
the item The OPC server object maintains information about the server and serves as a container for OPC group objects. The OPC group object maintains information about itself and provides the
mechanism for containing and logically organizing OPC items.
Data can be read and written
Exception based connections can also be created between the client and the items in the group and can be enabled and disabled as needed.
There are two types of groups, public and local (or ‘private’).Public is for sharing across multiple
clients, local is local to a client
The OPC Items represent connections to data sources within the server
An OPC Item, from the custom interface perspective, is not accessible as an object by an OPC Client All access to OPC Items is via an OPC Group object that “contains” the OPC item
Note that the items are not the data sources - they are just connections to them.
For example, the tags in a DCS system exist regardless of whether an OPC client is currently accessing them. The OPC Item should be thought of as simply specifying the address of the data, not as the actual physical source of the data that the address references.
An OPC client application communicates to an OPC server through the specified custom and automation interfaces. OPC servers must implement the custom interface, and optionally may implement
the automation interface
the item The OPC server object maintains information about the server and serves as a container for OPC group objects. The OPC group object maintains information about itself and provides the
mechanism for containing and logically organizing OPC items.
Data can be read and written
Exception based connections can also be created between the client and the items in the group and can be enabled and disabled as needed.
There are two types of groups, public and local (or ‘private’).Public is for sharing across multiple
clients, local is local to a client
The OPC Items represent connections to data sources within the server
An OPC Item, from the custom interface perspective, is not accessible as an object by an OPC Client All access to OPC Items is via an OPC Group object that “contains” the OPC item
Note that the items are not the data sources - they are just connections to them.
For example, the tags in a DCS system exist regardless of whether an OPC client is currently accessing them. The OPC Item should be thought of as simply specifying the address of the data, not as the actual physical source of the data that the address references.
An OPC client application communicates to an OPC server through the specified custom and automation interfaces. OPC servers must implement the custom interface, and optionally may implement
the automation interface
2015年7月29日 星期三
try-catch -finally 之finally之特別用處
為什麼需要寫 finally那段
try
{
}
catch (Exception e)
{
}
finally
{
DoSomeClose();
}
如果寫成
try
{
}
catch (Exception e)
{
}
DoSomeClose();
不也一樣嗎?我就是要在try catch之後去執行DoSomeClose();
事實上確實不同,finally確實有其特別之處
少了他,如果try或catch之中,有直接寫了return
那就不會執行DoSomeClose();
finally則會強制在你即便要return跳離開這段程式碼之前,也會先執行finally裡面的程式的
try
{
}
catch (Exception e)
{
}
finally
{
DoSomeClose();
}
如果寫成
try
{
}
catch (Exception e)
{
}
DoSomeClose();
不也一樣嗎?我就是要在try catch之後去執行DoSomeClose();
事實上確實不同,finally確實有其特別之處
少了他,如果try或catch之中,有直接寫了return
那就不會執行DoSomeClose();
finally則會強制在你即便要return跳離開這段程式碼之前,也會先執行finally裡面的程式的
2015年7月15日 星期三
多國語言小數點符號處理
撰寫多國語系的軟體,必須注意到一些特殊處理事項
本篇所針對的數值呈現問題,將可能造成很嚴重的後果
首先,先明白數值表示法這件事情,在某些歐洲或美洲、東南亞地區數值的小數點符號,並不是「.」,而是「,」,所以當你的程式輸出檔案或者顯示在主控台的時候,會出現312.566被顯示成312,566 這種情形。如下圖的
fValue
這樣的狀況並不只是看起來怪怪的而已,更嚴重的是,如果你要下SQL指令,而且你的指令並不是透過SqlCommand物件的正規使用方式來進行,而是自己串出SQL指令的話,就會讓指令失敗,由於你的數值如果帶有小數點,會變成逗號,這會讓SQL指令被誤解析。
比方
sb.Append("INSERT
INTO TB_RECORD_RAW VALUES (").Append(intIoId).Append(",").Append(douValue).Append(");”).
原本預期輸出
INSERT
INTO TB_RECORD_RAW VALUES ( 123, 194.566 );
但結果會輸出
INSERT
INTO TB_RECORD_RAW VALUES ( 123, 194,566 );
這會讓SQL誤判有三個參數要Insert,但是實際上只有兩個。結果要不就是填錯欄位,要不就會新增失敗(也許欄位不夠多)。
解決這個問題有兩種方式,要不就是透過SqlCommand物件的正規使用方式來進行。要不就是透過修改數值顯示方式(各國有各種特定的表示方式,可以在程式中強制統一),底下針對修改數值顯示方式來介紹。
CultureInfo TheCulture = new CultureInfo("en-US",
false);
NumberFormatInfo NumFmtInf = TheCulture.NumberFormat;
NumFmtInf.NumberDecimalSeparator = ".";
NumFmtInf.NumberDecimalDigits = 10;
Double TestDot_ Double = 123.4567;
String Str_Result
= String.Format(TheCulture, "{0:F}", TestDot_Double);
透過CultureInfo所建立的物件,會存放著作業系統的文化語言相關設定,指定為"en-US"是美國 “zh-TW“則是台灣所有語言列表於http://www.csharp-examples.net/culture-names/
也可以客制化的修改小數點符號,也可指定浮點數一律顯示到小數點後第幾位,這邊稍微要注意的是,當你在此指定了小數點後第幾位,則不足位數會補零,比方123.4567000000。如果不設定呢,則預設會顯示小數點兩位,進行四捨五入。
2015年5月19日 星期二
ref 與 out 修飾詞的比較
1.方法參數宣告為ref與out時,在編譯時視為相同。(同樣的方法,用ref ,另外一個用out並不會被視為多型)
4.out參數在方法結束之前,要先初始化完畢。(當呼叫宣告為out參數的方法時,不管變數有沒有初始化,都可以傳入方法中執行,只要在方法結束前,方法內參數有初始化,就不會出現編譯錯誤。)
5.ref 不會強制要求函式內的程式,一定要修改傳入的參數,但 out 會。
2.ref與out,都是將參數以ByRef方式傳遞。
3.ref參數在傳入方法之前,要先初始化完畢。
4.out參數在方法結束之前,要先初始化完畢。(當呼叫宣告為out參數的方法時,不管變數有沒有初始化,都可以傳入方法中執行,只要在方法結束前,方法內參數有初始化,就不會出現編譯錯誤。)
5.ref 不會強制要求函式內的程式,一定要修改傳入的參數,但 out 會。
2015年5月14日 星期四
C# 中如何將控制項陣列化
C# 如果要做到類似VB那種一大堆控制項陣列的方式來使用控制項
做法如下
先在Form視窗元件上面拉出要使用的控制項
假設要用4個元件,就拉4個出來
然後撰寫以下的程式碼(假設拉出來四個Label。名稱分別是label1 ~ label4)
Label[] Lbl_Shade = new Label[] { label1, label2, label3, label4 };
之後就可以如下的方式來使用
Lbl_Shade[0].Text = "001";
Lbl_Shade[1].Text = "002";
Lbl_Shade[2].Text = "003";
Lbl_Shade[3].Text = "004";
這樣比一個一個名稱來控制方便多了。
做法如下
先在Form視窗元件上面拉出要使用的控制項
假設要用4個元件,就拉4個出來
然後撰寫以下的程式碼(假設拉出來四個Label。名稱分別是label1 ~ label4)
Label[] Lbl_Shade = new Label[] { label1, label2, label3, label4 };
之後就可以如下的方式來使用
Lbl_Shade[0].Text = "001";
Lbl_Shade[1].Text = "002";
Lbl_Shade[2].Text = "003";
Lbl_Shade[3].Text = "004";
這樣比一個一個名稱來控制方便多了。
2015年2月8日 星期日
工業設計之跑步機UX
關於UI設計,雖然我也不是很專精
但是,以目前略懂略懂的情況來研究一下手邊的事物,總會有些體會的
來看看「公司的跑步機」
我動身體的時候,也來動動惱了
我們看看這樣的面板吧
第一個印象就是,好擁擠啊,不美觀啊
一堆按鈕也讓人覺得稍微會有恐懼的
加上一堆說明文字,這非常的不OK呀
再來看一個重點了,速度按鈕這邊有三個不好的設計
1.按鈕是沒有很好理解的圖示,這是鯊魚嗎?圓形按鈕上面有個圓角的三角形。簡單的圓形圖示,三角形指示方向就夠了
2.左邊表示提高,右邊表示降低,這裡其實也沒那麼不順,但是,一般提高會擺在右邊的。
3.光看圓形的部分,上升按鈕的圓形在底下,下降按鈕的圓形在上面,這點是蠻矛盾的,各位想像一下電梯的上升跟下降按鈕的位置,往上當然放在上的位置,如果往上放在下面的位置就違反了世俗的規範,容易造成使用者的困惑跟操作錯誤的
最後在看一下兩排速度按鈕跟高度按鈕,這樣的排列方式,說明文字又在奇怪的位置,再一排按鈕的正中間上方,又再調整速度跟高度按鈕的下方,設計的不是很好,還不如用個矩型把按鈕排列好,看起來比較整齊清爽些。
2014年12月30日 星期二
2014年11月2日 星期日
電腦用語之兩岸與英文對照表
| 英文 | 台灣 | 大陸 | |
| Advanced | 進階 | 高級 | |
| Anti-Virus | 防毒軟體 | 殺毒軟體 | |
| ARP Cache | ARP 快取記錄 | ARP 緩存表 | |
| ARP Spoofing | ARP 欺騙 | ARP 欺騙 | |
| Agent | 代理 | ||
| Auto-summary | 自動歸納 | ||
| Audit | 稽核 | 審核 | |
| Active Directory | 活動目錄 | ||
| Authentication Code | 驗證碼 | 鑒別碼 | |
| Access Token | 存取權杖 | 連接權杖 | |
| Add Hardware | 新增硬體 | 添加硬件 | |
| Assignment | 指派 | 賦值 | |
| Agility | 靈活 | 敏捷 | |
| Buffer Overflow | 緩衝區溢位 | 漏洞溢出 | |
| Bot | 殭屍電腦 | 肉雞 | |
| Backspace | 倒退 | 退格 | |
| Byte | 位元組 | 字節 | |
| Bit | 位元 | 位 | |
| Built-in | 內建 | 集成 | |
| Blog | 部落格 | 博客 | |
| Blogger | 部落客 | 博主 / 博客主 | |
| Big Data | 巨量資料 | 海量資料 | |
| Blackhat SEO | 搜尋引擎毒化 | 黑帽 SEO | |
| Breath First Search | 橫向優先搜尋 | 寬度優先遍歷 | |
| Binary | 二進制 | 二元 | |
| Configuration | 設定 | 設置 / 配置 | |
| Component | 元件 | 組件 | |
| Chip | 晶片 | 芯片 | |
| Clock Speed | 時脈速度 | 時鐘速度 | |
| Compatible | 相容 | 兼容 | |
| Computer | 電腦 | 計算機 | |
| Connect | 連線 | 連接 | |
| Control Panel | 控制台 | 控制面板 | |
| Client | 用戶端 | 客戶端 | |
| Command | 指令 | 命令 | |
| Capture | 擷取 | 補獲 | |
| Cross VLAN | 跨越式 VLAN | ||
| Class B | B 類網路 | ||
| Class A B C | 子網路等級 | 主類網路 | |
| Cache Region | 快取區域 | 緩存區域 | |
| Code Red | 紅色代碼 | ||
| Create | 建立 | 創建 / 新建 | |
| CA Certificate | CA 憑證 | CA 證書 | |
| Command Prompt | 命令提示字元 | 命令提示符 | |
| Crash | 當機 | 宕機 | |
| Community | 社群 | 社區 | |
| Cluster Sampling | 叢集抽樣 | 聚類抽樣 | |
| Coverage | 涵蓋 | 覆蓋 | |
| Cluster | 叢集 | 集群 | |
| CPU Throttling | CPU 調節 | ||
| Data Frame | 資料幀 | ||
| Digital Camera | 數位相機 | 數碼相機 | |
| Default | 預設 | 默認 | |
| Desktop | 桌面 | 壁紙 | |
| Desktop Computer | 桌上型電腦 | 台式計算機 | |
| Display Card | 顯示卡 | 顯卡 | |
| Delivery | 傳遞 | 交付 | |
| Device | 裝置 | 設備 | |
| Domain Name | 網域名稱 | 功能變數名稱 | |
| Deep Inspection | 深層檢測 | 深度檢測 | |
| Drive Letter | 磁碟機代號 | 驅動器符號 | |
| Data | 資料 | 數據 | |
| Default | 預設 | 默認 / 缺省 | |
| Digital | 數位 | 數碼 | |
| Demo | 示範 / 展示 | 演示 | |
| Domain Name | 網域名稱 | 功能變數名稱 | |
| DDW (Detecting near-Duplicate WebPages) | 重複網頁刪除偵測 | 網頁去重 | |
| Dimension | 次元 | 維度 | |
| Enter | 回車 | ||
| EIGRP | 路由器鄰居發現協定 | ||
| Echo Request | 回應要求 | 回顯請求 | |
| Echo Replay | 回應答覆 | 回顯應答 | |
| Floppy | 軟碟 | 軟盤 | |
| Font | 字型 | 字體 | |
| Feedback | 意見反應 | 回饋 / 反饋 | |
| Framework | 架構 | 框架 | |
| Founder | 創始者 | 奠基人 | |
| Field | 欄位 | 域 | |
| File Handle | 文件句柄 | ||
| Group | 群組 | 和組 | |
| Hard Disk | 硬碟 | 硬盤 | |
| Hardware | 硬體 | 硬件 | |
| Hostname | 主機名稱 | 主機別名 | |
| Homepage | 首頁 | 主頁 | |
| Header | 標頭 | 包頭 | |
| Hash Algorithm | 雜湊演算法 | 散列算法 / 哈希算法 | |
| Hijack | 劫持 | ||
| [Hard Code] | 寫死 | 硬編碼 | |
| Icon | 圖示 | 圖標 | |
| Internet | 網際網路 | 互聯網 | |
| IP Address | IP 位址 | IP 地址 | |
| Implementation | 實作 | 實現 | |
| In-Band | 帶內管理 | ||
| Inverted index | 反向索引 | 倒排索引 | |
| Interpolation | 內插補點 | 差值 | |
| Incoming/Inbound Link | 傳入連結 | 入鏈 | |
| Instance | 執行個體 | 實例 | |
| Intellisense | 智能感知 | ||
| Joystick | 搖桿 | 手柄 | |
| Kernel | 核心 | 內核 | |
| LAN | 區域網路 | 局域網 | |
| Link | 連結 | 鏈接 | |
| Login/Logon | 登入 | 登錄 | |
| Logout | 登出 | 註銷 | |
| Loopback | 環回 | ||
| Low-Latency | 低延遲時間 | 低延時 | |
| Localhost | 本地主機 | ||
| LM (Lan Manager) | LAN 管理員 | LAN 管理器 | |
| Local Security Authority | 本機安全性授權 | 安全子系統 | |
| Laser | 雷射 | 激光 | |
| Linked list | 連結清單 | 鏈表 | |
| Memory | 記憶體 | 內存 | |
| Match | 比對 | 匹配 | |
| Modeling | 模組化 | 建模 | |
| [mì] | n 的 m 次方 | n 的 m 次冪 | |
| Message Broker | 消息代理 | ||
| Nimda | 妮姆達 | ||
| New Technology File System | NTFS 檔案系統 | NTFS 分區 | |
| Online | 線上 | 在線 | |
| OSPF Cost | 路徑成本 | 度量值 | |
| Out-Of-Band | 帶外管理 | ||
| Outgoing/Outbound Link | 對外連結 | 出鏈 | |
| Packet | 封包 | 報文 / 包文 | |
| Password | 密碼 | 口令 | |
| Permission | 權限 | 許可權 | |
| Protocol | 協定 | 協議 | |
| Packet Loss | 封包遺失 | 數據包丟失 | |
| Promiscuous Mode | 混雜模式 | ||
| Permission | 權限 | 許可權 | |
| Patch | 更新檔 | 補丁 | |
| PKI | 公開金鑰基礎建設 | 公共金鑰結構 | |
| Process | 程序 | 進程 | |
| Private Key | 私密金鑰 | 私有金鑰 | |
| Printer | 印表機 | 打印機 | |
| Programming | 程式設計 | 編程 | |
| Posts | 文章 | 帖子 | |
| Policy | 原則 | 策略 | |
| [Poisson Process] | 卜瓦松過程 | 泊松过程 | |
| [Paradigm] | 範式 | 范式 | |
| Physical | 實體 | 物理 | |
| [Probability] | 機率 | 概率 | |
| Redundancy | 備援 | 冗餘 | |
| Recovery Agent | 修復代理人 | 恢復代理 | |
| Replay Attack | 重播攻擊 | 重放攻擊 | |
| Registry | 機碼 | 註冊表 | |
| Refresh | 重新整理 | 刷新 | |
| Recycle Bin | 資源回收筒 | 回收站 | |
| Robot Exclusion Protocol | 爬蟲禁抓協議 | ||
| Rollback | 復原 | 回滾 | |
| Return | 傳回 | 返回 | |
| Scheduling | 排程 | 調度 | |
| Submit | 送出 | 提交 | |
| Three Way Handshake | TCP 三向交握 | TCP 三次握手 | |
| TCP Session | TCP 會話 | ||
| TCP half-open Session | _ | TCP 半開會話 | |
| TCP Connection | TCP 連接 | ||
| TCP Intercept | TCP 攔截 | TCP 截取 | |
| Threshold | 門檻值 | 閾值 | |
| Time Exceeded | 逾時 | 超時 | |
| Traffic Shaping | 流量整形 | ||
| Token Buket | 權仗桶 | ||
| Training | 教育訓練 | 培訓 | |
| Text Retrieval | 文字檢索 | 文本檢索 | |
| Term-Document Matrix | 詞彙 - 文件矩陣 | 單詞 - 文件矩陣 | |
| Traversal | 周遊 | 遍歷 | |
| Unicast | 單點傳播 | 單播 | |
| User | 使用者 | 用戶 | |
| Uninstall | 解除安裝 | 卸載 | |
| Unary | 一進制 | 一元 | |
| Video | 視訊 | 視頻 | |
| Weighted | 權重 | 加權 | |
| Worm.Blaster | 疾風病毒 | 衝擊波病毒 | |
| WordPad | 寫字板 | ||
| Multicast | 多點傳播 | 多播 / 組播 | |
| Market Shares | 市場佔有率 | 市場份額 | |
| Media | 媒體 | 介質 | |
| Messenger Service | 信差服務 | 信使服務 | |
| Motherboard | 主機板 | 主板 / 母板 | |
| Modem | 數據機 | 調制解調器 | |
| Mouse | 滑鼠 | 鼠標 | |
| My Document | 我的文件 | 我的文檔 | |
| Master | 主要 | 主控 | |
| [Metadata] | 中繼資料 | 元數據 | |
| [microblog] | 微網誌 | 微博 | |
| Native VLAN | 原生 VLAN | 本地 VLAN | |
| Session State | 會話狀態 | ||
| Subnet Mask | 子網路遮罩 | 子網掩碼 | |
| Switchport mode access | Access 模式 | 接入模式 | |
| Support Tools | 支持工具資源包 | ||
| Security Reference Monitor | 安全參考監督 | 系統連接仲裁器 | |
| Simple Volume | 簡單磁碟區 | 簡單卷 | |
| Spanned Volume | 跨距磁碟區 | 跨區卷 | |
| Striped Volume | 等量磁碟區 | 帶區卷 | |
| SAM (Security Account Manager) | 安全性帳戶管理員 | 安全帳戶管理器 | |
| Submit | 送出 | 提交 | |
| Screen | 螢幕 | 屏幕 | |
| Support | 支援 | 支持 | |
| SNMP Community String | SNMP 團體字符串 | ||
| VLAN Trunk | VLAN 幹道 | ||
| VLAN Tag | VLAN 標記 | ||
| VLAN Double Tag | VLAN 雙標記 | ||
訂閱:
文章 (Atom)




