871 private links
Nice write up. Aside from these mentioned, I also wanted to point out a few problems about Protocols.
- the implementation on struct is fine, but implementations on primitive types are very different and sometimes awkward
- the first argument is forced to be the type that implements the protocol, making it difficult to define abstract methods on, for example, a set of values
- there is no concept of associated type, associated constant,
- the role of protocols mostly overlaps with a
@behaviour
but a behaviour is more flexible
And here are more places I'd like to see improvements (some pointed out in the article, too):
- the lack of simpler struct construction/deconstruction syntax sugar, forcing everyone to write code like
%{a_long_property: a_long_property}
repeatedly - the lack of early return. the design of
with
discards the information about the mismatching branch. Ecto.Multi
is not composable (I tried to fix it via https://github.com/shouya/ecto-tx)
A concise and complete cheatsheet for the format!
macro.
This article talks about the default value for DefaultRestartSec is not sensible for use cases where you expect the service to restart indefinitely. Under the default setting, if your service could crash in 100ms, then it will only be restarted for around 1 second before systemd gives up.
It's a pleasurable and informative read. The nature of algebraic effect was accurately and concisely pointed out. This has been one of the best write-up on algebraic effects implementation in Rust I've read so far.
Quick explainer for ZFS caching mechanisms: ARC, L2ARC, TXG, ZIL, and SLOG.
A detailed description on the hardware architecture of Game Boy console.
TIL A* with fixed iteration depth.
All look like interesting concepts to toy with!
- Text editor
- 2D game - Space Invaders
- Compiler - Tiny BASIC
- Mini operating system
- Spreadsheet (hard!)
- Video game console emulator (hard!)
- Ray tracer
- Key-value store web API
- Web browser
- Stock trading bot
Also see Challenging algorithms and data structures every programmer should try.
This article talked about three data structures for efficient text editing (a.k.a. text buffer data structure): Rope, Gap Buffer, and Piece Table. It's first time I learned about Piece Table, it works like this:
- Store the text in an append-only fashion in two buffers known as original file and add file
- Store the information about segments of the files as a list of reference to the slices into the two buffers (known as "piece table")
The inserting/deleting in this data structure would simply need to breaking up items in the piece table. It seems like a good candidate as a basis to implement CRDT in a collaborative editor.
From my preliminary understanding of the nature of this data structure, it doesn't seem necessary to have two buffers, a single append-only buffer preloaded with the file should be sufficient.
UPDATE: I found this post on vscode blog extremely helpful: https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation
A gallery of interactive explanations. And the tool used to make these.
Chatbot Arena: blind test on the performance of LLM models to assign them a ELO rating. It also serves as a playground for various models.
This is a useful lifehack I learned today.
TL;DR: pull the note downwards instead of peeling it upwards. This stops the note from curling and stick better.
Bluetooth protocol snooping, Android app decompilation, AES decryption.
A security search engine like https://shodan.io. Search open services on an IP, whois, protocol signature, etc.
A post on postgres replication feature.
The good'ol Google ngram explorer for tracking term uses across recent centuries.
Like godblot.org but for decompiling binaries into C code using various decompilers (Ghidra, etc).
An introduction to various graphical tracing and profiling tools.
Anagram: a word constructed from the same set of letters of a different word. Here by "visual anagram" it means the type of visual illusion that one picture can be rearranged to another picture with a different interpretation. This work demonstrates a method for generating visual anagrams automatically using a pixel-based diffusion model.
A nice article on the exploration of a performance issue, which ultimately leads to the discovery of a bug in AMD CPU.