Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # Extended python -m http.serve with --username and --password parameters for | |
| # basic auth, based on https://gist.github.com/fxsjy/5465353 | |
| from functools import partial | |
| from http.server import SimpleHTTPRequestHandler, test | |
| import base64 | |
| import os | |
| class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
| #!/usr/bin/env bash | |
| # Скрипт по загрузке публичных файлов с Облака mail.ru. Поддерживается докачка. | |
| # v1.0.5 от 2022-05-30 | |
| # | |
| # ЕСЛИ СКРИПТ НЕ РАБОТАЕТ | |
| # | |
| # 1. Убедитесь, что файл доступен публично. Возможна загрузка только публичных файлов. | |
| # 2. Mail.ru время от времени меняет внутрянку, не очень сильно, но требуется адаптация скрипта. | |
| # Если скрипт не работает, просьба сделать работающий форк и скинуть ссылку в комментарии. |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| (originally written in 2009 and posted to livejournal! https://jdimpson.livejournal.com/6812.html | |
| The last article teaches how to use socat by comparing it first to cat then to netcat. It skimped on socat's UDP-related features, because netcat only implements a subset of them. This article picks up where the last one left off, with respect to UDP. After this article will be one more that discusses advanced socat features. | |
| It turns out there are a lot of subleties when dealing with UDP, even before multicast is mixed in. We'll abandon the comparisons to netcat, as we've exceeded what netcat can do. But first a quick reminder of one way socat does UDP. | |
| socat as a UDP server on port 11111. | |
| socat STDIO UDP-LISTEN:11111 |
| procedure Check(d: string; var res: boolean; var hms: vec); | |
| var | |
| i, r: integer; | |
| begin | |
| res := length(d) = 8; | |
| if not res then exit; | |
| res := (d[3] = ':') AND (d[6] = ':'); | |
| if not res then exit; | |
| for i:=1 to 3 do | |
| begin |
| #!/bin/sh | |
| DOSBOX=/usr/bin/dosbox | |
| BCCDIR=${BCCDIR:-/home/george/.doses/BC} | |
| BCCBAT="$BCCDIR/BCCRUN.BAT" | |
| BCCP2M="" | |
| case "$1" in | |
| *.c|*.C|*.CPP|*.cpp|*.cxx|*.CXX|*.cc|*.CC) | |
| SRCDIR=$(dirname $(realpath "$1")) | |
| BCCBUILD="BCC `basename "$1"`" |
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <functional> | |
| #include <numeric> | |
| using namespace std; | |
| template <typename T> | |
| class vect: public vector<T> { |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <sys/wait.h> | |
| int main(void) | |
| { | |
| int pipefd[2], res; | |
| pid_t pout, pin, pwait; |