Secciones de la página

set. tol


Declaraciones


Funciones


Time oriented language


Árbol de ficheros

Funciones

Text Set2Txt()

Set Set2Keyword()

Text Set2TxtKeyword()

Text Set2TxtCommaAmp()

Set SetFirstN()

Set SetFirstNByFun()

Set SetLastN()

Set SetSubCicle()

Anything SetGetRand()

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









set.tol de iForense

Set functions.

Declaraciones

Funciones

  • Text Set2Txt(Set valSet, Text iniTxt, Text endTxt, Text sepTxt, Text sepLst, Text txtDet, Text datFmt, Text dteDet, Text dteFmt)
    Returns a text like a list with all the elements of valSet converted in a text format (elements types: Text, Real or Date). Arguments: - iniTxt initial text, for example: '(', '[[', '', etc. - endTxt end text, for example ')', ']]', '', etc. - sepTxt elements separator, for example '; ', ',', '', etc. - sepLst two last elements separator, for example, ' & ', ' and ', etc., you can specify the same as sepTxt - txtDet text delimiters, for exmple, quotes for TOL, single quote for SQL, nothing, etc. - datFmt real numbers format, for explame, '%.0lf' for integers, if none then uses the default TOL real number format. - dteDet date delimiters, for example, simgle quote for SQL. - dteFmt date format, for example, '%c%Y%m%d', if none then uses the default TOL dates format. Only works with TOL types Text, Real or Date, when find a Set type then works in a recursive way with the same arguments.
  • Set Set2Keyword(Set valSet, Real minChr, Real a2zOrd, Real maxKey)
    Returns a set with all the elements of valSet converted in a text format, ordered and without repetitions. Remove all word with LE(TextLength(), minChr). Returns the maxKey elements more occurrencies.
  • Text Set2TxtKeyword(Set valSet, Real minChr, Real a2zOrd, Real maxKey)
    Returns a text list with all the elements of valSet converted in a text format with commas like a keywords list, ordered and without repetitions. Remove all word with LE(TextLength(), minChr). Returns the maxKey elements more occurrencies.
  • Text Set2TxtCommaAmp(Set valSet)
    Return a text list with all the elements of valSet converted in a text format with commas and & in Html style. For example Set2TxtCommaAmp([['a','b','c','d']]) returns: a, b, c & d -> in html -> a, b, c & d.
  • Set SetFirstN(Set setInp, Real numEle)
    Retorna un subconjunto de un conjunto con los primeros numEle elementos. Si el conjunto tiene menos de numEle elementos los retorna todos. Si numEle es 0 o negativo retorna el conjunto vacio.
  • Set SetFirstNByFun(Set set, Real num, Code funSor)
    Returns a subset with the first num elements of a set ordered by funSor. If the set does not have num elements returns the set ordered by funSor.
  • Set SetLastN(Set setInp, Real numEle)
    Retorna un subconjunto de un conjunto con los ultimos numEle elementos. Si el conjunto tiene menos de numEle elementos los retorna todos.
  • Set SetSubCicle(Set setInp, Real iniPos, Real lenRet)
    Retorna un subconjunto de un conjunto con los primeros numEle elementos. Si el conjunto tiene menos de numEle elementos los extrae por el principio. Por ejemplo: SetSubCicle([a,b,c,d],3,8) -> [c,d,a,b,c,d,a,b]
  • Anything SetGetRand(Set setInp)
    Retorna un elemento al azar del conjunto de entrada setInp. Si setInp es Empty retorna FALSE.

Funciones

Text Set2Txt()

//////////////////////////////////////////////////////////////////////////////
Text Set2Txt(Set  valSet, // Set of elements
             Text iniTxt, // Initial text for list
             Text endTxt, // End text for list
             Text sepTxt, // Element separators
             Text sepLst, // 2 last elements separator
             Text txtDet, // Delimiter for texts
             Text datFmt, // Format for real numbers
             Text dteDet, // Delimiter for dates
             Text dteFmt) // Format for dates
