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
number = 3988322153843625493168050 | |
with_commas = ''.join([['', ','][i%3==0]+a for i, a in enumerate(str(number)[::-1])])[:0:-1] | |
print(with_commas) |
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
<?php | |
$filename = "changeme.csv"; | |
$handle = fopen($filename, "r"); | |
$contents = fread($handle, filesize($filename)); | |
fclose($handle); | |
if (!mb_check_encoding($contents, 'UTF-8') | |
OR !($contents === mb_convert_encoding(mb_convert_encoding($contents, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { |
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
<?php | |
if(!defined('STDOUT')) | |
{ | |
define('STDOUT', fopen(base_path().'/application.log', 'a')); | |
} | |
/** | |
* provides an useful function for logging things to a file instead of sendind | |
* anything to the browser, for example var_dumps | |
*/ |
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
from turtle import * | |
def square(size): | |
for i in range(4): | |
forward(size) | |
left(90) | |
def cantor(size, tolerance): | |
init = pos() |
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
#eleccion.py | |
""" | |
Este script soporta ser reiniciado varias veces, guardando los cambios cada vez | |
""" | |
from random import shuffle, choice | |
if __name__ == "__main__": | |
print "+--------------------------------+" |
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
#eleccion.py | |
from random import shuffle, choice | |
# La funcion shuffle del modulo random puede revolver una lista de forma aleatoria | |
# La funcion choice escoje de forma aleatoria un elemento de una lista | |
if __name__ == "__main__": | |
print "+--------------------------------+" | |
print "! Sistema de eleccion !" | |
print "! Aleatoria !" |
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
/* | |
* Este programa lee un numero entero positivo n y llena un arreglo | |
* con n elementos para luego ordenarlos usando el algoritmo quicksort | |
*/ | |
#include<iostream> | |
using namespace std; | |
void quicksort(int arreglo[], int inicio, int fin){ |
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
# http://search.twitter.com/search.json?q=query | |
#Juegos diversos con twitter | |
from urllib import urlopen | |
import json | |
from pprint import pprint | |
def busca_tweets(cadena): | |
result = urlopen("http://search.twitter.com/search.json?q=" + cadena) | |
tweets = json.loads(result.read()) | |
for tweet in tweets['results']: |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf8"> | |
<title>Clock</title> | |
<style type="text/css"> | |
.hero-circle{ | |
width:180px; | |
height:180px; | |
position:relative; |
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
# Arhivo de experimentos con python | |
from random import choice | |
lista_palabras = { | |
'pollo': ['Es un ave que se come', 'Se hace caldo de esto'], | |
'verdura':['Son vegetales', 'Son verdes'], | |
'sal':['es un mineral'] | |
} |
OlderNewer