# run rabbitmq on port 5672
# run rabbitmq-management on port 15672
docker run --name rabbitmq -d -p 5672:5672 -p 15672:15672 rabbitmq:4-management-alpine
# stop rabbitmq
docker ps -a --filter "name=rabbitmq" -q | ForEach-Object { docker stop $_ }
# remove rabbitmq container
# docker rm rabbitmq
// ==UserScript== | |
// @name Open In Sci-Hub | |
// @namespace Violentmonkey Scripts | |
// @match https://sciencedirect.com/* | |
// @match https://link.springer.com/article/* | |
// @match https://ieeexplore.ieee.org/document/* | |
// @match https://www.sciencedirect.com/science/article/* | |
// @match https://www.nature.com/articles/* | |
// @match https://journals.plos.org/plosone/article?id=* | |
// @match https://academic.oup.com/journals/* |
FastAPI Uvicorn / Sanic / Async Await _make_subprocess_transport
subprocess error when reload is enabled
There are two main reasons why reload was causing problems:
Event Loop Switching: When uvicorn runs with reload=True on Windows, it uses a different event loop implementation (SelectorEventLoop) for the file watcher. However, Windows requires ProactorEventLoop for subprocess support. This mismatch causes the NotImplementedError when trying to create subprocesses. Process Signal Handling: When uvicorn reloads on Windows, it sends a CTRL+C event to terminate the old process. However, on Windows, this signal can propagate to all child processes in the terminal session, including our Stockfish subprocess. This means every time the server reloads, it would accidentally kill the chess engine process. This is why disabling reload fixed the issue - it keeps us on a single ProactorEventLoop and avoids the problematic process signaling behavior.
For development, you have a few options:
import pygame | |
import sys | |
import random | |
import abc | |
import math | |
from typing import List, Tuple | |
# Initialize Pygame | |
pygame.init() |
{ | |
+ // add this to ~/AppData/Roaming/VSCode/User/settings.json | |
+ // or open Command Palette and select "Open Settings (JSON)" | |
+ "git.defaultBranchName": "master" | |
} |
// read https://pieces.app/blog/vs-code-snippets-guide | |
// ctrl + space to enable snippet | |
{ | |
"Insert Current Date": { | |
"prefix": "!date", | |
"body": [ | |
"${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}" | |
], | |
"description": "Insert current date (YYYY-MM-DD)" | |
}, |