nortti's microblog

#wikifinds

GitHub hosts the Expat project. Versions exist for most[quantify] major[citation needed] operating-systems.

(src)

eBooks on the Nokia 225 4G

(I'll post a proper writeup about this later, but here's the quick version)

Nokia 225 4G is an (imo) pretty dissapointing featurephone by HMD Global. Unlike some other Mocor OS-based devices from them, the 225 4G supports web browsing using Opera Mini. It's alright, the usual Opera Mini caveats apply.

However, some time ago I discovered that the 225 4G actually comes with a second, hidden, web browser. Unlike Opera Mini, that one does not proxy all your requests through a server.

Both Opera Mini and the NokiaBrowser support saving pages for offline usage (though, annoyingly, the OS on the 225 4G does not let you start up Opera Mini if you are in offline mode, and NokiaBrowser can be started only from within Opera Mini). Opera Mini uses a bespoke binary format called OBML, but NokiaBrowser uses HTML with just a small header prepended to it. As such, I created some tooling to attach such a header to arbitrary HTML documents.

So, what can you use this for? For one, eBooks. The EPUB format is essentially just (X)HTML files in a ZIP archive.

After extracting the "Compatible epub" of The Count of Monte Cristo, I'm left with a collection of .xhtml files under epub/text. If I mount 225 4G's internal storage on my computer, I can then run:

python encode.py epub/text/chapter-1.xhtml /media/nortti/disk/browser/snapshot/monte-cristo-1.html

When I unmount the phone's storage and open up NokiaBrowser, I now have the first chapter of the book available under Menu → Open → Offline pages.

Beginning of the 1st chapter
of The Count of Monte Cristo on the Nokia 225 4G

muhlqvist

Whoops

Looks like I forgot to run zola build after my last post. Really ought to automate this better…

Related posts

Pervert in the wild

I was catching up on my "social web" feeds, and read CSS is fun! by Caoimhe. One of the footnotes on there linked to Netscape, Now! by Luna, which has

So, if you’re a pervert (affectionate) like me who likes to use Netscape from time to time,

While I did not follow her, I did see a lot of her posts on Cohost – it's possible that's where I adopted the usage from.

Related posts

Pervert (positive)

When talking of someone who is really into a thing, especially aspects of it that are often thought to be off-putting such as jank in old video games or the hassle of maintaining a trash-picked bicycle, a term I've been using more and more recently is "pervert" or, if in company who are not familiar with the usage, "pervert (positive)".

I am not entirely sure where I picked it up. I would want to say I remember Kayin using it, but I'm not entirely sure. I did pick it up within the last couple years, so Cohost is a pretty reasonable guess for where I picked it up from.

I'm interested in hearing about others' usage of the term with same or similar meaning, so send me an e-mail (see my home page for my address) if you've encountered it.

Related posts

Easier installation of oldnewthing-link-unfucker

My partner pointed out installing the oldnewthing-link-unfucker to be a bit annoyingly manual. I had not really thought about it, but that is true.

They looked into it, and it appears Greasemonkey will prompt for installation if the filename being served ends with ".user.js". I have applied that change, so if you use Greasemonkey, you should now be able to install oldnewthing-link-unfucker by navigating to the raw file on Forgejo.

Related posts

Userscript for fixing (most of) the broken links on The Old New Thing

The Old New Thing is a long-running blog by Raymond Chen that contains a treasure-trove of information on old Windows (among others). Over the years the blog's moved around different domains and backends, which have had the effect of breaking many of the internal links. You can often find your way to the intended post with some URL hackery, but it would be nice not to have to do that, you know?

So because of that I wrote oldnewthing-link-unfucker, which automates most of the work. If it recognizes a link pointing to an old url it'll rewrite it to point to the modern URL for the post, or failing that, the day it was posted. Any URL thus modified will get a 𝌡 (the Taixuanjing tetragram for 'change') after it to mark it's been changed.

It's a userscript, so to use it paste it to any userscript manager you like. I use GreaseMonkey.

Related posts

Self-referential variable initialization in C

I was reading the SDL Shader Language Quickstart, which (at the moment) mostly consists of explanations about how the language differs from C.

One difference listed caught my eye: variable initialization can't reference itself. To quote,

Why does C even allow this?

int x = x + 1;

In C, x is in scope as soon as the parser sees int x, but this allows you to reference a variable that is definitely not initialized during its own initializer! Doing so is always a bug, so we just don't allow it.

I would consider myself fairly knowledgeable about the weird corners of C, but I had never come across this "feature"!

As stated, using the uninitialized value of the variable is going to be undefined behaviour in C. However, I did not immediately see why taking a pointer to the variable would be. So, as long as we only use the pointer of the value in its definition, that ought to be fine?

Normally, doing

type x = &x;

is going to fail because the types type and type* are not compatible. However, in C (but not C++!) you can implicitly cast between void* and any other pointer type, including void**. This means we should be able to do

void *x = &x;

To test this, I made the following test program

#include <stdio.h>

int main(void) {
	void *x = &x;
	// We need an explicit cast for &x here, since printf is a
	// varargs function.
	printf("x = %p, &x = %p\n", x, (void*)&x);
}

And with GCC 14.2.0, this does indeed work, with zero warnings with the flags -std=c23 -Wall -Wextra -pedantic!

First post

This is meant to be a microblog in the style of zunzuncito, a microblog run by my partner. The posts here are going to be lower-effort than what you'd see over either on zunzuncito or my writeups – I hope to have this be a replacement for social media for me.

At the moment the site is extremely bare-bones, but I hope to add support for h-entry based embeddings and a comment section (maybe using Cusdis?). In the meantime, if you want to comment on anything here, send me an e-mail.