HNHacker News
TopNewBestAskShowJobs

buserror

3,794 karma · joined April 29, 2015

UK: Linux Kernel Engineer & General embedded hard/soft; Author & Maintainer of various open source projects. https://github.com/buserror
submissionscomments
buserror··on The medieval habit of 'two sleeps' (2022)
Pretty much so. Mind you I did a lot (too much) in my 20's and 30's, both amazingly good, and amazingly bad, which means going out at in my little off-the-city town is boring as hell anyway.

I'm much more excited about able to be able to go fishing at 4am in the summer, NOW we're talking ;-)

buserror··on The medieval habit of 'two sleeps' (2022)
I do that a lot these days. I went to bed around 8:30pm, woke at 4am... It's 6:50 now and I've done a lot of work! It's nice, quiet, I just really crack on.

I'm waiting for 8am, then feed + walk the dogs, then I'll go back to bed for 1h or a bit more (tops), and it'll still be early when I wake up again. Most of my colleagues will show up around 10 with bleary eyes while I've done most of the stuff I wanted to do already!

... So that gives me a lot of time for a good walk, or tinkering etc in the afternoon.

I used to be a 'night owl' really, going to bed at 2am; but I realized I was never really terribly efficient until about lunchtime the following day, while I was also wasting my time in the evening for no real reason. AND wasting the short winter day at my desk.

Nowadays, well, I got the whole day to myself!

buserror··on Building a USB to Mac ADB keyboard adapter
Actually I use the same hardware setup (ADB->USB) and the same keyboard, just with a different adapter, so I'd be happy with any patch to QMK. That makes at least 2 of us ;-)
buserror··on Two handy GDB breakpoint tricks
well you can always while (1) {} -- run the program, and control-C when you hear the CPU fan :-)
buserror··on High C Compiler – A C language extension ahead of its time
It doesn't requires a space, you could modify the lexer to recognize '..' as a prefix and solve that problem, it's just a choice they made to refuse that it could be implemented by just having one character forward looking lexer.

It is not because it is implemented like that in gcc (requiring a space, possibly so they didnt have to modify the lexer) that it ought to be specced like that.

buserror··on High C Compiler – A C language extension ahead of its time
That has clearly prevented dozens of other languages to support that feature... because no parser would be able to tell you that range isn't valid at compile time?
buserror··on High C Compiler – A C language extension ahead of its time
Problem is, that approach forces the committee to roll in stuff from the C++ spec -- stuff that would have been shot in flame if you had hinted about that sort of things as a proposal C extension..

For example the [[keywords]] that had was rolled in because it was already out there -- imagine proposing that out of the blue and see a people self-propel into orbit...

On other hand the Case A ... B: syntax that has been out there for 30+ years, well there's a proposal for it but it won't be THAT because well it hasn't been invented here really, we'll make up a different syntax for it instead...

buserror··on High C Compiler – A C language extension ahead of its time
Case ranges are in gcc for a million years. And also nested functions. I used nested functions a lot but, it was never ported to clang which makes it a bit of a problem for portability, also, nowadays the linker complains about having to make the stack executable, which is another problem; so I had to stop using them.

