Skip to content

Instantly share code, notes, and snippets.

🏠
Programando!!

Edwin Rodríguez edwrodrig

🏠
Programando!!
  • Instituto Milenio de Oceanografía
  • Concepción, Chile
View GitHub Profile
View ignore_ctd_file_header.py
import sys
name = "/home/edwin/Desktop/sta0860.cnv"
f = open(name, "r")
for line in f:
line = line.strip()
if line == "*END*" :
break
View interval_class.py
class Interval:
start = 0
end = 0
def __init__(self, a, b):
self.start = a
self.end = b
if b < a:
self.start = b
View traspose.php
<?php
$data = [
'site1' => ['1','2','3','4'],
'site2' => ['2','3','4','5']
];
$matrix = [];
@edwrodrig
edwrodrig / generator.py
Created Apr 17, 2019
Generating and Spliting tsv in python
View generator.py
import sys
import random
f = open(sys.argv[1], "w")
f.write("OTU\tT5_300\tT5_250\tT5_160\n")
for i in range(0, 1000):
f.write("Otu")
f.write(str(random.randint(1,2000)))
@edwrodrig
edwrodrig / demo.py
Created Mar 27, 2019
Demo de clase de python 2019-03-27
View demo.py
import sys
largo = len(sys.argv)
if largo < 2:
print 'error'
exit()
entrada = sys.argv[1]
@edwrodrig
edwrodrig / filter_lili.php
Created Jan 11, 2019
Filtro por metro para archivo de CTD
View filter_lili.php
<?php
$files = glob(__DIR__. '/CTD.dat/*.dat');
passthru('rm OUTPUT/*');
foreach ( $files as $file ) {
$f = fopen($file, 'r');
@edwrodrig
edwrodrig / roulette.php
Created Dec 10, 2018
Roulette of alternatives
View roulette.php
<?php
$alternatives = explode("\n", trim(file_get_contents('alternatives.txt')));
$size = count($alternatives);
$delay = 1;
$i = 0;
function print_alt($word, $final = false) {
@edwrodrig
edwrodrig / compiler.php
Created Dec 10, 2018
Compiler and process for my own language
View compiler.php
<?php
$cpu_00 = [
'set' => [
0,
['var', 'value']
],
'set_a' => [
1,
['var']
@edwrodrig
edwrodrig / bray_curtis.php
Created Dec 10, 2018
Some bray curtis example
View bray_curtis.php
<?php
$a = [
'a' => [
'a1' => 2,
'a2' => 0
],
'b' => [
'b1' => 2,
'b2' => 5
@edwrodrig
edwrodrig / libro.cpp
Created Aug 18, 2018
Tarea de programación de la U
View libro.cpp
class libro{
private:
article *diario;
autor *mister;
public:
libro(); //constructor libro
~libro(); //destructor libro
void reset(); //Resetear libro
void add_articulo(char *); //agregar articulo
void add_autor(char *); //agregar autor
You can’t perform that action at this time.