MXcode http://mxcode.com All about coding Tue, 09 Mar 2010 03:13:09 +0000 http://wordpress.org/?v=2.7.1 en hourly 1 how to install squid-2.5.STABLE13 on linux http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/ http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/#comments Tue, 09 Mar 2010 03:12:20 +0000 admin http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/ To build and install the Squid Cache, type:

% ./configure –prefix=/usr/local/squid
% make all
% make install

To run a Cache, you will need to:

1. customize the squid.conf configuration file:
% vi /usr/local/squid/etc/squid.conf

2. start the cache:
% /usr/local/squid/sbin/squid

If you want to use the WWW interface to the Cache Manager, copy the cachemgr.cgi program into your httpd server’s cgi-bin directory.

]]>
http://mxcode.com/2010/03/how-to-install-squid-2-5-stable13-on-linux/feed/
validation problems when deploy an application in weblogic 10 http://mxcode.com/2010/03/validation-problems-when-deploy-an-application-in-weblogic-10/ http://mxcode.com/2010/03/validation-problems-when-deploy-an-application-in-weblogic-10/#comments Wed, 03 Mar 2010 11:34:07 +0000 admin http://mxcode.com/2010/03/validation-problems-when-deploy-an-application-in-weblogic-10/ Error message is:

Unable to access the selected application.
 
Exception in AppMerge flows' progression
 
Exception in AppMerge flows' progression
 
VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.3: Element 'filter@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'init-param@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'init-param@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'filter-mapping@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.:
 
VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.3: Element 'filter@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'init-param@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'init-param@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.: problem: cvc-complex-type.2.3: Element 'filter-mapping@http://java.sun.com/xml/ns/javaee' with element-only content type cannot have text content.:

If you meet this error message, please check your web.xml and make sure it does not contain any unusual characters.

]]>
http://mxcode.com/2010/03/validation-problems-when-deploy-an-application-in-weblogic-10/feed/
open a port on linux server http://mxcode.com/2010/01/open-a-port-on-linux-server/ http://mxcode.com/2010/01/open-a-port-on-linux-server/#comments Wed, 13 Jan 2010 14:39:47 +0000 admin http://mxcode.com/2010/01/open-a-port-on-linux-server/ =========================================
iptables -A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 3690 -j ACCEPT
=========================================
RH-Firewall-1-INPUT is the name of the chain, and change 3690 to the port number you expect.

You must restart the service to make it effective:
[root@localhost ~]# service iptables restart

]]>
http://mxcode.com/2010/01/open-a-port-on-linux-server/feed/
make div align center http://mxcode.com/2009/12/make-div-align-center/ http://mxcode.com/2009/12/make-div-align-center/#comments Thu, 31 Dec 2009 03:15:25 +0000 admin http://mxcode.com/2009/12/make-div-align-center/ use style as:
.style{margin-left:auto;margin-right:auto;}

or
.style{margin:0 auto;}
for short

]]>
http://mxcode.com/2009/12/make-div-align-center/feed/
ORACLE UTL_RAW.BIT_AND http://mxcode.com/2009/12/oracle-utl_raw-bit_and/ http://mxcode.com/2009/12/oracle-utl_raw-bit_and/#comments Tue, 01 Dec 2009 09:39:02 +0000 admin http://mxcode.com/2009/12/oracle-utl_raw-bit_and/ eg.
select to_number(UTL_RAW.bit_and(to_char(1), ‘3′)) from dual;

]]>
http://mxcode.com/2009/12/oracle-utl_raw-bit_and/feed/
href and onclick method in ‘A’ tag http://mxcode.com/2009/10/href-and-onclick-method-in-a-tag/ http://mxcode.com/2009/10/href-and-onclick-method-in-a-tag/#comments Fri, 16 Oct 2009 09:25:43 +0000 admin http://mxcode.com/2009/10/href-and-onclick-method-in-a-tag/ How to invoke onclick method but not go to the page head.

1
<a href="#" onclick="javascript:jsMethod();return false;">a link</a>
]]>
http://mxcode.com/2009/10/href-and-onclick-method-in-a-tag/feed/
create a swing application http://mxcode.com/2009/09/create-a-swing-application/ http://mxcode.com/2009/09/create-a-swing-application/#comments Fri, 11 Sep 2009 07:34:26 +0000 admin http://mxcode.com/2009/09/create-a-swing-application/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
 
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
 
public class Test3 extends JApplet {
 
	public void init() {
		Container contentPane = getContentPane();
 
		Icon icon = new ImageIcon(ClassLoader.getSystemResource("swing.gif")); 
		JLabel label = new JLabel(icon);
//		java.net.URL codebase = getClass().getResource("../swing.gif");
//		JLabel label = new JLabel(new ImageIcon(codebase));
 
		contentPane.setLayout(new FlowLayout());
		contentPane.add(label);
	}
 
	public static void main(String args[]) {
		final JFrame f = new JFrame();
		JApplet applet = new Test3();
 
		applet.init();
 
		f.setContentPane(applet.getContentPane());
		f.setBounds(100, 100, 308, 199);
		f.setTitle("An Application");
		f.setVisible(true);
 
		f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 
		f.addWindowListener(new WindowAdapter() {
			public void windowClosed(WindowEvent e) {
				System.exit(0);
			}
		});
	}
}
]]>
http://mxcode.com/2009/09/create-a-swing-application/feed/
how to read a url http://mxcode.com/2009/09/how-to-read-a-url/ http://mxcode.com/2009/09/how-to-read-a-url/#comments Tue, 01 Sep 2009 05:15:45 +0000 admin http://mxcode.com/2009/09/hwo-to-read-a-url/
String s = request.getRequestURL().toString();
URL url = new URL(s);
BufferedReader bf = new BufferedReader(new InputStreamReader(url.openStream()));
]]>
http://mxcode.com/2009/09/how-to-read-a-url/feed/
use kill with awk http://mxcode.com/2009/08/use-kill-with-awk/ http://mxcode.com/2009/08/use-kill-with-awk/#comments Thu, 27 Aug 2009 06:40:51 +0000 admin http://mxcode.com/2009/08/use-kill-with-awk/ kill `ps -ef | awk ‘{if($11~/WorkOrderProcessor/) print$2}’`

]]>
http://mxcode.com/2009/08/use-kill-with-awk/feed/
VI command - D & x http://mxcode.com/2009/08/vi-command-d-x/ http://mxcode.com/2009/08/vi-command-d-x/#comments Mon, 10 Aug 2009 03:16:45 +0000 admin http://mxcode.com/2009/08/vi-command-d-x/ D

The D command deletes from the cursor position to the end of the line. (D is a shortcut for d$.)

x

Often you want to delete only one or two characters. Just as r is a special change command to replace a single character, x is a special delete command to delete a single character. x deletes only the character the cursor is on.

]]>
http://mxcode.com/2009/08/vi-command-d-x/feed/