Recent Notes

Displaying keyword search results 21 - 30
Created by Dr. Xi on June 11, 2010 19:04:18    Last update: June 11, 2010 19:06:35
The caret ^ is DOS command line escape character. Example 1: echo < and > as is, not interpreting them as input/output redirect. @rem sign an XML file. Requires Java class utils.x... Example 2: treat & literally, not as the special character to combine two commands. @rem search "dos command line" in Google. curl ... Add switch -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" to make curl look like Firefox.
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 April 01, 2010 22:24:58    Last update: April 02, 2010 02:49:38
In this note I'll show you how to create and package a JSP custom tag. The purpose of this tag is to display a random splash image for a home page, among a set of images. We should be able to add or delete candidate splash images from the WAR archive without the need to change the JSP. This is the intended use of the tag: <%@ taglib uri="http://custom.tag.com/demo" prefix... In the above example you provide a set of images named splash*.png (e.g., splash1.png, spalsh2.png, ...), and the tag will pick a random one to display when the JSP is rendered. Let's get started. I'll use Maven for this purpose. Create the standard Maven directory structure ./pom.xml ./src ./src/main ./src/main/jav... pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... SplashTag.java package tagdemo; import java.util.ArrayList......
Created by James on October 11, 2009 21:15:53    Last update: October 11, 2009 21:19:39
Many techniques for making rounded corners do not work well when the element being rounded is displayed on a background with a different color (or multiple colors). Example 1: Nifty Cube with JavaScript <html> <head> <base href="http://www.html.i... Example 2: modx Simple Rounded Corner Box <html> <head> <title>Round Corner</title> ... Example 3: CSS3 (does not work in IE) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ... Example 4: This is one that actually works ! The nifty corner technique can be tweaked to be background friendly, although the JavaScript version didn't work for some reason. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...
Created by Dr. Xi on March 10, 2009 23:42:59    Last update: March 10, 2009 23:44:56
It seems that dt , dd doesn't exactly line them up either. With this HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... I got this for IE:
Created by James on March 10, 2009 21:11:18    Last update: March 10, 2009 23:01:24
iretuotiowur, The reason I used block to render the labels is to avoid long labels from flowing underneath the checkbox. I'm not sure I understand your proposed solution. As far as I know, text-indent only applies to the first line of a paragraph. And I just found that Firefox does not honor it for label s (IE indents the first line as usual). For example, this page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... renders like this in Firefox:
Created by James on February 22, 2009 00:12:50    Last update: February 23, 2009 02:55:31
This note records my struggle to get a checkbox aligned with its label in Firefox and IE. Starting HTML code. Use default attributes. Both checkbox and label float to the left. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... IE looked OK. Firefox is messed up. Long label shifted to the next line. IE 7: Firefox 3.0.6: Set width of label to that of the containing DIV: <style type="text/css"> label { display:... Both IE and Firefox shift the label to the next line. That's reasonable because the DIV isn't wide enough to contain the label and the browser tried its best to render the label properly. IE 7 and Firefox 3.0.6: Set width of label to be less than the containing DIV: <style type="text/css"> label { display:......
Created by Dr. Xi on August 21, 2008 22:35:24    Last update: October 16, 2008 02:27:59
import java.net.*; import java.io.*; pub... An example for POSTing from Java is available from here: http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
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 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 ...
Previous  1 2 3 Next