Susam
Susamsusam
2026-01-06

'you should not just sit here reading'

Godsil and Royle briefly break the fourth wall to remind the reader that algebraic graph theory is not a spectator sport.

A screenshot of a few paragraphs from a mathematics book
Susamsusam
2026-01-04

A test page with 2000 randomly generated entries to answer a question from the HN comments section:

susam.net/code/test/2k.html

Actual page size is 240 kB and the compressed transfer size is 130 kB.

Screenshot of a test page showing 2000 randomly generated entries
Susamsusam
2025-12-27

I have a slightly odd hobby. I collect related words of equal length.

susam.net/eql.html

A screenshot of a list of equal length words
Susamsusam
2025-12-26

@lens_r This is no bother at all. I'm delighted you're finding this little project to be fun. Updated susam.github.io/cfrs/demo.html with your optimised version.

Susamsusam
2025-12-25

@lens_r Thanks for playing with CFRS[]. This is nice. Can I add it to <susam.github.io/cfrs/demo.html> if you don't mind?

Susam boosted:
maxwellitomaxwellito
2025-12-19

After years of neglect, I finally rebuilt my website. It’s only one page, but it’s flashy.

maxwellito.com

maxwellito homepage. The layout is a black grid on a white background, every item fits on the grid to give a certain harmony. The header shows the maxwellito logo and its motto "maker of the useless". The rest of the page demos the minimator project, with a tiny description, the logo and an artwork made for it.maxwellito homepage. The layout is a red grid on a black background, every item fits on the grid to give a certain harmony. The top parts shows screenshots of the Breaklock game. The bottom part mentions the JavaScript library Vivus with a tiny description and a handwritten "keep on dreaming".
Susamsusam
2025-12-13

To the LaTeX crowd here: Which user-defined macros can you not live without?

I am perfectly happy to write unwieldy macro invocations like \mathbb{Q}, \operatorname{Sym}, etc. over and over again. But I cannot trust myself with the simple \cup and \cap macros. I've often made the wrong choice, leading to documents that were confusing to readers. As a result, now almost every preamble I write contains:

\newcommand{\union}{\cup}
\newcommand{\inter}{\cap}

A screenshot of two \newcommand calls in LaTeX that defines the macros \union and \inter for \cup and \cap, respectively.
Susamsusam
2025-12-12

@aartaka This example uses a second-order Markov model over words, equivalently a trigram language model. The program itself is very small and simply takes the n-gram order as a parameter, so other values of n are possible.

Why do you suggest that Markov chains must operate at the character level? I am not aware of any such definition. A Markov chain is defined over an arbitrary state space. In this case, the state space has word-level n-grams, though in principle it could be anything.

Susamsusam
2025-12-12

Today I fed 24 years of my blog posts into my Markov gibberish generator and asked it to speak for me. Here's the result. Apparently, this is how I would sound if I ever took up speaking gibberish!

The gibberish generator lives here by the name Mark V. Shaney Junior: github.com/susam/mvs

A screenshot of a Terminal showing a Python program generating gibberish-like text from a Markov text generator
Susamsusam
2025-12-12

A minimum viable Markov gibberish generator in 32 lines of Python: github.com/susam/mvs

A screenshot of a Markov text generator
Susamsusam
2025-12-11

Over the years, my personal static site generator has evolved into a rather nice set of functions that I can mix and match easily to implement new features.

For example, today I thought I'd add a backlinks page to my website and it took only 15 minutes or so to write a new function that generates the backlinks page merely by invoking a few existing functions.

Commit: github.com/susam/susam.net/com

Result: susam.net/backlinks.html

A screenshot of a Git commit
Susamsusam
2025-12-06

@css Yes, this is nice too. I have talked about a similar solution here: <news.ycombinator.com/item?id=4>.

Susamsusam
2025-12-05
A screenshot of CSS code printing Fizz Buzz
Susamsusam
2025-11-21

@autisticplushy Thank you! This is a very nice technique. I'm going to use it in the future.

Susamsusam
2025-11-21

@autisticplushy Semicolon where? The following is a syntax error:

printf 'import sys; for i in range(10): print(i)' | python3

Do you have a working example of what you mean?

Susamsusam
2025-11-21

I was asked over IRC if my cosine-powered Fizz Buzz could be a one-liner. Of course it can:

printf 'from math import cos, pi\nfor n in range(1, 20):\n print([n, "Fizz", "Buzz", "FizzBuzz"][round(11/15 + (2/3) * cos(2*pi*n/3) + (4/5) * (cos(2*pi*n/5) + cos(4*pi*n/5)))])' | python3

Screenshot of macOS Terminal running a Python program that prints the Fizz Buzz sequence

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst