Monday, July 09, 2007
locked file in trash
sudo chflags -R nouchg ~/.Trash
nouchg is the syntax for removing the uchg flag. Any flag can be removed by putting "no" in front of it.
Saturday, April 14, 2007
Toad + Oracle instant client
- Dowload Oracle instant client
- Create a directory called oracle with the following subdirectories
- Uncompress the instant client under the bin directory
- Add the following environment variables:
- SQL_PATH = c:\Program Files\oracle
- TNS_ADMIN c:\Program Files\oracle\network\admin
- LD_LIBRARY_PATH = c:\Program Files\oracle\bin
- Copy the tnsnames.ora in the following directory: c:\Program Files\oracle\network\admin. Here’s a simple tnsnames.ora:
DEV =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = foo)(PORT = 1531))
)
(CONNECT_DATA =
(SERVICE_NAME = foo)
)
)
c:\Program Files\oracle
├─bin
└─network
└──admin
Friday, April 13, 2007
use shadowbook to play next song in itue
Type: emacs ./shadow_nextsong and validate with enter.
This open the file shadow_nextsong in the text editor emacs.
Paste the line:
/Triggered/ { print $0; system("osascript -e \"tell application \\\"iTunes\\\" to play next track\";"); }
Press Ctrl-x then Ctrl-s to save the file.
Press Ctrl-x then Ctrl-c to quit emacs.
Launch ShadowBook.app
In the Terminal, paste the line:
tail -f /Library/Logs/Console/501/console.log | awk -f ./shadow_nextsong and validate with enter.
Next time you'll want to use it, if you didn't move or deleted the file shadow_song, you'll only need to execute the last 2 step
thanks to http://forums.macosxhints.com/showthread.php?t=57844
Monday, April 09, 2007
How to get widgets on to regular desktop
1 - Press F12
2 - Click the (+) to add a new widget
3 - Drag the widget on to the screen
4 - While still holding on to the widget with your mouse, press F12
5 - Release the widget.
To get rid of it simply press F12 again and close it in the dashboard screen
Tuesday, March 27, 2007
DatabaseMetadata getProcedureColumns and oracle
Considerations for getProcedures() and getProcedureColumns() Methods
According to JDBC versions 1.1 and 1.2, the methods getProcedures() and getProcedureColumns() treat the catalog, schemaPattern, columnNamePattern, and procedureNamePattern parameters in the same way. In the Oracle definition of these methods, the parameters are treated differently:
catalog: Oracle does not have multiple catalogs, but it does have packages. Consequently, thecatalogparameter is treated as the package name. This applies both on input (thecatalogparameter) and output (thecatalogcolumn in the returnedResultSet). On input, the construct""(the empty string) retrieves procedures and arguments without a package, that is, standalone objects. Anull
value means to drop from the selection criteria, that is, return
information about both stand-alone and packaged objects (same as
passing in "%"). Otherwise thecatalogparameter should be a package name pattern (with SQL wild cards, if desired).schemaPattern:
All objects within Oracle must have a schema, so it does not make sense
to return information for those objects without one. Thus, the
construct""(the empty string) is
interpreted on input to mean the objects in the current schema (that
is, the one to which you are currently connected). To be consistent
with the behavior of thecatalogparameter,nullis interpreted to drop the schema from the selection criteria (same as passing in "%"). It can also be used as a pattern with SQL wild cards.procedureNamePatternandcolumnNamePattern:
The empty string (" ") does not make sense for either parameter,
because all procedures and arguments must have names. Thus, the
construct""will raise an exception. To be consistent with the behavior of other parameters,nullhas the same effect as passing in "%".
Powered by ScribeFire.
Columns in the ResultSet returned by getProcedureColumns
- PROCEDURE_CAT
always "null" in Derby
- PROCEDURE_SCHEM
schema for a Java procedure
- PROCEDURE_NAME
the name of the procedure
- COLUMN_NAME
the name of the parameter (see column-Name-Pattern)
- COLUMN_TYPE
short indicating what the row describes. Always is DatabaseMetaData.procedureColumnIn for method parameters, unless the parameter is an array. If so, it is DatabaseMetaData.procedureColumnInOut. It always returns DatabaseMetaData.procedureColumnReturn for return values.
- TYPE_NAME
Derby-specific name for the type.
- NULLABLE
always returns DatabaseMetaData.procedureNoNulls for primitive parameters and DatabaseMetaData.procedureNullable for object parameters
- REMARKS
a String describing the java type of the method parameter
- COLUMN_DEF
a String describing the default value for the column (may be null)
- SQL_DATA_TYPE
reserved by JDBC spec for future use
- SQL_DATETIME_SUB
reserved by JDBC spec for future use
- CHAR_OCTET_LENGTH
the maximum length of binary and character based columns (or any other datatype the returned value is a NULL)
- ORDINAL_POSITION
the ordinal position, starting from 1, for the input and output parameters for a procedure.
- IS_NULLABLE
a String describing the parameter's nullability (YES means parameter can include NULLs, NO means it can't)
- SPECIFIC_NAME
the name which uniquely identifies this procedure within its schema
- METHOD_ID
a Derby-specific column.
- PARAMETER_ID
a Derby-specific column.
Saturday, March 24, 2007
FireFox AddOn for a web developer
The FireFox AddOn I am using:
1.
![]() | FireBug, as a web developer I must recommend this one. it's simple to use and powerful. you can trace your javascript, check your DOM structure, and ...... a bunch of powerful stuff. |
![]() | Web Developer ok, you already knew that I am a web developer. so you should not be surprised that I am using this addOn. |
![]() | del.icio.us bookmarks If you do not know what del.icio.us is, you should go check it now. right now. I mean it. stop reading.... |
![]() | FireFtp It's handy to have a ftp client built in your browser. |
![]() | FlashGot I switched to mac last year, so this one does not help me any more. I started to use Downthem! All instead. But If you use windows, and you are a flashget user. you should check it out. |
![]() | Downthem! All easy to use, if you often find yourself repeatly using right click and save as... in one web page. trust me, you definitely need this one. |
Sunday, January 28, 2007
Intel Based Mac Adobe Flash Player update issue
One day, I was surfing the net with my firefox. A message from adobe asked me to upgrade the flash player plugin. After followed the "easy" instruction step and completed the upgrade. Some thing bad happened, my firefox and safari cannot play the flash for me anymore. after reinstall several time, I asked help from google and found I am not alone. some ppl said that I have to find an older version plugin and install that particular version. but some how as almighty as google cannot find that older version plugins. so following is what i did with the latest adobe flash player plugin 9.0.28, and it works for me.
- Download Adobe Flash Player plugin for Intel-based Macs
- go to [/Library/Internet Plug-Ins] remove following files
- Flash Player.plugin
- flashplayer.xpt
- Flash Player Enabler.plugin
- unzip the file downloaded in step 1, and mount the dmg file
- after the dmg file is mounted, open a terminal window
- cd to following directory --
cd /Volumes/Adobe Flash Player 9
/Install Flash Player 9 UB/Contents/MacOS - And Execute the command as super user as follow
sudo ./Install Flash Player 9 UB - That's all. You might see some error messages, complaing some text file cannot be moved. just ignore it.
trac-installation
System installation
1. use synaptic package manager to install trac. (SQLite, fastCGI, svn)
2. and install the python module easy_install , which will be a great helper to install the trac plug later.
3. install following plugins
WebAdmin
easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin
AccountManager
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10
Sunday, July 16, 2006
iTunes 字體顯示問題.
選取全部的歌
按ctrl + 滑鼠左鍵
點選轉換ID3標籤
然後再點選轉譯文字字元裡面的ASCII轉為ISO Latin - 1
這樣顯示應該就會正常了
source:http://www.oikos.com.tw/modules/newbb/viewtopic.php?topic_id=27743&forum=2#174267
Tuesday, July 11, 2006
Autocomplete
第一個想要做的東西是 google suggest 的 autocompleter
當然網路上什麼都有人做
這是第一個整出來的版本 RockIT
但是只能處理String
所以有人整了第二個版本
可以配合DWR處理自行定義的物件了
但是第二個版本的sample code 只能顯示欲尋找的資訊
譬如若我們的autocompleter 是用輸入使用者姓名
第二個版本的suggest list 中便只能顯示使用者姓名
所以這東西拿出去用
面臨的第一個問題便是
如何顯示除了使用者代號之外的訊息譬如部門或電子郵件等資訊
其實script.aculo.us提供的 auto completer已經有這樣的能力
我們只要在 valueSelector這個function動點手腳便可以了
將display only的資訊放在一個 css class 為informal的 span中便可以了
function personValueSelector(personObj){
return personObj.ID+ " <span class ='informal' style='font-size:9pt'>"
+ personObj.name + "(" + personObj.EMail
+ ")</span>";
}
Sunday, June 25, 2006
script.aculo.us & DWR
手很癢
所以開始study
發現ajax需要很多基礎建設
但是javascript程度很差
所以開始找framework
DWR & script.aculo.us
其實一開始只有相中DWR
DWR 提供了在client side呼叫server端Object的能力
但是client side UI部份的支援就不是很好了
所以繼續尋找framework
一開始就發現了script.aculo.us
但是sample code 都是 ruby on rails
study起來有點小麻煩
途中又看到了yui (yahoo user interface library)
稍微好用一點
但是要自行擴充有點複雜
這時候google告訴我 prototype這個東西
javascript 也可以OO
所以為了延展性
又回來看based on prototype 的script.aculo.us







