Error en backends en matplotlib

Error


_tkinter.TclError: no display name and no $DISPLAY environment variable

(Posible) Solución
Probablemente utilices el backend TkAgg. Como mencionan en , la mejor solución es cambiar el backend. A pesar de que es posible hacerlo desde código (usando matplotlob.use('Agg')), es más práctico definirlo en .matplotlib/matplolibrc de la siguiente manera:

#### CONFIGURATION BEGINS HERE

# the default backend; one of GTK GTKAgg GTKCairo CocoaAgg FltkAgg
# MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template
# You can also deploy your own backend outside of matplotlib by
# referring to the module name (which must be in the PYTHONPATH) as
# 'module://my_backend'
#backend      : TkAgg
backend      : Agg

Comentarios sobre svn

Ignore list

auraham@virtual:~/python_repository/islands$ svn propset --recursive svn:ignore "*.log" .
property 'svn:ignore' set on '.'
property 'svn:ignore' set on 'models'
property 'svn:ignore' set on 'models/dim_sw'
property 'svn:ignore' set on 'models/dim_base'
property 'svn:ignore' set on 'models/dim'
property 'svn:ignore' set on 'testing'

Fuente

Sobre Valgrind

/*
| example1.c
|
| Uso de Valgrind
| 
| If you use uninitialized memory, write off the end of an array, 
| or forget to free a pointer, Valgrind can detect it. 
| 
| We'll focus mainly on the memcheck tool for this tutorial as running 
| valgrind with the memcheck tool will allow us to check correct memory usage.
| 
| 
| Compilacion
| $ gcc example1.c -o example1 -g
| 
| Valgrind
| $ valgrind --tool=memcheck --leak-check=yes ./example1
|
| Opciones
| --tool=memcheck
| --leak-check=yes
| --show-reacheable=yes  There will be times when the --leak-check=yes option will not result in showing you all memory leaks. 
*                       To find absolutely every unpaired call to free or new, you'll need to use the --show-reachable=yes option. Its output is almost exactly the same, but it will show more unfreed memory. 
| 
| Salida de Valgrind

==5316== Memcheck, a memory error detector
==5316== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==5316== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==5316== Command: ./example1
==5316== 
==5316== 
==5316== HEAP SUMMARY:
==5316==     in use at exit: 100 bytes in 1 blocks
==5316==   total heap usage: 1 allocs, 0 frees, 100 bytes allocated                         [1]
==5316== 
==5316== 100 bytes in 1 blocks are definitely lost in loss record 1 of 1                    [2]
==5316==    at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==5316==    by 0x80483F8: main (example1.c:58)                                              [3]
==5316== 
==5316== LEAK SUMMARY:
==5316==    definitely lost: 100 bytes in 1 blocks                                          [4]
==5316==    indirectly lost: 0 bytes in 0 blocks
==5316==      possibly lost: 0 bytes in 0 blocks
==5316==    still reachable: 0 bytes in 0 blocks
==5316==         suppressed: 0 bytes in 0 blocks
==5316== 
==5316== For counts of detected and suppressed errors, rerun with: -v
==5316== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

| 
| [1] El numero de allocs no coincide con el numero de frees, por lo tanto, no se esta liberando
|     memoria correctamente.
| [2] Memoria perdida
| [3] Para conocer el numero de linea que causa el problema, se debe usar la opcion -g de gcc
| [4] Sumario de memoria perdida
| 
| 
| Fuente: http://www.cprogramming.com/debugging/valgrind.html
*/

#include <stdlib.h>

int main()
{
    char *x = malloc(100);
    return 0;
}
/*
| example2.c
|
| Uso de Valgrind
| 
| Valgrind can also find the use of invalid heap memory using the memcheck tool. 
| For instance, if you allocate an array with malloc or new and then try to 
| access a location past the end of the array:
| 
| char *x = malloc(10);
| x[10] = 'a';
|
| Compilacion
| $ gcc example2.c -o example2 -g
| 
| Valgrind
| $ valgrind --tool=memcheck --leak-check=yes ./example1
|
| Opciones
| --tool=memcheck
| --leak-check=yes
| --show-reachable=yes  There will be times when the --leak-check=yes option will not result in showing you all memory leaks. 
*                       To find absolutely every unpaired call to free or new, you'll need to use the --show-reachable=yes option. Its output is almost exactly the same, but it will show more unfreed memory. 
| 
| Salida de Valgrind
|
==5517== Invalid write of size 1                                    [1]
==5517==    at 0x8048404: main (example2.c:67)
==5517==  Address 0x4200032 is 0 bytes after a block of size 10 alloc'd
==5517==    at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==5517==    by 0x80483F8: main (example2.c:66)
|
| 
| [1] Error de escritura
| 
| 
| Fuente: http://www.cprogramming.com/debugging/valgrind.html
*/

#include <stdlib.h>

int main()
{
    char *x = malloc(10);
    x[10] = 'a';
    return 0;
}
/*
| example3.c
|
| Uso de Valgrind
| 
| Another type of operation that Valgrind will detect is the use of an uninitialized 
| value in a conditional statement. Although you should be in the habit of 
| initializing all variables that you create, Valgrind will help find those cases where you don't. 
| 
| Compilacion
| $ gcc example3.c -o example3 -g
| 
| Valgrind
| $ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes  ./example3
|
| Opciones
| --tool=memcheck
| --leak-check=yes
| --show-reachable=yes  There will be times when the --leak-check=yes option will not result in showing you all memory leaks. 
*                       To find absolutely every unpaired call to free or new, you'll need to use the --show-reachable=yes option. Its output is almost exactly the same, but it will show more unfreed memory. 
| 
| Salida de Valgrind
|
==5661== Conditional jump or move depends on uninitialised value(s) [1]
==5661==    at 0x80483F2: main (example3.c:47)
|
| 
| [1] Uso de variable no inicializada
| 
| 
| Fuente: http://www.cprogramming.com/debugging/valgrind.html
*/

