Recent Notes

Displaying keyword search results 1 - 12
Created by Fang on October 30, 2011 20:35:17    Last update: October 30, 2011 20:37:03
This note lists some of the different behaviors I found using different JSF implementations. In the simple JSF facelet example, I used Sun's reference implementation version 2.0.0-RC: <dependency> <groupId>javax.faces</gro... With this version, the DOCTYPE declaration is dropped when the page is rendered. It doesn't matter what DOCTYPE you declare in your templates, the facelet engine simply drops it. The problem with this is, your page is always displayed in quirks mode , despite your intentions to require standards compliant mode. The DOCTYPE problem is fixed in release 2.0.2-FCS . Change the dependency in pom.xml to: <dependency> <groupId>javax.faces</gro... and test again, you'll find that DOCTYPE is faithfully passed over to the browser (view source at browser). You can delete the DOCTYPE declaration in the xhtml template...
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
Created by freyo on August 25, 2011 09:07:40    Last update: August 25, 2011 20:45:43
This is a list of built-in Android permission values: Permission Description Since API Level android.permission.ACCESS_CHECKIN_PROPERTIES Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded. 1 android.permission.ACCESS_COARSE_LOCATION Allows an application to access coarse (e.g., Cell-ID, WiFi) location 1 android.permission.ACCESS_FINE_LOCATION Allows an application to access fine (e.g., GPS) location 1 android.permission.ACCESS_LOCATION_EXTRA_COMMANDS Allows an application to access extra location provider commands 1 android.permission.ACCESS_MOCK_LOCATION Allows an application to create mock location providers for testing 1 android.permission.ACCESS_NETWORK_STATE Allows applications to access information about networks 1 android.permission.ACCESS_SURFACE_FLINGER Allows an application to use SurfaceFlinger's low level features 1 android.permission.ACCESS_WIFI_STATE Allows applications to access information about Wi-Fi networks 1 android.permission.ACCOUNT_MANAGER Allows applications to call into AccountAuthenticators. Only the system can get this permission. 5 android.permission.AUTHENTICATE_ACCOUNTS...
Created by freyo on August 05, 2011 14:30:12    Last update: August 08, 2011 19:47:15
The first time you sign in with your Google Account on an Android phone, you are asked to set up "Backup & Restore". But it's somewhat scary since it doesn't tell you what's backed up and how to restore. On the phone, backup & restore is managed by Privacy Settings . According to Google, these things are backed up to Google servers: Your wifi passwords Browser bookmarks A list of applications you've installed The words you've added to the dictionary used by the onscreen keyboard Most of the settings you configure with the Settings application Third party applications may backup their data if they support this feature. You have to check each application to find out. Restoration happens automatically when you sign in with the...
Created by Dr. Xi on January 14, 2010 00:28:27    Last update: March 30, 2011 15:37:44
A task that a Java developer does so frequently is to find out where a certain class can be found - to resolve compilation errors, classpath issues, or version conflicts of the same class introduced by multiple class loaders. A long while back I wrote a simple Perl script to perform the task. Later I was informed that there are Swing based Jar Browser and Jars Browser . Then, there are a couple of shell one-liners: # one liner 1 find -name "*.jar" -print0 | xarg... But all of them share the same problem: if a class is in a jar nested in another jar, it cannot be found. Such is the case for a class inside a jar under the WEB-INF/lib directory of a...
Created by Dr. Xi on November 23, 2010 20:20:01    Last update: March 01, 2011 13:38:51
I tried to find a GZIP compression servlet filter to compress a large log file that we send down to the browser. Most of the implementations I found were overly complicated and many buggy. This is a simple implementation that worked for me. The filter: package filter.demo; import java.io.*; i... Config web.xml : <filter> <filter-name>gzipFilter</filte... The ugly anonymous inner class could have been avoided if the servlet API did not insist on ServletResponse.getOutputStream returning the bogus ServletOutputStream class (instead of the plain OutputStream ). Additional Note: In an earlier version of this filter, the gzip headers were added in doFilter , like this: // This is NOT good! if (supportsGzip) { ... It turned out that the ServletResponse methods sendError bypasses the gzip...
Created by voodoo on April 01, 2010 04:28:04    Last update: April 01, 2010 04:37:32
You were tempted by "my fun cards" and installed "my web search" on your computer. Although some people say "my web search" is harmless, but still it behaved scary. So you want to uninstall it. You click the "Add/Remove Programs" and removed the "my web search" toolbar. But then when you type in things in the Firefox address bar you find that it still brings up "my web search"! Here's how to get rid of it: Enter "about:config" in the address bar (and promise that you'll be careful). Enter "myweb" in the filter box Reset browser.search.selectedEngine and keyword.URL , extensions.mywebsearch.openSearchURL , extensions.mywebsearch.prevKwdEnabled , and extensions.mywebsearch.prevKwdURL . The extensions.mywebsearch.* settings will be removed after Firefox restart. The parameter that affects the address bar search is keyword.URL...
Created by Dr. Xi on September 18, 2008 21:38:27    Last update: February 06, 2010 21:55:26
Editing Shortcut Meaning Ctrl+C Copy Ctrl+V Paste Ctrl+X Cut Ctrl+Z Undo Ctrl+F Find Ctrl+G Find Again Viewing Shortcut Meaning Esc Stop Ctrl+R Reload Mozilla/NS: Ctrl+Shift+R, IE: Ctrl-F5 Force reload (not from cache) Home Go to top of page End Go to end of page Page Up Scroll up one page Page Down Scroll down one page Ctrl+- (minus sign) Make fonts smaller Ctrl++ (plus sign) Make fonts bigger Ctrl+0 Restore default font size Tools Shortcut Meaning Alt Toggle menu bar (IE7 only) Ctrl+T Open new tab Ctrl+N Open new window Ctrl+P Print Ctrl+I, Ctrl+B Bookmarks Ctrl+H History Ctrl+U View page source Ctrl+W Close Window or tab if more than one tab is open Ctrl+L Go to location box Ctrl+E Go to search box
Created by Dr. Xi on February 04, 2009 16:16:03    Last update: February 06, 2010 21:53:40
Action Shortcut Bring up context menu Shift+F10 Move active window Alt+Space, M Minimize active window Alt+Space, N Move cursor to web browser address bar and select the text Alt+D Minimizes all open windows and displays the desktop Windows Logo+D Restore minimized windows Repeat Windows Logo+D Open windows explorer Windows Logo+E Navigate through tabs in browser Ctrl+TAB Close tab in browser Ctrl+W Page Back Alt + LeftArrow Page Forward Alt + RightArrow Reload Page F5 Reload Page Override Cache Ctrl+F5 Find computer CTRL+Windows Logo+F Open Run dialog box Windows Logo+R Display Start menu CTRL+ESC (same as the Windows Logo key) Move the focus on the taskbar so you can TAB to the Quick Launch tool bar, the Taskbar etc. CTRL+ESC,ESC Quick Launch shortcuts in Windows Vista...
Created by Dr. Xi on September 22, 2008 01:22:23    Last update: September 22, 2008 16:20:01
On the Programs tab of Internet Options IE provides a list of HTML Editors to choose from. Choosing a program from the list will not change the View Source editor. It only changes the Edit with... command from the File menu. You need to modify the registry to add your favorite editor to the HTML Editors list. Add the keys listed below to the registry, or edit the registry keys in an editor and import back into the registry: Windows Registry Editor Version 5.00 [HKEY_... Google " Internet Explorer Client Registry Layout " to find official information from MS.
Created by Dr. Xi on September 18, 2008 23:37:43    Last update: September 18, 2008 23:37:54
For IE: Open "Internet Options" dialog Select the security tab Click the "Custom Level" button Scroll from bottom up and find the "Scripting" section Select "Disable" under "Active scripting" For Firefox: Select Options from the Tools menu Click the Content tab Un-check "Enable JavaScript"
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/mod_python.so ... Python script: import time, os from os.path import basename ...