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 select | |
import socket | |
class UDPEchoServer(object): | |
def __init__(self): | |
self.sock = socket.socket(type=socket.SOCK_DGRAM) | |
self.sock.bind(('0.0.0.0', 5000)) |
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
/* gcc -O3 --std=gnu99 -o pbkdf2 pbkdf2.c sha256.c && time ./pbkdf2 password salt 100000 */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include "sha256.h" | |
#define DIGEST_SIZE 32 | |
#define BLOCK_SIZE 64 |
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
/** | |
* Represents 20ms of 8khz signed linear 16-bit audio | |
* | |
* This is how much audio gets put in each RTP packet. | |
*/ | |
typedef int16_t frame_t[160]; | |
/** | |
* Fast mix two audio frames together on x86 and x86_64 | |
* |
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
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~- | |
IAMBIC PENTAMETER COUPLETS GOTH CORPUS | |
-~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~--~*~- | |
we really have to plug my eyes before | |
black angel i feel hunger for the shore | |
which answered not with a caress he died | |
shone for me to the lake of the night tide | |
with sadness here i opened wide the door | |
that scream i hear the angels name lenore |
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
r""" | |
gotham | |
~~~~~~ | |
Gothic Poetry Generator | |
""" | |
import sys |
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
r""" | |
gotham | |
~~~~~~ | |
Gothic Poetry Generator | |
""" | |
import marshal |
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
{% for error in form.non_field_errors %} | |
<div class="alert alert-error">{{ error }}</div> | |
{% endfor %} |
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
# problem 1 | |
# add all natural numbers below one thousand that are multiples of 3 or 5. | |
print sum(n for n in xrange(1, 1000) if n % 3 == 0 or n % 5 == 0) | |
# problem 2 | |
# sum of even value fibs below four million | |
def fib(): | |
yield 1 | |
yield 1 | |
a, b = 1, 1 |
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
* http://google-opensource.blogspot.com/ | |
* http://blog.0x1fff.com/2009/12/35-google-open-source-projects-that-you.html | |
* glog - An excellent C++ logging library. | |
* gtest - An excellent C++ testing library. | |
* gflags - The best way to make your C++ program accept command line flags, be documented, and configurable all in one fell swoop. | |
* breakpad - A good multi-platform crash reporting system for C++ apps. | |
* gperftools - Faster heap memory and a bunch of tools similar to valgrind. Not as well maintained as it should be. | |
* sparsehash - An awesome hash map container library for both performance and low memory use cases. | |
* cityhash - Perhaps the best non-crypto hashing algorithm. 2x faster than MurmurHash. | |
* re2 - A drop-in replacement for PCRE (Perl Compatible Regular Expressions) that doesn't introduce security and performance risks. Most other regex libraries will run potentially boundless operations which can have surprising performance impacts and allow attackers to perform denial of service attacks. |
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
[48;5;232m [48;5;233m [48;5;234m [48;5;235m [48;5;236m [48;5;237m [48;5;236m [48;5;235m [48;5;234m [48;5;233m [48;5;232m [0m | |
[48;5;232m [48;5;233m [48;5;234m [48;5;235m [48;5;234m [48;5;235m [48;5;236m [48;5;237m [48;5;236m [48;5;235m [48;5;234m [48;5;233m [48;5;232m [0m | |
[48;5;232m [48;5;233m [48;5;234m [48;5;235m [48;5;234m [48;5;235m [48;5;236m [48;5;237m [48;5;236m [48;5;235m [48;5;234m [48;5;233m [48;5;232m [0m | |
[48;5;232m [48;5;233m [48;5;234m [48;5;235m [48;5;234m [48;5;235m [48;5;236m [48;5;237m [48;5;236m [48;5;235m [48;5;234m [48;5;233m [48;5;232m [0m | |
[m [48;5;233m [48;5;234m [48;5;233m [48;5;234m [48;5;235m [48;5;234m [48;5;235m [48;5;236m [48;5;237 |
OlderNewer