This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def desencolar( self ): | |
if self.cabeza: | |
self.cabeza = self.cabeza.obtenerSig() | |
self.tamanio -= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __init__( self ): | |
self.cabeza = None | |
self.cola = None | |
self.tamanio = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nodo: | |
def __init__( self, dato ): | |
self.dato = dato | |
self.sig = None | |
#def asignarDato( self, dato ): | |
# self.dato = dato | |
def asignarSig( self, sig ): |
NewerOlder