I also don't understand why the "C standard" hasn't evolved further -- there was a discussion lately about the committee being out of touch. Some of these extensions makes life so much easier. Instead we get stupid stuff nobody need, or have been in a header for 200 years (ie, <pthread.h>, whoohoo, I'm delighted this standard header is now a... standard!)

For nested/sub function, it makes so much sense it's not even funny. Having micro-callbacks right there before the call to qsort() (or any other) is SO much better than having to farm out a context, yet-another-static-function etc...

buserror··on Atuin replaces your existing shell history with a SQLite database
I've been using '.bash_history per directory' method for quite a while. Mostly changed 'cd' to see if I'm in /home or /opt and switch the HISTORY_PATH.. then tail -5 the bash_history that is (likely) there.

This allows me to switch context/projects etc and have a valuable history, instead of a whole mashup of all kind of other activities crammed into a single file in $HOME...

Perhaps I could use a single SQLITE database with a fancy invocation to do the same? Ie limit the history to the current subtree commands have been invoked in?

buserror··on Dennis Ritchie on the priorities of && || vs. == etc. (1982)
I do the same, not because I don't know the priorities, but because in my 35+ years career, I've seen so many times when cut+paste of partial expression leads to disaster just because it wasn't grouped properly with parenthesis..

Early in my career I erased several megabytes of shared memory on a mini computer, ie DOZENS of users worth of memory just because I was being 'clever' and cut+pasted bits of an expression the wrong way.

Since then, as a rule, sod the priorities, parenthesis it is...

buserror··on Apple's classic Pascal poster, remade as a vector image [pdf]
She is no longer on twitter, she's @nanoraptor on masto -- sorry can't give you the whole handle as masto seems to make it rather difficult to list one's own list of following!
buserror··on Apple II Emulation Evaluation (2022)
I wrote my own pet Apple IIe emulator for linux fairly recently [0]. It works fairly well, even if it doesn't try to emulate an exact cycle accurate 'pixel' video modes, instead, it 'cheats' and do it line by line. I think it is a good tradeoff between quality of emulation and CPU spent doing it... Only some demos will fail to display properly (mostly the ones changing video mode during line displays!), all the games and tools and applications I tried works just fine.

I mostly did my emu due to the rather poor quality I found for linux emulators I've seen, the 'goto' one is linapple, but the codebase is rather crusty.. I wanted a cleaner base to hack on, without the baggage -- more in the style of my own AVR emulator [1].

I've got a very big patchset to push 'soon' with a new UI library (that will be a topic of its own!) and a bunch of new features and improvements...

[0]: https://github.com/buserror/mii_emu [1]: https://github.com/buserror/simavr

buserror··on Musings on the C Charter
Pfew it wasn't just me then :-)
buserror··on Musings on the C Charter
I'll start caring about c standards above gnu99 as soon as they add case range values to switch statements, like case A ... B: -- which I've only been using for what, 35 years now?

All that time, I really wondered what the flip they are on about. Adding extensions that really, I really raise eyebrows at while ignoring complete elephants in the room, like the above feature.

Last year they were pontificating about something something adding some sort of (complicated) syntax to support destructor functions and were wondering about prior implementations, and I had to point to them the support of destructor function had been there as an extension of gcc for countless years.

It's like they aren't actually using the language, just speccing it. Kinda like linux maintainers who are more like some sort of priesthood and gatekeepers than actual users of the system.

buserror··on You're Supposed to Be Glad Your Tesla Is a Brittle Heap of Junk
My BMW X5 just was driven back to me yesterday after nearly 3 weeks away for 1) a puncture and 2) a recall of some sort. 3 weeks because they decided run flats would save them money, and also got rid of the garages courtesy car fleet, also tyre sizes which are near unobtainium and never in stock anywhere.

This is my second X5 G05, and this one is definitely of lower quality than the first. Removed bits here/there, replaced aluminium parts inside with coated plastic, replaced leather with synthetic-like thing and plenty of other cost cutting markers.

Don't tell me 'oh don't buy another one' as demonstrated by this article (and others), they all do it to pretty much the same degree, all you can hope is not to run out of warranty before something mind bogglingly expensive breaks.

buserror··on Brexit has failed for UK, say clear majority of Britons – poll
Heh, I am a EU immigrant to the UK, been with my wife 30 years, and both my in-laws were rabbid brexiters of course....

Until I told them they were voting for literally preventing their daughter and me the life we've been living. Their grandkids, everything wouldn't have been possible without her being allowed to work there, and me being able to work here...

They hadn't realized that of course, because you know, as far as immigration goes, they were just fine with the lovely polish lady at the shop, and me of course, what they didn't want is 'them' (not entirely clear who that is).

buserror··on Brexit has failed for UK, say clear majority of Britons – poll
Yes, mostly because they were ALSO under the assumption that the promise of deregulation was such a great thing. The manipulation wasn't entirely one sided on the plebs, it was a concerted effort, and not just ONE international interest had their fingers in it...
buserror··on Brexit has failed for UK, say clear majority of Britons – poll
This was a massive infowar against the whole country. There are tons of gullible people to 'convince' using their own prejudice, and there were quite a few people who saw it as a quick rise to power -- most of these people did very well with it as well!

