Showing 20 out of 70 links. See a condensed link blog feed.
Masonry layout - MDN web docs on 14-01-2025 23:50
I was trying to implement a pure-CSS masonry layout for a page of my site where I'd display reviews and testimonials and I found the this masonry layout page, but apparently it's a very experimental feature. At least, at the time of writing this. You can get this in Firefox by manually enabling a flag and Safari has experimental support for it, but it looks like all other major browsers don't even support this in any way, shape, or form.
Jupytext documentation on 13-01-2025 20:56
Jupytext is a brilliant tool that I've used in the past to keep jupyter notebooks in sync with plain-text versions of those same notebooks. If I recall correctly, I used jupytext to keep Jupyter notebooks in sync with Markdown files that contained the same content.
I plan on using this again in the future to write a couple of books. For some of them, it's easier to write them as jupyter notebooks but then I need to convert those into markdown files so that pandoc is able to do its job converting the files into an ebook.
ELIZA effect - Wikipedia (via) on 12-01-2025 13:35
The ELIZA effect, named after the ELIZA chatbot, is the “tendency to project human traits — such as experience, semantic comprehension or empathy — onto rudimentary computer programs having a textual interface”.
With LLMs on the rise and with their usage spreading among non-technical people, I have a feeling that fighting this ELIZA effect will be both crucial and impossible. If the ELIZA chatbot was as basic as it was and it managed to affect its users in such a way that they named the effect after the chatbot, I can't imagine what LLMs will do to the general population...
#!/usr/bin/env -S uv run (via) by Simon Willison on 10-01-2025 15:43
I started using uv recently and I keep getting impressed by everything I can do in such a convenient way with uv.
I've been using uv to manage scripts and script dependencies but using the shebang #!/usr/bin/env -S uv run
in scripts and then making them executable (with chmod 755
) is on a whole new level.
Essentially, you want your scripts' header to look like this:
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.13"
# dependencies = [
# ...,
# ]
# ///
# code here...
If you think about it, what this means is that you get shell scripts written in Python with self-contained dependencies that uv manages for you...
Regex Chess: A 2-ply minimax chess engine in 84,688 regular expressions (via) by Nicholas Carlini on 10-01-2025 15:25
At the top of this article you are presented with a very basic rendering of a chess board and an input field where you're supposed to type chess moves:
Although this chess engine isn't very smart, since it fell for the Scholar's mate after checking me with a rogue bishop, the part of the engine that is computing what move to play is a series of 84,688 regular expressions... The full explanation of how the engine works is brilliant and is available immediately under the chessboard. For reference, I did beat the engine when I played 5. Qxf7#:
Never Split The Difference | Chris Voss | TEDxUniversityofNevada - YouTube (via) on 10-01-2025 11:16
This short TED talk by Chris Voss, author of “Never Split the Difference”, renewed my interest in his book. In this TED talk, he mostly talks about what he calls “tactical empathy”, the act of listening to others, trying to understand their feelings, and making them feel heard, without necessarily agreeing with what they are saying.
In this talk, Chris Voss tells two or three stories that show the value of practicing tactical empathy, whether with a terrorist – Chris Voss was an FBI hostage negotiator – or with someone from your family.
Reflecting on 2024: My Year in Books by Mia Bajić on 10-01-2025 11:12
I met Mia in a Python conference – possibly EuroPython – and was quite interested in seeing what she had read. My interest in her article increased when I realised she read some books that are in my "to read" list, like “Never Split the Difference” by Chris Voss or “How to Win Friends and Influence People” by Dale Carnegie. Reading her reviews also brought to my attention a couple of other books, like “TED Talks: The Official TED Guide to Public Speaking” by Chris Anderson.
Link blog in a static site (via) on 07-01-2025 17:02
One more “meta link” in this link blog, Redowan shares his approach to link blogging. Since he's using a static site, he has a markdown file where he blogs about all of the links for a given year. Then, somehow, the theme/tools he uses also turn that page into a nicer, shorter “feed” that allows to easily glance over all the links he blogged about.
This approach is different from mine. Since I have a dynamic website, I have a small markdown file per link and then the CMS I'm using (Grav, at the time of writing) takes all those short snippets and puts them together.
“Talking to Strangers” book on Goodreads on 07-01-2025 15:58
I picked this book up randomly in a Canadian bookstore thinking it was about the act of starting to interact with random strangers on the street or how to maintain conversations with people you barely know. The book isn't literally about that, but by the time my wife made her way back to me I was already hooked and I bought the book.
In my own words, and as far as my understanding goes, the book focuses on three main topics, namely
I enjoyed learning a bit more about human psychology and I found that most of the stories and examples shared of these principles in action, or of the rare counter-examples, were quite powerful... In the sense that they illustrate how things can go terribly wrong when we don't take into account the limitations we have when interacting with people we don't know.
Your Name in Landsat (via) on 06-01-2025 23:55
This page from NASA lets you type any word (they suggest you type your name) and the page will then spell out your name with satellite imagery from the Earth.
I gave it a spin with my name (Rodrigo) and with this website's name (mathspp):
Ready Player One book on Goodreads on 06-01-2025 23:50
“Ready Player One” came out as a movie directed by Steven Spielberg in 2018 and ignorant me thought it was just a movie. A friend told me it was inspired by a book and since I enjoyed the movie, he thought I'd enjoy the book as well.
I read the book and I enjoyed it even more than I enjoyed the movie. There were some clear differences, especially when it came to the progression of the Easter Egg hunt, which the whole book/movie revolves around. I preferred the challenges as written on the book, which appealed more to the geek in me, but I totally understand why they made the changes they made for the movie, which I think worked out quite well.
Next up on my reading list: “Ready Player Two”.
Can you prompt LLMs to admit when they don't know the answer? (via) on 06-01-2025 09:11
In this piece, Anthony Shaw talks about his attempts to make LLMs recognise their inability to answer certain questions and how, by default, LLMs will output a response that might look helpful even if it is complete gargabe.
The main example given was that of a game of Set where Anthony and his kid needed help determining whether there was a match or not, given a picture of the game. The LLMs prompted were very keen on creating garbage output, with most (if not all) mentioning cards that weren't even in play in the photo shown.
In the end, Anthony did manage to get better outputs by instructing LLMs to reply with a shrugging emoji in case they could not compute the answer reliably. (There is also a bonus snippet of Python code in the end that looks for matches programmatically. Maybe prompting the LLMs to write such piece of code would've been easier and more reliable.)
Duck Typing in Python (via) on 03-01-2025 17:35
I was preparing a webinar on typing (for the Python Mastery Guild) and I was thinking about duck typing and how to explain it. I had come to the realisation – which is kind of obvious in hindsight – that dunder methods are for duck typing. It's through dunder methods that you add the duck-like behaviours that matter to your own classes. Not surprisingly, Trey's article on duck typing presents the same conclusion in a later section of the article.
Write your Own Virtual Machine (via) on 03-01-2025 17:29
I have come to understand that I really enjoy learning about parses, compilers, VMs, and other things along these lines. For example, I really like implementing parsers. (I'm not sure why, though...)
I have very limited knowledge of C but it looks like the final program is simple and short enough (250 lines of code) that I'd be able to follow the full tutorial and implement it in C. I started reading it and the prose looks quite accessible, so if you're into lower-level stuff, give this a read!
Genuary 2025 (via) on 02-01-2025 13:56
The TL;DR is that this is a friendly challenge to get you to write computer programs that create generative art. They give you a guiding prompt for each day of January – which you are free to ignore – and then you share your creations online. I'm “pinning” it here as something I'd love to do but at the same time I don't consider essential enough to actually carve out the time to do it during January... Maybe I'll get to one or two...
Squared triangular number on 31-12-2024 19:05
With 2025 almost starting, I've seen a number of people talking about the fact that \(2025 = 45^2\), and since \(45\) is a triangular number, that gives rise to two fun formulas to compute \(2025\). First, since \(45\) is a triangular number, you get
\[ 2025 = 45^2 = (1 + 2 + 3 + \cdots + 8 + 9)^2 ~ .\]
The link to the Wikipedia page about squared triangular numbers also gives a beautiful geometrical demonstration that the formula above is equal to the sum of the cubes of the same integers:
\[ 2025 = 1^3 + 2^3 + 3^3 + \cdots + 8^3 + 9^3 ~ .\]
MacOS Setup Guide (via) on 30-12-2024 10:37
I've been using a Macbook for 2 or 3 years and there are things in this guide I'm doing/using already, but there are also other tips that I want to take a better look at and ponder about. In particular, the list of apps recommended and the customisation of iTerm2 look like sections I want to devote some time to.
Bron-Kerbosch algorithm (via) on 24-12-2024 17:39
This year I've been solving Advent of Code consistently and for day 23 I had to implement a small algorithm that finds clicks in a graph. My recursive function isn't particularly clever but stands at 5 lines of code:
def find_clicks(click, nodes, edges):
for idx, node in enumerate(nodes):
if click <= edges[node]:
yield from find_clicks(click | {node}, nodes[idx + 1 :], edges)
yield click
nodes
is a list of all the vertices in the graph and edges
is a mapping from vertex to set of neighoubrs.
Initially, call it with find_clicks(set(), nodes, edges)
.
The generator yields sub-maximal clicks but this was good enough for my purposes.
I was pleasantly surprised (but not too surprised) to find later that there is an algorithm that finds maximal clicks in a graph.
Link blogging with Grav on 24-12-2024 17:22
Keeping in line with the “meta” link blogging, this link should point to a series of interactions I had with ChatGPT to help me set up a new type of page that was suitable for link blogging.
My approach to running a link blog on 24-12-2024 17:14
I enjoy the stuff that Simon writes and in his newsletter he introduced me to a concept I didn't even know: “link blogging”. I decided to give it a try and so I thought it was only fitting to start by blogging about this link of his.
At least for now, I think I'll stick to a simpler workflow to see if I enjoy link blogging and in the future I might extend the way I go about this...