http://www.freespamfilter.org/
tonyn | November 26, 2008postfix as Exchange gateway
tonyn | November 24, 2008Export Exchange email address into a text file:
export-exchange-address-to-textfile.cmd
#————————————-#
csvde -m -n -g -f c:\ex-address.txt -r “(|(&(objectclass=user) (objectcategory=person)) (objectclass=groupofnames) (objectclass=msexchdynamicdistributionlist))” -l proxyaddresses
-
extract_valid_recipients.sh
#————————-#
#!/bin/bash
cat $1 | tr -d \” | tr , \\n | tr \; \\n | awk -F\: ‘/(SMTP|smtp):/{printf(”%s\tOK\n”,$2)}’ |\grep -v -f blacklist > $2
-
extract_valid_senders.sh
#———————-#
#!/bin/bash
cat $1 | tr -d \” | tr , \\n | tr \; \\n | awk -F\: ‘/SMTP:/ {printf(”%s\tOK\n”,$2)}’ |\grep -v -f blacklist > $2
SSL versus TLS versus STARTTLS
tonyn | November 17, 2008Java Panels and layouts
tonyn | November 13, 2008Panels
Panels are rectangular components, which serve two main purpose:
1. they can be used as canvas that one draws on
2. they can be used as containers to embed further graphical components
Java Interface
tonyn |[public] interface interface-name {
[class-variable-declaration(s)]
[abstract-method-declaration(s)]
}
Implementing event handlings
public void addCategoryListener(CateoryListener l)
Defines another method
public void removeCategoryListener(CategoryListener)
addXXX();
removeXXX();
-
Example:
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
-
The steps in setting up event handling for a GUI are:
1. Identify the category of the event the GUI component is expected to handle.
2. Write an event handler class that implements the listener interface.
3. While constructing the GUI, create the GUI component and an object of the event handler class.
4. Call the addXXX() method of the GUI component to register the event handler object to be its event handler.
GUI listener classes and the defined methods
tonyn |
Category |
Listener type name |
Method defined |
| Action | ActionListener | void actionPerformed(ActionEvent e) |
| Adjustment | AdjustmentListener | void adjustmentValueChanged(AdjustmentEvent e) |
| Component | ComponentListener | void componentHidden(ComponentEvent e) void componentMoved(ComponentEvent e) void componentResized(ComponentEvent e) void componentShown(ComponentEvent e) |
| Container | ContainerListener | void componentAdded(ContainerEvent e) void componentRemoved(ContainerEvent e) |
| Focus | FocusListener | void focusGained(FocusEvent e) void focusLost(FocusEvent e) |
| Item | ItemListener | void itemStateChanged(ItemEvent e) |
| Key | KeyListener | void keyPressed(KeyEvent e) void keyReleased(KeyEvent e) void keyTyped(KeyEvent e) |
| Mouse | MouseListener | void mouseClicked(MouseEvent e) void mouseEntered(MouseEvent e) void mouseExited(MouseEvent e) void mousePressed(MouseEvent e) void mouseReleased(MouseEvent e) |
| Mouse motion | MouseMotionListener | void mouseDragged(MouseEvent e) void mouseMoved(MouseEvent e) |
| Text | TextListener | void textValueChanged(TextEvent e) |
| Window | WindowListener | void windowActivated(WindowEvent e) void windowClosed(WindowEvent e) void windowClosing(WindowEvent e) void windowDeactivated(WindowEvent e) void windowDeiconified(WindowEvent e) void windowIconified(WindowEvent e) void windowOpened(WindowEvent e) |
The definition of the handler class:
[public] class class-name [extends superclass-name] implements ActionListener {
….
public void actionPerformed(ActionEvent ae) {
….
}
}