Skip to content

Instantly share code, notes, and snippets.

View toast254's full-sized avatar
🐧

toast254 toast254

🐧
View GitHub Profile
import java.util.*;
public class Fibonacci
{
private HashMap <Integer,Double> fibo_results;
private int number;
private boolean fast_mode;
private boolean cache_mode;
# pour acceder aux fonctions maths evoluees
import math
# pour RHO/Erlang de 1 a 80
for p in range(1,80+1):
# pour C/capacite de RHO a RHO*2
for c in range(p,p*2+1):
# calcul numerateur
numerateur = pow(p,c) * 1.0 / math.factorial(c)
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import sys
import requests # http://docs.python-requests.org/en/master/
from bs4 import BeautifulSoup # http://www.crummy.com/software/BeautifulSoup/
# OpenNIC url
url = 'https://servers.opennicproject.org'
# -*- coding: utf-8 -*-
"""Generic linux daemon base class for python 3.x."""
import os
import sys
import time
import atexit
import signal
import logging
#
# smartcard_list.txt
# Copyright (C) 2002-2018 Ludovic Rousseau
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tornado import httpserver, ioloop, netutil, process, web, options
# app's title
__title__ = 'Example'
options.define('port', default=8080, help='run on the given port', type=int)
# -*- coding: UTF-8 -*-
import os
import csv
import logging
logger = logging.getLogger(__name__)
def read_csv(file: str = 'in.csv', skip_title: bool = True):
@toast254
toast254 / python-jwt-test.py
Last active February 9, 2017 16:24
python PyJWT test
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# depends :
# - cryptography
# - PyJWT
#
import timeit
import cryptography
@toast254
toast254 / dict_merge.py
Last active May 16, 2017 13:39 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python 3
# -*- coding: utf-8 -*-
import collections
def dict_merge(dct: dict, merge_dct: dict):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
# -*- coding: utf-8 -*-
import time
import threading
class ThreadedClass(object):
""" Threading example class.
The run() method will be started and it will run in the background