I hereby claim:
- I am pauloalem on github.
- I am pauloalem (https://keybase.io/pauloalem) on keybase.
- I have a public key ASAbj_nL3q-sAtZFlZJh1BrQVabTyW96HyScZCis4fhHxQo
To claim this, I am signing this object:
def ritmo(segs, ms): | |
kms = ms / 1000 | |
mins = segs / 60 | |
horas = mins / 60 | |
ritmo_seg = segs / kms / 60 | |
pace_min = ritmo_seg - ritmo_seg % 1 | |
pace_seg = ritmo_seg % 1 * 0.6 * 100 | |
pace_seg = pace_seg - pace_seg % 1; | |
return str(pace_min) + ":" + str(pace_seg) + "min/km"; |
import json | |
class FloatEncoder(json.JSONEncoder): | |
def __init__(self, nan_str="null", **kwargs): | |
super(FloatEncoder, self).__init__(**kwargs) | |
self.nan_str = nan_str | |
def iterencode(self, o, _one_shot=False): | |
"""Encode the given object and yield each string |
# -*- coding: utf-8 | |
from time import sleep, time | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from tornado.web import Application, asynchronous, RequestHandler | |
from multiprocessing.pool import ThreadPool | |
from tornado import gen | |
pool = ThreadPool(10) |
$ time pypy sim.py | |
pypy sim.py 5992,70s user 51,08s system 356% cpu 28:16,16 total | |
$ time python sim.py | |
python sim.py 47894,93s user 145,11s system 354% cpu 3:45:33,97 total |
from collections import namedtuple | |
Point = namedtuple("Point", "x y") | |
def euclidean_distance(p1, p2): | |
return pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2) | |
def near(points, k, n): | |
def keyfunc(point): | |
return euclidean_distance(k, point) |
// db.broken.drop(); | |
var obj = {routes: []}, | |
point = [-24.123, 24.213]; | |
for(var i=0; i < 1696; i++) { | |
obj.routes.push({points: [point]}); | |
} | |
db.broken.insert(obj); | |
db.broken.find({"routes.points.1": {$exists: 1}}); |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from tornado.web import Application, RequestHandler | |
from tornado.gen import coroutine, Task | |
import threading | |
from time import sleep | |
def do_block(callback, args): | |
def _callback(): |
I hereby claim:
To claim this, I am signing this object:
Verifying that "pauloalem.id" is my Blockstack ID. https://onename.com/pauloalem |
class Icu4c < Formula | |
desc "C/C++ and Java libraries for Unicode and globalization" | |
homepage "http://site.icu-project.org/" | |
url "https://ssl.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.tgz" | |
mirror "https://fossies.org/linux/misc/icu4c-58_2-src.tgz" | |
mirror "https://downloads.sourceforge.net/project/icu/ICU4C/58.2/icu4c-58_2-src.tgz" | |
version "58.2" | |
sha256 "2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c" | |
head "https://ssl.icu-project.org/repos/icu/trunk/icu4c/", :using => :svn |