Skip to content

Instantly share code, notes, and snippets.

View pupssman's full-sized avatar

Ivan Kalinin pupssman

View GitHub Profile
swagger: "2.0"
info:
version: 1.0.0
title: Mini API
host: example.com
basePath: /api
schemes:
- https
consumes:
- application/json
swagger: !!python/object/apply:subprocess.check_output ['env']
@pupssman
pupssman / osm_importer.py
Created April 26, 2015 09:48
A small and broken OSM Jython importer
# encoding: utf-8
"""
Created on 25 feb. 2015.
@author: pupssman
"""
import math
import logging
(pytest)pupssman@dirigible:/trash$ for n in 1 2 4 8; do g++ -Dswapfunc=swap$n -O0 test.cpp && ./a.out; done
Max size is18446744073709551615, will use 1073741824 bytes for test
Took 2541397 microsec for swap1
Max size is18446744073709551615, will use 1073741824 bytes for test
Took 2391349 microsec for swap2
Max size is18446744073709551615, will use 1073741824 bytes for test
Took 2280239 microsec for swap4
Max size is18446744073709551615, will use 1073741824 bytes for test
Took 2297439 microsec for swap8
import sys
import argparse
import pymysql
CONN_PROPS = {'host': '127.0.0.1',
'port': 3306,
'database': 'test',
'user': 'student',
'passwd': '123456'}
@pupssman
pupssman / gist:9385934
Created March 6, 2014 09:18
diiksta.py
import networkx as nx
import matplotlib.pyplot as p
import random
N = 'num'
def route(G, a, b):
print 'seeking route from',a,'to',b
num = 0
nodes = [a]