Linux only for now, uses pthread barriers for coordination which are linux only afaik.
cc -O2 ./main.c -o connect4 -pthread
| // See bucket_array.h | |
| // Define the same variables, include the .h file and then include this file in one .c file. | |
| #ifndef BA_PREFIX | |
| #error "BA_PREFIX must be defined" | |
| #endif | |
| #ifndef BA_TYPEDEF_NAME | |
| #error "BA_TYPEDEF_NAME must be defined" | |
| #endif |
| #include <assert.h> | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #define u8 uint8_t | |
| #define i32 int32_t | |
| #define u64 uint64_t | |
| // Solutions are 8x8 matrices in row-major order. If the value is 1, there's a wall, if it's 0 |
| // Single header file library for C. | |
| // * Provides an arena allocator and some data structures that use it. | |
| // | |
| // * Maintains a (thread local) pool of arenas so they are cheap to acquire and release for temporary allocations. | |
| // Since all allocations are backed by arenas you don't have to free anything individually, just | |
| // use an arena that matches the lifetime of the data. | |
| // * Includes data structures like a dynamic array that work well with the arena. | |
| // * Allows for some optimizations like extending instead of reallocing if the array is on the end of an arena. | |
| // * All lengths are signed. | |
| // * Makes for less casting when comparing lengths and pointers. |
| // wow, this is awesome | |
| // you really don't need drizzle, this is much better | |
| // I really kinda hate that copilot isn't working though... | |
| import postgres from "npm:postgres"; | |
| import PgBoss from "npm:pg-boss"; | |
| interface World { | |
| world: string; |
| ARG DENO_VERSION=1.42.2 | |
| ARG BIN_IMAGE=denoland/deno:bin-${DENO_VERSION} | |
| FROM ${BIN_IMAGE} AS bin | |
| FROM frolvlad/alpine-glibc:alpine-3.13 | |
| RUN apk --no-cache add ca-certificates | |
| RUN addgroup --gid 1000 deno \ | |
| && adduser --uid 1000 --disabled-password deno --ingroup deno \ |
Source for https://www.val.town/v/saolsen/example_rust_http_val For build instructions see https://gist.github.com/saolsen/d273bb1baba5e912e4dc2b187511affa For usage see https://www.val.town/v/saolsen/use_example_rust_http_val
Build a https://www.val.town/ val with rust. This is an example of how to compile a rust file to wasm and use it as a val.
Requires rust, wasm-pack and deno.
val.rs.| from itertools import batched | |
| def ordered(a, b) -> bool | None: | |
| match a, b: | |
| case int(i), int(j): | |
| if i == j: | |
| return None | |
| return i < j | |
| case list(i), list(j): |
C-b : capture-pane -S -
C-b : save-buffer filename.txt
https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file