Skip to content

Instantly share code, notes, and snippets.

@ancientstraits
ancientstraits / gl.html
Created May 14, 2024 02:39
webgl type thing
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>gl</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
@ancientstraits
ancientstraits / abstracts_and_summaries
Created December 6, 2023 18:03
My prompt's results
Abstract: We present the first deep learning model for segmenting galactic spiral arms and bars. In a blinded assessment by expert astronomers, our predicted spiral arm masks are preferred over both current automated methods (99% of evaluations) and our original volunteer labels (79% of evaluations). Experts rated our spiral arm masks as `mostly good' to `perfect' in 89% of evaluations. Bar lengths trivially derived from our predicted bar masks are in excellent agreement with a dedicated crowdsourcing project. The pixelwise precision of our masks, previously impossible at scale, will underpin new research into how spiral arms and bars evolve.
Summary: Scientists have introduced a groundbreaking deep learning model designed for accurately segmenting galactic spiral arms and bars, outperforming current automated methods and even original volunteer labels, according to expert astronomers in a blinded assessment. With 89% of evaluations rating the predicted spiral arm masks as 'mostly good' to 'perfect,' the mod
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>
<div id="viewer"></div>
<select id="models"></select>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <stdint.h>
#define ONE_LETTER_CMD(str, c) ((str[0] == c) && (str[1] == ' '))
#define TWO_LETTER_CMD(str, c0, c1) ((str[0] == c0) && (str[1] == c1) && (str[2] == ' '))
#define VCMD(str) ONE_LETTER_CMD(str, 'v')
#define FCMD(str) ONE_LETTER_CMD(str, 'f')
@ancientstraits
ancientstraits / error.h
Created March 7, 2023 18:23
Simple error-handling utility for C
#ifndef ERROR_H
#define ERROR_H
#define LOG(...) do { \
fprintf(stderr, "%s:%s():%d: ", __FILE__, __func__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fputc('\n', stderr); \
} while(0)
#define FAIL(...) do { LOG("Error: " __VA_ARGS__); exit(1); } while(0)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define ROUNDS 100
float outval(float w, float x) {
return w * x;
}
@ancientstraits
ancientstraits / sane.c
Last active July 5, 2022 19:22
stupid github microsoft jerks tryna indoctrinate us into using spaces instead of tabs
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
typedef struct Node {
size_t size;
struct Node* next;
struct Node* prev;
} Node;
@ancientstraits
ancientstraits / mock.c
Created May 12, 2022 17:30
A mocking framework
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
void mock(char* s) {
srand(time(NULL));
for (int i = 0; s[i]; i++) {
if (rand() % 2 == 0)
@ancientstraits
ancientstraits / print_all_args.asm
Created May 12, 2022 12:42
print all arguments in x64 asm
global main
extern puts
main:
push rbp
mov rbx, rdi
.loop:
push rsi
mov rdi, [rsi]
local cm = require('codim')
-- An animation is a function that takes time in and returns an image.
local function logo(props, time)
if time.seconds <= props.seconds then
return cm.text {
location = cm.position.center,
color = white,
}
else