Tuesday, May 24, 2011

Proxy server

http://www.youngzsoft.net/ccproxy/proxy-server-download.htm

CC Proxy

Monday, May 23, 2011

perl send email cgi

Lots of tutorials about sending email with perl depend on some uncommon libs.
There is a common way to do so:

use Net::SMTP::SSL;


sub send_mail {
    my $to      = $_[0];
    my $subject = $_[1];
    my $body    = $_[2];

perl session cgi

http://search.cpan.org/dist/CGI-Session/lib/CGI/Session/Tutorial.pm


$session = CGI::Session->load() or die CGI::Session->errstr;
if ( $session->is_expired ) {
    die "Your session expired. Please refresh your browser to re-start your session";
}
if ( $session->is_empty ) {
    $session = $session->new();
}


print $session->header();

#save into session
$session->param('username',$username);

#read from session
$variable = $session->param('username');

Saturday, May 14, 2011

Tuesday, May 10, 2011

Java sort list -- Collections.sort sample




public static void Sort(List<Movies> items) {
Collections.sort(items, SENIORITY_ORDER);
}
static final Comparator<Movies> SENIORITY_ORDER =
        new Comparator<Movies>() {
public int compare(Movies e1, Movies e2) {
if (e1.getReleaseDate().after(e2.getReleaseDate()))
return 1;
else
return -1;
}
};

Thursday, April 14, 2011

New View of Blogger is awesome!!

Set Window on top of others

The correct way to implement a modal window is by setting  this.Owner = Application.Current.MainWindow; in the XAML, and show the dialog by using DialogName.ShowDialog();