Para incluir más de un autor en Latex, con el estilo article:
\author{
Apellido 1, Nombre 1\\
\texttt{informacionRelevante} \\
\texttt{$correo@electronico1$}
\and
Apellido 2, Nombre 2\\
\texttt{informacionRelevante} \\
\texttt{$correo@electronico2$}
}
\begin{document}
\maketitle
\end{document}
sábado, 27 de octubre de 2012
miércoles, 12 de septiembre de 2012
Indice de contenidos, lista de tablas y lista de figuras en Latex
En forma regular, los comandos:
\tableofcontents
\listoffigures
\listoftables
despliegan el indice de contenidos, lista de figuras y lista de tablas, respectivamente.
Sin embargo, cuando se utiliza el estilo llncs, estos comandos no funcionan de por sì solos.
Para solucionar este inconveniente, ademas de ubicar los comandos mencionados, se escriben las siguientes lineas bajo el \documentclass y entre el \author y el \title del trabajo:
% make a proper TOC despite llncs
\setcounter{tocdepth}{2}
\makeatletter
\renewcommand*\l@author[2]{}
\renewcommand*\l@title[2]{}
\makeatletter
Compilar un par de veces y voila!
(by Priscill)
jueves, 6 de septiembre de 2012
Mostrar resultados de consultas SPARQL sin tipo
Con este método, usando la librería dotnetrdf en una aplicación web, podemos mostrar los valores asociados a las variables de una consulta SPARQL sin que se muestre el texto que identifica al tipo de dato o al idioma, etc.
private string GetINodeText(INode n)
{
String output = "";
if (n != null)
{
switch (n.NodeType)
{
case NodeType.Literal:
//For literals you only want the lexical value only so need to cast to
//literal and access the Value property
output = ((ILiteralNode)n).Value;
break;
default:
//For any other node we just want the string form so
//ToString() is sufficient
output = n.ToString();
break;
}
}
return output;
}
El parámetro que se pasa es el que se obtiene haciendo esto:
SparqlResultSet results = LoadFromEndPoint2("dbpedia.org/sparql", "dbpedia.org", query);
if (results != null)
{
foreach (SparqlResult result in results)
{
string text = GetINodeText(result.Value("varname"));
}
}
El método LoadFromEndPoint2 básicamente es esto:
private SparqlResultSet LoadFromEndPoint2(string ipaddress, string graph, string query)
{
try
{
SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri("http://" + ipaddress), "http://" + graph);
endpoint.Timeout = 0;
SparqlResultSet results = endpoint.QueryWithResultSet(query);
return results;
}catch(Exception ex)
{
}
}
private string GetINodeText(INode n)
{
String output = "";
if (n != null)
{
switch (n.NodeType)
{
case NodeType.Literal:
//For literals you only want the lexical value only so need to cast to
//literal and access the Value property
output = ((ILiteralNode)n).Value;
break;
default:
//For any other node we just want the string form so
//ToString() is sufficient
output = n.ToString();
break;
}
}
return output;
}
El parámetro que se pasa es el que se obtiene haciendo esto:
SparqlResultSet results = LoadFromEndPoint2("dbpedia.org/sparql", "dbpedia.org", query);
if (results != null)
{
foreach (SparqlResult result in results)
{
string text = GetINodeText(result.Value("varname"));
}
}
El método LoadFromEndPoint2 básicamente es esto:
private SparqlResultSet LoadFromEndPoint2(string ipaddress, string graph, string query)
{
try
{
SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri("http://" + ipaddress), "http://" + graph);
endpoint.Timeout = 0;
SparqlResultSet results = endpoint.QueryWithResultSet(query);
return results;
}catch(Exception ex)
{
}
}
Configurar IIS Express para que escuche peticiones externas
Para que IIS Express sea capaz de servir peticiones que llegan desde fuera de la máquina, copiamos el fichero 'C:\Program Files\IIS Express\AppServer\applicationhost.config' a la carpeta de la aplicación web y lo editamos, configuramos algo como esto:
<application path="/">
<virtualDirectory path="/" physicalPath="C:\temp" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:" />
</bindings>
Configuramos la carpeta raíz de la aplicación y el resto de parámetros y lo ejecutamos así
iisexpress.exe /config:c:\temp\applicationhost.config
donde 'temp' sería la capeta de nuestra aplicación.
lunes, 2 de julio de 2012
Referencias bibliográficas en Sweave
Consejos para añadir referencias bibliográficas en Sweave usando RStudio
1. Guardar los ficheros en formato utf-8
2. Los comandos \bibliography y \bibliographystyle van al final de la página
3. Puede ser necesario agregar o modificar las siguientes variables de entorno:
TEXINPUTS
BIBINPUTS
BSTINPUTS
Ejemplo: Sys.setenv(BIBINPUTS="D:/Documentos")
1. Guardar los ficheros en formato utf-8
2. Los comandos \bibliography y \bibliographystyle van al final de la página
3. Puede ser necesario agregar o modificar las siguientes variables de entorno:
TEXINPUTS
BIBINPUTS
BSTINPUTS
Ejemplo: Sys.setenv(BIBINPUTS="D:/Documentos")
martes, 17 de abril de 2012
Desde una página PHP, podemos hacer una llamada GET o POST o de otro tipo similar sobre HTTPS usando la librería CURL. Podemos definir la siguiente función en PHP:
function getResponse($url, $aParameters)
{
// Inicializar sesion y establecer url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// curl devuelve la respuesta en lugar de darle salida
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $aParameters);
// Obtener la respuesta y cerrar
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
Y la llamada sería:
$url="https://api.example.com/resource";
$aParameters = array();
$aParameters[] = "Accept: application/xml";
$response1 = getResponse($url,$aParameters);
miércoles, 11 de abril de 2012
Deshabilitar el PIN de una tarjeta SIM en un modem mediante comandos
Primero, para hacer la autenticación usamos el comando:
at+cpin=9999
(9999 es el código pin de la tarjeta)
Luego, para desactivar el PIN:
at+clck="sc",0,9999
at+cpin=9999
(9999 es el código pin de la tarjeta)
Luego, para desactivar el PIN:
at+clck="sc",0,9999
Suscribirse a:
Entradas (Atom)