Recent Notes

Displaying keyword search results 31 - 40
Created by James on June 30, 2010 19:04:45    Last update: July 03, 2010 21:24:33
Technically, file upload cannot be handled by Ajax, because XMLHttpRequest (XHR) does not handle file inputs. All techniques not using Flash rely on an invisible iframe as the upload form submit target. JavaScript then grabs the response content from the iframe and present it, giving the same illusion as Ajax. webtoolkit AIM The technique by webtoolkit is very simple. It involves 3 simple steps: include the AIM script, implement the start/finish JavaScript functions, and add an onsubmit handler to the normal file upload form. The hooked up form looks like: <head> <script type="text/javascript" src="webt... The AIM script is also quite simple: /** * * AJAX IFRAME METHOD (AIM) * http... The above code only supports HTML responses. In order to support JSON responses, the above...
Created by magnum on July 01, 2010 15:38:49    Last update: July 01, 2010 15:39:53
From Apache HTTPD docs: When acting in a reverse-proxy mode (using the ProxyPass directive, for example), mod_proxy_http adds several request headers in order to pass information to the origin server. These headers are: X-Forwarded-For The IP address of the client. X-Forwarded-Host The original host requested by the client in the Host HTTP request header. X-Forwarded-Server The hostname of the proxy server. Be careful when using these headers on the origin server, since they will contain more than one (comma-separated) value if the original request already contained one of these headers. For example, you can use %{X-Forwarded-For}i in the log format string of the origin server to log the original clients IP address, but you may get more than one address if the request passes through...
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......
Previous  1 2 3 4 5 Next