Secciones de la página

apa. tol


Declaraciones


Funciones


Time oriented language


Árbol de ficheros

Funciones

Set ApaBetween2Tag()

Set ApaBetween2TagFile()

Set ApaLineSet()

Set ApaUrl()

Set ApaUrlFile()

Real ApaSplitFile()

Tol

Artículos del sitio

Presentación de Tol

Todos los programas

Simuladores visuales

Sitios que me gustan

Por categorías

Algoritmia

Búsqueda y ordenación

Computación fisiológica

Editorial y edición

Gráficos de datos

Herramientas y utilidades

Hipertexto

Informática forense

Lectura óptica de datos

Metaprogramación

No determinista

Ofimática

Recursión e iteración

Reglas y restricciones

Series y estadística









apa.tol de Ink.Watercolor

Apache log file functions

Declaraciones

Funciones

  • Set ApaBetween2Tag(Set linSet, Text tagIni, Text tagEnd)
    Returns a table with different text that appear between 2 tags. For each text there are a line [[ text, number of ocurrences (Real)]].
  • Set ApaBetween2TagFile(Text logPth, Text tagIni, Text tagEnd)
    Returns a table with different text that appear between 2 tags inside a log file. For each text there are a line [[ text, number of ocurrences (Real)]].
  • Set ApaLineSet(Text logPth)
    Returns a set with all lines of a log file. The empty lines are removed.
  • Set ApaUrl(Set linSet)
    Returns a table with different urls of a set of log lines. For each url there are a line [[ url (Text), number of ocurrences (Real)]].
  • Set ApaUrlFile(Text logPth)
    Returns a table with different urls of a log file. For each url there are a line [[ url (Text), number of ocurrences (Real)]].
  • Real ApaSplitFile(Text logPth, Text outPth, Text prefix, Text filErr)
    Split an Apache log file (logPth) y several files by date and returns the number lines processed. Each output file has the name: <outPth> + / + <prefix> + YYYYMMDD + .log The error line are stored at filErr.

Funciones

Set ApaBetween2Tag()

//////////////////////////////////////////////////////////////////////////////
Set ApaBetween2Tag(Set  linSet, // Set of log lines,
                   Text tagIni, // Initial tag
                   Text tagEnd) // End tag
//////////////////////////////////////////////////////////////////////////////
{
  Set  set = EvalSet(linSet, Text(Text lin)
             { TxtBetween2Tag(lin, tagIni, tagEnd, TRUE) });
  SetTxtCount(set, TRUE)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different text that appear between 2 tags.
For each text there are a line [[ text, number of ocurrences (Real)]].",
ApaBetween2Tag);
//////////////////////////////////////////////////////////////////////////////

Set ApaBetween2TagFile()

//////////////////////////////////////////////////////////////////////////////
Set ApaBetween2TagFile(Text logPth, // Input file path
                       Text tagIni, // Initial tag
                       Text tagEnd) // End tag
//////////////////////////////////////////////////////////////////////////////
{
  Set  linSet = ApaLineSet(logPth); // Read log file
  ApaBetween2Tag(linSet, tagIni, tagEnd)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different text that appear between 2 tags inside a log
file.
For each text there are a line [[ text, number of ocurrences (Real)]].",
ApaBetween2TagFile);
//////////////////////////////////////////////////////////////////////////////

Set ApaLineSet()

//////////////////////////////////////////////////////////////////////////////
Set ApaLineSet(Text logPth) // Input file path
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(FileExist(logPth)), Empty,
  {
    Text logTxt = ReadFile(logPth);
    Set  linSet = Tokenizer(logTxt,"\n");
    Select(linSet, Real(Text lin) { lin != "" })
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set with all lines of a log file.
The empty lines are removed.",
ApaLineSet);
//////////////////////////////////////////////////////////////////////////////

Set ApaUrl()

