tag:blogger.com,1999:blog-16975252364785877332024-03-16T11:53:43.023+08:00Tomex Ou 專業部落格Copyright 2009-2023. Contact me via banner QR code.tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.comBlogger272125tag:blogger.com,1999:blog-1697525236478587733.post-51054803328047696792023-04-24T16:12:00.001+08:002023-04-24T16:39:21.768+08:00TextCrypt字串加解密工具<p>撰寫應用程式時,我們常會將設定檔*.config裏的敏感字串(如資料庫連線)加密以防止被人任意窺看,再於Runtime執行時依特定Secret Key作字串解密。然而明文字串隨時可能修改,因此我們需要一個簡易的工具來幫快速產生已加密的字串值。<br />此工具支援比較常用的對稱式可逆加密法:</p> <div class="separator" style="clear: both; text-align: center;"><strong><span style="font-size: medium;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEioRtKuWHwyTsyaYdohpiYilWWz8oV7b6O0bom7mgr_OMYGOAp_FyOPKS_yEPQ5MKapgFeOAWKbHzf0ZfALa0a82J5aNLP2LeINpHU4BPu_hxGdQ9fDLQy8kWVK9BmlL_Q2ZRn1P5ipOI_6yRlwlv6wrwlo2WK-4QFIpaSSK7O02Sd5ujxL3RERvKb8RQ" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="533" data-original-width="591" src="https://blogger.googleusercontent.com/img/a/AVvXsEioRtKuWHwyTsyaYdohpiYilWWz8oV7b6O0bom7mgr_OMYGOAp_FyOPKS_yEPQ5MKapgFeOAWKbHzf0ZfALa0a82J5aNLP2LeINpHU4BPu_hxGdQ9fDLQy8kWVK9BmlL_Q2ZRn1P5ipOI_6yRlwlv6wrwlo2WK-4QFIpaSSK7O02Sd5ujxL3RERvKb8RQ=s16000" /></a></span></strong></div><strong><span style="font-size: medium;"><br /><br /></span></strong><p></p><p><strong><span style="font-size: medium;">2023/04/24 Version History:</span></strong></p><ol><li>新增Base64Url加解密功能。<br /></li><li>升級.NET Framework版本,由4.6升級至最新4.8</li></ol><p><strong><span style="font-size: medium;">2015/08/14 Version History:</span></strong></p> <ol> <li>新增XOR+Salt4的原創加密方式,它的作法簡單卻效能高,且可轉換成各種程式語言(因為原理簡單)。<br />明文20字,加密後的長度為32值,剛好與一般密碼長度一致(MD5/GUID)。 </li><li>新增XOR+MD5加密法,它是將密碼MD5 Hash後(16-byte),與明文作XOR運算而得到密文。 </li><li>增加文字顯示的字串長度值,以觀測密文與明文之間的長度變化。 </li><li>更換App Icon.</li></ol><strong><span style="font-size: medium;">2014/10/06 Version History:</span></strong><br /> <ol> <li>新增輸出字串轉成HEX十六進位顯示,這可以驗證RC4加密後的加密陣列。 </li><li>升級方式,exe+config檔全部overwrite舊檔。</li></ol><strong><span style="font-size: medium;">2014/05/05 Version History:</span></strong><br /> <ol> <li>新增標準的AES-128/256加密法,使用32位長的Salt產生Hash Key/IV bytes,增強安全性。 </li><li>新增GUID/UUID產生器。 </li><li>新增Input/Output文字方式的複製、清除及大小寫的功能。 </li><li>重新排序CryptType的下拉項目順序。</li></ol><span style="font-size: medium;">程式下載:(.NET 4.8 Required, Portable, V23.4.24, Size: 394KB)<br />[</span><span style="font-size: medium;"><a href="https://1drv.ms/u/s!AiFW9yn8fdfQk8V9tg2mGKeAqAzelg?e=Ffmlz1" target="_blank">OneDrive</a></span><span style="font-size: medium;">]</span> tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-23779080066995300122017-06-28T09:32:00.000+08:002017-06-28T09:32:06.382+08:00VMware奇怪的網路NAT(VMnet8)不通<p>在一次升級VMware 12.5.3至15.5.5版本時,升級過程貌似一切正常,但虛擬機原本運作好好的NAT網卡,卻出現「Could not connect 'Ethernet0' to virtual network 'VMnet8'」的奇怪錯誤,無法上網也無法和HOST OS互PING相連。即使把該虛擬機網卡移除再新增,也無法連接網卡。</p><p>由於我的NAT網段不是用預設值的,估計裏頭亂掉了,經過查網是必須恢復回預設值。因此開啟VMware主畫面,在功能表「Edit/Virtual Network Editor」畫面的左下角,點擊「Restore Defaults」回復預設值按鈕。</p><p><a href="https://lh3.googleusercontent.com/-fQCc5J7iCtE/WUxv0X_OF_I/AAAAAAAAOXg/0YosSO7O-OM3HFGgphgl4Wt9OUKMZdv6gCHMYCw/s1600-h/image%255B2%255D"><img width="592" height="528" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="https://lh3.googleusercontent.com/-O83rFWR8U4A/WUxv1D-56fI/AAAAAAAAOXk/tTMdLP4AAmQMi31g5JzdjXwgTcjhdmQngCHMYCw/image_thumb?imgmax=800" border="0"></a></p><p>它會整個VMware網卡驅動重新整理,變成預設的網段,再調整回自己慣用的虛擬網段即可。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-9233989922264083202017-06-22T23:39:00.001+08:002017-06-22T23:47:39.649+08:00福特汽車FOCUS MK3的軟骨雨刷邊頭怎麼拆?<p>軟骨雨刷比傳統硬骨雨刷的優點是具彈性較貼合玻璃,更能掃除雨水而不殘留水痕,但其缺點就是當其接觸面膠條老化時,就會和玻璃產生澀感而出現尾部跳動的問題,很令人抓狂。</p><p><iframe width="854" height="480" src="https://www.youtube.com/embed/ciDjJHbgx9k?ecver=1" frameborder="0" allowfullscreen=""></iframe></p><p>網上有人說把膠條抽出來反著裝,就能解決問題,但由於我是買了新膠條後才發現這樣的撇步,所以就等日後再試了。不管是反裝或新膠條,第一步都是要拆兩側的邊頭,它是一個塑膠頭卡榫緊緊扣著。</p><p><a href="https://lh3.googleusercontent.com/-FdosazFoY7Y/WUvks60IJHI/AAAAAAAAOW4/-tlrzls8k5k8NLbPthRqYc1j7C4ANWfpQCHMYCw/s1600-h/image2"><img width="527" height="404" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="https://lh3.googleusercontent.com/-5QtkRqsIzWY/WUvktnqNKzI/AAAAAAAAOW8/VVYN5SKWIWA49gCH_4aJHotYRVmwh_NoQCHMYCw/image_thumb?imgmax=800" border="0"></a></p><p>第1次拆不知其卡榫原理,搜尋網上也沒有細部圖片,因此我用起子大力單側硬扯才下來。檢視其卡榫設計,原來是單側較厚,推入時就能利用這厚片卡著下方鐵片溝槽。</p><p><a href="https://lh3.googleusercontent.com/-KRDBCXXhN8w/WUvkukGaiEI/AAAAAAAAOXA/FPg7XJyn7eoWCjbNPErr50LiKt3Xfl-KgCHMYCw/s1600-h/image%255B3%255D"><img width="549" height="402" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="https://lh3.googleusercontent.com/-5W7drjfSYMk/WUvkvQiEGwI/AAAAAAAAOXE/JA48uGyQG38Aoop6XFzjqF4Jh3aeNFeBwCHMYCw/image_thumb%255B1%255D?imgmax=800" border="0"></a></p><p>因此要拆除這兩側邊頭,就是用起子翹起那厚片卡榫處,稍微提起放在溝槽邊角放著,再把另一側卡榫也同樣處理,最後輕輕往外抽就好了。</p><p><a href="https://lh3.googleusercontent.com/-a_jNPX00Az4/WUvkv4xhvKI/AAAAAAAAOXI/k8KOSrQFOkcEdaMC12A9vLSJfaxbdLkrACHMYCw/s1600-h/image%255B6%255D"><img width="445" height="214" title="image" style="margin: 0px; display: inline; background-image: none;" alt="image" src="https://lh3.googleusercontent.com/-KdyWE1juQ_c/WUvkwaZvA3I/AAAAAAAAOXM/nAwKz0NFdS0am-0RBUkad2cib5jy5e-4gCHMYCw/image_thumb%255B2%255D?imgmax=800" border="0"></a></p><p>解決兩側的邊頭套,裏面的膠條就很容易抽換掉了。燈光下檢視膠條切面,的確是朝某面傾斜,或許反裝膠條可以暫時延緩一下老化的速度。不過,會造成雨刷跳動的問題很多,玻璃油膜、含矽雨水劑、玻璃噴臘、刷骨角度…一大堆的,大致測試一下若無法解決,就是換新雨刷了。聽說雨刷積(刷卡去除老化膠末)也很好用,開車維修想省錢就是神農試百草,但堅持的程度要自己拿捏,否則省小錢花大錢也不理智。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-84769632578648723962017-05-09T16:11:00.000+08:002017-05-09T16:13:23.580+08:00移除Win10預設所有Apps軟件<p>如果你的Win10電腦是專門工作用途,而且用不著WIN10預設安裝APP的話,可以使用下面教學文章去移除所有預設安裝的App程式。若之後想要安裝,再使用其Store商店程式作單一安裝即可。</p> <p>How To Uninstall Default Apps In Windows 10<br><a href="http://www.intowindows.com/how-to-uninstall-default-apps-in-windows-10/">http://www.intowindows.com/how-to-uninstall-default-apps-in-windows-10/</a></p> <p>簡單步驟:</p> <ol> <li>以Admin角色執行「Windows Powershell」程式,輸入以下指令即可一鍵移除所有預設安裝的APP。<br><font color="#0000ff">Get-AppxPackage -AllUsers | Remove-AppxPackage</font><br><br><a href="https://lh3.googleusercontent.com/-T9vZj3ErUWM/WRF6G8Ls6YI/AAAAAAAANuM/jesW-nVkw3ouPQMgwfxeVyh3nIaWp8LAgCHM/s1600-h/image%255B2%255D"><strong><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-fjIka9HzK7U/WRF6Imkc81I/AAAAAAAANuQ/MiLRbx8CsXcWkPj0k7DdckcP55K0E5wLACHM/image_thumb?imgmax=800" width="741" height="634"></strong></a></li> <li>完成預設App移除工作,就是這麼簡單。</li></ol> <p>我也挺喜歡Win2016的工作介面環境,它使用WIN10的系統核心卻沒有多餘花俏的APP,只可惜SERVER版對一些硬件的驅動程式採事先驗證,無法像WIN10能插上就無痛驅動,因此還是選擇時常出新UPDATE的WIN ISO檔為宜。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-82970035947290232432017-04-18T14:50:00.000+08:002017-04-18T14:51:31.379+08:00透過GOOGLE翻譯和外籍看護溝通<p>2016年中旬因為老家父母陸續生病(中風及失智)需人照顧,因此聘請印尼看護居家照顧,由於看護個人語言能力不一,加上中文對外國人來說是相當難學習的語言,因此溝通的方式主要透過<a href="https://translate.google.com/?source=gtx" target="_blank">GOOGLE翻譯</a>工具來達到意思溝通。由於家裏沒有多餘人力能輔助,所以我尋找年紀30-40歲性格相對沉穩的看護,並給予看護完全自主買菜照護的自由,以達到最高效率。經過一段時間輔導相處及磨合,身為雇主的我發現有一些生活溝通翻譯的技巧,分享這些經驗給大家。 <ol> <li>印尼看護平均學歷為初中或高中,基本簡單英文OK,但要用完整英文句子溝通90%是有困難的,因此GOOGLE翻譯網站來產生印尼譯文是最常用的。家裏最好申辦網路供其上網需求,以能看YOUTUBE視頻及客廳網路攝像鏡頭為最低基準,推薦以中華光世代16MB/3M方案為宜,那種ADSL 5M/1M方案根本不敷需求。</li> <li>中文成語詞性博大精深,整段中文句子要直成印尼文50%會有偏誤,用英文翻成印尼文會好一點,但多一層轉換成本。發現多善用逗號來斷開中文詞句,翻譯的效果就能改善,再透過反覆逆轉翻譯來修正,就可以達到90%正確意思表達。<br><a href="https://lh3.googleusercontent.com/-wgtz1LnX_oM/WPW3WyvrvII/AAAAAAAAMnE/ygTgaUGPyX0/s1600-h/image%25255B2%25255D.png"><img title="Google Translator" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Google Translator" src="https://lh3.googleusercontent.com/-0xcot3ROmmg/WPW3XlzeazI/AAAAAAAAMnI/gTymtMmiXO4/image_thumb.png?imgmax=800" width="724" height="334"></a></li> <li>一圖勝千文,再貼心一點搜尋GOOGLE圖片,能100%表達正確意思。<br><a href="https://lh3.googleusercontent.com/-Cof1nVfcJDs/WPW3Yw_9h9I/AAAAAAAAMnM/-xAHqAHxY2I/s1600-h/image%25255B5%25255D.png"><img title="Google Image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Google Image" src="https://lh3.googleusercontent.com/-hxZlEWmcvIA/WPW3aJ2LXSI/AAAAAAAAMnQ/OOJcWsCn180/image_thumb%25255B1%25255D.png?imgmax=800" width="719" height="467"></a></li> <li>實務上生活簡易資訊分享溝通不會那麼費勁,我通常直接在LINE上用簡單英文+網圖來表達意思。請一定要用英文,不要直接打中文讓她們去谷歌搜尋,因為複製中文搜尋太折騰外國人。她們通常會用印尼文回應,不過簡短的印尼文因為無上下文推斷,GOOGLE翻譯有時不太靈光但瑕不掩瑜。<br><a href="https://lh3.googleusercontent.com/-ox65Nk5huqo/WPW3bGKca-I/AAAAAAAAMnU/Ia-zVFxuyJs/s1600-h/image%25255B8%25255D.png"><img title="LINE Dialog" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="LINE Dialog" src="https://lh3.googleusercontent.com/-C1wdhWxhiNA/WPW3cdCbpyI/AAAAAAAAMnY/LIVm4jcvp3Q/image_thumb%25255B2%25255D.png?imgmax=800" width="434" height="629"></a></li> <li>仲介公司通常有印尼翻譯可以幫忙溝通,不過我建議平時溝通就該化整為零,透過上面的自助翻譯方式,相處久了自然形成默契及信任感。</li></ol> <p>每個家庭裏的病人狀況/數量不一樣,加上聘用的看護個人能力及性格也有差異,雇主的管理方式就會跟著不同。每位雇主就像被老天爺突然開了一個玩笑,得像唐僧踏上取經之路,是否能獲得一位孫悟空或是沙悟淨型的看護,真的或多或少純看運氣。若是不幸遇上豬八戒型的看護,那麼就得加強訓練及要求,並協求仲介公司的專業幫助了。</p> <p>雖然不知道陪伴老病家人走上人生最後一段路,得走多久,但遇上了就只能去勇敢面對,一起和看護將日子過得平順一些了,彼此加油。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-71048295548554762622017-04-04T23:24:00.001+08:002017-04-04T23:42:18.884+08:00Visual Studio 2017 Update<p>VS2017在Offline Installation離線安裝未能提供ISO光碟檔被人詬病,不過它的優點是若只開發C++ Native程式,只需要下載安裝3GB空間而己,而不需要一般的20GB。然後,這理由未能說服離線安裝需求的人,畢竟微軟應該把最常用的Layout組合(C# ASP.NET/WinForm),製成一份20GB ISO檔供離線下載才對。</p> <p>Create an offline installer for Visual Studio 2017 | Microsoft Docs<br><a href="https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio" target="_blank">https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio</a></p> <p>幸好有熱心網友Myhammad提供離線Layout的RAR壓縮檔供人下載:</p> <p>Visual Studio 2017 Editions – Google Drive<br><a href="https://drive.google.com/drive/folders/0B78wbPvH6XGZcFg4bF9LS3QtWk0" target="_blank">https://drive.google.com/drive/folders/0B78wbPvH6XGZcFg4bF9LS3QtWk0</a></p> <p><a href="https://lh3.googleusercontent.com/-wl2Ai1SsQiM/WOO7FJ-2JTI/AAAAAAAAL5s/tuQCL1gi0a0/s1600-h/image%25255B5%25255D.png"><img title="VS2017 - Google Drive" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="VS2017 - Google Drive" src="https://lh3.googleusercontent.com/-GtkqT7scG4E/WOO7F4GdtwI/AAAAAAAAL5w/KMcM3h0zRpQ/image_thumb%25255B1%25255D.png?imgmax=800" width="609" height="184"></a></p> <p>然而這種Component模組安裝方式的架構,很適合之後的VS2017 Update更新,加速了Bug修正的周期,以VS2015的更新方式更快速。</p> <p>Visual Studio 2017 Release Notes<br><a href="https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes">https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes</a></p> <p><a href="https://lh3.googleusercontent.com/--HpjpeWaSiA/WOO7Ggh8oFI/AAAAAAAAL50/TGTcSZuXviM/s1600-h/image%25255B2%25255D.png"><img title="VS2017 - Update Log" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="VS2017 - Update Log" src="https://lh3.googleusercontent.com/-4xry148bPp4/WOO7HMW7AGI/AAAAAAAAL54/MPoU2BFZ3j0/image_thumb.png?imgmax=800" width="620" height="411"></a></p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-20627783379484016902016-11-24T02:03:00.000+08:002016-11-24T02:06:14.909+08:00建立目錄與VSTS Git版控服務的綁定教學<p><a href="https://www.visualstudio.com/team-services/" target="_blank">Visual Studio Team Services</a>網站(以下簡稱VSTS)提供Git Private Repository免費空間服務,在VS2015下可以使用Team Explorer與專案建立連結。然而我們的專案目錄通常不只存放一個Solution方案,也會放置專案文件,因此會以上一層目錄為Git Working Directory,就無法使用VS2015的Team Explorer工具來設定了。以下示範如何在Windows系統下不透過VS2015工具,直接綁定某目錄與VSTS Git Repository的綁定教學.</p> <ol> <li>登入Visual Studio Team Services網站,建立一個以Git版本為主的Team Project目錄。<br>網址: <a title="https://XXX.visualstudio.com/" href="https://XXX.visualstudio.com/" target="_blank">https://<font color="#ff0000">XXX</font>.visualstudio.com/</a> (XXX = VSTS申請的名稱)<br><a href="https://lh3.googleusercontent.com/-So0FrAjiVrQ/WDXaZACrFPI/AAAAAAAAEoA/fFhKh_6lZxk/s1600-h/image%25255B2%25255D.png"><img title="Create Team Project" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Create Team Project" src="https://lh3.googleusercontent.com/-4Q_XedIk9EQ/WDXaZ7ivytI/AAAAAAAAEoE/yxM4ucePgWY/image_thumb.png?imgmax=800" width="751" height="601"></a><br></li> <li>系統安裝<a href="https://tortoisegit.org/" target="_blank">TortoiseGit</a>, 建立一個空目錄ZZZ,在該目錄下按右鍵選擇「Git Clone」功能。<br><a href="https://lh3.googleusercontent.com/-A4SHbkqBZCs/WDXaaoPdm8I/AAAAAAAAEoI/yrcIcwPl2nA/s1600-h/image%25255B5%25255D.png"><img title="Git Clone ContextMenu" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Git Clone ContextMenu" src="https://lh3.googleusercontent.com/-5z0-4OkXqGU/WDXabqT8ZGI/AAAAAAAAEoM/tVLzGA8Ev7s/image_thumb%25255B1%25255D.png?imgmax=800" width="363" height="176"></a><br></li> <li>設定Git clone設定:<br>VSTS的GIT Remote URL網址為: <a title="https://XXX.visualstudio.com/DefaultCollection/_git/YYY" href="https://XXX.visualstudio.com/DefaultCollection/_git/YYY">https://<font color="#ff0000">XXX</font>.visualstudio.com/DefaultCollection/_git/<font color="#ff0000">YYY</font></a> (XXX = VSTS申請的名稱, YYY = Project名稱)<br><a href="https://lh3.googleusercontent.com/-B0MFGbuFQBo/WDXacBhYjjI/AAAAAAAAEoQ/UqE0DY32pyQ/s1600-h/image%25255B8%25255D.png"><img title="Git Clone Setting" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Git Clone Setting" src="https://lh3.googleusercontent.com/-rCoSSgaQMCE/WDXac7S2rbI/AAAAAAAAEoU/3cdpRh3MIqc/image_thumb%25255B2%25255D.png?imgmax=800" width="552" height="388"></a><br>按下OK後它會進行與遠端VSTS服務的登入驗證及綁定工作。<br></li> <li>成功綁定後,把VS2015的專案目錄移入該ZZZ目錄下,再右鍵選擇「Git Commit」把新目錄寫入VSTS遠端即可。<br><a href="https://lh3.googleusercontent.com/-CrfHPGhzqic/WDXadpf-T-I/AAAAAAAAEoY/VzbAjI0pNx8/s1600-h/image%25255B14%25255D.png"><img title="Git Commit" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Git Commit" src="https://lh3.googleusercontent.com/-jHqAMdTn3gY/WDXaeAqjNaI/AAAAAAAAEoc/oyMta_7oV_c/image_thumb%25255B4%25255D.png?imgmax=800" width="312" height="159"></a> <a href="https://lh3.googleusercontent.com/-Pv8IPhvePD8/WDXae9Y3ebI/AAAAAAAAEog/cx4daEkAlEg/s1600-h/image%25255B11%25255D.png"><img title="Git Linked Status" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Git Linked Status" src="https://lh3.googleusercontent.com/-C9A02SC6vB0/WDXagPTWFII/AAAAAAAAEok/JRBTZkqDDu4/image_thumb%25255B3%25255D.png?imgmax=800" width="391" height="162"></a><br></li> <li>開啟ZZZ目錄下的任何VS2015 Solution方案檔,專案自動都跟VSTS的Git版控進行良好的結合了。<br><a href="https://lh3.googleusercontent.com/-qzEMj_W8mBo/WDXahgKsbbI/AAAAAAAAEoo/2NYDPhwhGNE/s1600-h/image%25255B17%25255D.png"><img title="VS Solution Explorer" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="VS Solution Explorer" src="https://lh3.googleusercontent.com/-L65Q3IVpupU/WDXajK4ZTjI/AAAAAAAAEos/6MR42SZIqOs/image_thumb%25255B5%25255D.png?imgmax=800" width="275" height="390"></a><br></li> <li>某些不需要版控的目錄,如obj/, publish/輸出目錄,可以設定「Add to ignore list」。<br><a href="https://lh3.googleusercontent.com/-Ay7v5IhjyQY/WDXaklvwd5I/AAAAAAAAEow/OuNwvGw7-t0/s1600-h/image%25255B20%25255D.png"><img title="Ignore List" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Ignore List" src="https://lh3.googleusercontent.com/-Z8gRXXRmYeE/WDXaleSafII/AAAAAAAAEo0/YPmFcjpNnXs/image_thumb%25255B6%25255D.png?imgmax=800" width="423" height="137"></a></li></ol>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-44075498365670280382016-10-19T15:47:00.001+08:002016-10-19T15:47:05.351+08:00SQL Server版號對照表<p>SQL Server的版號不只有受主版本及Service Pack (SP)才會異動,平時的Windows Update補丁若有修正SQL Server的,也會改變。下表列出主要的SQL版本號碼,要配合現在DB版本,只要選擇最接近的低版本即可相容。</p> <p><a href="https://lh3.googleusercontent.com/-CMKOODtpbI8/V_88P0piTvI/AAAAAAAAEm4/6O0ciTryPyE/s1600-h/image%25255B2%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-6G3iZP-eZLo/V_88Sc6Wb4I/AAAAAAAAEm8/BFU0TxguIFQ/image_thumb.png?imgmax=800" width="594" height="347"></a></p> <p>資料來源: <a title="http://sqlserverbuilds.blogspot.tw/" href="http://sqlserverbuilds.blogspot.tw/">http://sqlserverbuilds.blogspot.tw/</a></p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-9671353917337421532016-10-12T12:08:00.000+08:002016-10-12T12:08:02.044+08:00掛載USB隱藏分區(Hidden Partition)<p>要將PE系統製作至一個USB開機碟時,通常它會分成兩個分區(Partition),分別為下圖編號1的資料區(Data)及及編號2開機區(Boot, Hidden),並且把開機區設定隱藏+活動(Active+Hidden),如此插入USB碟時,系統只會出現Data區。</p> <p><a href="https://lh3.googleusercontent.com/-fyf5Truw84A/V_kobBRb5fI/AAAAAAAAEl4/p5Qzfj0sn7E/s1600-h/image%25255B27%25255D.png"><img title="Partition List" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Partition List" src="https://lh3.googleusercontent.com/-OiOjjx_GVS0/V_kofaVO1zI/AAAAAAAAEl8/cHprlkrvU2s/image_thumb%25255B8%25255D.png?imgmax=800" width="440" height="93"></a></p> <p><a href="https://lh3.googleusercontent.com/-Q6yuFCFDRls/V_koivhaPHI/AAAAAAAAEmA/k9YNO5OXnaY/s1600-h/image%25255B8%25255D.png"><img title="Partition Unhide" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Partition Unhide" src="https://lh3.googleusercontent.com/-BBIAIaG2kDk/V_komNN3qmI/AAAAAAAAEmE/UippsyCvYm4/image_thumb%25255B2%25255D.png?imgmax=800" width="569" height="121"></a></p> <p>要升級PE工具的新版本,一般做法是直接替換開機區內的*.wim (Windows Image Manager)系統映像檔即可。但是開機分區雖能夠取消隱藏,卻無法掛載盤符至系統裏來操作,因為一般分區工具只允許磁碟第1主分區位置才能掛載盤符。為了解決這問題,我們可以使用<a href="http://www.ipauly.com/2015/11/15/bootice/" target="_blank">BOOTICE工具</a>來掛載任一隱藏分區至系統。</p> <p>操作步驟為:</p> <ol> <li>開啟BOOTICE工具,選擇「Physical disk > Destination Disk > Parts Manage」,然後選擇<br><a href="https://lh3.googleusercontent.com/-BJoIurXRQ08/V_kooD_-ZjI/AAAAAAAAEmI/zdY_m9A826E/s1600-h/image%25255B14%25255D.png"><img title="BOOTICE Parts" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="BOOTICE Parts" src="https://lh3.googleusercontent.com/-3HNAF-J6l4Q/V_korItnioI/AAAAAAAAEmM/r_EyRUuCVUM/image_thumb%25255B4%25255D.png?imgmax=800" width="415" height="296"></a></li> <li>選擇隱藏分區,點擊「Assign Drive Letter」按鈕,即可在系統載掛此分區。<br><a href="https://lh3.googleusercontent.com/-y4zWeQDJ4Wo/V_kot75kCNI/AAAAAAAAEmQ/8RQX8n5PQcA/s1600-h/image%25255B17%25255D.png"><img title="BOOTICE Assign Drive" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="BOOTICE Assign Drive" src="https://lh3.googleusercontent.com/-8m6mJmmh6nc/V_koyRB3K8I/AAAAAAAAEmU/MOGSwEuPIRk/image_thumb%25255B5%25255D.png?imgmax=800" width="624" height="398"></a></li> <li>解開新版PE ISO檔,將boot.wim覆蓋掉隱藏區的舊檔,再點擊BOOTICE裏的「Remove Drive Letter」按鈕即可恢復隱藏。<br><a href="https://lh3.googleusercontent.com/-m3I-xKGtfvI/V_ko1AKZuBI/AAAAAAAAEmY/U0R4vD3agzo/s1600-h/image%25255B20%25255D.png"><img title="BOOTICE Remove Drive" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="BOOTICE Remove Drive" src="https://lh3.googleusercontent.com/-dFI1EHPxIsE/V_ko7blpk4I/AAAAAAAAEmc/2_jx8okeiDA/image_thumb%25255B6%25255D.png?imgmax=800" width="624" height="398"></a></li> <li>完成隨身碟的PE版本升級。</li></ol>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-28337893745136826252016-10-07T06:43:00.002+08:002016-10-07T06:59:23.868+08:00鴻象電子式定時器的電池缺點<p><a href="http://hong-shaing.com.tw/products/content.php?moon_item=4&pd_id=151&pd_class_id=59" target="_blank">鴻象電子式定時器</a>是我在2012年於COSTCO購入而接觸使用的電子產品,它採用絕對時間制用來控制夜燈的定時開關很便利,運作一直也相當穩固。發現它的內建充電電池是它的優點也是缺點,只要電池老化或長時間不充電,當電池進入低電位無法復位就整組壞掉了,使用年限約4年。</p> <p>拆開插座內部,其電路版的結構很乾淨紮實,通常穩固的電子產品看電路版就知品質了。箭頭處應該是充電電池的位置,但它被焊死無法更換了。以這個產品的紮實感應該是可以用得更久,可惜受限在一個電池壽命非得棄全身,相當可惜。</p> <p><a href="https://lh3.googleusercontent.com/-Ztg8_gkTfYM/V_bWeRzp9yI/AAAAAAAAElg/ifFll2dpIZI/s1600-h/image%25255B5%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-S4E4G2PQ1P4/V_bWnMo_FkI/AAAAAAAAElk/IJ_v4OXFLic/image_thumb%25255B1%25255D.png?imgmax=800" width="452" height="573"></a></p> <p>不禁讓人思考,很多電子產品的設計,廠商會以商業考量用某短壽命零件的避免產品長壽命,但這就像一個健康的青壯年人死於某小器官的癌症,以生命本身的價值非常不忍心,而電子產品的丟棄則不環保。雖然很多人都會用價錢/年限比來衡量值不值得,但假如一個產品的設計不要綁死在短壽命的零件上,或許能讓USER更相信電子產品的穩定性,如同大同電鍋能用上十年前不壞而獲得用戶喜愛。</p> <p>每種產品設計都有其考量立場,就像手機使用不能拆換電池的設計,有其輕薄機身構造優點,及減低頻繁拆換電池可能造成的損傷之理由,但廠商至少能像蘋果手機保證官方電池換修的年限,會更合理一些。當我們在設計創造作品時,常以「生命會找到出路」這句話來讚嘆生命變化的驚喜,但若在裏頭埋入一個顯著短期必死的炸彈,這等於是扼殺了這句話的精神,共勉之。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-79674539060127211982016-06-15T22:47:00.000+08:002016-06-15T22:47:01.461+08:00建立WinPE工具多重開機系統<p>以前在Linux系統流行放入一個Live CD光碟片就可以運行一個微型OS系統,Windows也有這樣一個稱為PE (Preinstall Environment)的微系統,就是安裝Win7/Win10時的那簡易UI環境,用來作系統備份及救援非常好用。大陸網上有各式各樣的自製PE系統,目前大都是使用Win8核心,其中我個人覺得「<a href="http://www.zdfans.com/3631.html">無垠PE组合工具</a>」最為優秀,它除了有Ghost備份還原工具外,還有ATI (Acronis True Image)備份工具可以排除某目錄,也提供網路驅動的機制,雖然整個ISO檔肥了一點(540MB),但以現在新電腦的硬件規格,運行大PE系統輕而易舉。</p> <p><img title="WinPE Snapshot" alt="WinPE Snapshot" src="http://www.zdfans.com/wp-content/uploads/2016/05/Win8PE64-2015.5-2.jpg"></p> <p>自製PE系統的發佈通常是以ISO光碟檔發佈,常被製成USB開機碟進入系統,若想把PE裝入目前的Win7/Win10作業系統裏並行,<a href="http://www.zdfans.com/4760.html">李培聰的WePE工具</a>有提供EXE安裝版(簡體介面)最為方便。它其實是把PE ISO解壓縮至C:\WinPE目錄,並自動新增一個Windows的BCD (Boot Configuration Data)開機選單項目指到該WinPE目錄裏的WIM映像檔,並作隱藏。</p> <p>簡單來說,BCD開機項目就是指定到一個WIM (Windows Image Manager)系統映像檔,裏面存放各種免安裝綠化工具,而一般的ISO檔就是內含這樣的WIM檔及開機組態設定。BCD開機項目也可以指定一個到ISO光碟檔,這樣會更方便替換新的PE ISO檔。</p> <p>以下介紹如何在Win7/Win10現行系統下,製作平行的多開機PE系統。</p> <ol> <li>請從<a href="http://www.zdfans.com/3631.html">ZD243網站</a>下載最新版無垠PE工具ISO檔,以避免下載到假檔。它區分無網路及有網路驅動的ISO檔,我們當然選擇最強大的網路版ISO,將它放在C:\WinPE目錄裏。<br></li> <li>下載<a href="http://neosmart.net/EasyBCD/">EasyBCD</a>開機管理工具,它是一套綠化免安裝免費軟件。以Run as Admin方式運行EasyBCD.exe,依下圖步驟編號,新增一個BCD開機項目。<br><a href="https://lh3.googleusercontent.com/-1bLkXcy5zEg/V1WNJRHSfSI/AAAAAAAAEgo/bOYtuvdiSnI/s1600-h/image%25255B5%25255D.png"><img title="EasyBCD Add New Entry" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="EasyBCD Add New Entry" src="https://lh3.googleusercontent.com/-d1-xM-j0920/V1WNKayqGzI/AAAAAAAAEgw/Ka36JtpsGpM/image_thumb%25255B1%25255D.png?imgmax=800" width="571" height="484"></a><br></li> <li>新增後選擇「Edit Boot Menu」,取消「Metro bootloader」的勾選及設定倒數為3秒。Metro Boot Loader就是Win10開機時使用淺藍色美化過的開機選單畫面,它不僅會拖慢開機速度,而且在Metro畫面下選擇進入PE工具系統得重開機一次,因此不要勾選它。Win2008 Server的開機選單預設就是不使用Metro介面,以加快開機速度。<br><a href="https://lh3.googleusercontent.com/-h5BLwm-ckA8/V1WNKtViraI/AAAAAAAAEg4/cp-lta6otJQ/s1600-h/image%25255B11%25255D.png"><img title="EasyBCD Edit Boot Menu" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="EasyBCD Edit Boot Menu" src="https://lh3.googleusercontent.com/-NCktInOh1Js/V1WNLNS82QI/AAAAAAAAEg8/NSpkJF4mIdU/image_thumb%25255B3%25255D.png?imgmax=800" width="571" height="484"></a><br></li> <li>儲存後退出EasyCD,即可Reboot重開機看看效果。以上的教學流程,你也可以在VM虛擬機器上測試。BCD項目指到ISO檔時會先Loading內容到記憶體,這段ISO載入時間時間並不長,雖然比直接指定WIM檔慢一點,但使用ISO方式比較好更換新版PE。<br><a href="https://lh3.googleusercontent.com/-_6yYIF6SG3I/V1WNL0lY3pI/AAAAAAAAEhI/AjmZ3VYNies/s1600-h/image%25255B14%25255D.png"><img title="Windows Boot Manager" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Windows Boot Manager" src="https://lh3.googleusercontent.com/-RIT_9umxAhE/V1WNMSDIdoI/AAAAAAAAEhQ/Sow5iXXxAgs/image_thumb%25255B4%25255D.png?imgmax=800" width="602" height="236"></a><br>讀取ISO內容至記憶體需一小段時間,對於不常進PE系統的實務,這點等待時間是可接受的。<br><a href="https://lh3.googleusercontent.com/-httLfFpYDKo/V1WNMibrxHI/AAAAAAAAEhY/DbQiEe8A6AE/s1600-h/image%25255B17%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-qlAjI8rZuuU/V1WNNDrvnVI/AAAAAAAAEhg/sIKxaEzurWo/image_thumb%25255B5%25255D.png?imgmax=800" width="410" height="90"></a><br></li> <li>你可以把C:\WinPE目錄設為隱藏,也可以不管,下次有新的PE ISO檔發佈,直接蓋ISO檔即可。</li></ol>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-89276935226226270072016-06-08T13:03:00.000+08:002016-06-08T13:03:03.524+08:00網站w3wp.exe強佔Access denied解法<p>當我們把一個圖庫目錄上傳至網站,透過匯入程序將圖片歸類要移至正確目錄位置時,通常會出現「Path XXX access denied」錯誤。在IIS6/2003時代,這通常是指該目錄沒有Network Service角色寫入權限,但在IIS7.5/2008後,ASP.NET的執行權限是由AppPool角色來決定,即使使用最高權限「LocalSystem」,一樣會有w3wp.exe強佔匯入目錄的問題。</p> <p><a href="https://lh3.googleusercontent.com/-MPV1LJXWD1I/V0kmqDwqQ3I/AAAAAAAAEgU/Si_KM4ZU4Yw/s1600-h/image%25255B2%25255D.png"><img title="w3wp.exe Lock" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="w3wp.exe Lock" src="https://lh3.googleusercontent.com/-8Gz5zywG6NU/V0kmqrTmIwI/AAAAAAAAEgY/akdZjQdjEkU/image_thumb.png?imgmax=800" width="460" height="282"></a></p> <p>上圖是透過<a href="http://lockhunter.com/download.htm" target="_blank">Lock Hunter</a>軟件顯示該目錄被強佔的資訊,須要手動解除鎖定。爬過很多網文及嘗試皆無法有效解除w3 worker process佔住的問題,只要有切入該目錄或顯示File List就會強佔,跟是否using/Dispose()或Web.config/runAllManagedModulesForAllRequests皆無關。一開始我的思路是它既然能透過軟件強制解除強佔,是否只要讀出其Handle ID/Process ID皆可批次解除,但最後發現即使透過外掛程式要Kill掉主機端程序不是那麼容易及即時,因此此方法受堵。</p> <p>相信大家在Windows系統裏,都曾有刪除某目錄卻因在使用中無法刪除的經驗,但其實刪除其內的檔案卻是允許的!因此我們的解決思路,可以使用二段式。當圖庫目錄讀取歸類後先「複製」至正確位置,然後只刪除其內的圖檔,讓它變成一個空目錄,你也可以寫個「已匯入完成.txt」標記來提醒使用者。另外撰寫另一個網頁程式專門來清除這些特殊空目錄的存在,因此當User執行別的網頁時,發現w3wp.exe就不會再強佔該目錄了。</p> <p>這是一個迂迴的二段式解法,專門用來處理網頁檔案上傳時的強佔問題。建議作法上是先放在Temp臨時目錄,再使用複製目錄來歸檔,這些殘留下來的目錄,可以等下次執行時清除1天前殘存資料即可,這段間隔時間也夠IIS AppPool行程Recycle回收,保證不會被強佔住的。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-72221829873249237822016-06-01T14:19:00.000+08:002016-06-01T14:19:00.665+08:00製作自己的jQuery Plugin套件<p>在Web設計的事件點擊(Event Handler)裏,使用link會比button更好用,因為它有hover事件,要用css換底圖都方便。</p> <p><a href="https://lh3.googleusercontent.com/-bNTfskJs3Js/V0KhJNE9IpI/AAAAAAAAEfk/9XDZscyi4pc/s1600-h/image%25255B2%25255D.png"><img title="LinkButton UI" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="LinkButton UI" src="https://lh3.googleusercontent.com/-ttnxb9hTWQ0/V0KhKBXMkOI/AAAAAAAAEfo/RL4clsvuLIY/image_thumb.png?imgmax=800" width="504" height="253"></a></p> <p>簡單的Design Pattern就是以下的範例,透過jQuery讀取id作switch判斷。</p> <p><a href="https://lh3.googleusercontent.com/-95x0l2EXkqA/V0KhK9KKHpI/AAAAAAAAEfs/Jg5nlNSACNo/s1600-h/image%25255B11%25255D.png"><img title="LinkButton Switch" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="LinkButton Switch" src="https://lh3.googleusercontent.com/-x4w-i0aidm8/V0KhL3rrhXI/AAAAAAAAEfw/BGFwijMXxT0/image_thumb%25255B3%25255D.png?imgmax=800" width="526" height="366"></a></p> <p>優質的LinkButton,還要<a href="http://stackoverflow.com/questions/19075325/prevent-double-clicks-on-links-with-jquery" target="_blank">避免短時間雙擊(double click)</a>的問題,這可以透過在click()事件前後埋入data-clicked+setTimeout()來判斷短時間點擊。另外也要避免URL#的問題,這只要記得傳回event.preventDefault()及return false即可。</p> <p>總是有一些小細節要處理,而且又要重複使用,最好的作法就是包裝成jQuery Plugin。官方的<a href="https://learn.jquery.com/plugins/basic-plugin-creation/" target="_blank">Plugin教學</a>比較陽春一點,此篇<a href="http://expect7.pixnet.net/blog/post/38085270-%5B%E7%A8%8B%E5%BC%8F%5D%5Bjquery%5D-%E8%87%AA%E5%B7%B1%E7%9A%84%E7%AC%AC%E4%B8%80%E5%80%8Bjquery-plugin!-hello-worl" target="_blank">中文框架教學</a>比較平易近人,文中不懂的關鍵字查GOOGLE就會有衍生的教學。</p> <p>比較好的jQuery Plugin框架,應該是要能傳入options設定值,而且也能獨立呼叫裏面的methods才對。例如</p> <p><a href="https://lh3.googleusercontent.com/-nplzUbeZNQQ/V0KhMi5jhZI/AAAAAAAAEf0/nnwWp4wn6Y0/s1600-h/image%25255B8%25255D.png"><img title="LinkButton Init" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="LinkButton Init" src="https://lh3.googleusercontent.com/-1E6kD0ylAHY/V0KhNuA0pZI/AAAAAAAAEf4/O78pJ_dvAM4/image_thumb%25255B2%25255D.png?imgmax=800" width="664" height="765"></a></p> <p>建立jQuery Plugin的思路及方法,可以閱讀<a href="https://blog.hinablue.me/entry/jquery-plugin-build-your-own-plugin-in-hard-way/" target="_blank">這篇文章</a>,作者使用plugin prototype來擴增方法,不過它比較不好理解,我會建議觀看<a href="http://www.jeasyui.com/demo/main/index.php?plugin=LinkButton" target="_blank">jQuery EasyUI LinkButton</a> 的Plugin框架來寫作比較好理解(請自行下載查看其SRC源碼)。雖然EasyUI是一個重度自生html的套件,裏頭寫得很複雜,不過它的Plugin建構式架構是挺好的學習參考,用來實作自己的Plugin很棒。</p> <p>為了促進對它的Plugin框架初始化的理解,我把它抽取出來去掉不必要的東西,整理如下圖。若你看不懂它在寫什麼,可能是對jQuery API還不甚熟悉,那就先仿照其他別的Plugin框架來實作也是可以的。</p> <p><a href="https://lh3.googleusercontent.com/-Yv8aE81rjPY/V0KhOTxDR-I/AAAAAAAAEf8/XHPPBhsGg6Y/s1600-h/image%25255B17%25255D.png"><img title="LinkButton Framework" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="LinkButton Framework" src="https://lh3.googleusercontent.com/-2Zkg3SC7Oio/V0KhPjEdNDI/AAAAAAAAEgA/7n-gk2OOepI/image_thumb%25255B5%25255D.png?imgmax=800" width="685" height="769"></a></p> <p>最後值得一提的是,包裝jQuery Plugin要注意this的問題,除了$.fn.XXX()這個函式的this是指向jQuery物件外,其餘大部分的this都是指DOM物件。因為DOM物件是JS標準,所以要用它來作內部函式及外部的參數傳延溝通,而不是用jQuery Object來便宜行事.</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-56521489631324293842016-05-25T12:16:00.000+08:002016-05-28T13:20:50.478+08:00MVC Razor迴圈分組顯示<p>在MVC Views (*.cshtml)裏要將一個資料集合作loop迴圈分組顯示,一般正規的Razor程式寫法如下圖:</p> <p><a href="https://lh3.googleusercontent.com/-3FXf2ZQZKeA/VzfuZSpi1AI/AAAAAAAAEes/NVf9BOJb37Y/s1600-h/image2.png"><img title="Rzaor Regular Grouping" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Rzaor Regular Grouping" src="https://lh3.googleusercontent.com/-GzpVQUtIO6M/VzfuaFUqQjI/AAAAAAAAEew/taYqIopUy3Y/image_thumb.png?imgmax=800" width="686" height="638"></a></p> <p>應用在Table裏,它就可以輸出下圖行列的分組效果。</p> <p><a href="https://lh3.googleusercontent.com/-WUx_4TpGfVI/Vzfua5CSZWI/AAAAAAAAEe0/0AOAyVDg01E/s1600-h/image8.png"><img title="Razor Regular Output" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Razor Regular Output" src="https://lh3.googleusercontent.com/-pJzhvx7y6N4/VzfubmFTfII/AAAAAAAAEe4/Ir53t1qGkIM/image_thumb2.png?imgmax=800" width="562" height="310"></a></p> <p>但是一個View裏可能會存在多個群組顯示,若每個區塊都放上述的Razor源碼,不僅容易變數衝突,也缺乏程式ReUse的精神,所以我們可以利用<a href="https://dotblogs.com.tw/hatelove/archive/2013/09/09/csharp-linq-func-action-predicate-introduction.aspx.aspx" target="_blank">C# Action Delegate</a>把需要客制化的部分抽取出來,下圖函式內部裏的StringBuilder可以省略掉,以適應更多的變化:</p> <p><a href="https://lh3.googleusercontent.com/-mnfdb1PhjQ8/Vzf4FMx9KFI/AAAAAAAAEfI/T6lBO86Aqfo/s1600-h/image%25255B3%25255D.png"><img title="Action Extract" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Action Method" src="https://lh3.googleusercontent.com/-YqlH40lXQbI/Vzf4F5yPgpI/AAAAAAAAEfM/a1yFRlOGA18/image_thumb%25255B1%25255D.png?imgmax=800" width="624" height="755"></a></p> <p>日後在Razor View裏,就可以輕易輸出Grouping HTML自訂字串了。<br><a href="https://lh3.googleusercontent.com/-9X_ufW0NKPA/Vzf4GQKez0I/AAAAAAAAEfQ/Ew9BLdT_oWc/s1600-h/image%25255B13%25255D.png"><img title="Razor Custom Grouping" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Razor Custom Grouping" src="https://lh3.googleusercontent.com/--a43bvW_EOA/Vzf4HAntJGI/AAAAAAAAEfU/PChReKKGsyM/image_thumb%25255B5%25255D.png?imgmax=800" width="555" height="450"></a></p> <p>MVC最主要精神就是不要在View裏寫複雜的邏輯程式判斷,應該要將這些分組寫法放到Model去,再包一層Method來簡化呈現參數,例如只提供群組數量就好。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com2tag:blogger.com,1999:blog-1697525236478587733.post-67524793227697635382016-05-18T16:10:00.000+08:002016-05-18T16:10:00.290+08:00ASP.NET MVC的執行亂碼訊息<p>在使用VS2015開發ASP.NET MVC5 Web Application時,若要一步步偵錯當然是執行Debug模式,但它的執行速度比較慢,而且進入點不好控制。所以若很複雜的偵錯,我通常直接使用Release模式(Ctrl+F5)來測跑結果,有錯誤訊息再修改就好。畢竟程序寫久有經驗了,通常只是打錯字而己。</p> <p>我的習慣是修改後,直接在View的頁面(*.cshtml)視窗按滑鼠右鍵,選擇「View in Browser」來作執行測試:</p> <p><a href="https://lh3.googleusercontent.com/-zLEovGwQuSg/Vy70gHyPCnI/AAAAAAAAEeQ/5WaCVl_220g/s1600-h/image%25255B2%25255D.png"><img title="View in Browser" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="View in Browser" src="https://lh3.googleusercontent.com/-YyGYdHVr93Y/Vy70g2Jym1I/AAAAAAAAEeU/A2XbmmfNndw/image_thumb.png?imgmax=800" width="399" height="187"></a></p> <p>當cs源碼裏執行有錯誤時,卻發現它出現是亂碼,即使在Web.config設定<customErrors>也無法正常顯示錯誤訊息。偶然一次機會裏,在執行jQuery AJAX存取某頁面View時,我發現在js裏可以讀出正常編碼。</p> <p>因此我安裝<a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop" target="_blank">Chrome Postman</a>這個套件,使用GET方式貼上測試頁面的網址(下圖編號2),即可產生正確的錯誤訊息。從此,這樣的方式就是我慣用的MVC專案除錯模式了。</p> <p><a href="https://lh3.googleusercontent.com/-GxLph6Sdxbw/Vy70hTIUiWI/AAAAAAAAEeY/FUMDRSTR7vU/s1600-h/image%25255B5%25255D.png"><img title="Chrome Postman" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Chrome Postman" src="https://lh3.googleusercontent.com/-07A54Df3s4Q/Vy70iBqCaTI/AAAAAAAAEec/KNdDzNUk4eM/image_thumb%25255B1%25255D.png?imgmax=800" width="698" height="659"></a></p> <p>在ASP.NET 4.6.1的MVC5 「Web Application」裏,每當異動了cs程式碼,均需重新Build Project,沒有「Website」專案自動編譯的方便功能,可惜MVC5並不完整支援Website專案。值得慶幸的是,WebApp正佈網站時,日後的cs異動只需要直接覆蓋主要的DLL即可,不需要像Website須重新Publish,算是功過相抵能接受。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-47197383421831883262016-05-11T16:28:00.000+08:002016-05-11T16:28:13.794+08:00使用Docker執行本機端Mono程序<p>Docker 和傳統虛擬化方式的不同之處,在於少了Guest OS這層,除了大幅減少磁碟空間,最重要是獲得本機的執行效能,直接使用本地主機的作業系統。詳細介可,可閱讀這份<a href="https://philipzheng.gitbooks.io/docker_practice/content/introduction/what.html" target="_blank">教學文件</a>。<br><a href="https://lh3.googleusercontent.com/-VgQhgpqzas0/Vyhh_oYt6xI/AAAAAAAAEcg/f2q6XjvbYBA/s1600-h/image%25255B29%25255D.png"><img title="Docker vs VM" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Docker vs VM" src="https://lh3.googleusercontent.com/-krdG7TgpFkE/VyhiAh_wuII/AAAAAAAAEck/pv2EQuWBOMg/image_thumb%25255B9%25255D.png?imgmax=800" width="701" height="483"></a></p> <p>一般而言,我們會在Docker Container虛擬環境中運行獨立服務,透過IP Port對映與外界Host溝通互動。在VMware裏有個Unity功能,可以把Guest VM虛擬環境下的視窗,拉到外面Host運行,感覺就像Host執行一個視窗程式一樣。</p> <p>Docker也可以透過共用目錄(Docker Volume)讓Host與Guest VM共用同一個資料夾,讓Guest VM去執行共用的程式碼,產生最後結果,再以TTY Console回報至Host,宛如是在本地Host端執行程序一樣。</p> <p>以下是示範步驟:</p> <ol> <li>在Ubuntu Linux下安裝Docker:<br># apt-get install docker.io<br>約45.4MB<br># docker -v<br>Docker version 1.10.3, build 20f81dd<br> <li>到Docker Hub尋找<a href="https://hub.docker.com/_/mono/" target="_blank">官方mono image</a>:<br><br>下載官方mono映像檔image:<br># docker pull mono<br><a href="https://lh3.googleusercontent.com/-C5FI7a3D6Lc/VyhiBWxhzvI/AAAAAAAAEco/oaUE9cHeUzo/s1600-h/image%25255B2%25255D.png"><img title="Pull Mono Image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Pull Mono Image" src="https://lh3.googleusercontent.com/-y-91pZzdYEc/VyhiCGhwA9I/AAAAAAAAEcs/mVZyMgD7XV0/image_thumb.png?imgmax=800" width="722" height="205"></a><br>查看該image資訊<br># docker images<br><a href="https://lh3.googleusercontent.com/-XukffRdgUbw/VyhiCnwmfTI/AAAAAAAAEcw/HPlt8jcrhuA/s1600-h/image%25255B5%25255D.png"><img title="Docker Images" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Docker Images" src="https://lh3.googleusercontent.com/-qQpbiB2fNgE/VyhiDOiBBYI/AAAAAAAAEc0/5R8IlRPN3nI/image_thumb%25255B1%25255D.png?imgmax=800" width="803" height="66"></a><br> <li>在建立mono container之前,我們先建立一個host與container共用目錄(Docker Volume)。<br># mkdir /opt/hello<br>建立host本地目錄,應用程式依常規放在/opt/下面(相當Windows的C:\Program Files\XXX)。<br><br># nano /opt/hello/hello.cs<br>建立主程式CS源碼。<br><a href="https://lh3.googleusercontent.com/-oha4D-wPFmI/VyhiDhOG6bI/AAAAAAAAEc4/2y71ipBg18Y/s1600-h/image%25255B8%25255D.png"><img title="Hello SourceCode" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Hello SourceCode" src="https://lh3.googleusercontent.com/-kCaYtZDQFuM/VyhiEMBhdkI/AAAAAAAAEc8/oTdEFr1zyTg/image_thumb%25255B2%25255D.png?imgmax=800" width="478" height="229"></a><br> <li>建立以mono image為主的container, 並掛載/opt/hello這個分享共用目錄。<br># docker <font color="#000000">run --name mono_container</font><font color="#c0504d"> <font color="#9b00d3">-v /opt/hello:/opt/hello</font> -d -i -t mono</font> <font color="#0000ff">/bin/bash</font><br>--name: 命名該container名稱<br>-v: 建立分享Volume目錄,指定目錄的對應關係 host_path:container_path<br>-d: 該Container以Daemon方式運行,避免建立container時初始狀態為Exited。<br>- i –t: 以-i (Interactive)互動方式及獲取-t (TTY)運行container中的/bin/bash環境。<br>mono: 指定Image name或ID.<br><a href="https://lh3.googleusercontent.com/-KBOmPaRxfYc/VyhiEobQqtI/AAAAAAAAEdA/VihQa64b9CA/s1600-h/image%25255B26%25255D.png"><img title="Container Run" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Container Run" src="https://lh3.googleusercontent.com/-BrEASC8E3LU/VyhiFfXnCoI/AAAAAAAAEdE/upsymO5qAm4/image_thumb%25255B8%25255D.png?imgmax=800" width="878" height="109"></a><br>使用 docker ps -a查詢目前container狀態,此container(mono_container)虛擬環境正在運行中。<br> <li>日後要呼叫此container下的虛擬環境及服務,只需要在Host本機輸入docker exec指令即可。<br># docker exec mono_container <font color="#0000ff">mono -V</font><br>查詢container下的mono版本資訊<br><a href="https://lh3.googleusercontent.com/-8y-541FQMYE/VyhiGJDbm9I/AAAAAAAAEdI/0Rvgx01xlRk/s1600-h/image%25255B14%25255D.png"><img title="Mono Version" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Mono Version" src="https://lh3.googleusercontent.com/-0ce67T508YE/VyhiGyIyFCI/AAAAAAAAEdM/ydOLF4ZI45I/image_thumb%25255B4%25255D.png?imgmax=800" width="792" height="205"></a><br><br>因此,編譯及執行Host端的/opt/hello/hello.cs源碼檔,意義和修改Guest VM端裏的檔案是同一份的。<br># docker exec mono_container <font color="#0000ff">mcs /opt/hello/hello.cs<br></font>它會編譯hello.cs,並產生hello.exe這個IL檔。<br><a href="https://lh3.googleusercontent.com/-xCHY-iby3FY/VyhiHRwyPqI/AAAAAAAAEdQ/c28GRXAq9iM/s1600-h/image%25255B20%25255D.png"><img title="Docker Exec" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Docker Exec" src="https://lh3.googleusercontent.com/-hQeGGdqhSUU/VyhiIGqqOuI/AAAAAAAAEdU/7hBmap3niwQ/image_thumb%25255B6%25255D.png?imgmax=800" width="697" height="109"></a><br><br>日後在host環境,要執行NET程式,使用以下指令即可:<br># docker exec mono_container <font color="#0000ff">mono /opt/hello/hello.exe</font><font color="#0000ff"><br></font><a href="https://lh3.googleusercontent.com/-qHGIQHxWP0c/VyhiImneoaI/AAAAAAAAEdY/81ET_lXDXEE/s1600-h/image%25255B23%25255D.png"><img title="Docker Mono" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Docker Mono" src="https://lh3.googleusercontent.com/-uf576ojRh3Y/VyhiJVU6DPI/AAAAAAAAEdc/VaJ1_4p1KtM/image_thumb%25255B7%25255D.png?imgmax=800" width="614" height="143"></a><br> <li>若主機reboot重開機,該docker container不會自動運行,可加入rc.local自動運行:<br># vi /etc/rc.local<br>加入此行指令即可。<br>docker start mono_container</li></ol>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-54300106411527698512016-05-04T21:34:00.000+08:002016-05-04T21:34:05.602+08:00LINQPad Command Script自動化<p>我使用LINQPad不是用來查LINQ或SQL,而是把它當作程式產生器,增加編程的工作效率。後來發現它有提供Command-Line的執行模式(lqrun.exe),可以讓伺服器主動透過Schedule排程,定期自動執行一些管理工作,例如每日備份資料庫,FTP上傳到異地備援主機,並刪除超過30天前的舊檔案。你不再需要學習語法難用的Batch File或其他Shell Script,單單純純地執行C# Script即可。</p> <p>LINQPad免費版本在執行階段沒什麼限制,放在伺服器端跑Task Scheduler批次工作,十分完美搭配。</p><pre class="brush: csharp">"C:\LINQPad\lprun.exe" "C:\Task\hello.linq"
</pre>
<p><a href="https://lh3.googleusercontent.com/-aCjgJF2oOYs/VxopeysPoFI/AAAAAAAAEYA/52gGZZtIpxk/s1600-h/image%25255B5%25255D.png"><img title="Task Scheduler Action" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Task Scheduler Action" src="https://lh3.googleusercontent.com/-OnDS-Xnj65c/VxopfmRnYmI/AAAAAAAAEYE/3urMKAVCxks/image_thumb%25255B1%25255D.png?imgmax=800" width="451" height="243"></a></p>
<p>關於更多LINQPad內建功能,請詳見以下連結:</p>
<p>LINQPad Command-Line and Scripting<br><a title="http://www.linqpad.net/lprun.aspx" href="http://www.linqpad.net/lprun.aspx">http://www.linqpad.net/lprun.aspx</a></p>
<p>LINQPad Extension Methods - Stack Overflow<br><a href="http://stackoverflow.com/questions/3555317/linqpad-extension-methods">http://stackoverflow.com/questions/3555317/linqpad-extension-methods</a></p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-2250652974765322122016-04-29T00:56:00.000+08:002016-04-29T01:02:07.504+08:00System UpTime系統已運行時間在Win7/2008以後,使用Task Manager可以查看系統已運行時間統計,但舊系統XP/2003系統裏必須使用指令systeminfo查看開機時間,此指令也會因執行權限而有所受限,只能靠微軟提供的外掛Command指令<a href="http://uptimeexe.codeplex.com/" target="_blank">uptime</a>工具。<br><a href="https://lh3.googleusercontent.com/-wYao8LofXzY/Vw3-NZzs8pI/AAAAAAAAEW4/Yop54W65ZVE/s1600-h/image8.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-kmx24BooyCM/Vw3-N_pXd5I/AAAAAAAAEW8/ijdjh8_OfKw/image_thumb2.png?imgmax=800" width="633" height="451"></a><br>為了簡化流程,因此開發了一個簡單的UI工具來查詢系統已運行時間。顯示介面支援多國語言顯示框架,用戶可以自行擴充其他語言及字詞(在Language子目錄仿作)。<br> <a href="https://lh3.googleusercontent.com/-m2BXCbas0Vw/Vw3-OiA479I/AAAAAAAAEXA/CI699Ys3SCs/s1600-h/image2.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-1rNDqxEb86s/Vw3-PbMnW9I/AAAAAAAAEXE/n-6_SMMdH4Q/image_thumb.png?imgmax=800" width="509" height="336"></a><br>為了能讓UI介面高客製化,相關設定皆定義在Config.json檔中,您可自行修改。例如畫面的長寬、重疊置頂(TopMost)、字體Size皆能調整,並支援畫面上的時間字串格式化顯示、自動刷新間隔秒數。<br><a href="https://lh3.googleusercontent.com/--pDWbeUljAI/Vw3-QIhmS_I/AAAAAAAAEXI/DhKtpxr-TcE/s1600-h/image5.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-UneGP8wiEFs/Vw3-Q_fsWcI/AAAAAAAAEXM/3hEOPvT35Zo/image_thumb1.png?imgmax=800" width="520" height="349"></a><br> <h1>Version History:</h1><strong><span style="font-size: medium">2016/04/29:</span></strong><br> <ol> <li>設計此工具的專屬Web網站,提昇軟件品質形象,也方便用戶查看及下載。 <li>Config中的下載網址異動默認值,相容最小版次值為20160429。 </li></ol><strong><span style="font-size: medium">2016/04/22:</span></strong><br> <ol> <li>將畫面自訂長寬Size調整納入「Save Preferences」的儲存範圍內,它會自動計算表單的Width/Height Offset的值。 <li>表單預設寬度,由原本3位數的Days,縮減至2位數的寬度。 </li></ol> <h1>Download: <span style="font-size: medium">(.NET 4.6.1 Required, 綠化免安裝)</span></h1> <h1><a href="http://misagent.github.io/SystemUpTime/" target="_blank"><span style="font-size: medium">前往下載頁面</span></a></h1>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-71310282215524890182016-04-27T03:33:00.000+08:002016-04-29T02:11:37.526+08:00免費Free Private Git Server<p>GIT是一種分散式控本控管工具,適用程式源碼或者任何多次多次編改的文件管理。Git入門教學,很推薦林慶哲先生所寫的「<a href="https://kingofamani.gitbooks.io/git-teach/content/chapter_2/git.html" target="_blank">開始進入GIT世界 | GIT教學</a>」文章。強烈建議您一定要從打git command指令來入門(教學文章裏有批次指令可複製貼上,不需死記但要測試效果),才能理解不同git指令之間的差異,等學會之後才使用UI工具「<a href="https://tortoisegit.org/" target="_blank">TortoiseGit</a>」。因為遠端GIT Server服務頁面都會提供git該如何存取它的指令,假如不懂指令架構,又如何理解UI工具上的名詞所代表的背後git動作呢?</p> <p>要架設Private Git Server服務,目前沒有像<a href="https://www.visualsvn.com/server/download/" target="_blank">VirualSVN Server</a>這樣容易架設SVN服務的整合型軟件,而知名的<a href="https://github.com/" target="_blank">GitHub</a>服務要建立Private Repository是要付費的,因此我根據以下的網路討論串,試用了各種被推薦免費的免費 Private Git雲端服務:</p> <p>Revision Control Systems: What is the best free service that hosts private Git repositories? - Quora<br><a href="https://www.quora.com/Revision-Control-Systems-What-is-the-best-free-service-that-hosts-private-Git-repositories">https://www.quora.com/Revision-Control-Systems-What-is-the-best-free-service-that-hosts-private-Git-repositories</a></p> <p>依其服務功能、限制性及有前景不易倒閉的前提下,擇出兩個較佳Private Git雲端服務:<br></p> <ol> <li>微軟<a href="https://www.visualstudio.com/" target="_blank">Visual Studio Team Services</a> (VSTS)的免費Git服務:<br>免費無限制的Private Repository,但Free Users限5人. 由於VS2015內建這樣的服務及git工具,因此若開發團隊人數不多的話,會優先推薦使用這個,雖然不是很喜歡它的遠端管理介面。實測它的上傳速度最快約為每秒300KB左右。<br><a href="https://lh3.googleusercontent.com/-4sUil1ZrJXo/VxKU__lIjyI/AAAAAAAAEXk/QA6vS9c-JY4/s1600-h/image%25255B8%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-triK1LXLvdY/VxKVA3vgoyI/AAAAAAAAEXo/Nx6Ge3YdGUM/image_thumb%25255B2%25255D.png?imgmax=800" width="342" height="313"></a> <li><a href="https://about.gitlab.com/" target="_blank">GitLab</a>雲端服務:<br>GitLab雲端免費服務基本沒什麼限制,且提供自架伺服器軟件<a href="https://about.gitlab.com/downloads/" target="_blank">GitLab Community Edition</a> (Linux Platform based),而且專案網址很短,管理介面比較像GitHub一樣簡潔清楚。<br><a href="https://lh3.googleusercontent.com/-KDLH_tVbTBQ/VxKVB04akhI/AAAAAAAAEXs/M0uMMg8nFeg/s1600-h/image%25255B5%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://lh3.googleusercontent.com/-yj953fm-rdI/VxKVCgE-1XI/AAAAAAAAEXw/njPwS6wcqCI/image_thumb%25255B1%25255D.png?imgmax=800" width="419" height="379"></a> </li></ol> <p>以上就依自己的需求來選擇Git雲端服務商,在免費的前提下,Public Repository我會優先使用GitHub, 個人獨用的NET專案會使用微軟VSTS,若是和別人合作開發的Private專案,則會使用GitLab服務。</p> <p>至於另一種透過DropBox分享和別人同步Git目錄的方式並不推薦,因此一般免費帳號才2GB空間,專案不僅只會放程式碼,還會放文件或圖檔的,這點小小空間實在不夠用。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-16723363336513608602016-04-20T19:16:00.000+08:002016-04-22T21:36:10.393+08:00完美將TXT轉成電子書epub/mobi檔要將TXT轉換成epub/mobi電子書格式,很多人一開始會選用<a href="http://ebook.online-convert.com/convert-to-mobi" target="_blank">online-convert</a>, <a href="http://www.convertfiles.com/" target="_blank">Convert.Files</a>等線上轉換服務,但它轉換速度不快,對章節擷取不一定正確,也有人用<a href="http://calibre-ebook.com/download_portable" target="_blank">Clibre</a>這套Windows下知名的電子書閱讀軟件來轉換,但它內建的轉換操作介面太過複雜。因此我推薦使用<a href="http://www.hi-pda.com/forum/viewthread.php?tid=645717" target="_blank">EasyPub</a>這個綠化工具程式,只需要幾個很簡單的步驟,就能把TXT純文字檔轉成高品質、排版性佳的epub/mobi電子書格式。<br />
以下是轉換步驟:<br />
<ol>
<li>網上搜尋被推薦的書名,並下載該書TXT純文字檔案,很多網上連載小說網站均有提供。</li>
<li>利用<a href="http://blog.miniasp.com/post/2008/10/24/Useful-tool-ConvertZ.aspx" target="_blank">ConvertZ</a>中文繁簡工具,將TXT檔案BIG5/GB2312轉成UTF8編碼的格式(檔案Size會變大)。</li>
<li>開啟下圖EasyPub工具,拉入或指定來源TXT檔案(編號1),輸出副檔名(編號2)預設是.epub檔,若想轉成Kindle格式,改成.mobi檔即可。<br /><a href="https://lh3.googleusercontent.com/-EJGV-ezlhG0/Vv0HQBxe2vI/AAAAAAAAEUk/Pf4IDj-I8NM/s1600-h/image%25255B2%25255D.png"><img alt="image" border="0" height="428" src="https://lh3.googleusercontent.com/-rV0QGSXRuic/Vv0HQtQ5k0I/AAAAAAAAEUo/my64mYEnE74/image_thumb.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="487" /></a></li>
<li>具有章節索引對於電子書查閱很重要,先打開TXT檔我們發現下圖40行的章節寫法規則,是前面有空白字元,接著「第X章 章節名稱」,因此它的編寫規則都是上圖編號3的方式,點擊編號4按鈕「章節編輯」來預覽判讀結果。<br /><a href="https://lh3.googleusercontent.com/-3d9mgiGAJXo/Vv0HRK5jMPI/AAAAAAAAEUs/OjKAFMWM7NE/s1600-h/image%25255B11%25255D.png"><img alt="image" border="0" height="304" src="https://lh3.googleusercontent.com/-A_uyhIbGNM8/Vv0HRnAFLkI/AAAAAAAAEUw/vGC4_k0yPdA/image_thumb%25255B3%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="631" /></a></li>
<li>程式會依章節規則取出符合的項目名稱,但此TXT檔例子它的每個章節都有重複名,因此可以勾選下圖編號2,凡該章節下的內文不超過1行則刪除,即可呈現不重複的章節項目(下圖編號1)。<br /><a href="https://lh3.googleusercontent.com/-99MCSAzgJos/Vv0HSejzrQI/AAAAAAAAEU0/IQcIZ7Md2jo/s1600-h/image%25255B17%25255D.png"><img alt="image" border="0" height="457" src="https://lh3.googleusercontent.com/-4G_aAcv3mXs/Vv0HSh9J8LI/AAAAAAAAEU4/rBRTgKsH7Hk/image_thumb%25255B5%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="568" /></a></li>
<li>針對這本書的相關規則設定,你都可以儲存起來(*.epsav),若該TXT檔是連載中的小說,你就可定期依以上步驟快速產生完美的轉換過程。最後回到主畫面,點擊「開始轉換」按鈕,就可以產生epub及mobi檔案。</li>
<li>使用Clibre閱讀程式來觀看效果,章節判讀很正確,下圖編號3章節名稱呈現會有區塊底色,但實際在手機電子書軟件「<a href="https://play.google.com/store/apps/details?id=com.flyersoft.moonreader&hl=zh_TW" target="_blank">Moon+ Reader</a>」或Kindle實際閱讀時,均不會有這樣礙眼的底色。頁面的配色效果,也可以在EasyPub工具的「定製CSS」中自訂。<br /><a href="https://lh3.googleusercontent.com/-Cj5WY4hjp78/Vv0HTd_3TfI/AAAAAAAAEU8/YjcTpcTpIlI/s1600-h/image%25255B20%25255D.png"><img alt="image" border="0" height="450" src="https://lh3.googleusercontent.com/-M03qhF99-lw/Vv0HT-90ynI/AAAAAAAAEVA/h18OCRoJFzc/image_thumb%25255B6%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="724" /></a></li>
</ol>
tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-62626494670269343592016-04-10T10:44:00.000+08:002016-04-09T23:48:34.524+08:00資料庫好幫手SqlDbUtility工具<p>SQL Server雖然已是一個很友善操作的資料庫(以下簡稱DB),不過其管理工具SQL Server Management Studio(簡稱SSMS)裏的某些Task操作流程過於冗長,我將其比較常用的功能寫成一個Console獨立程式,它可被第三方陰影備份工具或自動化批次檔呼叫使用,比起受限在SSMS的排程工具,多了一些寬廣的選擇。</p> <p><a href="https://lh3.googleusercontent.com/-eRTkbMyKHXY/VvWD7TeoE3I/AAAAAAAAETc/MliG4d04HN0/s1600-h/image%25255B2%25255D.png"><img title="App Usage" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="App Usage" src="https://lh3.googleusercontent.com/-zO43uTjw-po/VvWD8dvSFaI/AAAAAAAAETg/jtvNbRyIhbI/image_thumb.png?imgmax=800" width="731" height="576"></a><br><br>以下介紹它的指令功能 (<span style="color: red">請使用*.bat批次檔來執行它,省得每次重複打字</span>)</p> <p><strong>DB終止使用中連線Kill</strong><br>SSMS裏很多動作在未強制踢出使用連線,是無法進行操作的,此工具會將該DB所有的SPID (Server Process ID)強制踢除,以進行後續工作。<br><span style="color: navy">App.exe -d tempdb -x killspid</span><br><span style="color: navy"><br></span><strong>指定Config內ConnectionString的Key值</strong><br>為了在同一個bat批次檔執行不同的DB連線,可以在App.config內設定不同的connectionStrings值,再利用-k參數來指定DB連線字串的KeyName,預設值為Default。<br><span style="color: navy">App.exe -d tempdb -x killspid -k "Local"</span><br><a href="https://lh3.googleusercontent.com/-t_YHVKX72dQ/VvWD9Dy9d9I/AAAAAAAAETk/G5zvoacaC7M/s1600-h/image%25255B5%25255D.png"><img title="ConnString" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="ConnString" src="https://lh3.googleusercontent.com/-VRaUcqlDIcQ/VvWD997lhkI/AAAAAAAAETo/qMSPho0RsC8/image_thumb%25255B1%25255D.png?imgmax=800" width="496" height="134"></a></p> <p><br><strong>DB離線Offline</strong><br>要替換不同版本的DB內容,不須Detach/Attach資料庫,只需把DB執行離線Offline動作,其MDF/LDF資料檔就不會呈現In Used,可以直接蓋檔。然而,在SSMO下若該DB有人連線使用中,離線指令會失敗,因此本工具會先踢出該DB連線ID, 再執行離線指令。<br><span style="color: navy">App.exe -d tempdb -x offline</span><br><span style="color: navy"><br></span><strong>DB上線Online</strong><br>未online的DB無法後續操作,因此替換MDF檔案後可啟用。<br><span style="color: navy">App.exe -d tempdb -x online</span><br><strong><br></strong><strong>DB備份Backup</strong><br>自從知道offline DB能換MDF檔後,已很少使用Backup指令了。輸出檔名支援NOW時間格式字串。若未指明路徑,會在Working Directory下建立以DB+日期為名的備份檔。<br><span style="color: navy">App.exe -d tempdb -x backup -f "D:\db_{0:yyyyMMddHHmmss}.bak"</span><br><strong><br></strong><strong>DB還原Restore</strong><br>此指令是以覆蓋Replace方式還原DB,其bak中記錄的MDF/LDF路徑,因此要注意這些細節。若是重要的DB還原,還是透過SSMS工具比較清楚安全。<br><span style="color: navy">App.exe -d tempdb -x restore -f "D:\</span><span style="color: navy">db_{0:yyyyMMddHHmmss}.bak</span><span style="color: navy">"</span><br><strong><br></strong><strong>DB壓縮Shrink</strong><br>對DB進行最小資料壓縮,保留可用空間0%。<br><span style="color: navy">App.exe -d tempdb -x shrinkdb</span><br><br><strong>DB清空表格內資料Truncate</strong><br>清除DB內所有Table裏的資料內容,個人喜歡用Truncate Table指令,因為它會Reseed Identity欄位。單一表格時清除資料,可能因為正規化Constraint限制而無法執行,因此提供了一道清除DB內所有表格資料的強制指令,它會避開Constraint/Trigger等限制。<br><span style="color: navy">App.exe -d tempdb -x truncateTable -t TABLE_NAME // 依正規化清除單表資料<br>App.exe -d tempdb -x truncateTable -t * // 避開正規化清除所有表格資料</span><br><strong><br></strong><strong>SQL Script檔案執行</strong><br>執行SQL Script檔案內容,不回傳結果。<br><span style="color: navy">App.exe -d tempdb -x sqlExec -f "D:\in.sql"</span><br><strong><br></strong><strong>SQL Script檔案查詢</strong><br>執行SQL Script檔案內容,並將查詢結果顯示console上,也可以把結果輸出至CSV檔案。<br><span style="color: navy">App.exe -d tempdb -x sqlQuery -f "D:\in.sql"<br>App.exe -d tempdb -x sqlQuery -f "D:\in.sql" > "D:\out.csv"</span><br><a href="http://lh6.ggpht.com/-UOCghraAy60/U_hNKFCBvXI/AAAAAAAACek/nsDkFo4WK-0/s1600-h/image%25255B5%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="http://lh4.ggpht.com/-LGlfLZBBClI/U_hNLa2ieHI/AAAAAAAACes/y706IigjMCc/image_thumb%25255B1%25255D.png?imgmax=800"></a> <br><strong><br></strong><strong>清除表格/欄位的註解資訊Description</strong><br>Table欄位有附上註解是好事,尤其在EF架構裏能被引入,對於開發階段很有幫助。若在發行Client單機板程序時,可以清除這些註記,達到保護用途。<br><span style="color: navy">App.exe -d tempdb -x clearDesc</span><br><span style="color: navy"><br></span><strong>重置表格內Identity欄位值為目前最大值</strong><br>Table的Identity欄位值若想重置(Reseed)為目前欄位的最大值,可以使用這指令來重設,例如Seed值為1000,但實際最大值為50,經過重置後Seed值會變成50。<br><span style="color: navy">App.exe -d tempdb -x identMax -t "Table1" -c "Column1"<br></span><strong><br>刪除表格 DropTable</strong><br>支援刪除多個Table表格(支援*號),可鎖定在某schema owner上。<br><span style="color: navy">App.exe -d tempdb -x dropTable -t "a*" [-s "SchemaName"]<br></span>Changed database context to 'tempdb'.<br>DROP TABLE [dbo].[a1]... [OK]<br>DROP TABLE [dbo].[a2]... [OK]<br>DROP TABLE [dbo].[a3]... [OK]<br>Total 3 tables has dropped.</p> <p><span style="color: navy"><br></span><strong>修改表格Schema擁有人</strong><br>修改多個Table表格(支援*號)的Schema Owner,方便調測用戶權限。<br><span style="color: navy">App.exe -d tempdb –x altTableSchema -t "Table1*" -s "OldName,NewName"<br></span><strong><br>取得目前Client連線數量</strong><br><span style="color: navy">App.exe -x cltConnCount<br></span>3</p><strong>取得目前Client連線狀態</strong><br><span style="color: navy">App.exe -x cltConnStatus<br></span>Status Count AppName<br>sleeping 1 Microsoft SQL Server Management Studio<br>sleeping 1 Microsoft SQL Server Management Studio - Query<br>running 1 SqlDbUtility <p><strong><br>查看SQL Server引擎版本</strong><br><span style="color: navy">App.exe -x version<br></span>Microsoft SQL Server 2014 - 12.0.4100.1 (X64)<br> Apr 20 2015 17:29:27<br> Copyright (c) Microsoft Corporation<br> Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)</p><span style="color: navy"></span><strong> <p><br>檢查資料庫完整性CheckDb<br></strong>檢查訊息可在Console呈現,也可寫入文字檔案。<br><span style="color: navy">App.exe -d tempdb -x checkDb > “D:\health.txt”</span></p> <p><br><br><b><span style="font-size: large">更新記錄:</span></b></p> <p><strong>2016/03/26 Version History:</strong></p> <li>新增「刪除表格DropTable、修改表格Schema」等2道Table操作指令。 <li>新增「讀取Client連線數量/狀態, 查看SQL Server版本, 檢查CheckDb完整性」等4道DB資訊指令。 <li>調整指令說明及語法範例的顯示,指令改斷義首字大寫說明,但大小寫不影響執行結果。 <p><strong>2016/01/05 Version History:</strong></p> <li>調整執行指令的參數為x,取代之前的c值。 <li>調整命令「shink」為「shinkdb」。 <li>調整c參數意義為Column Name。 <li>調整restore命令,加入執行前先踢除使用中連線,並能讀取日期格式化字串檔名。 <li>新增指定app.config內的connectioin string鍵值(-k參數)。 <li>新增s參數為讀取相關string字串(未來用途) <li>新增重置Reseed表格Identity值為目前的最大值的新命令(identmax)。 <p><strong>2014/08/23 Version History:</strong> </p> <li>初版Release,下載含本文Help說明件. <li>發佈前因停電導致程式源檔損毀,無奈下重寫主程序,也相較之前版本增加了4道指令。 <p> </p> <p><b><span style="font-size: large">程式下載</span>:(.NET 4.0 Required, Portable, Size: 140KB)</b><br>[<a href="http://pan.baidu.com/s/1eSEuivK">百度雲盤</a>: SqlDbUtility_20160326.rar] </p></li>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-3539016741689580232016-04-06T16:57:00.000+08:002016-04-06T19:20:36.918+08:00[APP]CALCU Stylish Calculator時尚計算器使用15年的CASIO fx-350TL計算器,發現4位數左下直豎顯示壞了(這個損壞問題很難被發現,是在寫時間秒數推算程式時發現是計算器的初值有錯),也不打算重買,畢竟手機APP有很多計算器軟件可取代。<br />
<a href="https://lh3.googleusercontent.com/-2n4YjsaHJBc/Vu0U0LUBSiI/AAAAAAAAESc/VG1j6PnBlfU/s1600-h/image%25255B2%25255D.png"><img alt="Calc Broken" border="0" height="321" src="https://lh3.googleusercontent.com/-U52Qr7NjJK4/Vu0U0wEmFnI/AAAAAAAAESg/jV_ksR4pn20/image_thumb.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Calc Broken" width="527" /></a><br />
用過工程型計算器之後,才會發現有優先次序的括號及運算式可顯示、調整是很重要,這樣才能檢查是否按錯。因此我開始在Google Play裏試用所有比較知名的計算器APP,主要訴求有幾點:<br />
<ol>
<li>獨立的APP,而非廠牌手機內建的(換手機就不擔心)。</li>
<li>有括號()按鍵。</li>
<li>要能顯示運算式及調整修改。</li>
<li>常用鍵位分佈要相近。</li>
<li>進階工程按鍵若有更好(加分)</li>
</ol>
最後勝出的是CALCU Stylish Calculator這個APP軟件。<br />
<a href="https://lh3.googleusercontent.com/-TcdMTXYZdhM/Vu0U1q4FK8I/AAAAAAAAESk/nnxefhjiCMY/s1600-h/image%25255B5%25255D.png"><img alt="Calc APP UI" border="0" height="405" src="https://lh3.googleusercontent.com/-Swt3DIGRg3A/Vu0U2YXCxYI/AAAAAAAAESo/ajfCHAwCPj4/image_thumb%25255B1%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Calc APP UI" width="356" /></a><br />
CALCU™時尚計算機 - Google Play Android 應用程式<br /><a href="https://play.google.com/store/apps/details?id=com.candl.athena">https://play.google.com/store/apps/details?id=com.candl.athena</a><br />
它的優點有:<br />
<ol>
<li>顯屏下方顯示運算式,手指點位置可作修改,且不需要按=號,隨時就能得到計算結果。</li>
<li>顯屏手勢往下滑就有運算式歷程(History),隨時能點項目出來修改重算。</li>
<li>數字按鍵盤手勢往上滑就能出現其他工程型功能按鍵,不用在小小屏幕裏顯示所有工程按鍵,能簡化呈現。</li>
<li>多種外觀Style顏色可選擇,計算結果按一下就可複製文字,貼到別處。</li>
<li>按鍵能震動(能減少按錯,但它的震值有點太大),數字顯示能千位逗號且換字型。</li>
<li>免費版上方有廣告,但不影響顯屏數字,付費版66元台幣很值得。</li>
</ol>
這APP是在Play市場上經過實際試裝各種計算器APP後,最後最後盲選勝出的,非常值得推薦。tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-41521706578477409322016-04-03T16:10:00.000+08:002016-04-03T16:10:18.705+08:00Xamarin.Android官方教學視頻<p>由於微軟於Build2016宣布Xamarin全面免費且開源(Open Source),估計Xamarin社群力量會蓬勃發展,官網提供了一鍵安裝所有環境的<a href="https://store.xamarin.com/" target="_blank">Xamarin Installer</a>,也提供了Developer<a href="https://developer.xamarin.com/videos/" target="_blank">教學視頻</a>。</p> <p><a href="https://lh3.googleusercontent.com/-rvpsSTkpWjA/VwDNyksG86I/AAAAAAAAEVk/97Wt4fo9a4k/s1600-h/image%25255B2%25255D.png"><img title="Xamarin Videos" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Xamarin Videos" src="https://lh3.googleusercontent.com/-lnvChNsrGZs/VwDNz66xJVI/AAAAAAAAEVo/B9__GUUe_J8/image_thumb.png?imgmax=800" width="895" height="551"></a></p> <p>針對Android開發部分,我覺得這些線上教學視頻做得非常好,雖然是講英文的,但簡報教材上都提供簡短的名詞解釋及示意圖,十分淺顯易懂。每份視頻長度約1小時,建議大家觀看。</p> <ol> <li>Installing Xamarin on Windows (51MB, <a href="https://embedwistia-a.akamaihd.net/deliveries/212ff7d094899fcd4ef0740361255af98a507684/file.mp4" target="_blank">720P影片下載</a>) <li>Introduction to Xamarin.Android (281MB, <a href="https://embedwistia-a.akamaihd.net/deliveries/301ccf01ead36402970feb0e056370926abd7355/file.mp4" target="_blank">720P影片下載</a>) <a href="http://xamarin-releases.s3.amazonaws.com/visual-studio-dev-essentials/Android%20Materials.zip" target="_blank">示範程式碼下載</a> <li>Activities and Intents (306MB, <a href="https://embedwistia-a.akamaihd.net/deliveries/882ce3b1bce48f255f95b6e41b50577f29fad316/file.mp4" target="_blank">720P影片下載</a>)</li></ol>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-83878043935524456952016-03-31T20:06:00.001+08:002016-03-31T20:10:05.610+08:00台灣3+2郵遞區號查詢<p>相較郵局官網或其他台灣郵遞區號3+2查詢程式,此軟件的主要特色除了綠化免安裝外,它能自己匯入郵局官網下載的郵編3+2 XML檔,方便離線查詢。它不需要繁瑣的鄉鎮下拉選單UI,只需要打入多個交叉查詢關鍵字(中間隔空白),即可以迅速過濾交集資料。</p> <p> <a href="http://lh5.ggpht.com/-VxCRSmGIqB8/U1l8NFx3dAI/AAAAAAAACJA/BN_PHFTORpE/s1600-h/image%25255B10%25255D.png"><img title="Main UI" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Main UI" src="http://lh5.ggpht.com/-HVq1GqXsxqA/U1l8Ny-gNFI/AAAAAAAACJI/ZNiWnzHmesM/image_thumb%25255B5%25255D.png?imgmax=800" width="620" height="490"></a> </p> <p>程式直接使用<a href="http://www.post.gov.tw/post/internet/Download/index.jsp?ID=220306" target="_blank">台灣郵局下載專區</a>的「3+2 郵遞區號XML」為來源資料,官方資料會定期更新,你可以在*.exe.config檔裏對映它的XML節點名稱:</p> <p> <a href="http://lh5.ggpht.com/-Ifb9XtPBYJk/U845YmScRdI/AAAAAAAACY4/OgigGFPT3Es/s1600-h/image%25255B9%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="http://lh3.ggpht.com/-zT0H2UhIYpQ/U845ZS_3nlI/AAAAAAAACZA/vis97WGSdy0/image_thumb%25255B5%25255D.png?imgmax=800" width="622" height="345"></a> </p> <p>「Optimize ZIP XML」功能是將官方XML檔裏刪除無謂的空白字元,讓檔案更小,並且依使用習慣作以下批次規則的轉換。</p> <p><a href="http://lh3.ggpht.com/-bkupkPWNq9Q/U1l4dfggJkI/AAAAAAAACIs/xD7On9z_2xI/s1600-h/image%25255B5%25255D.png"><img title="Optimizing Rules" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Optimizing Rules" src="http://lh6.ggpht.com/-3nG0Pr8jlZs/U1l4eBxoqnI/AAAAAAAACI0/mbiHxttHeBU/image_thumb%25255B2%25255D.png?imgmax=800" width="365" height="204"></a> </p> <p>支援簡體中文的關鍵查詢字串,也可在config中指定輸出字串為繁簡中文及全形、半形。查詢出來的地址,點一下就可複製。</p> <p><a href="http://lh5.ggpht.com/-QqK8yDJpWW0/U845aLASlLI/AAAAAAAACZI/r82UE8t66DY/s1600-h/image%25255B14%25255D.png"><img title="Chinese Support" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Chinese Support" src="http://lh3.ggpht.com/-yQr87mhJoxo/U845a42tH9I/AAAAAAAACZQ/PgsWN6--8_o/image_thumb%25255B8%25255D.png?imgmax=800" width="621" height="279"></a> </p> <p><font size="4"><strong><font size="5">版本歷史 (Version History)</font></strong></font></p> <p>2016/03/31:</p> <ol> <li>更新台灣郵局3+2 XML資料版本為Zip32_10501.xml,官網2016/02/15更新(資料量為61,904筆)。</li> <li>修正官網下載的Zip32_10501.xml,結束xml節點錯誤的問題。</li></ol> <p>2015/08/27:</p> <ol> <li>更新台灣郵局3+2 XML資料版本為2015/08/07(目前有61,663筆)。</li></ol> <p>2015/02/09:</p> <ol> <li>地址輸出的繁簡切換及全半形字元的設定值,默認皆改成「None」,代表不轉換而直接使用原生資料。</li></ol> <p> </p> <p><font size="4"><strong><font size="5">程式下載 (Download)<br></font></strong></font>.NET 4.0 Required, Portable, Size: 502KB,內含郵局官網2016-02-15更新的郵編XML檔<font size="4"><br></font><a href="http://pan.baidu.com/s/1qYT99jY" target="_blank"><font size="4">百度雲盤</font></a><font size="4"> (TaiwanZipCode_20160331.zip)</font></p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0tag:blogger.com,1999:blog-1697525236478587733.post-19515271692126846332016-03-30T16:17:00.001+08:002016-03-30T16:17:02.973+08:00修正LibreOffice Calc加總欄位不會自動更新問題<p>為了減少對微軟Excel的倚賴,我逐步慢慢把平時常用Excel記帳表轉成免費軟件LibreOffice Calc 5.x軟件,當然我是利用Calc開啟舊Excel檔,經過調整後再另存成Open Document Spreadsheet (*.ods)格式。有一天發現此檔的加總欄位SUM值,竟然不會在區間欄位值異動時自動計算加總,查了一下原因,原來是Calc對於Excel檔案及其他軟件的ODS檔並不會主動重新計算,算是不相容的理由。<br><a href="https://lh3.googleusercontent.com/-ZYDuf1GxM1U/Vu0LZq43InI/AAAAAAAAER4/h4GH9NtwrDI/s1600-h/image%25255B2%25255D.png"><img title="Sum Columns" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Sum Columns" src="https://lh3.googleusercontent.com/-sVgxMOKsfdY/Vu0LaQ03pyI/AAAAAAAAER8/4SvZ6XLAtWI/image_thumb.png?imgmax=800" width="280" height="230"></a></p> <p>在Calc的「Tools/Options/LibreOffice Calc」可以看到這樣的開啟選項。此處不需要調整為「自動重計算」,因為不相容的檔案最好保持原來初值就好,強制重算反而會有計算錯誤問題。</p> <p><a href="https://lh3.googleusercontent.com/-XzT0-CVfOhg/Vu0LbBwu3II/AAAAAAAAESA/5jF0DqynXhk/s1600-h/image%25255B5%25255D.png"><img title="Calc Formula" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Calc Formula" src="https://lh3.googleusercontent.com/-ExnSvYrbgCg/Vu0LbniEd-I/AAAAAAAAESE/kjSSkVlJHPM/image_thumb%25255B1%25255D.png?imgmax=800" width="607" height="132"></a><br><br>解決之道把目前的ods檔另存(Save a copy)成Excel檔(*.xlsx),然後使用Calc開啟這個另存的xlsx檔,再作一次另存成*.ods檔案(此時就是Calc支援的新ODS版本),就可修正不會自動加總的問題了。</p> <p><a href="https://lh3.googleusercontent.com/-zBTUNTuVbME/Vu0LcBn9DXI/AAAAAAAAESI/envbA80RUhM/s1600-h/image%25255B8%25255D.png"><img title="Save as type" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Save as type" src="https://lh3.googleusercontent.com/-mry-WzVR4_g/Vu0Lc0EAyaI/AAAAAAAAESM/UPxdV-ucE0k/image_thumb%25255B2%25255D.png?imgmax=800" width="342" height="165"></a></p> <p>若你不是重度使用微軟Excel的財務/會計,或需和別人檔案交換的需求,使用開源免費的LibreOffice是一個不錯的選擇,雖然它的UI介面沒有商業軟件那麼細緻但也趨近了,而且LibreOffice持續維護新版本也有免安版本(不到200MB),很值得推薦。</p>tomexouhttp://www.blogger.com/profile/16226250354905512760noreply@blogger.com0