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
#include <iostream> | |
using Age = unsigned int; | |
using Name = std::string; | |
using Country = std::string; | |
template <class PersonSubtype> | |
class Person | |
{ |
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
class Digraph: | |
def __init__(self): | |
self.d = {} | |
def has(self, x, y): | |
return x in self.d and y in self.d[x] | |
def _safe_get(self, x): | |
return self.d.setdefault(x, set()) |
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
# http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf | |
import random | |
# djbx31a backward | |
def rev(h, s): | |
for c in reversed(s): | |
h = ((h - ord(c)) * 3186588639) & 0xffffffff; | |
return h |
NewerOlder