Skip to content

Instantly share code, notes, and snippets.

Edwin Rodríguez edwrodrig

  • Instituto Milenio de Oceanografía
  • Concepción, Chile
Block or report user

Report or block edwrodrig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View get_url.php
<?php
do {
$letter = "abcdefghijklmnopqrstuvwxyz"[rand(0,25)];
$number = rand(0,999);
$url = sprintf("https://www.iqb.es/cbasicas/farma/farma04/%s%03d.htm", $letter, $number);
echo "Trying $url\n";
$return = @file_get_contents($url);
} while ( !$return );
@edwrodrig
edwrodrig / strcat.m
Created Jun 14, 2019
Concatenate string matlab
View strcat.m
list = [1,2,3,4,5]
for i = 1 : length(list)
str = strcat("inicio_", num2str(list(i)), "_final.txt")
disp(str)
#load(str)
end
@edwrodrig
edwrodrig / explode_implode.php
Last active Jun 14, 2019
Ejemplos random en php
View explode_implode.php
<?php
$palabra = "asdasdasdasdasdasd";
$result = explode('a', $palabra);
$palabra = implode('a', $result);
var_dump($palabra);
~
View autoplot.py
import os
os.system("rm out Rplots.pdf")
os.system("python process.py > out")
os.system("Rscript plot.r")
os.system("mv Rplots.pdf caca.pdf")
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');
You can’t perform that action at this time.