//////////////////////////////////////////////////////////////////////////////
{
  Real card = Card(valSet);
  Text body =
    If(EQ(card,0), "",
    If(EQ(card,1), F(valSet[1]),
    If(EQ(card,2), F(valSet[1])+sepLst+F(valSet[2]),
    {
      Set txtVal = For(2,card,Text(Real p)
      {
        If(EQ(p,card),sepLst,sepTxt) + F(valSet[p])
      });
      F(valSet[1]) + BinGroup("+",txtVal)
    })));
  iniTxt+body+endTxt
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a text like a list with all the elements of valSet converted in a
text format (elements types: Text, Real or Date).
Arguments:
 - iniTxt initial text, for example: '(', '[[', '', etc.
 - endTxt end text, for example ')', ']]', '', etc.
 - sepTxt elements separator, for example '; ', ',', '', etc.
 - sepLst two last elements separator, for example, ' & ', ' and ', etc.,
   you can specify the same as sepTxt
 - txtDet text delimiters, for exmple, quotes for TOL, single quote for
   SQL, nothing, etc.
 - datFmt real numbers format, for explame, '%.0lf' for integers, if none
   then uses the default TOL real number format.
 - dteDet date delimiters, for example, simgle quote for SQL.
 - dteFmt date format, for example, '%c%Y%m%d', if none
   then uses the default TOL dates format.
Only works with TOL types Text, Real or Date, when find a Set type then
works in a recursive way with the same arguments.",
Set2Txt);
//////////////////////////////////////////////////////////////////////////////

Set Set2Keyword()

//////////////////////////////////////////////////////////////////////////////
Set Set2Keyword(Set  valSet, // Set of texts
                Real minChr, // Minimum number of chars
                Real a2zOrd, // If true ordered az else by ocurrences
                Real maxKey) // Maximun number of keywords
//////////////////////////////////////////////////////////////////////////////
{
  Set cmmWrd =
  [[
     "ambos",
     "desde",
     "dentro",
     "entre",
     "esta", "estas", "esto", "estos", 
     "junto",
     "mucho", "muchos",
     "otra", "otras", "otro", "otros",
     "parte",
     "porque",
     "puede", "pueden", "pudiendo",
     "siguiente", "siguientes",
     "sobre",
     "sumamente",
     "también",
     "tanto",
     "zulú"
  ]];

  // Convert all to text
  Text lstTxt = ToLower(Set2Txt(valSet,"", "", " ", " ", "", "", "", ""));
  
  Text htmNot = TxtOutHtmScr(lstTxt);

  Text lstCls = Compact(ReplaceTable(htmNot, // _ must NOT be changed
    [[ [[Char(34), " "]], [["'",      " "]],
       [["." ,     " "]], [[":",      " "]],
       [[";",      " "]], [[",",      " "]],
       [["[",      " "]], [["]",      " "]],
       [["(",      " "]], [[")",      " "]],
/*     [["<",      " "]], [[">",      " "]],    Sobra */
       [["«",      " "]], [["»",      " "]], // Titulos de libros
       [["¡",      " "]], [["!",      " "]],
       [["¿",      " "]], [["?",      " "]],
       [["/",      " "]], [["|",      " "]],
       [["&amp",   " "]],
       [["&nbsp;", " "]],
       [[" none ", " "]],
       [[" the ",  " "]],
       [[" and ",  " "]],
       [[" or ",   " "]],
       [[" & ",    " "]],
       [[" y ",    " "]],
       [[" o ",    " "]]
    ]]));

// Split in words
  Set  setTxt = Tokenizer(lstCls, " ");
  
// Select word with more than minChr characters that locks like words
  Set  setSel = Select(setTxt, Real(Text wrdTxt)
  {
    Real wrdLen = TextLength(wrdTxt);
    Text iniLet = Sub(wrdTxt, 1,      1);
    Text lstLet = Sub(wrdTxt, wrdLen, wrdLen);
    And(GT(wrdLen, minChr), iniLet >= "a", iniLet <= "z",
                            lstLet >= "a", lstLet <= "z")
  });

// Classify words
  Set  setCla = Classify(setSel, Real(Text a, Text b)
                        { Compare(ToLower(a),ToLower(b)) });

// Make a frecuencies table [ word, number of occurrencies ]
  Set  tabFrq = EvalSet(setCla, Set(Set cla)
                        { [[ cla[1], Card(cla) ]] });

// Sort (with most ocurrencies first)
  Set  srtFrq = Sort(tabFrq, Real(Set a, Set b)
                     { Compare(Real(b[2]), Real(a[2])) });

// Project by word column (the first column)
  Set  keySet = EvalSet(srtFrq, Text(Set a) { Text(a[1]) });

// Minus common words
  Set  keyMin = keySet - cmmWrd;

// Select the first maxKey or Card(keySet) or all if maxKey=0
  Set  keyFst = If(maxKey, SetFirstN(keyMin, maxKey), keyMin);

// Sort if is needed
  If(! a2zOrd, keyFst,
     Sort(keyFst, Real(Text a, Text b)
       { Compare(ToLower(a),ToLower(b)) })) // Order
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set with all the elements of valSet converted in a
text format, ordered and without repetitions.
Remove all word with LE(TextLength(), minChr).
Returns the maxKey elements more occurrencies.",
Set2Keyword);
//////////////////////////////////////////////////////////////////////////////

