Skip to content

Instantly share code, notes, and snippets.

View colltoaction's full-sized avatar

Martin Coll colltoaction

View GitHub Profile
@colltoaction
colltoaction / decidir_materias.py
Created February 27, 2014 23:43 — forked from anonymous/decidir_materias.py
No s茅 qu茅 materias elegir, as铆 que lo estoy intentando de la mejor manera que s茅: programando
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:
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"
// ******* NO COMPIL脡 ESTE ARCHIVO **********
abstract class MailMessageBuilder
{
private MailMessage mailMessage = new MailMessage();
public MailMessageBuilder WithTo(string to)
{
mailMessage.To.Add(to);
return this;
@colltoaction
colltoaction / tracer_bullets.txt
Created July 30, 2012 16:35
Extracto del libro Pragmatic Programmer
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.
@colltoaction
colltoaction / error_vectores.c
Created July 30, 2012 15:40
Problemas con C
// *** 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);
@colltoaction
colltoaction / probar_funcion.py
Created July 3, 2012 16:31
Una funci贸n en python para mostrar c贸mo testear una funci贸n de forma sencilla
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'