- Learn Python the Hard Way - Great introductory course to python and programming
- The Python Guide - After you have a cursory idea of python, this is great
- Code Like a Pythonista: Idiomatic Python - For learning the "pythonic" way of doing things
- Tango with Django - Great intro to building python web applications
- Intro to Flask, TDD, and jQuery
- Selenium's Page Object Pattern for testing websites
- The Python Yield Keyword Explained - Good precursor to the generator tricks
- Incredible guide on Python's __ (underscore) methods - Must read for anyo
This file contains hidden or 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
blueprint: | |
name: Wake-up light alarm with sunrise effect | |
description: 'A wake-up light alarm with a brightness and color temperature sunrise | |
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!' | |
domain: automation | |
input: | |
light_entity: light.bedroom_lights | |
name: Wake-up light entity | |
description: 'The light to control. Turning it off during the sunrise will keep | |
it off. Color temperature range is auto-detected.' |
This file contains hidden or 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 websocket, thread, time, json, datetime, sys, os | |
def set_exit_handler(func): | |
if os.name == "nt": | |
try: | |
import win32api | |
win32api.SetConsoleCtrlHandler(func, True) | |
except ImportError: | |
version = ".".join(map(str, sys.version_info[:2])) | |
raise Exception("pywin32 not installed for Python " + version) |
This file contains hidden or 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
Transactions: | |
504658563f231e71f79312e96da2cc13e779875ac262269b1b8f9f04e527dfc9 | |
a1faf7b6db5bb4ef4a39911ca54152df57758e128cd19fbf16178aea59e06c87 | |
b1346f1ab63dc90cb592028e1f7283f02b54e46afb35b9145ad91ac2a55877be | |
e61458c302d75b8e0925d4bb0da5466c0a76d60dce506cc766b2d3f160b1d0a5 | |
Addresses: | |
1BwJgbMKb7nz4GZ3uTDTbpovzznTrBbyJE | |
1DnJ4rzDpSG5GJsXNyXE7f17rky8wc1RLT | |
1Q6M9Vyuv5RyeuqpgJfCUCWrM2yrSb45BD |
More later...
This file contains hidden or 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
''' | |
Just to illustrate idea on how I believe the maximum block size should be determined. | |
My idea stems from a simple scalability metric that affects real users and the desire to use Bitcoin: | |
Waiting times to get your transactions confirmed on the blockchain. | |
Anything past 45mins-1 hour should be unnacceptable. | |
Initially I wanted to measure the mean time for the transactions in blocks to go from being sent by the user | |
(initial broadcast into mempools) until the transaction was effectively | |
confirmed on the blockchain, say for 2 blocks (acceptable 15~20mins) |
This file contains hidden or 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
#!/usr/bin/python ## JORDAN arithmetic (OLD) rather than Jacobian ## ## from .py2specials import * from .py3specials import * import binascii import hashlib import re import sys import os import base64 import time import random import hmac from bitcoin.ripemd import * # Elliptic curve parameters (secp256k1) P = 2**256 - 2**32 - 977 N = 115792089237316195423570985008687907852837564279074904382605163141518161494337 A = 0 B = 7 Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240 Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424 G = (Gx, Gy) def change_curve(p, n, a, b, gx, gy): global P, N, A, B, Gx, Gy, G P, N, A, B, Gx, Gy = p, n, a, b, gx, gy G = (Gx, Gy) def getG(): return G # Extended Euclidean Algorithm def inv(a, n): lm, hm = 1, 0 low, high = a % n, n while low > 1: r = high//low nm, new = hm-lm*r, high-low*r lm, low, hm, high = nm, new, lm, low return lm % n # JSON access |
This file contains hidden or 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
/wallet/Cryptsy.com = Cryptsy.com |
This file contains hidden or 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
# Copyright 2014 Chris Cohen | |
# | |
# 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 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains hidden or 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 os, os.path, sys, urllib2, requests | |
class PyPiError(Exception): | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return repr(self.value) | |
def _chunk_report(bytes_so_far, chunk_size, total_size): | |
if (total_size != None): |
NewerOlder