Wednesday, August 21, 2013

August 21, 2013: A painful reinstallation and rewrite of our extreme site.

It was working before extremely well with Quixote server. In my desire to upgrade to the latest QP , QPY webserver system, I have wrecked my hard work of so many years. But I know the developers of QP and QPY have a gem of a web server framework. It just occupies a few space in a Linux system. So we start documenting a fresh rewrite of our solvers using QP, QPY.

Here is what we did.

1. Download the installation files.




wget -ct 0 --no-check-certificate https://www.mems-exchange.org/software/DurusWorks/DurusWorks-1.2.tar.gz
wget -ct 0 --no-check-certificate https://www.mems-exchange.org/software/dulcinea/Dulcinea-0.22.tar.gz


2. Install DurusWorks first.

Unpack the tarball. tar xzvvf DurusWorks-1.2.tar.gz. This creates a directory DurusWorks-1.2/ with the following files: BUGFIX_AGREEMENT.txt CHANGES.txt LICENSE.txt README.txt setup.py

and the following sub directories: doc durus proto qp qpy sancho scgi

Reading the README.txt tells me that the installation instructions and other documentation are in docs/DurusWorks.html

As root create the following directories:

mkdir /www
mkdir /www/trunk
mkdir /www/pythonlib
mkdir /www/bin
mkdir /www/var;
chmod 777 /www/var
mkdir /www/qp_sites
mkdir /www/ssl
mkdir /www/cgi-bin
mkdir /www/conf


You are supposed to unpack the package at the /www/trunk directory. But if you unpacked it, you may just use a copy operation: sudo cp -Ruv * /www/trunk.

cd /www/trunk/DurusWorks
python setup.py build_ext -i
rm -r build

To be continued .....








Wednesday, March 13, 2013

Timeline for DurusWorks Installation

