2010年1月31日 星期日
Libusb for win32
http://libusb-win32.sourceforge.net/
Libusb-win32 is a port of the USB library libusb to the Windows operating systems (Win98SE, WinME, Win2k, WinXP). The library allows user space applications to access any USB device on Windows in a generic way without writing any line of kernel driver code.
Libusb-win32 is a port of the USB library libusb to the Windows operating systems (Win98SE, WinME, Win2k, WinXP). The library allows user space applications to access any USB device on Windows in a generic way without writing any line of kernel driver code.
NSIS : Nullsoft Scriptable Install System
NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
http://nsis.sourceforge.net/Home
http://nsis.sourceforge.net/Home
Windows Driver Kit: User-Mode Driver Framework
Windows Driver Kit: User-Mode Driver Framework
http://msdn.microsoft.com/en-us/library/aa510983.aspx
WinUSB
http://msdn.microsoft.com/en-us/library/aa476426.aspx
General Requirements on HIDClass Drivers
http://msdn.microsoft.com/en-us/library/ms789962.aspx
USBVIEW Sample Application
http://msdn.microsoft.com/en-us/library/dd163454.aspx
http://msdn.microsoft.com/en-us/library/aa510983.aspx
WinUSB
http://msdn.microsoft.com/en-us/library/aa476426.aspx
General Requirements on HIDClass Drivers
http://msdn.microsoft.com/en-us/library/ms789962.aspx
USBVIEW Sample Application
http://msdn.microsoft.com/en-us/library/dd163454.aspx
JRebel (JavaRebel) : Do you need to rebuild/deploy your application ?
JRebel is an award-winning productivity tool for Java EE development. It enables your team to complete more features, fix more bugs, and release quality software on schedule and under budget by eliminating time-wasting build and redeploy phases.
http://www.zeroturnaround.com/jrebel/
JRebel Netbeans Plugin
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=22254
http://www.zeroturnaround.com/jrebel/
JRebel Netbeans Plugin
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=22254
2010年1月29日 星期五
MSSQL: The best performance of datatypes
有人覺得 char 比 varchar 快速,所以全部欄位都用 char @@
該用什麼,常理就能判斷,懶得幫他實驗,所以找了這些資料
http://blogs.techrepublic.com.com/10things/?p=381
http://www.sql-server-performance.com/tips/datatypes_p1.aspx
該用什麼,常理就能判斷,懶得幫他實驗,所以找了這些資料
http://blogs.techrepublic.com.com/10things/?p=381
http://www.sql-server-performance.com/tips/datatypes_p1.aspx
2010年1月27日 星期三
Java String replaceAll 真的很 tricky
String start = "yours now for just <amount>";
String price = "12$9.99";
// 必須取代 $ 成為 \$,別懷疑就是六個 backslash!!!
price = price.replaceAll("\\$", "\\\\\\$");
String end = start.replaceAll("<amount>", price);
replaceAll 第一個參數要小心特殊符號,大家都知道...
而且,它的第二個參數,不能包含 $,否則會出現
java.lang.StringIndexOutOfBoundsException
或是用 $$ 來跳脫 $ (把所有的 $ 取代成兩個 $$)
String price = "12$9.99";
// 必須取代 $ 成為 \$,別懷疑就是六個 backslash!!!
price = price.replaceAll("\\$", "\\\\\\$");
String end = start.replaceAll("<amount>", price);
replaceAll 第一個參數要小心特殊符號,大家都知道...
而且,它的第二個參數,不能包含 $,否則會出現
java.lang.StringIndexOutOfBoundsException
是因為 "$數字",會被當成 regex 在 replace 用的 "變數" (ex. $&, $1, $2...)
若 $ 不是變數,就要用 backslash 去 escape $或是用 $$ 來跳脫 $ (把所有的 $ 取代成兩個 $$)
2010年1月26日 星期二
Java Decompiler
Java Decompiler project (freeware)
http://java.decompiler.free.fr/?q=jdgui
Jad
http://members.fortunecity.com/neshkov/dj.html
Wrapper for recursive (with Jad)
http://www.adarshr.com/papers/recursive
(It contains jad.exe, replace it by the latest version of jad)
http://java.decompiler.free.fr/?q=jdgui
Jad
http://members.fortunecity.com/neshkov/dj.html
Wrapper for recursive (with Jad)
http://www.adarshr.com/papers/recursive
(It contains jad.exe, replace it by the latest version of jad)
2010年1月25日 星期一
PRADO PHP Framework
http://www.pradosoft.com/
Qiang Xue - founder of PRADO framework, core development
He is in developer team of Yii Framework now.
PRADOTM is a component-based and event-driven programming framework for developing Web applications in PHP 5. PRADO stands for PHP Rapid Application Development Object-oriented.
Qiang Xue - founder of PRADO framework, core development
He is in developer team of Yii Framework now.
PRADOTM is a component-based and event-driven programming framework for developing Web applications in PHP 5. PRADO stands for PHP Rapid Application Development Object-oriented.
Main Features of PRADO
- Object-oriented and highly reusable code
- Event-driven programming
- Separation of presentation and logic
- Configurable and pluggable modular architecture
- Full spectrum of database support
- Feature-rich Web components: HTML input controls, validators, datagrid, wizard...
- AJAX-enabled Web components
- Built-in support of internationalization (I18N) and localization (L10N)
- Customizable and localizable error/exception handling
- Multiway message logging with filters
- Generic caching modules and selective output caching
- Extensible authentication and authorization framework
- Security measures: cross-site script (XSS) prevention, cookie protection...
- XHTML compliance
- Rich documentation and strong userbase
2010年1月23日 星期六
Error 651 in Windows 7: A killer for internet connection/VPN
http://ghost301tech.wordpress.com/2009/10/29/error-651-in-windows-7-a-killer-for-internet-connectionvpn/
3. Disable IPv6 for your connection
My problem was solved by this.
2010年1月22日 星期五
Yii : How to upload a file using a model
How to upload a file using a model
http://www.yiiframework.com/doc/cookbook/2/
Multi File upload - CFileValidator and CUploadedFile
http://www.yiiframework.com/doc/cookbook/2/
Multi File upload - CFileValidator and CUploadedFile
http://www.yiiframework.com/forum/index.php?/topic/3035-multi-file-upload-cfilevalidator-and-cuploadedfile/
Usefull Yii Extension
Datafilter
This extension can be used to add search and filtration capabilities to data grids.
http://www.yiiframework.com/extension/datafilter/
grbac
This module is for User-Management
http://www.yiiframework.com/extension/grbac/
extendedclientscript
With this extension you can transparently reduce page load times by combining and compressing the used Javascript and CSS files.
http://www.yiiframework.com/extension/extendedclientscript/
euploadify
This extension adds a flash based file-upload with progress-bar and multi-file upload capability.
http://www.yiiframework.com/extension/euploadify/
cfile
This extension offers commonly used functions for filesystem objects (files and directories) manipulation.
http://www.yiiframework.com/extension/cfile/
esanitizer
This extension sanitizes all user input ($_POST, $_GET, $_COOKIE,$_FILES) with html purifier to protect against XSS
http://www.yiiframework.com/extension/esanitizer/
cvsout
http://www.yiiframework.com/extension/csvout/reviews/
printout
http://www.yiiframework.com/extension/printout/
Image Extension, Convert Kohana Image Library to Yii
Provides methods for the dynamic manipulation of images. Various image formats such as JPEG, PNG, and GIF can be resized, cropped, rotated and sharpened.
http://www.yiiframework.com/extension/image/
http://www.yiiframework.com/extension/image/
How to add more information to Yii::app()->user
在 Yii 中,一般情況會用
第一次在 view 裡面使用時,覺得很怪異,我要 id 怎麼取到 username (LoginID)...
以下文件說明
1) 如何把 id 取代成 table 的 id 欄位 (sequence id)
2) 如何增加 user 的欄位,如 lastLoginTime
http://www.yiiframework.com/doc/cookbook/6/
$id=Yii::app()->user->id; // 取得 username
第一次在 view 裡面使用時,覺得很怪異,我要 id 怎麼取到 username (LoginID)...
以下文件說明
1) 如何把 id 取代成 table 的 id 欄位 (sequence id)
2) 如何增加 user 的欄位,如 lastLoginTime
http://www.yiiframework.com/doc/cookbook/6/
2010年1月21日 星期四
Yii extension:從 mwb file 產生 model
mwbmodelcommand
http://www.yiiframework.com/extension/mwbmodelcommand/
php.ini 需載入 zip extension,不然會出現以下錯誤
Warning: simplexml_load_file(): I/O warning : failed to load external entity "zip://db.mwb#document.mwb.xml" in ...commands\shell\mwbModelCommand.php on line 78
Flex 4 (Flash Builder 4): 使用 state 及 transitions
與 Flex 3 有些不同,筆記一下~
http://www.artima.com/articles/flex_4_states.html
<s:states>
<s:State name="InitState"/>
<s:State name="ReadyState"/>
</s:states>
<s:transitions>
<s:Transition fromState="*" toState="ReadyState">
<s:Sequence duration="2500">
<s:Parallel>
<mx:Blur target="{this.gios_image}" blurXFrom="10" blurXTo="0" blurYFrom="10" blurYTo="0"/>
<mx:Resize target="{this.gios_image}" widthFrom="1" heightFrom="1" widthTo="290" heightTo="297"/>
<mx:Fade target="{this.gios_image}" alphaFrom="1" alphaTo="0"/>
</s:Parallel>
</s:Sequence>
</s:Transition>
</s:transitions>
http://www.artima.com/articles/flex_4_states.html
<s:states>
<s:State name="InitState"/>
<s:State name="ReadyState"/>
</s:states>
<s:transitions>
<s:Transition fromState="*" toState="ReadyState">
<s:Sequence duration="2500">
<s:Parallel>
<mx:Blur target="{this.gios_image}" blurXFrom="10" blurXTo="0" blurYFrom="10" blurYTo="0"/>
<mx:Resize target="{this.gios_image}" widthFrom="1" heightFrom="1" widthTo="290" heightTo="297"/>
<mx:Fade target="{this.gios_image}" alphaFrom="1" alphaTo="0"/>
</s:Parallel>
</s:Sequence>
</s:Transition>
</s:transitions>
2010年1月20日 星期三
2010年1月17日 星期日
Why Git is Better than X
Why Git is Better than X
http://zh-tw.whygitisbetterthanx.com/
Linus Torvalds on Git
http://people.debian.org.tw/~chihchun/2008/12/19/linus-torvalds-on-git/
Pro Git (a paperbook)
http://progit.org/book/
http://progit.org/book/zh/
http://zh-tw.whygitisbetterthanx.com/
Linus Torvalds on Git
http://people.debian.org.tw/~chihchun/2008/12/19/linus-torvalds-on-git/
Pro Git (a paperbook)
http://progit.org/book/
http://progit.org/book/zh/
2010年1月13日 星期三
2010年1月12日 星期二
Drupal Translation
Drupal 的 Translation 是類似 GNU Gettext 的做法
直接用特定函式把要 transalation 的字串包起來,然後用工具 (potx-cli.php) 把這些字串從 code extract 成文字檔,再用一般的 text editor 去修改成 target language。
Translation template extractor (含 potx-cli.php)
http://drupal.org/project/potx
Command line extraction: Copy potx.inc
and potx-cli.php
to the directory you would like to generate translation templates for and run php potx-cli.php
. The translation templates will get generated as separate files in the current directory. Use php potx-cli.php --help
to get a list of command line options.
Microsoft.XMLDOM for ASP
同事問到 xml 解析,利用 Microsoft.XMLDOM 可以支援 xpath
<xml masterProduct="3949">
<product1 mainProduct="yes">
<color>Red</color>
<price>23.99</price>
<onHand>483948</onHand>
</product1>
<product2 productID="2222"></product2>
<product3 productID="3333"></product3>
</xml>
<xml masterProduct="3949">
<product1 mainProduct="yes">
<color>Red</color>
<price>23.99</price>
<onHand>483948</onHand>
</product1>
<product2 productID="2222"></product2>
<product3 productID="3333"></product3>
</xml>
<%@ LANGUAGE=VBSCRIPT %> <%Option Explicit%> <% Response.Buffer = True Dim objXML, strPath, oRoot, x, strColor, strPrice strPath = "[YOUR_PATH_TO_THE_XML_FILE]" Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.load (Server.MapPath(strPath)) If objXML.parseError.errorCode <> 0 Then Response.Write(objXML.parseError.reason) Response.Write(objXML.parseError.errorCode) End If Set oRoot = objXML.selectSingleNode("//xml/product1") for each x in oRoot.childNodes Select Case x.baseName case "color" strColor = x.text case "price" strPrice = x.text case else end select next set objXML = nothing %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>ASP to read XML file Page</title> </head> <body> <b>COLOUR:</b> <%=strColor%><br /> <b>PRICE:</b> <%=strPrice%> </body> </html>
2010年1月11日 星期一
VMWare 在 Power On the Guest OS 時出現 Failed to Lock the File
刪除目錄下 *.vmdk.lck 的子目錄,容易發生在重新安裝 vmware 再 Add Virtual Machine to Inventory 的時候。
VMware server 2 登入時出現 http://localhost:8222/sdk 連不上的錯誤
The VMware Infrastructure Web Service at "http://localhost:8222/sdk" is not responding (Connection Refused)
安裝 VMWare server 2 時,會要求輸入 FQDN,若輸入 localhost 則需要以下設定
修改 C:\Windows\System32\Drivers\etc\hosts 以下兩行 uncomment
::1 localhost
127.0.0.1 localhost
http://winromulus.com/Other/Work-Related/VMware-Server-The-VMware-Infrastructure-Web-Service-is-not-responding-Connection-Refused.html
安裝 VMWare server 2 時,會要求輸入 FQDN,若輸入 localhost 則需要以下設定
修改 C:\Windows\System32\Drivers\etc\hosts 以下兩行 uncomment
::1 localhost
127.0.0.1 localhost
http://winromulus.com/Other/Work-Related/VMware-Server-The-VMware-Infrastructure-Web-Service-is-not-responding-Connection-Refused.html
2010年1月10日 星期日
2010年1月7日 星期四
PHP 5.2.6 (Win32) 有個奇怪的問題
<?php
echo 169926.25841615902027 * 31.19;
?>
在版本
5.2.1
5.2.9-2
5.2.11-2 結果都是 5300000
在 5.2.6 結果是 5.3E+6
通常科學符號表示不是我們要的,所以我認定這是個 BUG
echo 169926.25841615902027 * 31.19;
?>
在版本
5.2.1
5.2.9-2
5.2.11-2 結果都是 5300000
在 5.2.6 結果是 5.3E+6
通常科學符號表示不是我們要的,所以我認定這是個 BUG
2010年1月6日 星期三
2010年1月5日 星期二
設定 Apache2 自訂的 php.ini 位置
有時不指定 libmySQL.dll 會出現 (error.log)
win32 下面測試有效,Linux 還未試過
> httpd.conf
win32 下面測試有效,Linux 還未試過
PHP Warning: PHP Startup: Unable to load dynamic library 'D:/appserv/php5/ext/php_mysql.dll' - \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C\r\n in Unknown on line 0
> httpd.conf
LoadModule php5_module "C:/AppServ/php5/php5apache2.dll"
LoadFile "C:\AppServ2.0\php5\php5ts.dll"
# 避免 php_mysql.dll 無法被載入
LoadFile "C:\AppServ2.0\php5\libmySQL.dll"
# 避免php_mcrypt.dll 無法被載入
LoadFile "D:\AppServ\php5\libmcrypt.dll"
# 指定 php.ini 的目錄
PHPINIDir "C:\AppServ2.0\php5"
訂閱:
文章 (Atom)