Instantly share code, notes, and snippets.

View filter_lili.php
<?php
$files = glob(__DIR__. '/CTD.dat/*.dat');
passthru('rm OUTPUT/*');
foreach ( $files as $file ) {
$f = fopen($file, 'r');
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) {
View compiler.php
<?php
$cpu_00 = [
'set' => [
0,
['var', 'value']
],
'set_a' => [
1,
['var']
View bray_curtis.php
<?php
$a = [
'a' => [
'a1' => 2,
'a2' => 0
],
'b' => [
'b1' => 2,
'b2' => 5
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
View Linux library
#/bin/sh
LD_LIBRARY_PATH=/usr/local/bosque
export LD_LIBRARY_PATH
exec /usr/local/bosque/app.binary \$@
EOL
View ec_line.php
<?php
function parse_ec($linea) {
if ( preg_match("/\[EC:([\d\. ]*)\]/", $linea, $matches) ) {
$content = $matches[1];
return explode(' ', $content);
} else return [];
}
View all_files.php
<?php
$files = glob("*.txt");
foreach ( $files as $file ) {
system("php arbitrary.php $file.out $file dan dan kokoro hikareteku");
}
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'
];