This file contains 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
def funcion_que_prueba_la_suma(): | |
suma = 1 + 2 | |
assert suma == 3, 'La suma no funciona correctamente, su resultado fue ' + str(suma) + ', distinto de 3' | |
# si el assert no corta la ejecución, entonces funcionó bien | |
print 'La suma funciona correctamente' |
This file contains 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
// *** funciona *** | |
#include <stdio.h> | |
#define MAX 2 | |
int main(){ | |
int vector[MAX]; | |
for (int i=0; i<=MAX; i++){ | |
int a; | |
printf("Ingrese un numero:"); | |
scanf("%i", &a); |
This file contains 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
Tracer Bullets | |
-------------- | |
Ready, fire, aim... | |
There are two ways to fire a machine gun in the dark. You can find out exactly where your target is (range, elevation, and azimuth). You can determine the environmental conditions (temperature, humidity, air pressure, wind, and so on). You can determine the precise specifications of the cartridges and bullets you are using, and their interactions with the actual gun you are firing. You can then use tables or a firing computer to calculate the exact bearing and elevation of the barrel. If everything works exactly as specified, your tables are correct, and the environment doesn't change, your bullets should land close to their target. | |
Or you could use tracer bullets. | |
Tracer bullets are loaded at intervals on the ammo belt alongside regular ammunition. When they're fired, their phosphorus ignites and leaves a pyrotechnic trail from the gun to whatever they hit. If the tracers are hitting the target, then so are the regular bullets. |
This file contains 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
// ******* NO COMPILÉ ESTE ARCHIVO ********** | |
abstract class MailMessageBuilder | |
{ | |
private MailMessage mailMessage = new MailMessage(); | |
public MailMessageBuilder WithTo(string to) | |
{ | |
mailMessage.To.Add(to); | |
return this; |
This file contains 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
try | |
{ | |
$key = 'HKLM:\SOFTWARE\Microsoft\Microsoft SDKs\ServiceHosting' | |
$registryProperty = Get-ChildItem $key -ErrorAction Stop | Sort CreationTime -Descending | Select -First 1 | Get-ItemProperty -ErrorAction Stop | |
$fullVersion = ($registryProperty | Select FullVersion).FullVersion | |
$installPath = ($registryProperty | Select InstallPath).InstallPath | |
if ($fullVersion -lt "2.2.0000.0") { throw } | |
$ref1 = "${installPath}ref\Microsoft.WindowsAzure.Storage.dll" | |
$ref2 = "${installPath}ref\Microsoft.WindowsAzure.StorageClient.dll" |
This file contains 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
if curso_proba: | |
asignar(Grynberg) | |
if curso_analisis: | |
asignar(Hagman) | |
elif curso_numerico: | |
asignar(Menendez, demora = ~30min) | |
elif prioridad(Murmis) == alta: | |
asignar(Murmis) | |
asignar(Menendez, demora = ~30min) | |
else: |
This file contains 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
#! /usr/bin/env python2 | |
# coding=utf8 | |
class Cruz(object): | |
def __repr__(self): | |
return "X" | |
def __eq__(self, other): | |
return isinstance(other, self.__class__) |
This file contains 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
def replicar(lista, repeticiones): | |
if len(lista) <= 1: | |
return lista * repeticiones | |
mitad = len(lista) / 2 | |
return replicar(lista[:mitad], repeticiones) + replicar(lista[mitad:], repeticiones) |
This file contains 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
def escalera_feo(n): | |
if n == 1: | |
return 1 | |
elif n == 2: | |
return 2 | |
return escalera_feo(n - 1) + escalera_feo(n - 2) | |
def escalera(n): | |
d = { 1 : 1, 2 : 2 } | |
return escalera_r(n, d) |
This file contains 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
struct paramentro_buscador_de_persona { | |
char* nombre; | |
persona_t* salida; | |
}; | |
// Función usada para buscar una persona con un nombre usando | |
// struct paramentro_buscador_de_persona como extra | |
bool buscador_de_persona(void* dato, void* extra){ | |
struct paramentro_buscador_de_persona* param = extra; | |
char* nombre = param->nombre; | |
persona_t* persona = dato; |
OlderNewer