Skip to content

Instantly share code, notes, and snippets.

View rocarvaj's full-sized avatar
馃悁

Rodolfo Carvajal rocarvaj

馃悁
View GitHub Profile
@rocarvaj
rocarvaj / .vimrc
Created April 27, 2012 21:28
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@rocarvaj
rocarvaj / chomp.cpp
Created July 25, 2012 19:57
C++ string chomp
string::size_type pos = str.find_last_not_of("\n \t");
if(pos != string::npos)
str = str.substr(0, pos+1);
@rocarvaj
rocarvaj / mpiRingISendIRecv.c
Created April 27, 2012 17:22
MPI_Send/MPI_Recv versus MPI_ISend/MPI_IRecv, ring example
/*######################################################################
Example 6 : MPI_Isend MPI_Irecv
Description:
Examples 5 and 6 demonstrate the difference between blocking
and non-blocking point-to-point communication.
Example 5: MPI_Send/MPI_Recv (blocking)
Example 6: MPI_Isend/MPI_Irecv (non-blocking)
@rocarvaj
rocarvaj / _bookdown.yml
Created December 26, 2022 14:03
Bookdown spanish internationalization
language:
label:
fig: 'Figura '
tab: 'Tabla '
eq: 'Ecuaci贸n '
thm: 'Teorema '
lem: 'Lema '
cor: 'Corolario '
prp: 'Proposici贸n '
cnj: 'Conjetura '
@rocarvaj
rocarvaj / math.md
Last active July 25, 2022 23:23
This is a test

Hola, este es un test $$\sum_{i=1}^n$$.

@rocarvaj
rocarvaj / prename.pl
Created October 31, 2017 16:26
Perl version of the rename script
#!/usr/bin/perl
use strict;
use warnings;
=head1 NAME
rename - renames multiple files
=head1 SYNOPSIS
@rocarvaj
rocarvaj / generar-datos-grupo.R
Last active April 1, 2022 17:48
Generador de datos por grupo en Proyecto RCD II
# Cargar base de datos (requiere cargar tidyverse y readxl)
MK <- read_excel("NIELSEN01V2.xlsx")
# Escribir en la funci贸n set.seed() el c贸digo de cuatro d铆gitos asignado
# a tu grupo para obtener los datos que el grupo deber analizar
set.seed(CodigoGrupo)
p = 0.8 # Proporci贸n de la muestra
BaseGrupo <- MK %>%
@rocarvaj
rocarvaj / comandos-r.md
Last active February 14, 2022 17:22
Algunos comandos m谩s usados de R (Taller de Data Analytics UAI 2019) #R

Lista de comandos 煤tiles

Nota: Varios de estos comandos pertenecen al Tidyverse, por lo que se asume que se ha instalado y cargado tidyverse.

Generales

Comando Descripci贸n Ejemplo
install.packages() Instalar paquete (es necesario hacer s贸lo una vez) install.packages("tidyverse")
library() Cargar paquete library(tidyverse)
read_csv() Cargar datos en formato .csv (separado por comas) read_csv("carpeta/misdatos.csv")
read_excel() Cargar datos desde un archivo Excel (requiere cargar paquete readxl) read_excel("misdatos.xlsx", sheet = "Hoja1")
@rocarvaj
rocarvaj / dotgraph.tex
Created May 8, 2017 17:56
Dot graph paper in LaTeX
\documentclass{article}
\pagenumbering{gobble}
\usepackage[a4paper,hmargin={0mm,3mm},vmargin=5mm]{geometry}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=.5]
\foreach \x in {0,...,41}
\foreach \y in {0,...,57}
{
\fill[gray!75] (\x,\y) circle (0.06cm);
@rocarvaj
rocarvaj / instalar-rstudio-tidyverse.md
Last active June 25, 2021 13:26
C贸mo instalar R, RStudio y Tidyverse

C贸mo instalar R, RStudio y Tidyverse

  1. Descargar e instalar R aqu铆: https://cran.rstudio.com/
    • Windows: En la secci贸n "Download and Install R", hacer click en "Download R for Windows". Luego hacer click en "install R for the first time", se llegar谩 a un p谩gina con un link que indica "Download R 3.5.3 for Windows". Bajar ese archivo y ejecutar.
    • MacOS: En la secci贸n "Download and Install R", hacer click en "Download R for (Mac) OS X". Luego descargar el archivo en el link "R-3.5.3.pkg" y ejecutar.
    • Linux: En la secci贸n "Download and Install R", hacer click en "Download R for Linux". Seleccionar la carpeta con el nombre de su distribuci贸n.
  2. Descargar e instalar RStudio aqu铆: https://www.rstudio.com/products/rstudio/download/#download
    • Windows: Bajo la secci贸n "Installers for Supported Platforms", descargar y ejecutar archivo en link "RStudio 1.1.463 - Windows Vista/7/8/10".
  • MacOS: Bajo la secci贸n "Installers for Supported Platforms", Descargar y ejecutar archivo en link "RStudio