View matrix_ptr_of_ptr.cpp
#include <cstdio>
#include <stdlib.h>
int main() {
int size = 3;
int** matrix = (int **)malloc(sizeof(int*) * size);
for ( int i = 0 ; i < size ; i ++ ) {
View recursivity.php
<?php
$nodo = [
'm1',
'ec1',
'tax1',
'tax2',
'd1',
'd2',
'ec2'
];
View contar.php
<?php
$m = ['hola', 'chao', 'hola'];
$m = [
['beta', 2],
['beta', 4],
['gamma', 3],
['gamma', 7],
['delta', 11]
View seq.php
<?php
//$seq = 'ACTGTC----GATGTAC----GTACGTGACTG-------TACG-TAC-GTAGCTAGTC';
$seq = 'ACC';
$largo = strlen($seq);
$pos_0 = $seq[0];
$concat = 'AB' . 'C';
View primes.php
<?php
function es_divisible($numero, $divisor) {
$resto = $numero % $divisor;
if ( $resto == 0 ) return true;
else return false;
}
function es_par($numero) {
View pass_function.php
<?php
function search($min, $max, $criteria) {
for ( $i = $min; $i < $max; $i++ ) {
if ( $criteria($i) ) {
return true;
}
}
return false;
}
View join_fasta.php
<?php
$f = fopen('/home/edwin/hola.fasta', 'r');
echo ">hola.fasta\n";
while ( $line = fgets($f) ) {
if ( $line[0] == '>') continue;
if ( empty(trim($line)) ) continue;
echo trim($line);
View generate_r_charts.php
<?php
function script_r($filename) {
$script = <<<'EOF'
setwd("C:/Users/EDGART/Desktop/project_php")
data = read.csv("%%%IN%%%", sep = ";")
pdf(file = '%%%OUT%%%', width = 8, height = 8)
plot(data$Temperature, data$Depth, type="b", col="blue", ylim=c(8000,0), axes=FALSE, xlab="",
View ctd_to_csv.php
<?php
function es_terminador($linea) {
$result = strpos($linea, '*END*') === 0;
return $result;
}
function es_header($linea) {
$result = strpos($linea, '# name') === 0;
return $result;
View pie_chart.php
<?php
//Pie reference : https://danielpataki.com/svg-pie-chart-javascript/
function draw_pie($x, $y, $radius, $angle_start, $angle_end, $stroke_color, $fill_color, $opacity) {
$angle_start = $angle_start * M_PI / 180;
$angle_end = $angle_end * M_PI / 180;
$start_x = $x + $radius * cos($angle_start);
$start_y = $y + $radius * sin($angle_start);