2010年1月31日 星期日

Mac OS X Internals: A Systems Approach, by Amit Singh

http://osxbook.com/

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.

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

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

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

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

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
是因為 "$數字",會被當成 regex 在 replace 用的 "變數" (ex. $&, $1, $2...)
若 $ 不是變數,就要用 backslash 去 escape $
或是用 $$ 來跳脫 $ (把所有的 $ 取代成兩個 $$)
 

Refactorings 重構

http://www.refactoring.com/catalog/index.html

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.

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日 星期六

2010年1月22日 星期五

How to use TortoiseGit

http://wiki.github.com/multitheftauto/multitheftauto/how-to-use-tortoisegit

Online Chord Book

http://yourmusicarena.com/jamorama.html

Zend Server Community Edition

http://www.zend.com/en/products/server-ce/index







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/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/

How to add more information to Yii::app()->user

在 Yii 中,一般情況會用
$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 : Windows Bitmap Format Encoder Decoder AS3 Flex 4 SDK

Flex 不能直接讀 BMP/TIFF,需要用非官方元件

http://code.google.com/p/windowsbitmapdencoder/

Flex 4 (Gumbo) Skinning with States and Animation

其中的 "Red Alert" 滿有趣的,剛好用得到
View the Project in Action
Explore the Source Code

全文出處:
http://www.adambergman.com/2009/06/28/flex-4-gumbo-skinning-with-states-and-animation/

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>

Adobe - Flash Player : Settings Manager - Global Security Settings Panel

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

2010年1月20日 星期三

DooPHP Sitemap Generator tool

可以用來快速產生 route table 及 controller




DooPHP Sitemap Generator tool from Leng Sheng Hong on Vimeo.

2010年1月17日 星期日

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.

 

BitBake User Manual

http://bitbake.berlios.de/manual/

SQUASHFS - A squashed read-only filesystem for Linux

Official Site
http://squashfs.sourceforge.net/

SquashFS HOWTO
http://www.tldp.org/HOWTO/SquashFS-HOWTO/index.html

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>


<%@ 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>

自己 "編輯" 漫畫劇情

相當有趣的網站 (Drupal 架構)
http://www.zimmertwins.com/movie/starters

BitBake Data class

http://olvaffe.blogspot.com/2008/12/bitbake-data-class.html

What is "Et cetera" (etc)

Et cetera

http://en.wikipedia.org/wiki/Et_cetera

Psyco is a Python extension module which can greatly speed up the execution of any Python code.

http://psyco.sourceforge.net/

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

2010年1月10日 星期日

Artisteer : Template Generator

商業軟體,可用來產生 joomla, drupal, wordpress 的 template

http://www.artisteer.com/

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

2010年1月6日 星期三

Ubercart 電子商務模組

Drupal 5.x + Ubercart 的購書網站
http://www.go8.com.tw

東豐農業網
http://www.dongfon.com/products

2010年1月5日 星期二

設定 Apache2 自訂的 php.ini 位置

有時不指定 libmySQL.dll 會出現 (error.log)
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"