//////////////////////////////////////////////////////////////////////////////
Set ApaUrl(Set linSet) // Set of log lines
//////////////////////////////////////////////////////////////////////////////
{
  Set urlSet = EvalSet(linSet, Text(Text lin)
               { Compact(Sub(lin,1,TextFind(lin," - - ["))) });
  SetTxtCount(urlSet, TRUE) // Count different urls that aren't null
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different urls of a set of log lines.
For each url there are a line [[ url (Text), number of ocurrences (Real)]].",
ApaUrl);
//////////////////////////////////////////////////////////////////////////////

Set ApaUrlFile()

//////////////////////////////////////////////////////////////////////////////
Set ApaUrlFile(Text logPth) // Input file path
//////////////////////////////////////////////////////////////////////////////
{
  Set  linSet = ApaLineSet(logPth); // Read log file
  ApaUrl(linSet)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different urls of a log file.
For each url there are a line [[ url (Text), number of ocurrences (Real)]].",
ApaUrlFile);
//////////////////////////////////////////////////////////////////////////////

Real ApaSplitFile()

//////////////////////////////////////////////////////////////////////////////
Real ApaSplitFile(Text logPth, // Input file path
                  Text outPth, // Output path
                  Text prefix, // File prefix
                  Text filErr) // Error file
