Codigos fuente realzado en varios lenguajes de programacion
//////////////////////////////////////////////////////////////////////////////
// FILE : gpl.tol
// AUTHOR : http://www.asolver.com
// PURPOSE : Funciones para crear graficos polares en estrella con Gnuplot,
// son especificas de esta aplicacion, no son generales.
// Depende del directorio de instalacion de GnuPlot.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// CONSTANTS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text GplExe = Q(FilDos(Q("%BIN%/gnuplot/bin/pgnuplot")));
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Ruta directorios donde esta instalado Gnuplot, depende de la instalacion.
Notese la necesidad de comillas dentro de comillas.",
GplExe);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text GplPolar2x20 = "polar2x20";
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Prefijo para los ficheros Gnuplot de programacion (.gpl) y datos (.dar).",
GplPolar2x20);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text GplDat =
" 0, a01, c01
18, a02, c02
36, a03, c03
54, a04, c04
72, a05, c05
90, a06, c06
108, a07, c07
126, a08, c08
144, a09, c09
162, a10, c10
180, a11, c11
198, a12, c12
216, a13, c13
234, a14, c14
252, a15, c15
270, a16, c16
288, a17, c17
306, a18, c18
324, a19, c19
342, a20, c20
360, a01, c01
";
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Plantilla de datos especifica para crear de graficos polares en estrella.
Permite generar graficos de 2 series de datos de 20 preguntas, cada 18º,
con respuestas en el rango del 0 al 5.
Los datos son etiquetas que seran reemplazados por los valores que
correspondan en cada llamada.",
GplDat);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real PdfPolar2x20(Text outPth, // Ruta del fichero png de salida
Set repTab) // Tabla de reemplazamiento con datos a pintar
//////////////////////////////////////////////////////////////////////////////
{
Text seePth = CtrDir+"/semilla/"+
GplPolar2x20+".see"; // Semilla de programacion Gnuplot
Text gplPth = GplPolar2x20+".gpl"; // Programacion Gnuplot
Text datPth = GplPolar2x20+".dat"; // Fichero de datos para Gnuplot
Text WriteFile(datPth, ReplaceTable(GplDat, repTab)); // Escribe datos
Text seeTxt = ReadFile(seePth); // Lee la semilla de programacion
Text WriteFile(gplPth, Replace(seeTxt,"web/shi_syntaxhighlight/resultado.html",outPth)); // Escribe programa
Text cmdTxt = GplExe+" "+gplPth; // Ejecutable Gnuplot y programa .gpl
Real cmdExe = System(cmdTxt);
Text cmdMsg = " "+If(cmdExe, "Plot OK", "Plot ERROR")+" -> ";
Text WriteLn(cmdMsg+outPth);
cmdExe
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna TRUE si puede crear el fichero grafico Png de ruta outPth.",
PdfPolar2x20);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FILE : sqlqry.tol
// AUTHOR : http://www.asolver.com
// PURPOSE : Funciones con los queries basicos de la aplicacion
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text SqlLitNam(Text ctrCod, // Control, periodo en el que se realiza
Text domCod, // Dominio
Text anyCod) // Codigo de para localizar el nombre
//////////////////////////////////////////////////////////////////////////////
{
Text sqlTxt = "
select Etiqueta
from Literal
where
Control = '"+ctrCod+"' and "+
" Dominio = '"+domCod+"' and "+
" Codigo = '"+anyCod+"'; ";
Set sqlSet = DBTable(sqlTxt);
If(EQ(Card(sqlSet),1), sqlSet[1][1], "ERROR") // Solo puede haber 1
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna el nombre de algo dado un periodo, su dominio y su codigo.",
SqlLitNam);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text SqlResAnd(Text ctrCod, // Control, periodo
Text prgCod, // Codigo de programa (opcional)
Text gruCod, // Codigo de grupo (opcional)
Text curCod, // Codigo de curso (opcional)
Text prfCod, // Codigo del profesor (opcional)
Text asiCod, // Codigo de la asignatura (opcional)
Text preCod) // Codigo de pregunta
//////////////////////////////////////////////////////////////////////////////
{
Text ctrQry = If(ctrCod=="", "", "Control = '"+ctrCod+"'");
Text prgQry = If(prgCod=="", "", "Programa = '"+prgCod+"'");
Text gruQry = If(gruCod=="", "", "Grupo = '"+gruCod+"'");
Text curQry = If(curCod=="", "", "Curso = '"+curCod+"'");
Text prfQry = If(prfCod=="", "", "Profesor = '"+prfCod+"'");
Text asiQry = If(asiCod=="", "", "Asignatura = '"+asiCod+"'");
Text preQry = If(preCod=="", "", "Pregunta = '"+preCod+"'");
Set wheSet = [[ctrQry, prgQry, gruQry, curQry, prfQry, asiQry, preQry]];
Set wheSel = Select(wheSet, Real(Text txtQry) { txtQry != "" });
Set2Txt(wheSel, "", "", " and ", " and ", "", "", "", "")
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna una serie de condiciones Sql para la tabla Respuestas enlazadas con
el operador and.
Aquellos argumentos de entrada cuyo valor sea nulo no apareceran en la
serie de condiciones.",
SqlResAnd);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set SqlResLst(Text ctrCod, // Control, periodo
Text prgCod, // Codigo de programa (opcional)
Text gruCod, // Codigo de grupo (opcional)
Text curCod, // Codigo de curso (opcional)
Text prfCod, // Codigo del profesor (opcional)
Text asiCod, // Codigo de la asignatura (opcional)
Text preCod) // Codigo de pregunta
//////////////////////////////////////////////////////////////////////////////
{
Text wheQry = SqlResAnd(ctrCod,prgCod,gruCod,curCod,prfCod,asiCod,preCod);
Text sqlTxt = "
select CInt(Respuesta)
from Respuesta
where
Respuesta >= '1' and
Respuesta <= '5' and
" + wheQry + ";";
//Text WriteLn(sqlTxt);
Set sqlSet = DBTable(sqlTxt);
If(Card(sqlSet), Traspose(sqlSet)[1], Empty)
};
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Retorna la lista de respuestas que cumplen unas determinadas condiciones de
control, programa, grupo, curso, profesor, asignatura y pregunta.
Aquellos campos para los que su codigo sea nulo quedan libres en el query.
El campo Respuesta es de texto pues se admite la respuesta ?,
pero en este querie el campo Respuesta se convierte a entero CInt().",
SqlResLst);
//////////////////////////////////////////////////////////////////////////////
-- ///////////////////////////////////////////////////////////////////////////
-- FILE : edi.sql
-- AUTHOR : http://www.asolver.com
-- PURPOSE : Dos select de ejemplo para datos procedentes de EDI.
-- ///////////////////////////////////////////////////////////////////////////
-- ///////////////////////////////////////////////////////////////////////////
-- SlsUltLst
-- ///////////////////////////////////////////////////////////////////////////
select
Tienda.Empresa as Empresa,
SlsUltDat.TiendaCodigo as TiendaCodigo,
SlsUltDat.Departamento as Departamento,
Tienda.Sucursal as TiendaSucursal,
Tienda.Nombre as TiendaNombre,
Tienda.Provincia as TiendaProvincia,
Tienda.Comunidad as TiendaComunidad,
SlsUltDat.FechaInicio as FechaInicio,
SlsUltDat.FechaFin as FechaFin,
SlsUltDat.ProductoEAN as ProductoEAN,
Producto.Codigo as ProductoCodigo,
Producto.Nombre as ProductoNombre,
Producto.Formato as ProductoFormato,
Producto.Fabricante as ProductoFabricante,
SlsUltDat.Venta as Venta,
SlsUltDat.Devolucion as Devolucion
from
Tienda right join
(SlsUltDat left join Producto on SlsUltDat.ProductoEAN = Producto.EAN)
on Tienda.CodigoOperacional = SlsUltDat.TiendaCodigo
order by
Empresa,
TiendaCodigo,
Departamento,
FechaInicio,
ProductoEAN;
-- ///////////////////////////////////////////////////////////////////////////
-- SlsAbeWee
-- Ventas semanales de la empresa ABE
-- Ventas - Devolucion (que hay que sumar porque son negativas).
-- ///////////////////////////////////////////////////////////////////////////
select
Departamento,
Format(FechaInicio,'WW',2,2) as Semana,
min(FechaInicio) as minFecha,
max(FechaFin) as maxFecha,
ProductoEAN,
ProductoCodigo,
ProductoNombre,
ProductoFormato,
Sum(Venta)+Sum(Devolucion) as VentaMenosDevolucion
from
SlsAllLst
where
Empresa = 'ABE' and
(Format(FechaInicio,'WW',2,2) = Format(Now(), 'WW',2,2) or
Format(FechaInicio,'WW',2,2) = Format(DateAdd('d',-7,Now()),'WW',2,2))
group by
Departamento,
Format(FechaInicio,'WW',2,2),
ProductoEAN,
ProductoCodigo,
ProductoNombre,
ProductoFormato
order by
Format(FechaInicio,'WW',2,2),
ProductoEAN,
Departamento
#/////////////////////////////////////////////////////////////////////////////
#/ FILE : gif.gpl
#/ AUTHOR : http://www.asolver.com
#/ PURPOSE : Gnu Plot Test 01.
#/////////////////////////////////////////////////////////////////////////////
# Generate a gif format, font arial 10 of all text, size 800 x 500 pixels
set term gif font 'arial' 10 size 800, 500
set output 'gnuplot.01.gif'
set datafile separator ';'
set title 'Título ejemplo 01'
set style data lines
# Format dd/mm/yyyy (I try to define yyyy/mm/dd format but does not work)
set timefmt '%d/%m/%Y'
set xdata time
set xlabel 'tiempo en días'
set xrange [ '1/6/2014':'1/11/2014' ]
set xtics rotate by 90
set format x '%d/%m/%Y'
set ylabel 'euros'
set yrange [ 0 : ]
set grid
# Put the time series label at top left
set key left
# plot data from gnuplot.01.dat:
# 1:2 t -> first column dates and second column data title serie.01
# 1:3 t -> first column dates and third column data title serie.02
plot 'gnuplot.01.dat' using 1:2 t 'serie.01', \
'gnuplot.01.dat' using 1:3 t 'serie.02'
reset
::////////////////////////////////////////////////////////////////////////////
:: FILE : pdf.bat
:: AUTHOR : http://www.asolver.com
:: PURPOSE : Convierte de html a pdf, los ficheros necesitan el path completo,
:: se usa doble % para pasar un solo % a HTML2PDF_Pilot.exe.
::////////////////////////////////////////////////////////////////////////////
"C:\Program Files (x86)\Two Pilots\HTML2PDF Pilot\HTML2PDF_Pilot.exe"^
%CD%\web.memo\%1^
%CD%\web.memo\%2^
/jpeg 100^
/margin-left 76^
/margin-right 76^
/margin-top 38^
/margin-bottom 38^
/pagenumbers center^
/pagenumstr "lazytol.com | %3 %%c de %%t"^
/author LazyTol^
/subj Memoria^
/title %3^
/keyWords LazyTol^
/psize A4^
/protect yes
/*-///////////////////////////////////////////////////////////////////////////
// FILE : cmm.css
// AUTHOR : http://www.asolver.com
// PURPOSE : Cascade style sheet for syntax highlight test
///////////////////////////////////////////////////////////////////////////-*/
/*-///////////////////////////////////////////////////////////////////////////
// Body
///////////////////////////////////////////////////////////////////////////-*/
body
{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
text-align: justify;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: #000000;
background-color: #a0e0e0;
letter-spacing: -1px;
}
/*-///////////////////////////////////////////////////////////////////////////
// Divs hierarchy
///////////////////////////////////////////////////////////////////////////-*/
div.Mid /* Middle main space */
{
margin: 0px;
padding: 0px 186px 0px 186px;
background-image: url('vida.en.agua.01.png');
}
div.Mem /* Outer membrane */
{
background: #808080;
border: 8px solid #808080;
border-radius: 8px;
box-shadow: 5px 5px 5px #404040;
}
div.Fix /* Fix position */
{
position: fixed;
top: 16px;
width: 220px;
}
div.Lft /* Left position */
{
left: -62px;
text-align: right;
}
div.Lft:hover
{
left: -12px;
}
div.Rgh /* Left position */
{
right: -62px;
text-align: left;
}
div.Rgh:hover
{
right: -12px;
text-align: left;
}
//////////////////////////////////////////////////////////////////////////////
// FILE : arr.js
// AUTHOR : http://www.asolver.com
// PURPOSE : Array functions
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// CONSTANTS
//////////////////////////////////////////////////////////////////////////////
var ArrNil = new Array(); // The empty array
//////////////////////////////////////////////////////////////////////////////
// FUNCTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
function Arr2Txt(arr, // Array
sep, // Separator (optional)
ini, // Initial text (optional)
end, // Final text (optional)
lsp) // Last separator (optional)
// PURPOSE: Returns a text with the catenation of all element in the array.
// The last separator lets do list like 1, 2, 3 y 4.
//////////////////////////////////////////////////////////////////////////////
{
if(!sep) { sep = ""; } // If not definned then the empty string
if(!ini) { ini = ""; } // If not definned then the empty string
if(!end) { end = ""; } // If not definned then the empty string
if(!lsp) { lsp = sep; } // If not definned then like the separators
var str = ini;
for(var pos=0; pos < arr.length; pos++)
{
if(pos==0) { str = str + arr[pos]; } // The first
else if((pos+1)==arr.length) { str = str + lsp + arr[pos]; } // The last
else { str = str + sep + arr[pos]; } // Middle
}
return(str+end);
}
//////////////////////////////////////////////////////////////////////////////
function Arr2Pag(arr, // Array of numbers of pages
end) // Ending (optional, default ".")
// PURPOSE: Returns a text with the catenation of all pages in the array,
// ordered and unique.
//////////////////////////////////////////////////////////////////////////////
{
var ini = "página"; // Init for one
if(!end) { end = "."; }
var uni = ArrStrUni(arr); // Order and remove duplicates pages
if(uni.length < 1) { ini = "adicional"; } // For 0
else if(uni.length > 1) { ini = ini+"s"; } // For 2, 3, ...
var res = Arr2Txt(uni, ", ", ini+" ", end, " y "); // Pages
return(res);
}
//////////////////////////////////////////////////////////////////////////////
function Arr2Ul(arr, // Array of numbers of pages
cla) // Optional
// PURPOSE: Returns a basic html ul/li list.
//////////////////////////////////////////////////////////////////////////////
{
if(cla && cla!="") { cla = " class='"+cla+"'"; }
var res = Arr2Txt(arr, // Array
"</li><li"+cla+">", // Separator
"<ul><li" +cla+">", // Initial
"</li></ul>"); // End
return(res);
}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://www.lazytol.com/</loc>
<priority>0.5</priority>
<lastmod>2013-04-09T21:56:45+00:00</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>http://www.lazytol.com/index.html</loc>
<priority>0.5</priority>
<lastmod>2013-04-09T21:56:44+00:00</lastmod>
<changefreq>monthly</changefreq>
</url>
<url>
<loc>http://www.lazytol.com/absoluto.html</loc>
<priority>0.5</priority>
<lastmod>2013-04-09T21:56:44+00:00</lastmod>
<changefreq>monthly</changefreq>
</url>
</urlset>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<!-- /////////////////////////////////////////////////////////////////////////
// FILE : see.htm
// AUTHOR : http://www.asolver.com
// PURPOSE : Semilla html con Tol embebido para librok.es, una web de LibrOk
////////////////////////////////////////////////////////////////////////// -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="ROBOTS" content="INDEX, FOLLOW" />
<meta name="revisit-after" content="7 days" />
<meta name="rating" content="GENERAL" />
<meta name="distribution" content="GLOBAL" />
<meta name="language" content="spanish" />
<{
// CtrXxx Control variables inherit from make.tol
// xxxXxx Local variables created here, inside html code
// XXX.XXX Text macro variables created here, inside html code.
Set DEF.KEY = [["librok",
"libro", "libros",
"análisis",
"corrección", "correcciones",
"guión", "guiones", "guionista", "guionistas",
"texto", "textos",
"literario", "literarios",
"autor", "autora", "autores", "autoras",
"editor", "editora", "editores", "editoras",
"productor", "productora", "productores", "productoras",
"editorial", "editoriales", "edición", "ediciones"]];
Text WIN.TIT = // Window title
{
Set lstPst = PdbFirstN(SelPdb, CtrTit, Real(Set objPst)
{ objPst->pstTit != "" });
Set lstTit = EvalSet(lstPst, Text(Set objPst)
{ objPst->pstTit+"; " });
SetSum(lstTit)+"Análisis y correcciones de guiones y textos literarios"
};
Text MET.DES = // Page description
{
Set lstPst = PdbFirstN(SelPdb, CtrDes, Real(Set objPst)
{ objPst->pstTit != "" });
Set lstTit = EvalSet(lstPst, Text(Set objPst)
{ objPst->pstTit+". " });
SetSum(lstTit)
};
Text MET.KEY = // Keywords
{
Set txtSet = EvalSet(SelPdb, Text(Set pdbObj)
{ pdbObj->pstTit+" "+pdbObj->pstTxt });
Set2TxtKeyword(txtSet << [[ DEF.KEY ]], 4, FALSE, 40) // Not ordered
};
Text TAG.KEY = MET.KEY;
Text TmeEmpty; // Only definitions, no html code
}>
<meta name="description" content=""<{MET.DES}>" />"
<meta name="keywords" content=""<{MET.KEY}>" />"
<link rel="icon" href="../favicon.ico" />
<link href="../css/common.css" rel="stylesheet" type="text/css" />
<title><{WIN.TIT}></title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'AU-72131254-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript" src="../src/common.js"></script>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/es_ES/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="wrapper">
<!-- header: ini ---------------------------------------------------------->
<div id="header">
<div id="logo">
<a href="http://www.librok.es">
<h1>libr<b>ok</b></h1>
</a>
<p>Análisis y correcciones de guiones y textos literarios</p>
<p>
<a href="https://twitter.com/share"
class="twitter-share-button"
data-count="horizontal">Tweet</a>
<script type="text/javascript"
src="//platform.twitter.com/widgets.js"></script>
</p>
<p>
<div class="fb-like"
data-href="http://www.librok.es"
data-send="true"
data-layout="button_count"
data-width="450"
data-show-faces="true"
data-font="arial"></div>
</p>
</div>
</div>
<!-- header: end ---------------------------------------------------------->
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<!-- menu: ini ------------------------------------------------------>
<div id="menu">
<ul>
<li><a href="http://www.librok.es" >Inicio</a></li>
<li><a href="../articulos/novelistas.html" >Novelistas</a></li>
<li><a href="../articulos/guionistas.html" >Guionistas</a></li>
<li><a href="../articulos/editores.html" >Editores</a></li>
<li><a href="../articulos/productores.html">Productores</a></li>
</ul>
</div>
<!-- menu: end ------------------------------------------------------>
<!-- content: ini --------------------------------------------------->
<div id="content">
<!-- ini posts ---------------------------------------------------->
<{
Set allPst = EvalSet(SelPdb, Text(Set objPst)
{
"<div class='"+objPst->pstTyp+"'>"+
If(objPst->pstTyp != "post", objPst->pstHtm, // book, results
{
objPst->pstTh1+"
<div class='entry'>" + objPst->pstHtm + "</div>
"
})+
"</div>\n\n"
});
Text SetSum(allPst); // Escribe todos los posts
}>
<!-- end posts ---------------------------------------------------->
<div style="clear: both;"> </div>
</div>
<!-- content: end --------------------------------------------------->
<!-- sidebar: ini --------------------------------------------------->
<div id="sidebar">
<ul>
<li>
<h2>Para novelistas</h2>
<ul>
<{ PhtLinkPstSet(CtrNov, TRUE); }>
</ul>
</li>
<li>
<h2>Para guionistas</h2>
<ul>
<{ PhtLinkPstSet(CtrGui, TRUE); }>
</ul>
</li>
<li>
<h2>Para editores</h2>
<ul>
<{ PhtLinkPstSet(CtrEdi, TRUE); }>
</ul>
</li>
<li>
<h2>Para productores</h2>
<ul>
<{ PhtLinkPstSet(CtrPro, TRUE); }>
</ul>
</li>
<li>
<h2>Enlaces</h2>
<ul>
<{ PhtLinkPstSet(CtrVar, TRUE); }>
</ul>
</li>
</ul>
</div>
<!-- sidebar: end --------------------------------------------------->
<div style="clear: both;"> </div>
</div>
</div>
</div>
</div>
<div id="footer-wrapper">
<div id="footer">
<p>
Copyright (c) 2011
<a href="http://www.librok.es">librok.es</a>.
Todos los derechos reservados.
Desarrollado por <a href="http://www.asolver.com">asolver.com</a>
con <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
</p>
</div>
</div>
</body>
</html>
SHi.SyntaxHighlight funciones de sintaxis realzada de codigo
2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio