time.google.com
time1.google.com
time2.google.com
time3.google.com
//go:build ignore | |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" |
//go:build ignore | |
package main | |
import ( | |
"fmt" | |
"html" | |
"io/ioutil" | |
"log" | |
"mime" |
/* | |
robin verton, dec 2015 | |
implementation of the RC4 algo | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#define N 256 // 2^8 |
from itertools import permutations | |
def match(pattern, constraints): | |
return (perm | |
for perm in permutations(constraints, len(pattern)) | |
if all(p(c) for p, c in zip(pattern, perm)) | |
) | |
There are a lot of strategies that you will hear about in the Javascript community for keeping your conditionals from becoming a tangled mess. This isn't like them. This is someting different. MATH! Boolean Algebra to be exact. I use it all the time to simplify complex conditionals. There are two things that you need to know: de Morgan's Theorem, and Karnaugh (pronounced CAR-no) Maps. (Don't worry, there is no test)
De Morgan's Theorem is great distributing nots (!
), and for when you want to convert an &&
to an ||
, or back. This is it:
!(A && B) = !A || !B
#!/usr/bin/env python3 | |
class ToddCoxeter: | |
def __init__(self): | |
self.nodes = [0] | |
self.edges = None | |
self.kappa = [] | |
self.next_node = 1 | |
self.R = [] |
def cntBit(num): | |
return len(bin(num)) - 2 | |
print(cntBit(0xFFFFFFFF)) # 32 |
free_entry **fe; | |
for ( | |
fe = &first_free_entry; | |
(*fe)->next && | |
( | |
reinterpret_cast <char *> ((*fe)->next) > | |
reinterpret_cast <char *> (e) + sz | |
); | |
fe = &(*fe)->next |