Skip to content

Instantly share code, notes, and snippets.

@qpwo
qpwo / monte_carlo_tree_search.py
Last active December 28, 2024 13:29
Monte Carlo tree search (MCTS) minimal implementation in Python 3, with a tic-tac-toe example gameplay
"""
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3
Luke Harold Miles, July 2019, Public Domain Dedication
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1
"""
from abc import ABC, abstractmethod
from collections import defaultdict
import math
@jboner
jboner / latency.txt
Last active December 28, 2024 13:25
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@kiwidamien
kiwidamien / unbalanced.ipynb
Created May 9, 2019 07:00
Example of cross-validation with unbalanced data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewseidl
andrewseidl / Clang-format Comparison.md
Last active December 28, 2024 13:25
Clang-format style comparison

This is a comparison of the different formatting styles including with clang-format.

Generated via:

styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
  clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h

done

@denisxab
denisxab / docker-compose.yml
Created June 25, 2024 16:04
Настройка собственного GitLab CI/CD сервера с помощью Docker Compose
version: "3.5"
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: "localhost"
restart: unless-stopped
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost'
gitlab_rails['gitlab_shell_ssh_port'] = 8822
@ynagatomo
ynagatomo / ContentView.swift
Created November 16, 2023 08:30
A sample of Head-up Display Component for visionOS
// ContentView.swift
import SwiftUI
import RealityKit
import RealityKitContent
struct ContentView: View {
@State private var showImmersiveSpace = false
@State private var immersiveSpaceIsShown = false
@petrilli
petrilli / main.py
Last active December 28, 2024 13:14
Example combination of FastAPI and Pydantic with aiosql and aiosqlite
# -*- coding: utf-8 -*-
"""Example combination of FastAPI and Pydantic with aiosql and aiosqlite.
This module demonstrates the minimum viable integration approach for putting
together a few components:
- FastAPI. This provides a very high-performance and type-driving approach to
building APIs in Python
- Pydantic. A powerful data validation library.
- aiosql. Inspired by annosql and originally Clojure's yeSql, a way to programatically,
@judero01col
judero01col / Service KMS
Last active December 28, 2024 13:14
Volume License Activation Key Service - KMS
## Find Available Target Editions
DISM.exe /Online /Get-TargetEditions
## Convert Server Standard 2019 Evaluation to Server Standard 2019
DISM /online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula
## How To Activate
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms [server]:[port]
slmgr /ato
@pommicket
pommicket / win64_call.asm
Last active December 28, 2024 13:12
Call C functions with a dynamic number of arguments x64 MSVC
;;; Call C functions with a dynamic number of arguments x64 MSVC ;;;
;;; Written in NASM ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This is free and unencumbered software released into the public domain.
;;
;; Anyone is free to copy, modify, publish, use, compile, sell, or
;; distribute this software, either in source code form or as a compiled
;; binary, for any purpose, commercial or non-commercial, and by any
;; means.
;;
@fnky
fnky / ANSI.md
Last active December 28, 2024 13:11
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27