Monday, July 09, 2007

locked file in trash

to remove the locked flag via Terminal

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

many thanks to Christian Gosselin’s weblog
  1. Dowload Oracle instant client
  2. Create a directory called oracle with the following subdirectories
  3. c:\Program Files\oracle
    ├─bin
    └─network
    └──admin

  4. Uncompress the instant client under the bin directory
  5. 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
  6. 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)
    )
    )
traceback: http://www.javamart.ca/blog/wp-trackback.php?p=34

Friday, April 13, 2007

use shadowbook to play next song in itue

Open Terminal (Terminal.app in /Applications/Utilities)
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, the catalog parameter is treated as the package name. This applies both on input (the catalog parameter) and output (the catalog column in the returned ResultSet). On input, the construct " " (the empty string) retrieves procedures and arguments without a package, that is, standalone objects. A null
    value means to drop from the selection criteria, that is, return
    information about both stand-alone and packaged objects (same as
    passing in "%"). Otherwise the catalog parameter 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 the catalog parameter, null is 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.



  • procedureNamePattern and columnNamePattern:
    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, null has the same effect as passing in "%".




Powered by ScribeFire.



Columns in the ResultSet returned by getProcedureColumns

Columns in the ResultSet returned by getProcedureColumns are as described by the API. Further details for some specific columns:
  • 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.
2.
Web Developer
ok, you already knew that I am a web developer. so you should not be surprised that I am using this addOn.
3.

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....
4.
FireFtp
It's handy to have a ftp client built in your browser.
5.
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.
6.


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.
  1. Download Adobe Flash Player plugin for Intel-based Macs
  2. go to [/Library/Internet Plug-Ins] remove following files
    • Flash Player.plugin
    • flashplayer.xpt
    • Flash Player Enabler.plugin
  3. unzip the file downloaded in step 1, and mount the dmg file
  4. after the dmg file is mounted, open a terminal window
  5. cd to following directory --
    cd /Volumes/Adobe Flash Player 9
    /Install Flash Player 9 UB/Contents/MacOS
  6. And Execute the command as super user as follow
    sudo ./Install Flash Player 9 UB
  7. That's all. You might see some error messages, complaing some text file cannot be moved. just ignore it.

trac-installation

os: ubuntu 6.1
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

找到了DWR與script.aculo.us後
第一個想要做的東西是 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

AJAX -- 看著google calendar,google suggest上ajax的特效
手很癢
所以開始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

Sunday, June 11, 2006

I am now a mac user. yeah..

Using mac for a week... still searching for utility under mac to make my life easy.

Sunday, September 11, 2005

Disney


orlando 047
Originally uploaded by ouchyen.
My First Photo Blog, using flickr.

Tuesday, December 07, 2004