Skip to content

Instantly share code, notes, and snippets.

library('ggplot2')
f_circulo <- function()
{
# Generar 500 puntos de 0pi radianes a 2pi radianes,
# lo cuales equivalen a 0 y 360 grados respectivamente.
t <- seq( from = 0, to = 2 * pi, length.out = 1000 )
# Generar un circulo con ecuaciones parametricas
library('ggplot2')
f_lanzar <- function( p_dardos )
{
# Radio = 1.
r <- 1
# Generar n puntos (x,y) por medio de una distribucion uniforme.
x <- runif( min = -1, max = 1, n = p_dardos )
library('ggplot2')
f_lanzar <- function( p_dardos )
{
# Radio = 1.
r <- 1
# Generar n puntos (x,y) por medio de una distribucion uniforme.
x <- runif( min = -1, max = 1, n = p_dardos )
library('ggplot2')
# Dataset column names and classes
l_colnames = c( 'game_no','stadium', 'team', 'x_cord', 'y_cord', 'desc' )
l_colClasses = c( 'numeric', 'character', 'character', 'numeric', 'numeric', 'character' )
# Load the dataset
hip_data <- read.csv( file = 'hitsPerGame.csv'
, header = F
, col.names = l_colnames
library('ggplot2')
# Dataset column names and classes.
l_colnames = c( 'game_no','stadium', 'team', 'x_cord', 'y_cord', 'desc' )
l_colClasses = c( 'numeric', 'character', 'character', 'numeric', 'numeric', 'character' )
# Load the dataset.
hip_data <- read.csv( file = 'hitsPerGame.csv'
, header = F
, col.names = l_colnames
from lxml import etree
import glob
import csv
# Input Files.
hipFiles = glob.glob('*hip.xml')
gameFiles = glob.glob('*data.xml')
# Output File.
csvFile = open('hitsPerGame.csv', 'wb')
def desencolar( self ):
if self.cabeza:
self.cabeza = self.cabeza.obtenerSig()
self.tamanio -= 1
def encolar( self, dato ):
nuevoNodo = Nodo( dato )
if not self.cabeza:
nuevoNodo.asignarSig( None )
self.cabeza = nuevoNodo
else:
self.cola.asignarSig( nuevoNodo )
self.cola = nuevoNodo
def __init__( self ):
self.cabeza = None
self.cola = None
self.tamanio = 0
class Nodo:
def __init__( self, dato ):
self.dato = dato
self.sig = None
#def asignarDato( self, dato ):
# self.dato = dato
def asignarSig( self, sig ):