lunedì 13 maggio 2013

Hierarchical data in a relational database

Hi All

Today an interesting article about how represents hierarchical data in a relational database.

 http://fungus.teststation.com/~jon/treehandling/TreeHandling.htm

Interesting this concept :




Every node must have a node identify and a "Child of" identify. So the key of every object is formed by two keys :

  • ID_NODE
  • CHILD_OF

For example (represents image above) :

ID_NODE  CHILD_OF
1
1
2
1
3
1
4
2
5
3
6
5


Stay tuned.







giovedì 9 maggio 2013

How To Identify If a Port Is Listening on a Unix Server



Hi all

To see if a port is listening on a Unix Server command is :

           netstat -an | grep port number | grep LISTEN

To see what process is using a port the command is :

           lsof -i tcp:port number

Here a simple perl programm to open a port and check a connection from a client web :


#!/usr/bin/perl -w
        use IO::Socket;
        use Net::hostent;              # for OO version of gethostbyaddr
        $PORT = 8080;

        $server = IO::Socket::INET->new( Proto     => 'tcp',
                                         LocalPort => $PORT,
                                         Listen    => 5,
                                         Reuse     => 1) or die "can't setup server" unless $server;

    printf("\nSERVER Waiting for client connection on port $PORT");

         while ($client = $server->accept()) {

          printf("\nClient Connected\n");

          $client->autoflush(1);
          print $client " Connected You are connected on port $PORT";

          close $client;
        }

Stay tuned


Check Mid Year Objectives

Hi all Today middle year check of my 2026's goals. 1. ENGLISH Improve listening comprehension (So and So)   See at least one or two film...