I should not have upgraded the working old version of QP/QPY but I was severely tempted to do so after updating the Operating System. The new QP/QPY/Durus package is now named DurusWorks, includes Sancho, Dulcinea
  • March 13, 2013
  • The software is hosted at Mems-Exchange. According to the documentation, the steps to to define a new site named named hello, is to start with a copy of the proto site:
    mkdir /www
    mkdir /www/trunk
    cp -r /www/trunk/DurusWorks/proto /www/trunk/hello 
    ln -s /www/trunk/hello/lib /www/pythonlib/hello 
    ln -s /www/trunk/hello/site /www/qp_sites/hello 
    
    Edit /www/trunk/hello/lib/ui/slash.qpy to configure the service addresses (I did not change the defaults) Edit /www/trunk/hello/site/slash.py and change the import to this:
    from hello.ui.slash import SitePublisher, SiteDirectory 
    
    I got the following when starting the qp server.
    > qp start
    Using Python base classes for persistence.
    Could not find sites in any of these places:
       /www/qp_sites
       /usr/local/lib/python2.7/dist-packages/qp/sites
    
    Interestingly I get the following output when invoking qpcheck.py:
    > qpcheck.py
    ./trunk/hello/lib/ui/slash.qpy: 'SitePublisher' is unused
    ./trunk/hello/lib/ui/slash.qpy: 'SiteDirectory' is unused
    
    Here is the directory structure of the /www
    $ ls -alR /www/*
    /www/pythonlib:
    total 8
    drwxr-xr-x 2 root root 4096 Mar 13 17:21 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    lrwxrwxrwx 1 root root   15 Mar 13 17:21 hello -> trunk/hello/lib
    
    /www/qp_sites:
    total 8
    drwxr-xr-x 2 root root 4096 Mar 13 17:22 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    lrwxrwxrwx 1 root root   16 Mar 13 17:22 hello -> trunk/hello/site
    
    /www/trunk:
    total 12
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 5 root root 4096 Mar 13 17:20 ..
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 hello
    
    /www/trunk/hello:
    total 24
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 ..
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 conf
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 doc
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 lib
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 site
    
    /www/trunk/hello/conf:
    total 12
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root 1070 Mar 13 17:19 apache2_proto.conf
    
    /www/trunk/hello/doc:
    total 12
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root   11 Mar 13 17:19 doc.txt
    
    /www/trunk/hello/lib:
    total 16
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root  149 Mar 13 17:19 __init__.py
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 ui
    
    /www/trunk/hello/lib/ui:
    total 48
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 .
    drwxr-xr-x 3 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root 3712 Mar 13 17:19 forms.qpy
    -rw-r--r-- 1 root root  229 Mar 13 17:19 __init__.py
    -rw-r--r-- 1 root root 3665 Mar 13 17:19 qwiki.qpy
    -rw-r--r-- 1 root root 9662 Mar 13 21:27 slash.qpy
    -rw-r--r-- 1 root root 9661 Mar 13 17:28 slash.qpy~
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 static
    
    /www/trunk/hello/lib/ui/static:
    total 24
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 3 root root 4096 Mar 13 21:27 ..
    -rw-r--r-- 1 root root 1054 Mar 13 17:19 all.css
    -rwxr-xr-x 1 root root 3638 Mar 13 17:19 favicon.ico
    -rw-r--r-- 1 root root   82 Mar 13 17:19 favicon.png
    -rw-r--r-- 1 root root 1450 Mar 13 17:19 proto.js
    
    /www/trunk/hello/site:
    total 16
    drwxr-xr-x 2 root root 4096 Mar 13 17:19 .
    drwxr-xr-x 6 root root 4096 Mar 13 17:19 ..
    -rw-r--r-- 1 root root  150 Mar 13 17:19 __init__.py
    -rw-r--r-- 1 root root   86 Mar 13 17:19 slash.py
    $ 
    
    I wonder what is wrong!
  • March 15, 2013
  • I followed to the letter the "standard installation" procedure published in https://www.mems-exchange.org/software/DurusWorks/DurusWorks-1.1.tar.gz/DurusWorks-1.1/doc/DurusWorks.html The problem in installation was that the scgi modules wanted the apxs compiler. We temporarily ignore this scgi and let qp serve pages temporarily. Now our problem is configuring with Apache2. I get the following error when restarting the web server!
     sudo /etc/init.d/apache2 restart
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    [Fri Mar 15 16:12:50 2013] [warn] module scgi_module is already loaded, skipping
    Syntax error on line 35 of /www/conf/apache2_proto.conf:
    Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
    Action 'configtest' failed.
    The Apache error log may have more information.
       ...fail!
    
    It turned out that I have not enabled mod_ssl! just type sudo a2enmod ssl. but that is not all, the server will look for a certificate and key! Please read the instructions to do this from help.ubuntu.com The commands I typed were (you have to do this one line at a time!)
      openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
      openssl genrsa -des3 -out server.key 1024
      openssl rsa -in server.key -out server.key.insecure
      mv server.key server.key.secure
      mv server.key.insecure server.key
      openssl req -new -key server.key -out server.csr
      mv server.csrt server.crt
      mv server.csr server.crt
    
    Then restart the apache server.

Site has to be rewritten again!

March 13, 2013 I upgraded to latest version of qp/qpy now named as durusworks 1.0. That was a bad move. Now the site extreme.adorio-research.org is inaccessible. We will spend time on bringing it up again. I get the following console output when running qp:
qp start    
Using Python base classes for persistence.

Import failed for site in /home/XXXX/qp_sites/proto
 No module named proto.ui.slash


Import failed for site in /home/XXXXX/qp_sites/extreme
 No module named extreme

Could not find sites in any of these places:
   /home/XXXXX/qp_sites
   /usr/local/lib/python2.7/dist-packages/qp/sites

Monday, February 14, 2011

Correlation Test using R software

There is no reason why anyone interested in statistical computing will not choose R software, unless they are already wedded to existing software from their school days, or the choice was already made for them by their companies or their professors!. R boasts the most number of libraries and is open source and best of all FREE!
It takes time to master the syntax and we suggest that readers should try to download and test the R software in their machine if they had not done so.

In this post, we shall describe our online solver for testing correlation between two variables X and Y.
The solver is mainly a web interface to the cor.test function available in R. This function has the following spec for input arguments:


cor.test(x, y,
alternative = c("two.sided", "less", "greater"),
method = c("pearson", "kendall", "spearman"),
exact = NULL, conf.level = 0.95, continuity = FALSE, ...)


Here is how our solver for correlation test looks like at the moment.



When the user clicks on the submit button, the solver will call the R software, grabs its output, and print the results:

0001 > x <- c(44.4,45.9,41.9,53.3,44.7,44.1,50.7,45.2,60.1)

0002 > y <- c(2.6,3.1,2.5,5.0,3.6,4.0,5.2,2.8,3.8)

0003 >

0004 > cor.test(x,y, alternative="two.sided", method="pearson",conf.level=0.9,exact=TRUE, continuity=TRUE)

0005 

0006 Pearson's product-moment correlation

0007 

0008 data:  x and y

0009 t = 1.8411, df = 7, p-value = 0.1082

0010 alternative hypothesis: true correlation is not equal to 0

0011 90 percent confidence interval:

0012 -0.02223023  0.86697863

0013 sample estimates:

0014 cor

0015 0.5711816

0016 

0017 >

The printed p-value .1082 tells us not to reject the Null hypothesis that the correlation between
x and y is zero.

We will a scattergraph to the solver in the future.


Here is our interface code for the correlation test.

__version__ = "0.0.2"  
__catalog__ = "TEST-STAT-0036"
__date__    = "2011.02.14"
__author__  = "E.P. Adorio"


from   qp.fill.form     import Form, SingleSelectWidget, RadiobuttonsWidget, TextWidget, StringWidget, CheckboxWidget
from   qp.sites.extreme.lib.uicommon  import renderheader, renderfooter, processheader, processfooter
from   math             import sqrt
from   qp.sites.extreme.lib.webutils import vecRead
from   qp.sites.extreme.lib   import webutils
from   qp.fill.directory import Directory
from   qp.pub.common     import header, footer, page, redirect
from   qp.fill.css  import BASIC_FORM_CSS
from   qp.sites.extreme.lib.webutils import vecRead, matRead, matReadByColumn, runRcode
from   qp.sites.extreme.lib.qpyutils        import printRlines, showLogo


from   scipy          import stats

import time
from   scipy          import stats

import copy
import math


def getGrFile(grType):
    grfile   = GraphicsFile("%s" % grType)
    barefile = grfile.split(str("/"))[-1]
    return grfile, barefile

def getformDict(form):
    D={}
    for field in form.get_all_widgets():
        D[field.name] = form.get(field.name)
    return D    

def asColumns(S, ncolumns):
    """
    Args:
      ncolumns is number of columns.
      S is a string containing a space delimited columns of values.
    Return value
      a list consisting of the columns of S.
    """
    columns = [[] for i in range(ncolumns)]
    for i, v in enumerate(S.split()):
        columns[i % ncolumns].append( v)
    return columns

def asRvector(x):
    """
    Arg
      x - Python string array.
    Return value
      an R vector as a string c(v1,....vn)
    """
    S = "c(" 
    for v in x:
        S += str(v) + ","
    S += ")"
    return S.replace(",)", ")")

 


def SolveProblem(form):
    D    = getformDict(form)
    x, y = asColumns(D["pairedSample"], 2)
    alpha       = float(D["alpha"])
    method      = D["method"]
    alternative = D["alternative"]
    cont        = D["continuity_correction"]
    exact       = D["exact"]

    exact = "TRUE" if exact else "FALSE"
    cont  = "TRUE" if cont else  "FALSE"

    xstr = "x <- " + asRvector(x)+"\n"
    ystr = "y <- " + asRvector(y)+"\n"
    Rcode =xstr + ystr

    conflevel = 1-alpha

    Rcode += """
cor.test(x,y, alternative="%s", method="%s",conf.level=%s,exact=%s, continuity=%s)               
""" %(alternative, method,conflevel, exact, cont)
     
    # create the R command.
    Rcode = Rcode.replace(",)", ")")
    return runRcode(Rcode)


class CorrTestPage(Directory):
    def get_exports(self):
        yield ('',       'index',   'Correlation test for Paired Data', "R stat software corr.test for Correlation")

    def index[html](self):
        form = Form(enctype = "multipart/form-data")

        form.add(CheckboxWidget, name = "continuity_correction", \
                 value = True,
                )
        form.add(CheckboxWidget, name = "exact", \
                 value = True,
                )

        form.add(TextWidget,  name = "pairedSample",  \
                 rows = "10", cols = "30", value=""" 
          44.4 2.6
          45.9 3.1
          41.9 2.5
          53.3 5.0
          44.7 3.6
          44.1 4.0
          50.7 5.2
          45.2 2.8
          60.1 3.8
                """
                )

        form.add(StringWidget, name = "alpha", size = 5, value = "0.10")
        form.add(SingleSelectWidget, name="alternative", options=[
                 ("two.sided", "two.sided"),
                 ("less", "less"),
                 ("greater", "greater")])

        form.add(SingleSelectWidget, name="method", options=[
                 ("pearson", "Pearson"),
                 ("kendall", "Kendall"),
                 ("spearman", "Spearman")])


        form.add_hidden("time",   value = time.time())
        form.add_submit("submit", "submit")


        def render [html] ():
            renderheader("Correlation test using R-software")

            pairedSample = form.get_widget("pairedSample")
            alpha = form.get_widget("alpha")
            exact = form.get_widget("exact")
            method   = form.get_widget("method")
            alternative = form.get_widget("alternative")
            cont = form.get_widget("continuity_correction")
            """
            







MethodAlternativeAlphaContinuity CorrectionExact p value?
%s %s%s%s%s
X Y data
%s
""" %( method.render(), alternative.render(), alpha.render(),cont.render(), exact.render(), pairedSample.render())

renderfooter(form, __version__, __catalog__, __author__)

if not form.is_submitted():
return page('CorrTestPage', render(), style= BASIC_FORM_CSS)

def process [html] ():
processheader("Correlation test using R software corr.test() function")
calctime_start = time.time()

if True:
flag, output = SolveProblem(form)
printRlines(output)

if 0:
for widget in form.get_all_widgets():
"
%s %s
" % (widget.name, widget.value)
processfooter(form, calctime_start, "./", "./stest_t1samp")
process()

Tuesday, February 1, 2011

Creating a Unit Conversion Page

We had a unit conversion page before but I felt the initial code was too complicated to maintain. A rewrite was necessary and though the page is still at version 0.0.1, we feel that the rewrite is justified. Here is the code, using Python and QP. I need a web artist or graphic designer to add color and spice to the unit conversion page.

from qp.sites.extreme.lib.config import image_dir, homeurl



__version__ = "0.0.1 2011.01.28"
__date__    = "2011.01.28"
__catalog__ = "UNITS-CONV-001"
__author__  = "ernesto.adorio@gmail.com"
__url__     = homeurl + "solvers/units/"
__title__   = "Fundamental Units Conversion Page"


from qp.pub.common      import get_session
from qp.fill.css        import BASIC_FORM_CSS
from qp.fill.directory  import Directory
from quixote.errors     import PublishError
from quixote.util       import dump_request
from qp.fill.form       import Form
from qp.fill.widget    import CheckboxWidget,StringWidget,SingleSelectWidget, StringWidget, TextWidget
from qp.pub.common      import header, footer, page, redirect
from   qp.sites.extreme.lib.uicommon import renderheader, renderfooter, processheader, processfooter
import time
import urllib

from unitslib import Length, Mass, Time, convert


import urllib, urllib2, os

from  qp.sites.extreme.lib.webutils  import before, after
from  qp.sites.extreme.lib import config


def getstatusoutput(command):
     """
     Fredrick Lundh 
     http://mail.python.org/pipermail/python-list/2006-October/406444.html 
     """
     from subprocess import Popen, PIPE, STDOUT
     p = Popen(command, stdout=PIPE, stderr=STDOUT, shell=True)
     s = p.stdout.read().split("\n")
     return p.wait(), s


class UnitsDirectory(Directory):
    def get_exports(self):
        yield '', 'index', 'NetTools server', None



    def index (self):
        form  = Form(enctype = "multipart/form-data")  # enctype for file upload

 form.add(StringWidget, name = "qty_length", value = "1.0", size = 30)
        length_options = []
        for key in Length:
            length_options.append(key)
      
 form.add(SingleSelectWidget, name = "unit_length",
           value = "meter",  
           options=length_options
        )   


 form.add(StringWidget, name = "qty_mass", value = "1.0", size = 30)
        mass_options = []
        for key in Mass:
            mass_options.append(key)
      
 form.add(SingleSelectWidget, name = "unit_mass",
           value = "kilogram",  
           options=mass_options
        )   

 form.add(StringWidget, name = "qty_time", value = "1.0", size = 30)
        time_options = []
        for key in Time:
            time_options.append(key)
      
 form.add(SingleSelectWidget, name = "unit_time",
           value  = "second",  
           options=time_options
        )   

 form.add_hidden("time",   value = time.time()) 
        form.add_submit("submit", "submit")

 def render [html] ():
            renderheader(__title__)
            if 1:
              """
              

Length Unit

%s%s
""" % (form.get_widget("qty_length").render(), form.get_widget("unit_length").render()) """

Mass Unit

%s%s
""" % (form.get_widget("qty_mass").render(), form.get_widget("unit_mass").render()) """

Time Unit

%s%s
""" % (form.get_widget("qty_time").render(), form.get_widget("unit_time").render()) "The quantified unit will be converted in other equivalent units." renderfooter(form, __version__, __catalog__, __author__) if not form.is_submitted(): return page('UnitsDirectory', render(), style= BASIC_FORM_CSS) def process [html] (): processheader("Unit Utility") calctime_start = time.time() "" "" "" "" "
"
qty = float(form.get("qty_length"))
unit = form.get("unit_length")

"

Length Conversion

"


'' % (qty, unit) for u in Length.keys(): " " % (convert(Length, qty, unit, u),u) "
Input [%s %s]
%s%s
"
"
"
qty = float(form.get("qty_mass"))
unit = form.get("unit_mass")

"

Mass Conversion

"
'' % (qty, unit) for u in Mass.keys(): " " % (convert(Mass, qty, unit, u),u) "
Input [%s %s]
%s%s
"
"
"
qty = float(form.get("qty_time"))
unit = form.get("unit_time")
"

Time Conversion

"

'' % (qty, unit) for u in Time.keys(): " " % (convert(Time, qty, unit, u),u) "
Input [%s %s]
%s%s
"
"
" processfooter(form, calctime_start, homeurl, __url__) return process()

Yuck! the html output code is being translated by a browser! Use your browswerĊ› View Source facility to recover the original contents.

Codes are provided for educational use. Please make the proper attribution.


Only the fundamental units for Length, Mass and Time are considered here, we will add unit conversions for other quantities such as Area, Volume/Capacity, Work/Energy, Pressure and others.

The solver page may be accessed at http://extreme.adorio-research.org/solvers/units/.

The Python code units.py which is called by the above QP interface code above is at http://adorio-research.org/wordpress/?p=10377.

Our reference to conversion values is http://physics.nist.gov/Pubs/SP811/appenB9.html#LENGTH
for length units. The Mass and Time units are similarly obtained from NIST.

Sunday, January 23, 2011

Creating a network tools service page

I first wrote the following code in 2008 and it is still running. People who work in Linux are blessed with plenty of open source and free software tools for networking. Here are five tools which we use in our nettools service page:ping, whois, nslookup, traceroute, and dig.


We show the code, using the mean and lean QP web framework for future reference.
More details are avaiable from the link Digital Explorations, our main blog site.




from qp.sites.extreme.lib.config import image_dir, homeurl

__version__ = "0.0.1 2008.10.23"
__date__    = "2008.10.23"
__catalog__ = "SERV-NETTOOLS-001"
__author__  = "ernesto.adorio@gmail.com"
__url__     = homeurl + "services/nettools/"
__title__   = "NetTools Service Page"



from qp.fill.css        import BASIC_FORM_CSS
from qp.fill.directory  import Directory
from quixote.errors     import PublishError
from quixote.util       import dump_request
from qp.fill.form       import Form
from qp.fill.widget    import CheckboxWidget,StringWidget,SingleSelectWidget, StringWidget, TextWidget
from qp.pub.common      import header, footer, page, redirect
from   qp.sites.extreme.lib.uicommon import renderheader, renderfooter, processheader, processfooter
import time
import urllib



import urllib, urllib2, os

from  qp.sites.extreme.lib.webutils  import before, after
from  qp.sites.extreme.lib import config


def getstatusoutput(command):
     """
     Fredrick Lundh 
     http://mail.python.org/pipermail/python-list/2006-October/406444.html 
     """
     from subprocess import Popen, PIPE, STDOUT
     p = Popen(command, stdout=PIPE, stderr=STDOUT, shell=True)
     s = p.stdout.read().split("\n")
     return p.wait(), s

def isAddressOK(Address):
    """
    Check for bad addresses.
    """
    #Quickie checks.
    if " " in Address:
       return False,"Embedded blanks are not allowed inside addresses"
    if "." not in Address:
       return False
    if Address.startswith("-"): # attempt to hack?
       return False, "Addresses do not start with a dash (-)."

    #Pure numeric address?
    return True, "Ok"


class NetToolsPage(Directory):
    def get_exports(self):
        yield '', 'index', 'NetTools server', None



    def index (self):
        form  = Form(enctype = "multipart/form-data")  # enctype for file upload

 form.add(StringWidget, name = "Address", value = "www.adorio-research.org", size = 30)
        
 form.add(SingleSelectWidget, name = "service",
        value = "ping",  options=[("ping", "ping"),
        ("whois", "whois"), 
        ("nslookup", "nslookup"),
        ("traceroute","traceroute"),
        ("dig", "dig")])

                 
 form.add_hidden("time",   value = time.time()) 
        form.add_submit("submit", "submit")


 
 def render [html] ():
            renderheader(__title__)
     
            """
%sAddress or domain name
%sService command
Please wait for the output to be displayed after clicking on the submit button! """ % (form.get_widget("Address").render(), form.get_widget("service").render()) renderfooter(form, __version__, __catalog__, __author__) if not form.is_submitted(): return page('NetToolsPage', render(), style= BASIC_FORM_CSS) def process [html] (): processheader("NetTools Server") calctime_start = time.time() Address = form.get("Address") service = form.get("service") if service == "ping": command = "ping -c 5 %s" % Address else: command = "%s %s" % (service, Address) status = 0 addressOK, errormessage = isAddressOK(Address) if addressOK: status, output = getstatusoutput(command) if status == 0: """
"""
                  for line in output:
                     "\n%s
" % line
                  """
""" else: """ Something is wrong with the input Address. [%s] Setting status to -1. """ % errormessage status = -1 if status: "Error in processing command[%s], exit code =%s " % (command, status) """Check for valid addresses. Embedded blanks are not allowed and must contain a dot "." and must not start with a "-".
""" processfooter(form, calctime_start, homeurl, __url__) return process()

Visitors to this web service will be naturally curious what IP address of their ISP is. We will add this feature SOON!

We just did! Take a look at the first screen shot. The second screenshot is the output page.




I just imported the get_sesson from qp.pub.common and made the call
remote_address= get_session.get_remote_address()

You can see the result in the first image above.