A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
import random | |
class TreapNode(object): | |
def __init__(self, key, data): | |
self.key = key | |
self.ran = random.random() | |
self.size = 1 | |
self.cnt = 1 | |
self.data = data | |
self.left = None |
''' | |
Non-parametric computation of entropy and mutual-information | |
Adapted by G Varoquaux for code created by R Brette, itself | |
from several papers (see in the code). | |
This code is maintained at https://github.com/mutualinfo/mutual_info | |
Please download the latest code there, to have improvements and | |
bug fixes. |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
view icons: https://fontawesomeicons.com/ | |
{"name":"Font Awesome v5.0.1", "icons":[ | |
"fab fa-500px", | |
"fab fa-accessible-icon", | |
"fab fa-accusoft", | |
"fas fa-address-book", "far fa-address-book", | |
"fas fa-address-card", "far fa-address-card", | |
"fas fa-adjust", | |
"fab fa-adn", |
<script type="text/javascript"> | |
window.MathJax = { | |
jax: ["input/TeX", "output/CommonHTML"], | |
extensions: ["tex2jax.js"], | |
TeX: { | |
equationNumbers: { autoNumber: "AMS" }, | |
extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"] | |
}, | |
/* The MathJax API provides us with the ability to register | |
callbacks on signals broadcast during its startup sequence. |
#include "var.h" | |
#include <stdio.h> | |
#define hello1(s) hello2(s, "default string") | |
void hello2(const char *s, const char* s2) { | |
printf("hello2 %s and %s\n", s, s2); | |
} | |
#define hello(...) xglue(hello, PP_NARG(__VA_ARGS__))(__VA_ARGS__) |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
D [0-9] | |
L [a-zA-Z_] | |
H [a-fA-F0-9] | |
E ([Ee][+-]?{D}+) | |
P ([Pp][+-]?{D}+) | |
FS (f|F|l|L) | |
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U)) | |
%{ | |
#include <stdio.h> |
【===========算法============】 | |
【*****leetcode/lintcode*****】 | |
same tree, Binary tree inorder iterator, inorder & postorder traverse BST, binary tree level order traversal(print指定level的binary tree), tree upside down, add next to every tree node, Convert Sorted Array to BST, binary tree的maxSumPath, reverse linkedlist, linkedlist输出倒数K个node的值, linked list取中值, linked list做减法/加法(反序), valid BST, linkedlist找merge point, copy linkedlist with random pointer, flatten BST to linkedlist(把BST替换为2Dlinkedlist,本质不变), depth, interseciton of linked list(一个一步一个多步是否可以(复杂度高)) LRUCache, upside down, recover binary tree from inorder and preorder, | |
word search I, min stack, stock transaction I(buy date is needed) & II, two sum, subset, unique paths II, merge two/k sorted array/linked list, Find kth largest number(quickselect, array partition), sort colors, remove duplicate from a sorted array, search in sorted rotated array(binary search), search for a range and delete it in array, next permutation, find peak element(一个先降后升的数组,怎么在这个数组中找到 |