This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with: cc -g `pkg-config --libs --cflags gtk4` -o gsk-demo gsk-demo.c | |
#include <stdio.h> | |
#include <gdk/gdk.h> | |
#include <gsk/gsk.h> | |
void gtk_init(void); | |
static const char node[] = "container {\ | |
color {\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with gcc -fshort-wchar | |
#define _GNU_SOURCE // for pipe2 | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
capacity = 10 | |
def __init__(self, index, count): | |
self.index = index | |
self.count = count | |
self.children = [] | |
def __iter__(self): | |
return iter(self.children) | |
def __len__(self): | |
return len(self.children) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://twitter.com/geofflangdale/status/1798605087885214050 | |
import inspect | |
import itertools | |
def sat(formula, preassignment, n=None): | |
# just bruteforce it, but could be a sat solver too | |
if n is None: | |
n = len(inspect.getfullargspec(formula)[0]) | |
for inputs in itertools.product((0, 1), repeat=n): |
OlderNewer