Members not set via the constructor are ignored in equality comparisons. Consider other
in the code example below:
from dataclasses import dataclass
@dataclass
class Data:
value: int
May 6th 2025
The ares' emulators N64 core performance in homebrew libdragon ROMs seems to have deteriorated since v132. The goal of this experiment is to gain clarity what caused it.
The emulated frames per second ("VPS") for different builds are below. v132 is a commit in between v132 and 133 that I could get to build.
This is an example on how to read & write files from N64 roms running in the ares emulator. It uses a GDB script that hooks into native functions that do nothing otherwise.
There's a helper script that starts GDB and passes the given root dir for the Python script.
./connect.sh /tmp/tmp.mCtBkj7vaS
Now you can do file access from your ROM.
License of all code in this gist: CC0.
Spherical cap cone analytic solution is a 1d problem, since the cone cap sphere slides along the ray. The intersection point to empty space sphere is always on the ray. | |
S : radius of cone cap sphere at t=1 | |
r(d) : cone cap sphere radius at distance d | |
r(d) = d*S | |
p = distance of current SDF sample | |
SDF(p) = sdf function result at location p | |
x = distance after conservative step |
Pekka Väänänen, Aug 19 2021.
This proposal is a response to It's Time to Retire the CSV by Alex Rasmussen and the discussion on lobste.rs. Don't take it too seriously.
CSV files (comma-separated values) are great but sometimes difficult to parse because everybody seems to have a slightly different idea what CSV means. The obvious solution is to transmit some metadata that tells what to expect but where do you put it? Well, how about a ZIP archive?
An archive with two files. The first file, say format.txt
, has the metadata inside and the second one is the original CSV file unchanged. This is still readable by non-technical users because ZIP files are natively supported by both Windows and macOS. People can double click on them like a directory and then double click again on the CSV to open it up in Excel.
Pekka Väänänen, Sep 14 2020
Data-Oriented Design (2018) by Richard Fabian
Computers keep getting faster but the future ain't what it used to be. Instead of higher clock rates we get deeper pipelines, higher latencies, more cores. Programming these systems requires paying attention to how we structure and access our data. In Data-Oriented Design Richard Fabian—who has worked at Frontier Developments, Rockstar Games, and Team17—presents us an approach to reason about these issues from a C++ game developer's perspective.
Data-oriented design is about caches and decoupling meaning from data. The former implies laying out your data so that they're compact and predictably accessed. The latter means exposing the raw transforms from one sequence of bits to another. For example, finding the pla
""" | |
A pretty terrible arithmetic coder with a 0th order model. | |
Based on Matt Mahoney's fpaq0 implementation available at | |
http://mattmahoney.net/dc/#fpaq0 | |
""" | |
import sys |
import numpy as np | |
import matplotlib.pyplot as plt | |
from numpy import array | |
import torch | |
from torch import Tensor | |
""" | |
A dumb triangle rasterizer with PyTorch. | |
It evaluates the barycentrics for all image pixels for each triangle | |
and then picks the "colors" (just barycentrics again) for each pixel |
import numpy as np | |
import matplotlib.pyplot as plt | |
from numpy import array | |
width = 100 | |
height = 80 | |
# The triangle | |
d = np.array([ [ [0.9, 0.5], [0.5, 0.8], [0.1, 0.15] ] ]) |