Monday, August 27, 2007

iPod, African Version


portable, pedestrian
Originally uploaded by fbar
First saw this on digg. before clicking the link, on my mind is a ipod in ubuntu style. and this is what i saw.

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