/[ddp]/manuals/trunk/quick-reference/asciidoc/12_program.txt
ViewVC logotype

Diff of /manuals/trunk/quick-reference/asciidoc/12_program.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6871 by osamu, Fri Aug 21 18:37:23 2009 UTC revision 6872 by osamu, Sat Aug 22 05:41:18 2009 UTC
# Line 166  else Line 166  else
166  fi  fi
167  --------------------  --------------------
168    
169  Here trailing "`|| true`" was needed to ensure this shell script will not exit at this line accidentally when shell is invoked with "`-e`" flag.  Here trailing "`|| true`" was needed to ensure this shell script does not exit at this line accidentally when shell is invoked with "`-e`" flag.
170    
171  .List of file comparison operators in the conditional expression  .List of file comparison operators in the conditional expression
172  [grid="all"]  [grid="all"]
# Line 515  The backtrace can be obtained by the fol Line 515  The backtrace can be obtained by the fol
515    
516  - Run the program under `gdb`(1).  - Run the program under `gdb`(1).
517  - Reproduce crash.  - Reproduce crash.
518   * It will cause you to be dropped back to the `gdb` prompt.   * It causes you to be dropped back to the `gdb` prompt.
519  - Type "`bt`" at the `gdb` prompt.  - Type "`bt`" at the `gdb` prompt.
520    
521  In case of program freeze, you can crash the program by pressing `Ctrl-C` in the terminal running `gdb` to obtain `gdb` prompt.  In case of program freeze, you can crash the program by pressing `Ctrl-C` in the terminal running `gdb` to obtain `gdb` prompt.
522    
523  TIP: Often, you will see a backtrace where one or more of the top lines are in "`malloc()`" or "`g_malloc()`". When this happens, chances are your backtrace isn\'t very useful. The easiest way to find some useful information is to set the environment variable "`$MALLOC_CHECK_`" to a value of 2 (`malloc`(3)). You can do this while running `gdb` by doing the following.  TIP: Often, you see a backtrace where one or more of the top lines are in "`malloc()`" or "`g_malloc()`". When this happens, chances are your backtrace isn\'t very useful. The easiest way to find some useful information is to set the environment variable "`$MALLOC_CHECK_`" to a value of 2 (`malloc`(3)). You can do this while running `gdb` by doing the following.
524    
525  --------------------  --------------------
526   $ MALLOC_CHECK_=2 gdb hello   $ MALLOC_CHECK_=2 gdb hello
# Line 667  http://en.wikipedia.org/wiki/Autoconf[Au Line 667  http://en.wikipedia.org/wiki/Autoconf[Au
667    
668  WARNING: Do not overwrite system files with your compiled programs when installing them.  WARNING: Do not overwrite system files with your compiled programs when installing them.
669    
670  Debian does not touch files in "`/usr/local/`" or "`/opt`".  So if you compile a program from source, install it into "`/usr/local/`" so it will not interfere with Debian.  Debian does not touch files in "`/usr/local/`" or "`/opt`".  So if you compile a program from source, install it into "`/usr/local/`" so it does not interfere with Debian.
671    
672  --------------------  --------------------
673  $ cd src  $ cd src
# Line 737  See `perlrun`(1) for the command-line op Line 737  See `perlrun`(1) for the command-line op
737  Basic interactive dynamic web pages can be made as follows.  Basic interactive dynamic web pages can be made as follows.
738    
739  - Queries are presented to the browser user using http://en.wikipedia.org/wiki/HTML[HTML] forms.  - Queries are presented to the browser user using http://en.wikipedia.org/wiki/HTML[HTML] forms.
740  - Filling and clicking on the form entries will send one of the following http://en.wikipedia.org/wiki/Uniform_Resource_Locator[URL] string with encoded parameters from the browser to the web server.  - Filling and clicking on the form entries sends one of the following http://en.wikipedia.org/wiki/Uniform_Resource_Locator[URL] string with encoded parameters from the browser to the web server.
741   * "`http://www.foo.dom/cgi-bin/program.pl?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"   * "`http://www.foo.dom/cgi-bin/program.pl?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"
742   * "`http://www.foo.dom/cgi-bin/program.py?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"   * "`http://www.foo.dom/cgi-bin/program.py?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"
743   * "`http://www.foo.dom/program.php?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"   * "`http://www.foo.dom/program.php?VAR1=VAL1&VAR2=VAL2&VAR3=VAL3`"
744  - "`%nn`" in URL is replaced with a character with hexadecimal `nn` value.  - "`%nn`" in URL is replaced with a character with hexadecimal `nn` value.
745  - The environment variable is set as: "`QUERY_STRING="VAR1=VAL1 VAR2=VAL2 VAR3=VAL3"`".  - The environment variable is set as: "`QUERY_STRING="VAR1=VAL1 VAR2=VAL2 VAR3=VAL3"`".
746  - http://en.wikipedia.org/wiki/Common_Gateway_Interface[CGI] program (any one of "`program.\*`") on the web server executes itself with the environment variable "`$QUERY_STRING`".  - http://en.wikipedia.org/wiki/Common_Gateway_Interface[CGI] program (any one of "`program.\*`") on the web server executes itself with the environment variable "`$QUERY_STRING`".
747  - `stdout` of CGI program will be sent to the web browser and is presented as an interactive dynamic web page.  - `stdout` of CGI program is sent to the web browser and is presented as an interactive dynamic web page.
748    
749  For security reasons it is better not to hand craft new hacks for parsing CGI parameters.  There are established modules for them in Perl and Python.  http://en.wikipedia.org/wiki/PHP[PHP] comes with these functionalities.  When client data storage is needed, http://en.wikipedia.org/wiki/HTTP_cookie[HTTP cookies] are used.  When client side data processing is needed, http://en.wikipedia.org/wiki/JavaScript[Javascript] is frequently used.  For security reasons it is better not to hand craft new hacks for parsing CGI parameters.  There are established modules for them in Perl and Python.  http://en.wikipedia.org/wiki/PHP[PHP] comes with these functionalities.  When client data storage is needed, http://en.wikipedia.org/wiki/HTTP_cookie[HTTP cookies] are used.  When client side data processing is needed, http://en.wikipedia.org/wiki/JavaScript[Javascript] is frequently used.
750    

Legend:
Removed from v.6871  
changed lines
  Added in v.6872

  ViewVC Help
Powered by ViewVC 1.1.5