• Here are all articles tagged Python
  • Creating a Simple Bloom Filter

    Posted on February 2nd, 2013 | 175 Comments

    Bloom filters are super efficient data structures that allow us to tell if an object is most likely in a data set or not by checking a few bits. Bloom filters return some false positives but no false negatives. Luckily we can control the amount of false positives we receive with a trade off of time and memory.

    You may have never heard of a bloom filter before but you've probably interacted with one at some point. For instance if you use ...

    read more

  • Python Shortcuts for the Python Beginner

    Posted on January 26th, 2013 | 1138 Comments

    The following are just a collection of some useful shortcuts and tools I've found in Python over the years. Hopefully you find them helpful.

    Swapping Variables

    x = 6
    y = 5
    
    x, y = y, x
    
    print x
    >>> 5
    print y
    >>> 6
    

    Inline if Statement

    print "Hello" if True else "World"
    >>> Hello
    

    Concatenations

    The last one is a pretty cool way to combine objects of two different types.

    nfc = ["Packers", "49ers"]
    afc = ["Ravens", "Patriots"]
    print nfc + afc
    >>> ['Packers', '49ers', 'Ravens', 'Patriots']
    
    print str(1 ...

    read more

Newer Posts >>