Friday, May 14, 2010

Bose USB speaker play static pitch during playback

My brand new Bose Companion 5 USB speakers that are acting very strangely on my new Window 7 Ultimate 64 bit descktop. They will play music for a little while, but after maybe 10 minutes, they output horrible static pitch constantly. The pitch can change over time. I have to close the player such as iTune or Window Media player and restart the playback. Unplug and re plug the USB cable does not solve the problem. After searched Internet I have found a hint about the Power Options on USB device. After tried to switch off "USB selective suspend setting", the speakers behaviour normally:-)

Thought it might be useful to post this if anyone else encounters the same issue.

The step to disable the "USB selective suspend setting":

Open Control Centre/Power Options/Change plan settings/Change advanced power settings:

Thursday, September 24, 2009

Content Assist (Ctrl+Space) stopped working in eclipse 3.5

The Content Assist (Ctrl+Space) has been life saver during all of my experience in using eclipse. So a sudden lose of the capability the other day caused a big havoc. I scrambled all over the places to find the cause and a resolution. Here is what I have found.

The cause: there is a OS level setting to use "Ctrl+Space" as toggle key for the MS IME for Chinese Simplified.

The resolution: remapped the key within eclipse to use "Ctrl+Alt+Space" for the "Content Assist" as seen on the left.

Friday, May 18, 2007

Java Generics

Java Generics has been around since Java version 1.5 but I have not been using it quite much yet due to the fact "Generified code" can only run under version 1.5 JVM onward. With the requirements to maintain earlier JVM support, we have intentionly stayed away from the Generics. However new code created for Java 1.5 or onward JVM, should start to use Generics for type safe collection etc. More information can be found: website.

Sunday, February 04, 2007

Configure MySQL JDBC Datasource in Tomcat 5.5

Found the instructions posted on Tomcat JNDI Datasource HOW-TO does not work for me. The datasource initialized does not have any reference to the parameters confgured through ResourceParams element.

After searching through vast amount of posts on TheServerSide I found these steps to be the simplest ones.

1. Make sure MySQL JDBC driver jar file such as "mysql-connector-java-3.1.14-bin.jar" is in the /commom/lib directory. The Connector/J version 5.0 does not work with Tomcat 5.5 connection pool.

There should be no other version of the MySQL JDBC driver in neither this directory not WEB-INF/lib directory.

2. Update the web application context definition in $TOMCAT_HOME/conf/server.xml

<Context path="/testApp" reloadable="true" docBase="D:\testApp\webapp" workDir="D:\testApp\work">

<Resource name="jdbc/MySQLDB"
validationQuery="SELECT 1"

Do not include the FACTORY attribute as instructed as JNDI Datasource HOW-TO, this is automatically picked up by tomcat 5.5 based on the type of datasource, which here is java.sql.Datasource. Therefore it automatically uses the Tomcat internal dbcp factory.

3. Restart the Tomcat, that's it.

4. Now in your code you should be able to look the connection pool like this:

Context initContext = new InitialContext();
DataSource ds = (DataSource)envContext.lookup("java:/comp/env/jdbc/MySQLDB");
Connection conn = ds.getConnection();


Saturday, January 27, 2007


XAMPP is a software bundle created by which includes everything you need to install Apache/MySQL/PHP/Perl in one go. It is available for Windows, Linux and Solaris. Particularly on a Windows machine, this is definitely the fastest way to get up and running with these tools, as someone else has done the integration and DEFAULT configuration work for you.
The philosophy behind XAMPP is to build an easy to install distribution for developers to get into the world of Apache, PHP and MySQL. To make it convenient for developers XAMPP is configured with all features turned on. The default configuration is not good from a security point of view and it is not secure enough for a production environment. Since v0.9.5 you can make your XAMPP installation securer by calling "security" from XAMPP admin web interface, from which you can tighten up the loose ends.


Tuesday, January 23, 2007

Change Data Range For Existing PivotTables

Say you have a existing PivotTable in Microsoft Excel Speadsheet to summarize the number of accounts in a list of banks. If you change the values in the data source, you need to Refresh the PivotTable and PivotChart to bring the updates from the data source. However these changes are updated only for the data values fallen within the original data range when the PivotTable was initially created. For instance, you have a table with these values:

Based on this data source, you have created a simple pivotTable like this one:

Now add an extra row in the data source table, and refresh pivotTable, you will find the pivotTable is not updated. Why? The reason is that the data range is set to "Sheet1!$A$1:$B$5" when you first created the pivotTable. It is not obvious how can one change the data range in the pivotTable. Right clicking the pivotTable does not give you any options, nor do the menu items.
The trick is to re-enter the PivotTable wizard from the existing pivotTable. The Wizard shows the step 3 of 3 like this:

You need to go back one step to step 2 of 3, like:

From there you can update the data range to "Sheet1!$A$1:$B$6" to include newly added data row, such as this:

Now you can finish the wizard, voilĂ , the pivotTable is updated with newly added data row included:-)

For more Excel tips visit: MrExcel...


Enterprise AJAX

In one of my recent projects, I have used Backbase AJAX Framework for JSF to create rich user interface for an B2B telco ebilling application. Backbase AJAX platform consists of a client-side AJAX Engine, JSF Runtime, JSF Components (UI Widgets) and a Developer Tools.
The Backbase AJAX Engine is developed in JavaScript and provides a number of generic and reusable client side features, such as drag-and-drop, animations, back-forward button support, bookmarks, focus model, state management, data binding and templating.
The Backbase JSF runtime performs the AJAX component rendering in the JSF presentation framework. It extends the JSF request lifecycle to work in a Single Page Interface environment, it synchronizes client-server state and facilitates data binding.
The Backbase AJAX JSF Components includes over 30 customizable UI components with built-in AJAX features.
The Backbase AJAX Developer Tools provide a complete set of development tools with a plug-in for the Eclipse platform and debugging tools within the web browser itself.
It offers a 30-day trial version which contains the full functionality.