This file contains hidden or 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
function slugify($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
// trim | |
$text = trim($text, '-'); | |
// transliterate | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); |
This file contains hidden or 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
function time_elapsed_string($datetime, $full = false) { | |
$now = new \DateTime; | |
$ago = $datetime; | |
$diff = (array) $now->diff($ago); | |
$diff['w'] = floor($diff['d'] / 7); | |
$diff['d'] -= $diff['w'] * 7; | |
$string = array( | |
'y' => 'año', |
This file contains hidden or 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
mysql -u username -p database_name < file.sql |
This file contains hidden or 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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int m[5][5] = { | |
{1,2,3,4,5}, | |
{6,7,8,9,10}, |
This file contains hidden or 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
__author__ = 'hormiga' | |
rango = [10,11] | |
verdulerias = [ | |
[0,3], | |
[2,3], | |
[1,8], | |
[7,9], | |
[7,1], |
This file contains hidden or 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
#include <cstdlib> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int pos[2] = {1,1}; | |
while (pos[0] != 8 || pos[1] != 8) { |
This file contains hidden or 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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int potencia(int base, int exp); | |
int main(int argc, char *argv[]) | |
{ | |
This file contains hidden or 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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
int B[5][5] = { | |
{1,2,3,7,5}, | |
{4,5,6,8,4}, |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from random import randint, uniform | |
#DESCOMENTAR PARA GENERAR LA LISTA DE DATOS QUE INGRESAN | |
#ingresos = [] | |
#for i in range(0,30): | |
# ingresos.append({'mozo':randint(1,2),'mesa':randint(1,4),'importe':uniform(0,200),'cantidad_de_personas':randint(1,10)}) | |
#print ingresos | |
ingresos = [{'cantidad_de_personas': 3, 'mesa': 2, 'mozo': 2, 'importe': 11.680529678994134}, {'cantidad_de_personas': 1, 'mesa': 3, 'mozo': 2, 'importe': 145.38676459634559}, {'cantidad_de_personas': 7, 'mesa': 4, 'mozo': 1, 'importe': 147.23374683869713}, {'cantidad_de_personas': 7, 'mesa': 1, 'mozo': 1, 'importe': 79.99672355340462}, {'cantidad_de_personas': 2, 'mesa': 2, 'mozo': 2, 'importe': 146.44670501620328}, {'cantidad_de_personas': 7, 'mesa': 2, 'mozo': 1, 'importe': 163.22603363847838}, {'cantidad_de_personas': 9, 'mesa': 1, 'mozo': 2, 'importe': 176.76862989793597}, {'cantidad_de_personas': 10, 'mesa': 4, 'mozo': 1, 'importe': 133.26449672637062}, {'cantidad_de_personas': 10, 'mesa': 2, 'mozo': 1, 'importe |
This file contains hidden or 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
Algoritmo = Sueldos | |
Var | |
int: | |
cantidad_de_empleados_categoria_1, cantidad_de_empleados_categoria_2, cantidad_de_empleados_categoria_3, categoria_sueldo_maximo, cantidad_empleados_totales, categoria | |
float: | |
sumatoria_de_sueldos_categoria_1, sumatoria_de_sueldos_categoria_2, sumatoria_de_sueldos_categoria_3, | |
promedio_de_sueldos_categoria_1, promedio_de_sueldos_categoria_2, promedio_de_sueldos_categoria_3, | |
sueldo_maximo, sueldo_aux |