Skip to content

Instantly share code, notes, and snippets.

"""Pseudocode description of the AlphaZero algorithm."""
from __future__ import google_type_annotations
from __future__ import division
import math
import numpy
import tensorflow as tf
from typing import List
# This example shows how to use keras TensorBoard callback
# with model.train_on_batch
import tensorflow.keras as keras
# Setup the model
model = keras.models.Sequential()
model.add(...) # Add your layers
model.compile(...) # Compile as usual
@erenon
erenon / .config_sway_config
Created January 20, 2023 16:21
Sway sessions à la tmux
set $mode_session session [s]elect [r]ename [f]latten
bindsym $mod+s mode "$mode_session"
mode "$mode_session" {
bindsym s exec --no-startup-id ~/bin/way_select_session.py, mode "default"
bindsym r exec --no-startup-id ~/bin/way_rename_workspace.py, mode "default"
bindsym f exec --no-startup-id ~/bin/way_flatten_sessions.py, mode "default"
bindsym Escape mode "default"
bindsym Return mode "default"
}
@erenon
erenon / rewrite_rust_errors.py
Created July 19, 2022 09:39
Replace matching patterns at the specified locations
#!/bin/python
# Replace matching patterns at the specified locations
#
# On stdin it expects locations (as reported by the rustc compiler):
#
# --> path/to/file.rs:line:col
#
# Lines not matching this pattern are ignored:
@erenon
erenon / rewrite_matches.py
Created July 15, 2022 08:40
Rewrite matches
#!/bin/python
# Replace matching patterns at the specified locations
#
# On stdin it expects locations:
#
# <file_path>|<line> col <col>| match
#
# For example:
#
@erenon
erenon / btree-latex.c
Created November 30, 2010 09:42
binary tree visualization
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _btree {
int value;
struct _btree *left;
struct _btree *right;
} btree;
@erenon
erenon / doublelinked.c
Created November 19, 2010 20:46
Simple double linked list implementation in C
#include <stdio.h>
#include <stdlib.h>
#define SENTINEL_VALUE -1
typedef struct _list {
int value;
struct _list *prev;
struct _list *next;
} list;
@erenon
erenon / Get-RemoteEventId.ps1
Created May 13, 2013 06:26
IRF homework snippets.
# OVERVIEW:
# parse command line
# write output header
# create filter string
# read csv -> machines
# for machine in machines
# Get-WSManInstance wmicimv2/*
# -ComputerName ...
# -Enumerate
@erenon
erenon / Crossover.asm
Created April 19, 2012 22:24
Crossover
;***************************************************************
;* Feladat: Forgalmi jelzolampa fenyerzekelo ejszakai uzemmoddal
;* Rövid leírás:
;
;* Szerzők: Thaler Benedek EDDO10
;* Mérőcsoport: CDU65
;
;***************************************************************
;* "AVR ExperimentBoard" port assignment information:
;***************************************************************
@erenon
erenon / point.cc
Created July 14, 2011 06:39
Why my constructor doesn't run?
#include <node.h>
#include <v8.h>
#include <iostream>
using namespace v8;
using namespace node;
class Point
:ObjectWrap