Text Set2TxtKeyword()

//////////////////////////////////////////////////////////////////////////////
Text Set2TxtKeyword(Set  valSet, // Set of texts
                    Real minChr, // Minimum number of chars
                    Real a2zOrd, // If true ordered az else by ocurrences
                    Real maxKey) // Maximun number of keywords
//////////////////////////////////////////////////////////////////////////////
{
  Set2Txt(Set2Keyword(valSet, minChr, a2zOrd, maxKey),
          "", "", ", ", ", ", "", "", "", "")
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a text list with all the elements of valSet converted in a
text format with commas like a keywords list, ordered and without repetitions.
Remove all word with LE(TextLength(), minChr).
Returns the maxKey elements more occurrencies.",
Set2TxtKeyword);
//////////////////////////////////////////////////////////////////////////////

Text Set2TxtCommaAmp()

//////////////////////////////////////////////////////////////////////////////
Text Set2TxtCommaAmp(Set  valSet) // Set of elements
//////////////////////////////////////////////////////////////////////////////
{ Set2Txt(valSet, "", "", ", ", " &amp; ", "", "", "", "") };
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Return a text list with all the elements of valSet converted in a
text format with commas and & in Html style.
For example Set2TxtCommaAmp([['a','b','c','d']]) returns:
 a, b, c &amp; d -> in html -> a, b, c & d.",
Set2TxtCommaAmp);
//////////////////////////////////////////////////////////////////////////////

Set SetFirstN()

