Playing with zim files
Vibe coding, or the assisted coding, as some prefer to say, has become a brilliant way to tinker with code that other way would be out of reach (either because of lack of skill, or time, or pure laziness). It allows anyone to produce runnable code for simple common tasks without relying on other peoples code. Bespoke solutions for single problems. This has been very clear to me recently with openZim.
Zim files are a files that hold entire websites for offline viewing. Originally thought as a way to have Wikipedia save to disk (all 115GB of it, and brilliantly I’ll say), they could be used for other websites too… Hm…
“Could I offer a ZIM file of sixhat.net”
Sure I can, but what if, instead of finding someone else’s code, I simply coded my little tool? Yes, that’s what I/it vibe coded. Asked deepseek to code zim-maker so I could create sixhat.zim every time I post something. Don’t have the time to research the full zim format, to think of an architecture for this tool, or to even think about the time I’d be spending coding this. All of that would put me off. With vibe coding, this was a two hour session (mixed with other important stuff). In the end I have a tool that I can use.
Is it complete? Yes, for what need. Does it have RANDOM FEATURE. Probably not. It is probably full of bugs then? Yes, but the attack space and victims are very limited. Are you releasing the code? Why? If it is mostly code generated by AI? I might send copies to anyone that asks but why publish this online?
You can do the same thing in a couple of hours and a free AI agent. Don’t go and run other people’s code. People that you only met through reading a blog post are not a trustworthy source of anything, least code.
ZIM Readers
If you want a ZIM reader (besides coding your own, with or without AI) you can use one from the openZIM readers list.
On the mac I use Kiwix (just because I’m lazy) and there’s also a version for Android.
Interesting quirks of P5js random number generator
function draw() {
randomSeed(frameCount);
console.log(random());
}
This is a really interesting piece of code. Try it online.
=> https://editor.p5js.org/sixhat/sketches/WRBChpIXz
See the interesting thing? The random numbers generated are growing sequentially.
This is a side effect of using a Linear Congruent Generator. The random seed just applies the value of the seed sequentially and as the seeds are close enough, the resulting random numbers are also close to each other.
Curiously, if the user doesn’t use the randomSeed function the PRNG still sets a seed given by Math.random() * 2**32. And as Math.random() is not possible to seed…
=> https://github.com/processing/p5.js/blob/v2.2.3/src/math/random.js#L30
The solution for your sketch is not to use randomSeed with close seeds. Always multiply them with a big constant. In the previous example, multiplying frameCount by 2**16 will spread the seeds so the resulting random numbers at least don’t seem so sequential.
function draw() {
randomSeed(frameCount * 2**16 );
console.log(random());
}
Why do you need this? Probably you don’t need to set different seeds like this, but if you are trying to do something based on the current time (let’s say using the second() as your seed, so you have changing random values each second) then you’ll have the unpleasant surprise that it doesn’t behave randomly. For this if using second() as seed, multiply it with a big constant (eg. 1<<16).
A suggestion to p5js would be to implement a hashing algorithm to the seed value in the above example.
Playing with RAM monitors
Wrote (with AI) the same mini ram monitor CLI and the results are very interesting in terms of memory usage:
GO 14. MB Rust 9. MB C 1.2 MB
For reference, htop usually uses 9.MB in my machine.
In the age of AI, one can really build his own tools, tailored for one user. Something bespoke, and quick.
=> https://medium.com/@NMitchem/if-ai-writes-your-code-why-use-python-bf8c4ba1a055 If AI Writes Your Code, Why Use Python?
=> https://www.youtube.com/watch?v=nepKKz-MzFM FFMpeg Jean-Baptiste Kempf and Kieran Kunhya explain why EVERY CYCLE MATTERS. GREAT #FFmpeg #programming
In the age of AI fights
A t i n i l l s
W a o i w l e o e r t n a e g s o r n
m e m g o e a o m s i e e r e l s a i s H a
w l i t a , t y r a e y t t g t f h b k D a P s
o i . M e c p n s r i l a r p g e e i . o e t
c p i a i u d a o o x a o . h w t e h a
a l s n t s t d i t e a G a c r w c d n
j p v y 3 i t ?
I r n g s a e .
e r w n a o d w r p p ’ e i s r i e a
o l a i p c t s h a t c a r e n e c n . u n
i g c h e l a a i o i t a . a o o i a
p o a r p g l s e a e k s a i x n v r h
o a e t i n o y r a t r i i a a b w n u n
n c o h b t r i o o B t S r a t a e e o e e t
u e n e
a i w s
e n r h e e l s c a o e b n u d t t i
d s i n t r l e h e u n w h h p l t s m h e m s
l f h b k e a r d s r n g c t i n s n
t n k s a i e l b , m e c p n p s e F c e
m n s r n g n o t t d e r w k T s s r e e m s
d y n i e e a t n f a l t l i . A n m d o
m e r 3 m u sComputer Vision Courses online
=> https://www.youtube.com/playlist?list=PLCEC78997E3E2DAB4 Coding & Vision 101
=> https://see.stanford.edu/Course/CS223A CS223A - Introduction to Robotics
=> https://ocw.mit.edu/courses/6-034-artificial-intelligence-fall-2010/ Not Vision, but AI.
Illusions, illusions
Many interesting optical illusions / visual phenomena, coded by Professor Michael Bach. Many have high pedagogical value for computer vision topics.
=> https://michaelbach.de/index.html
=> https://michaelbach.de/ot/index.html
Playing with Voronoi
=> https://www.jasondavies.com/maps/voronoi/ Very interesting 3D visualizations
=> https://www.youtube.com/watch?v=Bxdt6T_1qgc Coding Train…
=> https://paulbourke.net/ Paul Bourke website - fantastic math and geometry website.
Scarcity rules everything.
The only way to take stop an exponential process is by starvation. AI will be starved at some point. The scarcity is creeping in and will start being dominant, even if managing the scarcity could benefit the companies for sometime. But the very nature of the process will mean that one day it will implode (either because of materials, energy or just money).
=> The Beginning of Scarcity in AI
Readings
=> https://arxiv.org/abs/2604.13242 On the Creativity of AI Agents
=> https://arxiv.org/abs/2604.13534 Who Decides in AI-Mediated Learning? The Agency Allocation Framework
=> https://arxiv.org/abs/2604.13017 PAL: Personal Adaptive Learner
=> https://arxiv.org/abs/2604.14126 AI-assisted writing and the reorganization of scientific knowledge
Hide macOS Tahoe menu icon explosion with
defaults write -g NSMenuEnableActionImages -bool NO
Links for Computer Vision and Obstacle Detection
=> https://www.sciencedirect.com/topics/computer-science/obstacle-detection
=> https://doi.org/10.1016/j.dcan.2020.12.002
=> https://docs.octave.org/latest/Image-Processing.html Image Processing in Octave
=> https://scikit-image.org/ scikit-image
=> https://juliapackages.com/c/computer-vision Julia Computer Vision Packages
Trying a new thing… don’t worry
Trying to integrate Blog, Toots, and everything else. Is it possible? Bashisms to the resque.
=> https://www.sixhat.net/2026/03-gemtext-or-markdown.html Playing with GemText
=> https://caniuse.com/css3-tabsize tab-size Learning something about CSS everyday. Why do we keep having the discussion of spaces vs tabs?
- You really only need 4 txt (or Markdown) files (Tomorrow, Todo, Year, Calendar). Tomorrow holds up to 6 tasks that you’ll do… tomorrow, Todo holds every task pending, Year is a log (one big long file) and Calendar, well it is a calendar so you don’t get lost. This works? Yes. My Year file is a mix of both a physical notepad and a markdown file in Obsidian. My Calendar is in Google, because french. My Tomorrow is in Google Keep because french and my Todo is another file in Obsidian. Well, maybe I could use CryptPad.fr - Works very well, and is in … France.
=> https://cryptpad.fr “the end-to-end encrypted and open-source collaboration suite”
- Today is Kagi day at HN. Everything is Kagi. Everything is Small Web. Why? Is this random or not? You think about it.
=> https://flounder.online A Free hosting for Gemini Capsules
Gemtext or Markdown
Recently I’ve stumbled upon the Gemini Protocol and Gemtext. I am really interested in its syntax simplicity. In some aspects is like a minimal Markdown, although not fully compatible. The good thing is that it can be learnt in one minute. Also, it has a line oriented philosophy that makes parsing Gemtext very easy. This leads to a very straightforward approach to writing and that is what I like the most.
=> Gemini Protocol
Quick Gemtext reference
Headings: Only # can be used.
# Heading 1
## Heading 2
### Heading 3
Lists: only flat, no nested lists, only uses *
* item!
* item!
* item!
Links: This one is the really nice but breaks Markdown (and Text is optional)
=> URL Text
Quotes: As expected…Simple and practical
> quote
And that is it. The only major thing is that line breaks and empty lines are respected as opposed to Markdown, and that might be a good thing.
=> Gemtext Spec - oficial
=> Gemtext Spec
The syntax is so simple and so line oriented that a parser is really easy to build. You only have to match the beginning of the first characters and parse them into what ever format you need.
A simple example could be written in bash like this (incomplete, there’s no PRE element yet - coded fences)
gem2html(){
local LINHA="$*"
if [[ "$LINHA" =~ ^"# " ]]; then
printf "<h1>%s</h1>\n" "${LINHA#\#\ }"
elif [[ "$LINHA" =~ ^"## " ]]; then
printf "<h2>%s</h2>\n" "${LINHA#\#\#\ }"
elif [[ "$LINHA" =~ ^"### " ]]; then
printf "<h3>%s</h3>\n" "${LINHA#\#\#\#\ }"
elif [[ "$LINHA" =~ ^"=> " ]]; then
read -r first url texto <<< "$LINHA"
if [[ -z "$url" ]]; then
exit
fi
if [[ -z "$texto" ]]; then
printf "<a href='%s'>%s</a>\n" "$url" "$url"
else
printf "<a href='%s'>%s</a>\n" "$url" "$texto"
fi
elif [[ "$LINHA" =~ ^"* " ]]; then
printf "<li>%s</li>\n" "${LINHA#\*\ }"
elif [[ "$LINHA" =~ ^"> " ]]; then
printf "<blockquote>%s</blockquote>\n" "${LINHA#\>\ }"
else
printf "%s\n" "$LINHA"
fi
}