Monday, October 24, 2011
Ubuntu 11.10 and Parallels Desktop Notes
Thursday, October 20, 2011
google chrome -- why insecure content
1. Right-click anywhere on your Gmail page and click "Inspect Element".
2. A debug window will take over the bottom half of your browser. Click "Console" at the bar at the top of this window.
3. Search for the words "insecure content" in the console (search bar at the top-right of the console). This line will reveal where the insecure content is coming from.
4. Disable the plug-in that is creating this message. In my case it was Zemanta, which neither one of us realized was even a gmail plug-in.
Sunday, October 16, 2011
Wednesday, August 31, 2011
Uninstall XCode
sudo <XcodeDir>/Library/uninstall-devtools --mode=all
Monday, August 29, 2011
How to install Sun Java SDK on Ubuntu 1104
$sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
$sudo apt-get update
$sudo apt-get install sun-java6-jre sun-java6-plugin
$sudo apt-get install sun-java6-jdk
$sudo update-alternatives --config java
if your add-apt-repository is not installed
$sudo apt-get install python-software-properties
Wednesday, August 24, 2011
Jira 4.4 with MS SQL Server and Integrated Security
- Install your JIRA with run as service option
- Stop the JIRA server.
- Download the Microsoft SQL Server JDBC Driver 3.0
- Run sqljdbc_<version>_enu.exe
- Enter an install directory when prompted; it is recommended that you unpack this zip file in %ProgramFiles% with the default directory:
Microsoft SQL Server JDBC Driver 3.0 - Copy C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc4.jar to C:\Program Files (x86)\Atlassian\JIRA\lib or your [JIRA installation dir]/lib
note: if you use JDK 6.0 or above, you need to use sqljdbc4.jar. - Copy C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\auth\x86\sqljdbc_auth.dll to C:\Program Files (x86)\Atlassian\JIRA\bin or your [JIRA installation dir]/bin
- Add your service account to the administrators group of the JIRA server.
- Change the account of the jira windows service to the above service account.
- Change the C:\Program Files (x86)\Atlassian\Application Data\JIRA\dbconfig.xml or your [JIRA Application Data dir]/dbconfig.xml as following, the username and password need to be set, but a random string is ok. JIRA will check these two properties when starting the server.
<?xml version="1.0" encoding="UTF-8"?> <jira-database-config> <name>defaultDS</name> <delegator-name>default</delegator-name> <database-type>mssql</database-type> <schema-name>dbo</schema-name> <jdbc-datasource> <url>jdbc:sqlserver://dbserver:dbport;databaseName=dbname;integratedSecurity=true</url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <username>user@domain</username> <password>ooxx</password> <pool-size>15</pool-size> </jdbc-datasource> </jira-database-config>
- Start the JIRA server
Note:
- Not sure why the x86 version of sqljdbc_auth.dll is required, although both my windows and JDK are x64 editions. but x64 version of sqljdbc_auth.dll just does NOT work.
- This only applies to JIRA 4.4. For JIRA 4.3, some file location is different. for example dbconfig.xml
Saturday, April 19, 2008
Content Query Web Part Customization 101
Many of us have heard that we can create a content query web part that can display more than one column. To achieve this you have to familiar yourself with following files.
- ContentQueryMain.xsl
- ItemStyle.xsl
- the .webpart file you get by exporting the content query web part
For the two .xsl files, my recommendation would be "create a copy of your own". do not change these two files directly. Because all content query web parts that currently exist in the system all references these two files. If something is wrong with these two files, all content query web parts on your server will all go wrong. You do not want this happen.
In Short, all you need to do can be summarized into following steps:
1. Identify the actual column name and type of the column for the column you would like to display.
2. Let your webpart know what to display by changing the .webpartfile
3. Define how to display content by defining the xslt in the ContentQueryMain.xsl and ItemStyle.xsl
Let's dive into the details.
1. Identify the actual column name and type of the column for the column you would like to display.
Personally, I think this is the most important step. Without knowing the correct name, you can not go to anywhere. Heather has done a good job on how to do this. For me, the method she mentioned in the [The Other Internal Column Names & Finding Field Types] section works.
The most important thing is to find the right file - SCHEMA.XML.
You can find it at following location:
[SharePoint Installation Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\[Feature Name]
where Feature Name is the name of the list type you are querying.
In the file, browse the <FIELD> property, GUESS which one is the column you need.
Yes, you have to guess. Most of the time, when you see the Name attribute in the FIELD property, you know this is the one.
2. Let your webpart know what to display by changing the .webpartfile
How do we achieve this?
remember the .webpart file we were talking about earlier?
locate the CommonViewFields property in the file, and modify it based on the syntax below:
<property name="CommonViewFields" type="string">InternalColumnNameGoesHere, FieldType</property>
Fill in the column name and column type in the SCHEMA.XML you found in step 1.
Normally we use notepad to do this. But I would like to share a great tool with you.
The web part developed by MSIT: CQWP Dynamic QueryOverride.
This is a replacement for Content Query Web Part.
This is a codeplex project. Use it at your own risk.
Not only the CommonViewFields, but also lots of other things you can manipulate with this web part.
3.Define how to display content by defining the XSLT in the ContentQueryMain.xsl and ItemStyle.xsl
Starting from here, it all depends on how good you are with XSLT.
And before you begin to change anything, change the reference to the ContentQueryMain.xsl and ItemStyle.xsl in the .webpart file to your own copy. Do not know how to make your own copy. You can follow Kyle's instruction at here. Again the CQWP Dynamic QueryOverride also allow you to change the reference in "Modify this web part".
Following is the how Microsoft describe these two files:
- ContentQueryMain.xsl: You can use the Content Query Web Part to aggregate content from multiple data sources across your Web site, and then present it all in one place.
- ItemStyle.xsl: Contains templates that define how to display an item. These templates receive and process one row of data at a time, ensuring that the style and data in the item rows is consistent.
The Paul Gavin's article about Display Content Query Web Part Results in a Grid / Table helps me a lot on understanding what should I do with these two files
Now you should know when I think find the column name is the most important thing when you customize the CQWP.
Because the CQWP Dynamic QueryOverride web part can assist you to complete the task. This does not include XSLT part. That is another topic.
[Useful Tools]
Web Part: CQWP Dynamic QueryOverride by MSIT
[Useful Links]
Customizing the Content Query Web Part and Custom Item Styles by Heather soloman
Content query web part: customisation and adding custom fields by Kartic
Display Content Query Web Part Results in a Grid / Table by Paul Gavin
Using a Custom ContentQueryMain.xsl by Kyle
How to: Customize XSL for the Content Query Web Part from MSDN
How to: Customize Styles from MSDN
Monday, August 27, 2007
iPod, African Version
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






