Python
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 collections, random, sys, textwrap | |
# Build possibles table indexed by pair of prefix words (w1, w2) | |
w1 = w2 = '' | |
possibles = collections.defaultdict(list) | |
for line in sys.stdin: | |
for word in line.split(): | |
possibles[w1, w2].append(word) | |
w1, w2 = w2, word |
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
# N.B. The only tool missing here that is mentioned in the document is `zenmap` | |
# purely because this image is intended to be run via a CLI and `zenmap` is a GUI | |
# to `nmap` i.e. one can play around with the tools by running: | |
# | |
# $ docker build --name bite_size_networking:latest . | |
# $ docker run --rm -d --name bsn_test bite_size_networking:latest | |
# $ docker exec -it bsn_test bash | |
# | |
# Alternatively, one can change the `ENTRYPOINT` to `["bash"]` and run: | |
# |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 asyncio | |
import pathlib | |
import socket | |
import ssl | |
import pytest | |
import aiohttp | |
from aiohttp import web | |
from aiohttp.resolver import DefaultResolver |
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 asyncio | |
from concurrent import futures | |
import functools | |
import inspect | |
import threading | |
from grpc import _server | |
def _loop_mgr(loop: asyncio.AbstractEventLoop): |
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
#!/usr/bin/python | |
__author__ = "Nicolas Seriot" | |
__date__ = "2017-05-24" | |
# http://mathworld.wolfram.com/ElementaryCellularAutomaton.html | |
# https://en.wikipedia.org/wiki/Rule_110 | |
import png |
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
(* Good morning everyone, I'm currently learning ocaml for one of my CS class and needed to implement | |
an avl tree using ocaml. I thought that it would be interesting to go a step further and try | |
to verify the balance property of the avl tree using the type system. Here's the resulting code | |
annotated for people new to the ideas of type level programming :) | |
*) | |
(* the property we are going to try to verify is that at each node of our tree, the height difference between | |
the left and the right sub-trees is at most of 1. *) |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- 180+ cognitive biases, codified and categorized by Buster Benson: Cognitive bias cheat sheet
- printed poster version: now available from Design Hacks
NewerOlder