Recent Notes
Displaying keyword search results 1 - 11
Created by Fang on December 06, 2011 19:03:25
Last update: December 07, 2011 08:54:11
Our custom tag, as implemented in the previous note , is broken when a template is used.
Create a template file ( home-template.xhtml ):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric...
and a test page that uses it ( home.xhtml ):
<?xml version="1.0" encoding="UTF-8"?>
<ui:comp...
Then request the page with URL: http://localhost:8080/facelet-demo/home.jsf?name=Jack .
You'll find that our hello tag works inside ui:repeat but fails to get the value defined by ui:param ! What's the problem? Our hello tag implementation evaluated the EL with the wrong EL context!
This is the corrected implementation:
package com.example;
import java.io.IOExcep...
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 May 13, 2011 15:45:29
Last update: September 20, 2011 08:08:12
This is an Android app that dumps any binarized xml file as plain text - to the sdcard on the device or emulator.
build.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project...
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<man...
res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<Lin...
res/values/strings.xml :
<?xml version="1.0" encoding="utf-8"?>
<res...
src/com/android/xmltool/DumpXml.java
package com.android.xmltool;
import java.ut...
Screenshot
Pre-built APK can be downloaded from: http://code.google.com/p/android-binxml-dump/
Created by freyo on June 30, 2011 12:36:26
Last update: July 01, 2011 09:43:54
Code
public void install(View view) {
String url = ...
Screenshots:
Logcat:
D/InstallApp( 338): install: file:///sdcard/GetAp...
Using http://... as the URI for the APK does not work. Android fails to find a handler for the intent (logcat):
No Activity found to handle Intent { act=android.i...
Therefore, download the APK to sdcard then fire the Intent.
Created by James on February 14, 2011 12:10:19
Last update: February 14, 2011 20:22:05
I have long noticed that IE8 displays a "broken page" icon while showing my web pages, but didn't pay much attention. Since the world in general considers IE to be broken, it's not so unlogical for IE to see much of the world as broken. Until one day I noticed that the Google home page was not "broken". Then I thought may be I should fix my pages also. So I moused over the "broken page" icon, and this is what I saw: Compatibility View: websites designed for older browsers will often look better, and problems such as out-of-place menus, images, or text will be corrected. Very descriptive indeed! Older browsers? Such as Firefox 1.5? When it comes to MS products, I often had better...
Created by Dr. Xi on March 31, 2010 19:18:33
Last update: March 31, 2010 19:18:33
Query the dba_users view to find locked accounts.
SQL> select username, account_status, lock_dat...
Created by Dr. Xi on March 31, 2010 15:14:39
Last update: March 31, 2010 15:17:46
DBA_WAITERS shows all the sessions that are waiting for a lock.
Column Datatype Description
WAITING_SESSION NUMBER The waiting session
HOLDING_SESSION NUMBER The holding session
LOCK_TYPE VARCHAR2(26) The lock type
MODE_HELD VARCHAR2(40) The mode held
MODE_REQUESTED VARCHAR2(40) The mode requested
LOCK_ID1 VARCHAR2(40) Lock ID 1
LOCK_ID2 VARCHAR2(40) Lock ID 2
SQL> set lin 120
SQL> select * from dba_wai...
Or join the v$session view to find out who it is:
select w.waiting_session, w.mode_requested, s.user...
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 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 13, 2008 21:16:14
Last update: September 13, 2008 21:47:22
Oracle provides three view to find information about an object: USER_OBJECTS describes all objects owned by the current user. This view does not display the OWNER column. ALL_OBJECTS describes all objects accessible to the current user. DBA_OBJECTS describes all objects in the database. These are the columns: Column Name Description OWNER Owner of the object OBJECT_NAME Name of the object SUBOBJECT_NAME Name of the subobject (for example, partition) OBJECT_ID Dictionary object number of the object DATA_OBJECT_ID Dictionary object number of the segment that contains the object OBJECT_TYPE Type of the object (such as TABLE, INDEX) CREATED Timestamp for the creation of the object LAST_DDL_TIME Timestamp for the last modification of the object resulting from a DDL statement (including grants and revokes) TIMESTAMP Timestamp for the...
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
...