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 __future__ import absolute_import, division, unicode_literals, print_function | |
import atexit | |
import cPickle | |
import logging | |
import multiprocessing | |
import sys | |
import time | |
import traceback | |
from datetime import datetime |
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 __future__ import division | |
def binary_digits(n): | |
if n == 0: | |
return '0' | |
res = '' | |
while n > 0: | |
mod_n = n % 2 | |
res = str(mod_n) + res | |
n = int(n / 2) |
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
import re | |
class DaveType(type): | |
not_allowed_attr_names = re.compile('^__\w+__$') | |
@classmethod | |
def _is_allowed_attr_name(cls, name): | |
return not cls.not_allowed_attr_names.match(name) | |
@classmethod |
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
# The story of rebels economical system began | |
## Introduction | |
Here I tell you a story to present a solution to an everyday problem. | |
How many times it happens that you go for a travel in the hyperspace | |
with other rebels, you go on a mission with a couple of Jedi or, | |
in general, you do something together with other people with which | |
you have to share expenses? |
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
:neo4j-version: 2.2 | |
:author: Marcello Dalponte | |
:twitter: @m_dalp | |
## Contact networks | |
A contact network is one of the typologies of dynamic networks described in the famous paper of Holme and Saramäki[1]. | |
A dynamic network is a mathematical representation of the evolution of the relationships between entities through graphs. | |
It's interesting to catch this dynamicity because describes the transitivity of the order of the interactions: if A meets B and after B meets C then A can transmit something to C but not the opposite; this is useful to study the spreading of informations or infections. | |
An interesting project that aims to collect this kind of data is Sociopatterns[2], where Cattuto and others developed a framework to collect contacts data from RFID sensors [3]. |