//////////////////////////////////////////////////////////////////////////////
Set SetFirstN(Set  setInp, // Set de entrada
              Real numEle) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  If(LE(numEle, 0), Empty,
     For(1, Min(Card(setInp), numEle), Anything(Real setPos)
         { setInp[setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los primeros numEle elementos.
Si el conjunto tiene menos de numEle elementos los retorna todos.
Si numEle es 0 o negativo retorna el conjunto vacio.",
SetFirstN);
//////////////////////////////////////////////////////////////////////////////

Set SetFirstNByFun()

//////////////////////////////////////////////////////////////////////////////
Set SetFirstNByFun(Set set, Real num, Code funSor)
//////////////////////////////////////////////////////////////////////////////
{ SetFirstN(Sort(set, funSor), num) };
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a subset with the first num elements of a set ordered by funSor.
If the set does not have num elements returns the set ordered by funSor.",
SetFirstNByFun);
//////////////////////////////////////////////////////////////////////////////

Set SetLastN()

//////////////////////////////////////////////////////////////////////////////
Set SetLastN(Set  setInp, // Set de entrada
             Real numEle) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  If(LE(numEle, 0), Empty,
     For(Max(1, 1+Card(setInp)-numEle), Card(setInp), Anything(Real setPos)
         { setInp[setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los ultimos numEle elementos.
Si el conjunto tiene menos de numEle elementos los retorna todos.",
SetLastN);
//////////////////////////////////////////////////////////////////////////////

Set SetSubCicle()

//////////////////////////////////////////////////////////////////////////////
Set SetSubCicle(Set  setInp, // Conjunto de elementos
                Real iniPos, // Posicion inicial 
                Real lenRet) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  Real modCic(Real setPos, Real crdSet)
  {
    Real modPos = setPos % crdSet;
    If(LE(modPos, 0), crdSet, modPos)
  };
  
  Real crdSet = Card(setInp);
  
  For(0, lenRet-1, Anything(Real setPos)
  {
    Real posCic = modCic(iniPos + setPos, crdSet);
    setInp[posCic]
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los primeros numEle elementos.
Si el conjunto tiene menos de numEle elementos los extrae por el principio.
Por ejemplo: SetSubCicle([a,b,c,d],3,8) -> [c,d,a,b,c,d,a,b]",
SetSubCicle);
//////////////////////////////////////////////////////////////////////////////

Anything SetGetRand()

//////////////////////////////////////////////////////////////////////////////
Anything SetGetRand(Set setInp)
//////////////////////////////////////////////////////////////////////////////
{
  Real setCrd = Card(setInp);
  If(LE(setCrd, 0), FALSE,
  {
    Real     rndPos = Min(setCrd, Max(1, Round(Rand(0, setCrd)+0.5)));
    Anything rndVal = setInp[rndPos];
    rndVal
  })  
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un elemento al azar del conjunto de entrada setInp. 
Si setInp es Empty retorna FALSE.",
SetGetRand);
//////////////////////////////////////////////////////////////////////////////

Time oriented language

//////////////////////////////////////////////////////////////////////////////
// FILE    : set.tol
// AUTHOR  : http://www.asolver.com
// PURPOSE : Set functions.
//////////////////////////////////////////////////////////////////////////////


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

//////////////////////////////////////////////////////////////////////////////
Text Set2Txt(Set  valSet, // Set of elements
             Text iniTxt, // Initial text for list
             Text endTxt, // End text for list
             Text sepTxt, // Element separators
             Text sepLst, // 2 last elements separator
             Text txtDet, // Delimiter for texts
             Text datFmt, // Format for real numbers
             Text dteDet, // Delimiter for dates
             Text dteFmt) // Format for dates
//////////////////////////////////////////////////////////////////////////////
{
  Real card = Card(valSet);
  Text body =
    If(EQ(card,0), "",
    If(EQ(card,1), F(valSet[1]),
    If(EQ(card,2), F(valSet[1])+sepLst+F(valSet[2]),
    {
      Set txtVal = For(2,card,Text(Real p)
      {
        If(EQ(p,card),sepLst,sepTxt) + F(valSet[p])
      });
      F(valSet[1]) + BinGroup("+",txtVal)
    })));
  iniTxt+body+endTxt
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a text like a list with all the elements of valSet converted in a
text format (elements types: Text, Real or Date).
Arguments:
 - iniTxt initial text, for example: '(', '[[', '', etc.
 - endTxt end text, for example ')', ']]', '', etc.
 - sepTxt elements separator, for example '; ', ',', '', etc.
 - sepLst two last elements separator, for example, ' & ', ' and ', etc.,
   you can specify the same as sepTxt
 - txtDet text delimiters, for exmple, quotes for TOL, single quote for
   SQL, nothing, etc.
 - datFmt real numbers format, for explame, '%.0lf' for integers, if none
   then uses the default TOL real number format.
 - dteDet date delimiters, for example, simgle quote for SQL.
 - dteFmt date format, for example, '%c%Y%m%d', if none
   then uses the default TOL dates format.
Only works with TOL types Text, Real or Date, when find a Set type then
works in a recursive way with the same arguments.",
Set2Txt);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set Set2Keyword(Set  valSet, // Set of texts
                Real minChr, // Minimum number of chars
                Real a2zOrd, // If true ordered az else by ocurrences
                Real maxKey) // Maximun number of keywords
//////////////////////////////////////////////////////////////////////////////
{
  Set cmmWrd =
  [[
     "ambos",
     "desde",
     "dentro",
     "entre",
     "esta", "estas", "esto", "estos", 
     "junto",
     "mucho", "muchos",
     "otra", "otras", "otro", "otros",
     "parte",
     "porque",
     "puede", "pueden", "pudiendo",
     "siguiente", "siguientes",
     "sobre",
     "sumamente",
     "también",
     "tanto",
     "zulú"
  ]];

  // Convert all to text
  Text lstTxt = ToLower(Set2Txt(valSet,"", "", " ", " ", "", "", "", ""));
  
  Text htmNot = TxtOutHtmScr(lstTxt);

  Text lstCls = Compact(ReplaceTable(htmNot, // _ must NOT be changed
    [[ [[Char(34), " "]], [["'",      " "]],
       [["." ,     " "]], [[":",      " "]],
       [[";",      " "]], [[",",      " "]],
       [["[",      " "]], [["]",      " "]],
       [["(",      " "]], [[")",      " "]],
/*     [["<",      " "]], [[">",      " "]],    Sobra */
       [["«",      " "]], [["»",      " "]], // Titulos de libros
       [["¡",      " "]], [["!",      " "]],
       [["¿",      " "]], [["?",      " "]],
       [["/",      " "]], [["|",      " "]],
       [["&amp",   " "]],
       [["&nbsp;", " "]],
       [[" none ", " "]],
       [[" the ",  " "]],
       [[" and ",  " "]],
       [[" or ",   " "]],
       [[" & ",    " "]],
       [[" y ",    " "]],
       [[" o ",    " "]]
    ]]));

// Split in words
  Set  setTxt = Tokenizer(lstCls, " ");
  
// Select word with more than minChr characters that locks like words
  Set  setSel = Select(setTxt, Real(Text wrdTxt)
  {
    Real wrdLen = TextLength(wrdTxt);
    Text iniLet = Sub(wrdTxt, 1,      1);
    Text lstLet = Sub(wrdTxt, wrdLen, wrdLen);
    And(GT(wrdLen, minChr), iniLet >= "a", iniLet <= "z",
                            lstLet >= "a", lstLet <= "z")
  });

// Classify words
  Set  setCla = Classify(setSel, Real(Text a, Text b)
                        { Compare(ToLower(a),ToLower(b)) });

// Make a frecuencies table [ word, number of occurrencies ]
  Set  tabFrq = EvalSet(setCla, Set(Set cla)
                        { [[ cla[1], Card(cla) ]] });

// Sort (with most ocurrencies first)
  Set  srtFrq = Sort(tabFrq, Real(Set a, Set b)
                     { Compare(Real(b[2]), Real(a[2])) });

// Project by word column (the first column)
  Set  keySet = EvalSet(srtFrq, Text(Set a) { Text(a[1]) });

// Minus common words
  Set  keyMin = keySet - cmmWrd;

// Select the first maxKey or Card(keySet) or all if maxKey=0
  Set  keyFst = If(maxKey, SetFirstN(keyMin, maxKey), keyMin);

// Sort if is needed
  If(! a2zOrd, keyFst,
     Sort(keyFst, Real(Text a, Text b)
       { Compare(ToLower(a),ToLower(b)) })) // Order
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a set with all the elements of valSet converted in a
text format, ordered and without repetitions.
Remove all word with LE(TextLength(), minChr).
Returns the maxKey elements more occurrencies.",
Set2Keyword);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Text Set2TxtKeyword(Set  valSet, // Set of texts
                    Real minChr, // Minimum number of chars
                    Real a2zOrd, // If true ordered az else by ocurrences
                    Real maxKey) // Maximun number of keywords
//////////////////////////////////////////////////////////////////////////////
{
  Set2Txt(Set2Keyword(valSet, minChr, a2zOrd, maxKey),
          "", "", ", ", ", ", "", "", "", "")
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a text list with all the elements of valSet converted in a
text format with commas like a keywords list, ordered and without repetitions.
Remove all word with LE(TextLength(), minChr).
Returns the maxKey elements more occurrencies.",
Set2TxtKeyword);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Text Set2TxtCommaAmp(Set  valSet) // Set of elements
//////////////////////////////////////////////////////////////////////////////
{ Set2Txt(valSet, "", "", ", ", " &amp; ", "", "", "", "") };
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Return a text list with all the elements of valSet converted in a
text format with commas and & in Html style.
For example Set2TxtCommaAmp([['a','b','c','d']]) returns:
 a, b, c &amp; d -> in html -> a, b, c & d.",
Set2TxtCommaAmp);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set SetFirstN(Set  setInp, // Set de entrada
              Real numEle) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  If(LE(numEle, 0), Empty,
     For(1, Min(Card(setInp), numEle), Anything(Real setPos)
         { setInp[setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los primeros numEle elementos.
Si el conjunto tiene menos de numEle elementos los retorna todos.
Si numEle es 0 o negativo retorna el conjunto vacio.",
SetFirstN);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set SetFirstNByFun(Set set, Real num, Code funSor)
//////////////////////////////////////////////////////////////////////////////
{ SetFirstN(Sort(set, funSor), num) };
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Returns a subset with the first num elements of a set ordered by funSor.
If the set does not have num elements returns the set ordered by funSor.",
SetFirstNByFun);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set SetLastN(Set  setInp, // Set de entrada
             Real numEle) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  If(LE(numEle, 0), Empty,
     For(Max(1, 1+Card(setInp)-numEle), Card(setInp), Anything(Real setPos)
         { setInp[setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los ultimos numEle elementos.
Si el conjunto tiene menos de numEle elementos los retorna todos.",
SetLastN);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set SetSubCicle(Set  setInp, // Conjunto de elementos
                Real iniPos, // Posicion inicial 
                Real lenRet) // Numero de elementos a retornar
//////////////////////////////////////////////////////////////////////////////
{
  Real modCic(Real setPos, Real crdSet)
  {
    Real modPos = setPos % crdSet;
    If(LE(modPos, 0), crdSet, modPos)
  };
  
  Real crdSet = Card(setInp);
  
  For(0, lenRet-1, Anything(Real setPos)
  {
    Real posCic = modCic(iniPos + setPos, crdSet);
    setInp[posCic]
  })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un subconjunto de un conjunto con los primeros numEle elementos.
Si el conjunto tiene menos de numEle elementos los extrae por el principio.
Por ejemplo: SetSubCicle([a,b,c,d],3,8) -> [c,d,a,b,c,d,a,b]",
SetSubCicle);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Anything SetGetRand(Set setInp)
//////////////////////////////////////////////////////////////////////////////
{
  Real setCrd = Card(setInp);
  If(LE(setCrd, 0), FALSE,
  {
    Real     rndPos = Min(setCrd, Max(1, Round(Rand(0, setCrd)+0.5)));
    Anything rndVal = setInp[rndPos];
    rndVal
  })  
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna un elemento al azar del conjunto de entrada setInp. 
Si setInp es Empty retorna FALSE.",
SetGetRand);
//////////////////////////////////////////////////////////////////////////////

Árbol de ficheros

iForense construye las paginas del sitio sobre informática forense Forense.Info

  • make.tol proceso principal de generacion del sitio web y todas su páginas
  • tol directorios de código en lenguaje Tol
    • cmm funciones comunes
      • txt.tol código de funciones de textos
      • dte.tol código de funciones de fechas
      • set.tol código de funciones de conjuntos
      • fil.tol código de funciones de ficheros
      • dir.tol código de funciones de directorios
      • tme.tol funciones del macro-expansor doble de Tol en Html
      • img.tol funciones para imagenes declaradas en Html
      • ftp.tol para generar mandatos para hacer Ftp
      • xsm.tol para construir sitemaps en Xml
    • app funciones específicas de aplicación
      • glo.tol de términos del glosario forense e informatico
      • pdb.tol de manejo de los posts de una agenda
      • pht.tol funciones auxiliares para el Html de los post
    • inc.tol para la inclusión de ficheros en lenguaje Tol
  • agenda directorio destinado a la agenda de post
  • web directorio destinado a las páginas web generadas y a contenido
    • css directorio para ficheros de estilo de tipo Css
      • common.css fichero Cascading Style Sheets para las paginas Html
    • seed directorio para ficheros semilla
      • seed.htm semilla de página Html, template, con Tol embebido
    • src directorio para ficheros con código Javascript
      • common.js funciones Javascript de redes sociales y multimedia
    • imagenes directorio de ilustraciones del sitio web
    • articulos directorio para las páginas de artículos de informática forense
    • categorias directorio para paginas de categorias de informática forense
    • sitemap.xml mapa del sitio web generado automáticamente en Xml
  • resultado.html muestra del web de informática forense del dominio Forense.Info
  • iforense.pdf documento resumen de funciones del programa creador del web

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

Tol