Paul - The Programmer

simple & stupid

my first Perl proxy server

It's ungly but it's working!!!

So, the lesson learnt.

  • Model developing with a script language is a happy work.
  • Perl fork works on Win32, but it seems a little buggy. Awalys end up with resource tmporary unavailable error : ( May be my bad, but I am quite sure every child process and file handle has been release properly.
  • Have no idea to  Perl multi-thread.  Even the Perl declares it's a multi-thread version.
  • Perl fcntl does not work with Active Perl but is supported by cygwin porting Perl. Great work!
  • Share out-going connections may be a good idea, but how to seperate the responses for each client connection.
  • Pre-fork model seems a good idea to have a try. : )
  • HTTP connect method is to create a tunnel. Still working on this.

how does it work

result love(boy, girl)
{
    if( boy.own_house() and boy.own_car() )
    {
        boy.set(nothing);
        return girl.marry_to(boy);
    }
    while( boy.money < 100000 and girl.can_wait() )
    {
        for( day=1; day <=365; day++)
        {
            if( day == VALENTINES_DAY  )
                if( boy.give_girl( ROSE ) )
                    girl.emotion++;
                else
                    girl.emotion--;  
            if( day == girl.birthday )
                if( boy.give_girl( ROSE ) )
                   girl.emotion++;
                else
                   girl.emotion--;
            boy.earn_money_hard();
        }
        if( boy.own_house() and boy.own_car() )
        {
            boy.set(nothing);
            return girl.marry_to(boy);
        }
        boy.age++, boy.emotion++;
        girl.age++, girl.emotion--;
    }
    return girl.goto( another_boy );
}

Get oracle table primary key info

    SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
    FROM all_constraints cons, all_cons_columns cols
    WHERE cols.table_name = 'TABLE_NAME'
    AND cons.constraint_type = 'P'
    AND cons.constraint_name = cols.constraint_name
    AND cons.owner = cols.owner
    ORDER BY cols.table_name, cols.position;

-- What a terrible statement. 

-- Reference link: http://www.techonthenet.com/oracle/questions/find_pkeys.php

setup http proxy server for ppm

SET HTTP_proxy=<proxy_server_address:port_number> 

# the prefix http:// is mandatory.

# e.g., SET HTTP_proxy=http://proxy:8080

# following system variables are optional

SET HTTP_proxy_user=<your user name> 

SET HTTP_proxy_pass=<your password> 

Shape the sql*plus output

Command to make the output of sql*plus nicer to read.

set linesize 1500