#include <stdlib.h>
#include <stdio.h>

int main()
{
    int x;
    
    if (x == 0)
        printf("x is zero");
    
    return 0;
}
/*
| example4.c
|
| Uso de Valgrind
| 
| Another type of operation that Valgrind will detect is the use of an uninitialized 
| value in a conditional statement. Although you should be in the habit of 
| initializing all variables that you create, Valgrind will help find those cases where you don't. 
| 
| Compilacion
| $ gcc example4.c -o example4 -g
| 
| Valgrind
| $ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes  ./example4
|
| Opciones
| --tool=memcheck
| --leak-check=yes
| --show-reachable=yes  There will be times when the --leak-check=yes option will not result in showing you all memory leaks. 
*                       To find absolutely every unpaired call to free or new, you'll need to use the --show-reachable=yes option. Its output is almost exactly the same, but it will show more unfreed memory. 
| 
| Salida de Valgrind
|
==5733== Conditional jump or move depends on uninitialised value(s) [1]
==5733==    at 0x80483EE: foo (example4.c:39)
==5733==    by 0x8048413: main (example4.c:47)

|
| 
| [1] Traceback de la variable no inicializada
| 
| 
| Fuente: http://www.cprogramming.com/debugging/valgrind.html
*/

#include <stdlib.h>
#include <stdio.h>

void foo(int y)
{
    if (y == 0)
        printf("y is zero");
}


int main()
{
    int x;
    foo(x);
    
    return 0;
}
/*
| example5.c
|
| Uso de Valgrind
| Valgrind doesn't perform bounds checking on static arrays (allocated on the stack).
| So if you declare an array inside your function: 
| 
|   char x[10];
|   x[11] = 'a';
|
| Compilacion
| $ gcc example5.c -o example5 -g
| 
| Valgrind
| $ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes  ./example5
|
| Opciones
| --tool=memcheck
| --leak-check=yes
| --show-reachable=yes  There will be times when the --leak-check=yes option will not result in showing you all memory leaks. 
*                       To find absolutely every unpaired call to free or new, you'll need to use the --show-reachable=yes option. Its output is almost exactly the same, but it will show more unfreed memory. 
| 
| Salida de Valgrind
|
==5733== Conditional jump or move depends on uninitialised value(s) [1]
==5733==    at 0x80483EE: foo (example4.c:39)
==5733==    by 0x8048413: main (example4.c:47)

|
| 
| [1] Traceback de la variable no inicializada
| 
| 
| Fuente: http://www.cprogramming.com/debugging/valgrind.html
*/

#include <stdlib.h>
#include <stdio.h>

int main()
{
    int x[10];
    //x[9] = 1;       // correcto
    x[11] = 1;       // correcto
    
    return 0;
}

Fuente: cprogramming.com

Sobre R

Variables


> name <- "carmen"; n1 <- 10; n2 <- 100; m <- 0.5

Mostrar variables

> ls()
[1] "m"    "n"    "n1"   "n2"   "name"
> ls(pattern="m")
[1] "m"    "name"
> ls(pat="m")
[1] "m"    "name"

> ls(pat="^m")
[1] "m"
> ls.str()
m :  num 0.5
n :  num 16
n1 :  num 10
n2 :  num 100
name :  chr "carmen"
> M <- data.frame(n1, n2, m)
> M
  n1  n2   m
1 10 100 0.5
> ls.str()
m :  num 0.5
M : 'data.frame':	1 obs. of  3 variables:
 $ n1: num 10
 $ n2: num 100
 $ m : num 0.5
n :  num 16
n1 :  num 10
n2 :  num 100
name :  chr "carmen"
> ls.str(pat="M")
M : 'data.frame':	1 obs. of  3 variables:
 $ n1: num 10
 $ n2: num 100
 $ m : num 0.5
> print(ls.str(pat="M"), max.level=-1)
M : 'data.frame':	1 obs. of  3 variables:

Eliminar variables

> ls()
[1] "list" "m"    "M"    "n1"   "n2"   "name"
> rm(m, n1)
> ls()
[1] "list" "M"    "n2"   "name"
> ls()
[1] "list" "m"    "M"    "n1"   "n2"   "name"
> rm(list=ls(pat="M"))
> ls()
[1] "list" "n2"   "name"

Sobre Latex

Múltiples referencias en Beamer

\begin{frame}[allowframebreaks]
\frametitle{Referencias}
\tiny\bibliographystyle{plain}                           % style
\bibliography{book_chapters,library}            % *.bib
\end{frame}

Fuente: tex

máx y max


\documentclass[letterpaper,11pt]{article}

%\usepackage[english, spanish, es-nodecimaldot, es-tabla, es-minimal]{babel} % max
\usepackage[english, spanish, es-nodecimaldot, es-tabla]{babel} % máx
\selectlanguage{spanish}

\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\title{sample}
\author{author}
\date{\today}

\begin{document}

\maketitle

\begin{equation}
\max
\end{equation}

\end{document}