Recent Notes
Displaying keyword search results 31 - 42
Created by James on May 07, 2010 04:13:14
Last update: May 07, 2010 04:35:03
It seems that the key to aligning a checkbox with its label lies in the line-height property of the label. This simple HTML snippet aligns well:
<!DOCTYPE HTML> <html> <head> <style typ... which is rendered like this: Change the font size of the label to 12px throws off the alignment: label.checkbox { font-size: 12px; di... In case 1, the height of the checkbox is 13px with 3px top and bottom margin, for a total of 19px , which is exactly the height of the label div. As can be seen from Firebug : Checkbox layout Label layout In case 2, the height of the label div shrinks to 15px , while the height of the checkbox remains the same: Checkbox layout Label layout And...
Created by Fang on March 22, 2010 02:55:04
Last update: March 22, 2010 03:48:55
If you followed the steps in Start a Java EE application with Maven , you'll arrive at an EAR file that's ready to be deployed. However, if you look carefully, you'll find that the ejb-1.0.jar file is included in the EAR file twice : once as the ejb module of the EAR, another time under the WEB-INF/lib folder of webapp-1.0.war . The second is brought about by specifying the ejb project as a dependency in the webapp POM. Actually, the webapp project is dependent on the ejb project as an EJB client. So we should have been more accurate by specifying the type of dependency as ejb-client , not ejb : Edit webapp/pom.xml , change the ejb dependency to ejb-client :
<project> <modelVersion>4.0.0</modelVersion... Update ejb/pom.xml...
Created by voodoo on February 08, 2010 04:57:49
Last update: February 08, 2010 04:57:49
If you don't want to open an extra port for VNC or want extra security with SSH, you can setup an SSH tunnel for VNC. On Windows, you can do this with Putty or openssh .
Open a command window, and enter (using Putty as example):
C:\local\bin\plink.exe -ssh -2 -L localhost:5901:r...
When connecting with vncviewer , use localhost:5901 as server instead of remote_host:5901 .
If you use the setup frequently, it is more convenient to setup the tunnel as a Windows service . Assuming the name of the service is vnc_tunnel , the registry entry would look like:
Windows Registry Editor Version 5.00
[HKEY_...
Created by Dr. Xi on March 02, 2009 23:29:08
Last update: March 28, 2009 21:35:41
An HTML form contains more than what meets the eye. This bookmarklet displays information about form fields in the page. When there are multiple forms on the page, successive invocations of the bookmarklet display each form in turn. Add this link to your bookmarks.
Here's the code:
<html>
<body>
<a href="javascript:
i...
Created by Dr. Xi on October 30, 2008 03:39:50
Last update: October 30, 2008 03:40:51
-- define types
CREATE OR REPLACE TYPE pers...
Created by Dr. Xi on October 23, 2008 03:54:04
Last update: October 23, 2008 03:57:44
Add validator plugin in struts-config.xml
<struts-config>
.
.
.
...
Set validate="true" on action form
<struts-config>
<!-- ========== Form Bean De...
Add validation rules in validation.xml
<?xml version='1.0' encoding='windows-1252'?>
<...
If you override validate , make sure super.validate is called.
package com.example;
import javax.servlet.h...
Read the documentation:
http://struts.apache.org/1.2.4/userGuide/dev_validator.html
Created by Dr. Xi on October 08, 2008 19:33:21
Last update: October 08, 2008 20:17:42
In sqlnet.ora , there's a parameter named NAMES.DEFAULT_DOMAIN that usually contains the value world . If you remove this parameter then you don't need to append .world . My sqlnet.ora contains three lines:
# sqlnet.ora Network Configuration File: C:\wo...
To force a lookup without NAMES.DEFAULT_DOMAIN appended, append a dot to the tnsname:
tnsping unqualified_tnsname_name.
Created by Dr. Xi on October 06, 2008 22:48:08
Last update: October 06, 2008 22:50:11
A first attempt would be to create an input file like this:
userid password shell_command1 shell_... and feed the lines to the telnet client: cat telnet_input.txt | telnet remote_host #... However, you'll learn soon enough that it doesn't work. You get output like this: Trying 192.168.159.128... Connected to bash... What's happening? The telnet client depleted all input before the remote host had a chance to respond. Since there's no more input, the telnet client initiated to close the connection. Adding a delay between the commands makes it work: (echo userid sleep 10 echo password ... How much time to sleep between commands is just guesswork. You can use Expect to provide more control over the automated session: #!/usr/bin/expect # timeout script aft......
Created by Dr. Xi on October 06, 2008 20:23:49
Last update: October 06, 2008 20:26:45
The __doc__ string on an object provides documentation for the object, which is available from an interactive Python session:
$ python
Python 2.5.1 (r251:54863, Mar 7 2008,...
Created by Dr. Xi on September 29, 2008 23:05:12
Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on August 15, 2007 18:08:34
Last update: November 08, 2007 22:00:01
I had this problem when deploying a J2EE application into Oracle app server. It worked fine with an OC4J container configured in the default group. But it failed to start with an OC4J container I created. Here's a sample stack trace of the initialization exception:
07/08/14 13:32:46.34 10.1.3.3.0 Started 07/08/1... The problem was, the struts ActionServlet loads commons logging LogFactory, the log factory somehow knows that it needs log4j, but it can't load log4j since it's loaded by a different class loader. The solution for Oracle is to omit commons logging from the list of inherited libraries. Add this to META-INF/orion-application.xml solves the problem: <imported-shared-libraries> <remove-inhe... Actually, this is a quite common problem with commons-logging. If you search the web, you'll find that people have...
Created by Dr. Xi on April 26, 2007 03:27:41
Last update: April 26, 2007 03:27:41
Use this command to remove files (whose name ends with .log) that were modified 15 (or more) days ago:
find . -name '*.log' -mtime +15 -exec rm {} \;...