//////////////////////////////////////////////////////////////////////////////
{
  FilSplit(logPth, TRUE, Text(Text lin)
  {
    Text dteTxt = TxtBetween2Tag(lin, "[", "]", TRUE);
    If(dteTxt=="", filErr,
    {
      Date dte = Txt2Dte(dteTxt, "dd/mmm/yyyy");
      If(dte==UnknownDate, filErr,
         outPth+"/"+prefix+FormatDate(dte,"%c%Y%m%d")+".log")
    })
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Split an Apache log file (logPth) y several files by date and returns the
number lines processed.
Each output file has the name: <outPth> + / + <prefix> + YYYYMMDD + .log
The error line are stored at filErr.",
ApaUrlFile);
//////////////////////////////////////////////////////////////////////////////

Time oriented language

//////////////////////////////////////////////////////////////////////////////
// FILE    : apa.tol
// AUTHOR  : http://www.asolver.com
// PURPOSE : Apache log file functions
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
Set ApaBetween2Tag(Set  linSet, // Set of log lines,
                   Text tagIni, // Initial tag
                   Text tagEnd) // End tag
//////////////////////////////////////////////////////////////////////////////
{
  Set  set = EvalSet(linSet, Text(Text lin)
             { TxtBetween2Tag(lin, tagIni, tagEnd, TRUE) });
  SetTxtCount(set, TRUE)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different text that appear between 2 tags.
For each text there are a line [[ text, number of ocurrences (Real)]].",
ApaBetween2Tag);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set ApaBetween2TagFile(Text logPth, // Input file path
                       Text tagIni, // Initial tag
                       Text tagEnd) // End tag
//////////////////////////////////////////////////////////////////////////////
{
  Set  linSet = ApaLineSet(logPth); // Read log file
  ApaBetween2Tag(linSet, tagIni, tagEnd)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different text that appear between 2 tags inside a log
file.
For each text there are a line [[ text, number of ocurrences (Real)]].",
ApaBetween2TagFile);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set ApaLineSet(Text logPth) // Input file path
//////////////////////////////////////////////////////////////////////////////
{
  If(Not(FileExist(logPth)), Empty,
  {
    Text logTxt = ReadFile(logPth);
    Set  linSet = Tokenizer(logTxt,"\n");
    Select(linSet, Real(Text lin) { lin != "" })
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set with all lines of a log file.
The empty lines are removed.",
ApaLineSet);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set ApaUrl(Set linSet) // Set of log lines
//////////////////////////////////////////////////////////////////////////////
{
  Set urlSet = EvalSet(linSet, Text(Text lin)
               { Compact(Sub(lin,1,TextFind(lin," - - ["))) });
  SetTxtCount(urlSet, TRUE) // Count different urls that aren't null
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different urls of a set of log lines.
For each url there are a line [[ url (Text), number of ocurrences (Real)]].",
ApaUrl);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set ApaUrlFile(Text logPth) // Input file path
//////////////////////////////////////////////////////////////////////////////
{
  Set  linSet = ApaLineSet(logPth); // Read log file
  ApaUrl(linSet)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a table with different urls of a log file.
For each url there are a line [[ url (Text), number of ocurrences (Real)]].",
ApaUrlFile);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Real ApaSplitFile(Text logPth, // Input file path
                  Text outPth, // Output path
                  Text prefix, // File prefix
                  Text filErr) // Error file
//////////////////////////////////////////////////////////////////////////////
{
  FilSplit(logPth, TRUE, Text(Text lin)
  {
    Text dteTxt = TxtBetween2Tag(lin, "[", "]", TRUE);
    If(dteTxt=="", filErr,
    {
      Date dte = Txt2Dte(dteTxt, "dd/mmm/yyyy");
      If(dte==UnknownDate, filErr,
         outPth+"/"+prefix+FormatDate(dte,"%c%Y%m%d")+".log")
    })
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Split an Apache log file (logPth) y several files by date and returns the
number lines processed.
Each output file has the name: <outPth> + / + <prefix> + YYYYMMDD + .log
The error line are stored at filErr.",
ApaUrlFile);
//////////////////////////////////////////////////////////////////////////////

Árbol de ficheros

Ink.Watercolor construye las páginas del sitio web inkwatercolor.com

  • make.tol proceso principal de generación de contenidos del sitio web
  • tol directorios de código fuente en lenguaje de programación Tol
    • cmm funciones comunes de textos, fechas, conjuntos, ficheros, etc.
      • txt.tol funciones de manejo de textos
      • set.tol funciones de manejo de conjuntos
      • tab.tol funciones de tablas como set of sets
      • ser.tol funciones de series temporales
      • fil.tol funciones de gestión de ficheros
      • zip.tol compresor de ficheros en línea de mandatos
      • apa.tol proceso de ficheros de log de Apache
      • dir.tol funciones de gestión de directorios
    • app funciones especificas de Ink.Watercolor
      • pdb.tol funciones de la base de datos de pinturas
      • pag.tol funciones para generar páginas web Html
      • sed.tol semillas, templates, de páginas web Html
      • ftp.tol funciones para generar mandatos para hacer Ftp
      • xml.tol funciones históricas para sitemaps en Xml
      • alc.tol alchemy para la transformación de imágenes
      • ink.tol funciones auxiliares de InkWatercolor
    • inc.tol inclusión de los ficheros Tol básicos y de aplicación
  • agenda directorio destinado a albergar los ficheros de agendas de posts
    • chpphodb01.txt ejemplo con las 4 primeras obras artísticas que se incluyeron
  • web directorio destinado a las paginas web generadas automáticamente
    • common directorio de recursos comunes a todas las galerías
      • css directorio para ficheros de estilo
        • common.css fichero de estilo para las paginas Html del sitio web
      • seed trozos de código Html para construir templates
        • strseed.htm estructura básica de página Html de inkwatercolor.com
        • pi1lowseed.htm estructura para albergar información sobre una obra
        • pi4cntseed.htm estructura para albergar 4 pinturas en una página
      • src directorio para ficheros javascript
    • chppho directorio para la galería principal de Inkwatercolor
      • index.html ejemplo de página Html generada automáticamente
    • download directorio para material extra para descargas
      • chppho0129.jpg ejemplo de imagen de obra artística para descargar
      • chppho0143.jpg ejemplo de imagen de obra artística para descargar
    • sitemap.xml mapa del sitio web generado en Xml de forma automática
  • history archivo de registro histórico del programa Ink.Watercolor
  • ink_watercolor.pdf documento resumen de funciones del programa de generación Html

2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio

Tol