(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import argparse | |
| import os | |
| import boto3 | |
| class S3MultipartUpload(object): | |
| # AWS throws EntityTooSmall error for parts smaller than 5 MB | |
| PART_MINIMUM = int(5e6) |
| # Hierholzer's algorithm for Eulerian graphs # | |
| """ | |
| EXAMPLE | |
| V = [1,2,3,4,5,6] | |
| E = [(1,2),(2,3),(3,4),(4,5),(5,6),(6,1),(2,6),(6,4),(4,2)] | |
| returns [1, 2, 6, 4, 2, 3, 4, 5, 6, 1] | |
| V = ["AA","AB","BC","CD","DE","EF"] | |
| E = [("AA","AB"),("AB","BC"),("BC","CD"),("CD","DE"),("DE","EF"),("EF","AA"),("AB","EF"),("EF","CD"),("CD","AB")] |
| #!/usr/bin/python | |
| # Requires passlib: pip install passlib | |
| from passlib.hash import pbkdf2_sha512 | |
| from passlib.util import ab64_decode | |
| from biplist import * | |
| # Checksum size must be 128 bytes for use as OS X password hash! | |
| pbkdf2_sha512.checksum_size = 128 | |
| hash = pbkdf2_sha512.encrypt("password", rounds=38000, salt_size=32) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| " Save the current file and run current ruby script | |
| function! RunRuby() | |
| :w | |
| let name = input('Enter Argument (if any): ') | |
| execute ':!ruby % '.name | |
| endfunc | |
| " Use F6 to trigger a run |
| import java.util.Comparator; | |
| import java.util.PriorityQueue; | |
| import java.util.Queue; | |
| // Given a stream of unsorted integers, find the median element in sorted order at any given time. | |
| // http://www.ardendertat.com/2011/11/03/programming-interview-questions-13-median-of-integer-stream/ | |
| public class MedianOfIntegerStream { | |
| public Queue<Integer> minHeap; | |
| public Queue<Integer> maxHeap; |