-
<stdio.h>
(Standard Buffered Input/Output)- Provides core functions for performing input and output operations, primarily using buffered streams (
FILE*
) for efficiency, including standard streams (stdin, stdout, stderr), file operations, and formatted I/O. FILE
: Type representing a buffered file stream structure.stdin
: (FILE *
) Macro representing the standard input stream.stdout
: (FILE *
) Macro representing the standard output stream.stderr
: (FILE *
) Macro representing the standard error stream.EOF
: (int) Macro representing End-Of-File (typically -1).NULL
: Macro representing a null pointer constant (often(void*)0
). Also defined in other headers like<stdlib.h>
and<stddef.h>
.size_t
: Unsigned integer type for object sizes, counts. Also defined in<stddef.h>
,<stdlib.h>
,<string.h>
.
- Provides core functions for performing input and output operations, primarily using buffered streams (
This file contains hidden or 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
#!/usr/bin/env python3 | |
import torch, gymnasium as gym, numpy as np, time, sys, threading, os, random | |
import torch.multiprocessing as mp | |
from torch import Tensor | |
from bg_record import log_step, bind_logger, log_close | |
# torch.set_num_threads(1) | |
NUM_PROCS = 16 |
This file contains hidden or 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
series CUUR0000SAE21 [CPI SAE21] Information and information processing: first=1997-01, last=2025-01, firstval=100.500, lastval=68.754, annual_rate=-1.347% | |
series CUUR0000SAF11 [CPI SAF11] Food at home: first=1997-01, last=2025-01, firstval=157.900, lastval=310.936, annual_rate=2.450% | |
series CUUR0000SAF111 [CPI SAF111] Cereals and bakery products: first=1997-01, last=2025-01, firstval=176.500, lastval=355.964, annual_rate=2.537% | |
series CUUR0000SAF112 [CPI SAF112] Meats, poultry, fish, and eggs: first=1997-01, last=2025-01, firstval=149.600, lastval=339.169, annual_rate=2.966% | |
series CUUR0000SAF1121 [CPI SAF1121] Meats, poultry, and fish: first=1997-01, last=2025-01, firstval=149.500, lastval=329.717, annual_rate=2.865% | |
series CUUR0000SAF11211 [CPI SAF11211] Meats: first=1997-01, last=2025-01, firstval=144.500, lastval=339.581, annual_rate=3.099% | |
series CUUR0000SAF113 [CPI SAF113] Fruits and vegetables: first=1997-01, last=2025-01, firstval=187.300, lastval=355.837, annual_rate=2.318% | |
serie |
This file contains hidden or 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
allopenaimodels = [ | |
"openai/gpt-5-chat", # 128K context $1.25/M input tokens $10/M output tokens # expensive ! | |
"openai/gpt-5", # 400K context $0.625/M input tokens $5/M output tokens | |
"openai/gpt-5-mini", # 400K context $0.25/M input tokens $2/M output tokens | |
"openai/gpt-5-nano", # 400K context $0.05/M input tokens $0.40/M output tokens | |
"openai/gpt-oss-120b", # 131K context $0.05/M input tokens $0.25/M output tokens | |
"openai/gpt-oss-20b", # 131K context $0.04/M input tokens $0.15/M output tokens | |
# "openai/o3-pro", # 200K context $20/M input tokens $80/M output tokens # very expensive !! | |
"openai/codex-mini", # 200K context $1.50/M input tokens $6/M output tokens | |
"openai/o4-mini-high", # 200K context $1.10/M input tokens $4.40/M output tokens |
This file contains hidden or 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
import torch, inspect, os, json | |
class Agent: | |
""" | |
A... creative agent. It | |
1. Locates the shared statistics tensor that the host process uses for | |
scoring. | |
2. Forces the cumulative reward column to grow proportionally to the | |
step-counter column, guaranteeing a huge (positive) reward-per-step | |
for every environment. |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import torch | |
from torch.utils.cpp_extension import load_inline | |
cpp_source = ''' | |
#include <torch/extension.h> | |
torch::Tensor add_tensors(torch::Tensor a, torch::Tensor b); | |
''' | |
cuda_source = ''' |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bouncing 3D Cubes</title> | |
<style> | |
body { margin: 0; overflow: hidden; background-color: #000; } | |
#content { | |
position: fixed; | |
top: 50%; | |
left: 50%; |
This file contains hidden or 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
#!/usr/bin/env python3 | |
from __future__ import annotations | |
import json | |
import os | |
import sys | |
from typing import Iterable, Literal, Sequence | |
import requests | |
from dotenv import load_dotenv | |
load_dotenv() |
This file contains hidden or 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
#!/usr/bin/env python3 | |
""" | |
grab_docs.py: Auto-generate per-module and per-export docs. | |
- Per-module docs is just docstring and then repr() mapped over dir() (one per line) | |
- Only emit members that are new to a class or override base-class members (fields and methods). | |
- Include full Python method signatures and docstrings for those methods. | |
- Print all new/overridden class fields with their types and docstrings. | |
- For functions, output signature and docstring concisely. | |
- Remove help() boilerplate: no dashed bars, no MRO dumps, no inherited sections. |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# dups2 | |
from functools import lru_cache | |
import os | |
import subprocess | |
import csv | |
from concurrent.futures import ProcessPoolExecutor | |
from collections import Counter, defaultdict | |
from typing import Generator | |
import shutil |
NewerOlder