The goal was never in doubt really, and it was never the 'good of the country', or its people.

buserror··on "If buying isn't owning, piracy isn't stealing"
What sort of reply is this? Does it address the fact they sell a product and you aren't getting what you paid for?
buserror··on If buying isn't owning, piracy isn't stealing
See also https://news.ycombinator.com/item?id=38578872 -- 4 hours ago.
buserror··on "If buying isn't owning, piracy isn't stealing"
No you don't really, google around and you'll see that whatever you use, unless it's a google stick (not even sure either), you won't get HD. Seems the DRM for displays has been cracked a while back and everyone has just downgraded playback silently ever since.

With zero notifications, refunds or anything of course.

buserror··on "If buying isn't owning, piracy isn't stealing"
It is just not even just deleting shows, they do whatever they like. For example, if you buy a "HD" show on youtube, you are actually getting 480p, because something something DRM will prevents you from playing that HD version you bought on anything but a locked up air gapped computer in Youtube's VP's own office.

This is a scandal that has been going on for years -- they still sell you HD versions of the movies and shows knowing full well you can't possibly play them in anything but 480p

buserror··on Hetzner is terminating contracts with all users who had a Russian postal address
Last time I checked, their new server are way more than the typical 35 euros mark, which is what I pay at the minute for ~3TB RAID1 quad core with 16GB ram... The current gen of server auction seems already to be quite a nice upgrade to my hardware, if I'm willing to ditch hardware raid...
buserror··on Hetzner is terminating contracts with all users who had a Russian postal address
I hope this is not going to be a massive hit for them financially -- I like Hetzner. On the flip side they might have some cheap 'server auction' on the block soon, I've been pondering a cross/upgrade for a little while already :-)
buserror··on MakeMake: Generate make files from C source code
THIS is the lightest way to have continuous make, without wasting cycles and hammering the file system. inotifywait is a pretty standard tool that does exactly what's needed.

watch : while true; do \ clear; $(MAKE) -j all tests; \ inotifywait -qre close_write src tests; \ done

buserror··on MakeMake: Generate make files from C source code
I don't understand, with gcc -MM (to generate .d files), -include to include them, and VPATH for source file discovery, a typical small project makefile is about 1/2 page and requires very little maintenance.

More complicated project? Might shoot out to 2 pages. It'll still work in 20 years time too, the tools won't change under you (I'm looking at you, pretty much all other build systems)

buserror··on Geany 2.0 – Flyweight IDE
I love geany for loose file edits, but I don't use as an IDE. For one thing (perhaps this has changed in the 2.0?) no "proper" split window support; there was a patch implementing it a few years back, but it was refused on religious reasons (read, "not done the way we want it so we're going to do it ourselves instead and in fact never came around to it").

Still, great editor, super fast, and the fact you can easily open a file in your currently open session (and that it supports the <filename>:<line number> convention) makes it super for checking out error message/warnings etc when compiling code that you don't have in an IDE...

buserror··on Scientologists Ask Federal Government to Restrict Right to Repair
paywalled
buserror··on Can you use a class in C?
The only times I had to do that I.... converted the whole heap of C++ to C and used that instead. You rarely see libraries using all the most complex constructs of C++, and quite frankly, if they do, I'd rather stay clear of that pile of bloatware :-)

I wrote and shipped C++ as a job for many years -millions of lines I'm sure- and I've 'reverted' to plain C around 2007 or so, and I couldn't be happier.

buserror··on Lesser known tricks, quirks and features of C
I "abuse" unions and anonymous unions all the time, it's very practical, and make the 'user' code a lot clearer as you can access the small 'namespace' as convenient. Here for example I can access it as named coordinates, x,y points or a vector.

   typedef union c2_rect_t {
     struct {
        c2_pt_t tl, br;
     };
     c2_coord_t v[4];
     struct {
       c2_coord_t l,t,r,b;
     };
   } c2_rect_t;
← PreviousPage 3 of 23Next →