Secciones de la página

set. tol


Declaraciones


Funciones


Time oriented language


Árbol de ficheros

Funciones

Text Set2Txt()

Set Set2Keyword()

Text Set2TxtCommaAmp()

Set SetFirstN()

Set SetFirstNByFun()

Set SetLastN()

Anything SetGetRand()

Set SetReverse()

Set SetSubCicle()

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 Antonio.Salmeron

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 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.
  • Anything SetGetRand(Set setInp)
    Retorna un elemento al azar del conjunto de entrada setInp. Si setInp es Empty retorna FALSE.
  • Set SetReverse(Set setInp)
    Retorna el conjunto de entrada con su orden invertido.
  • 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]

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",
     "aunque",
     "avppm",
     "barcelona",
     "carlos",
     "cinco",
     "cuando",
     "cuatro",
     "con-q",
     "dentro",
     "desde",
     "donde",
     "entre",
     "están",
     "estas", "estos",
     "había",
     "junto",
     "luego",
     "madrid",
     "misma", "mismo",
     "mucho",
     "número",
     "otro", "otros",
     "página", "páginas",
     "partir", "permite",
     "primer", "primera",
     "propio",
     "puede", "pueden",
     "segunda", "segundo", "segundos", 
     "siguiente", "siguientes", 
     "sobre",
     "también",
     "tiene", "tienen",
     "través",
     "utilizando", "utilizar",
     "verse",
     "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 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);
//////////////////////////////////////////////////////////////////////////////

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);
//////////////////////////////////////////////////////////////////////////////

Set SetReverse()

//////////////////////////////////////////////////////////////////////////////
Set SetReverse(Set  setInp) // Set de entrada
//////////////////////////////////////////////////////////////////////////////
{
  Real numEle = Card(setInp);
  If(LE(numEle, 0), Empty,
     For(1, numEle, Anything(Real setPos) { setInp[numEle+1-setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna el conjunto de entrada con su orden invertido.",
SetReverse);
//////////////////////////////////////////////////////////////////////////////

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);
//////////////////////////////////////////////////////////////////////////////

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",
     "aunque",
     "avppm",
     "barcelona",
     "carlos",
     "cinco",
     "cuando",
     "cuatro",
     "con-q",
     "dentro",
     "desde",
     "donde",
     "entre",
     "están",
     "estas", "estos",
     "había",
     "junto",
     "luego",
     "madrid",
     "misma", "mismo",
     "mucho",
     "número",
     "otro", "otros",
     "página", "páginas",
     "partir", "permite",
     "primer", "primera",
     "propio",
     "puede", "pueden",
     "segunda", "segundo", "segundos", 
     "siguiente", "siguientes", 
     "sobre",
     "también",
     "tiene", "tienen",
     "través",
     "utilizando", "utilizar",
     "verse",
     "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 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);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
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);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
Set SetReverse(Set  setInp) // Set de entrada
//////////////////////////////////////////////////////////////////////////////
{
  Real numEle = Card(setInp);
  If(LE(numEle, 0), Empty,
     For(1, numEle, Anything(Real setPos) { setInp[numEle+1-setPos] }))
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna el conjunto de entrada con su orden invertido.",
SetReverse);
//////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////
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);
//////////////////////////////////////////////////////////////////////////////

Árbol de ficheros

Antonio.Salmeron construye las páginas y documentos del sitio web antoniosalmeron.con

  • 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
      • dte.tol funciones de manejo de fechas en español
      • set.tol funciones de manejo de conjuntos
      • fil.tol funciones de gestión de ficheros
      • dir.tol funciones de gestión de directorios
      • tme.tol del macro-expansor simple de Tol en Html
      • htm.tol funciones básicas del lenguaje Html
      • ftp.tol funciones para generar mandatos para hacer Ftp
      • pdf.tol funciones para generar documentos en Pdf
      • xsm.tol para construir sitemaps en Xml
    • app funciones especificas de aplicacion para Antonio.Salmeron
      • pdb.tol funciones de manejo de los posts de una agenda
      • pht.tol funciones auxiliares para el Html de los post
    • 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
    • 03.arte.age ejemplo de 2 posts de contenido de poesía para publicar
  • web directorio destinado a las paginas web generadas automáticamente
    • css directorio para ficheros de estilo
      • common.css fichero de estilo para las paginas Html del sitio web
    • seed directorio para ficheros semilla de Html con Tol embebido
      • seed.htm semilla de pagina Html con Tol embebido para el sitio web
      • seed.cv.htm semilla Html con Tol embebido para generar curriculum vitae
    • articulos directorio para paginas de artículos generadas por este programa
    • categorias directorio para paginas de categorias generadas automáticamente
    • sitemap.xml mapa del sitio web generado en Xml de forma automática
  • doc directorio de documentación del programa Antonio.Salmeron
  • antonio_salmeron.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