@pwaring@fosstodon.org avatar

pwaring

@pwaring@fosstodon.org

UK Whovian, railway & politics geek and event organiser. Freelance PHP developer and Linux system administrator. He/him/Paul

Most toots deleted after 3 months

Book reviews and updates: https://ramblingreaders.org/user/pwaring

#NoSearch #NoBot #NoArchive #NoIndex #NoBridge

This profile is from a federated server and may be incomplete. Browse more on the original instance.

pwaring, to random
@pwaring@fosstodon.org avatar

I've been a member of a film club for a few years and have some observations:

  1. Films get longer over time.

  2. 1h30m to 2h is about the right length. Anything less doesn't get enough background, more is too boring/padding (Lord of the Rings is the exception).

  3. There's no correlation between what other people think (e.g. awards) and whether I enjoy a film.

  4. Some people get upset when you don't like their film (I don't).

Actually this applies to books too (page length maybe 300-450)...

pwaring, to golang
@pwaring@fosstodon.org avatar

TIL: Go only supports a subset of Perl Compatible Regular Expressions (unlike PHP which I think supports everything), excluding things that would be very useful (e.g. \R to match \r\n, \n or \r for platform-independent splitting by line breaks), and not following PCRE in all cases.

pwaring, to random
@pwaring@fosstodon.org avatar

Someone really wants me to vote in the upcoming GM mayoral elections, as I have been sent EIGHTEEN copies of the booklet with the candidate statements (all addressed to me on the envelope, so it's not a lazy post-person sticking all the booklets for our block of flats in one letterbox).

Also it's a bit depressing how many candidates are explicitly anti the Clean Air Zone (no one is explicitly pro, not even the Green candidate).

pwaring, to random
@pwaring@fosstodon.org avatar

The failure to create a centralised library IT system in the UK is an excellent example of when someone with no IT background produces a report saying it's a good idea, then more people with no IT background sign off on it and promise it can be built using a tiny budget.

It took years to get the 10 authorities in Greater Manchester using the same IT system, and they were already used to working together.

https://www.theguardian.com/books/2023/dec/30/millions-wasted-on-attempt-to-create-nationwide-uk-library-website-campaigners-claim

pwaring, to random
@pwaring@fosstodon.org avatar

Maybe I'm not explaining it very well, but quite a few people who contact me don't seem to understand that "I'm usually booked up 4-12 weeks in advance" doesn't mean "if you contact me again in 4-12 weeks I'll be available".

pwaring, to email
@pwaring@fosstodon.org avatar

TIL: Something which I suspected for ages (and is really annoying) but have finally found the answer to, is that @thunderbird global searches are faceted and try to find close matches:

"Most of the time this is a very useful feature, but there is no way to disable it if you want an exact match"

https://kb.mozillazine.org/Search_-_Thunderbird#Global_Search

pwaring, to random
@pwaring@fosstodon.org avatar

I suspect we'll see a lot more of this - students being accused of cheating by 'AI' software.

I wonder who, if anyone, is liable if the accusation turns out to be false? Calling someone a cheat / plagiariser (which is basically what '100% AI-generated' is saying) is definitely damaging to their reputation.

https://www.theguardian.com/commentisfree/2024/feb/13/software-student-cheated-combat-ai

pwaring, to random
@pwaring@fosstodon.org avatar

My local market is the main photo for the lead article on the Guardian today. Given that it has a global audience, I guess this is finally evidence for the market's claims that it is World Famous.

pwaring, to random
@pwaring@fosstodon.org avatar

TIL: Intel is working on X86S, which involves dropping support for 16 and 32 bit operating systems (you'll still be able to run 32 bit code under a 64 bit OS, and presumably a 32 bit guest VM on a 64 bit host).

Feels like a major break from the usual extreme backwards compatibility of x86 (compared with Apple hardware for example).

pwaring, to php
@pwaring@fosstodon.org avatar

Adding some tests to a legacy PHP project. Much more challenging than with a brand new codebase, also building the infrastructure is harder when test frameworks assume you're using PSR-4 autoloading etc. I think the payoff is worth it though as it's helping to ensure that a patch to fix an edge case (roughly 1% of records) actually works without regressions.

pwaring, to random
@pwaring@fosstodon.org avatar

Fun things I have (re)learnt about C recently:

  1. int isn't guaranteed to be the same as the word size, only >= 16 bits.

  2. getchar returns int, not a char.

  3. Character literals are also int.

  4. You can get the numeric value of a character literal digit c with: c - '0'. This assumes that 0-9 are sequential, which is true for any encoding you're likely to meet, and required from C89 onwards (see Baudot code for an example which does not meet this criterion).

#c

pwaring, to random
@pwaring@fosstodon.org avatar

TIL: My fridge does not make a warning sound if the door is left slightly ajar. Just had to throw away the contents as I'm not sure how long it's been open (enough to make the back freeze up). Luckily as I live by myself that's not a huge amount, but still annoying.

pwaring, to random
@pwaring@fosstodon.org avatar

Got on the bus for free as the card machine wasn't working, and of course that also means it's the 1 in 500 journeys when ticket inspectors get on - thankfully they believed me (I guess they could also ask the driver).

pwaring, to random
@pwaring@fosstodon.org avatar

There are two big tech events this year which a lot of people I know will be going to, but there's a huge difference in how seriously they're taking Covid (and health issues in general).

FOSDEM ('encouraging ventilation' and no official beer event):

https://fosdem.org/2024/practical/covid/

EMF (CO2 monitoring, free masks and tests, full refund if you can't attend due to infection):

https://www.emfcamp.org/about/health

pwaring, to random
@pwaring@fosstodon.org avatar

I've recently started squashing Git commits on a regular basis, especially just before a PR. I commit regularly during development for each incremental stage (which means I can rebase often) but having a single commit for review keeps the history a bit tidier.

Squash the last N commits:

git reset --soft HEAD~N

Only do this on local branches that haven't been pushed, as it rewrites history.

More tips on my Git Cheat Sheet:

https://docs.google.com/document/d/1SCr279qbc9cGie8noyYUwHN17IvbicYXOw2lPI8Yz4k/edit?usp=sharing

pwaring, to golang
@pwaring@fosstodon.org avatar

TIL: In Go:

assert.Equal(t, nil, find())

is not the same as:

assert.Nil(t, find())

but this does work:

if find() == nil

I'm sure there's a good reason for this, but it looks wrong (find() returns either a pointer to an object, or nil if no object could be found - which is NOT an error).

pwaring, to random
@pwaring@fosstodon.org avatar

Apparently you can still get a coach to Paris from Manchester. I can only assume it's staggeringly cheap as I did that once and it was roughly 16 hours (we started outside of Manchester but that probably only added 45 minutes).

pwaring, to golang
@pwaring@fosstodon.org avatar

Solved Advent of Code Day 8 Part 1 in Go. Not too difficult, spent most of my time thinking whether to make the data structure a slice (with index in the struct) or map, and struggling with how nil works when returned from a function.

Solution:

https://github.com/pwaring/advent-of-code/blob/master/2023/08/a/8a.go

Test suite:

https://github.com/pwaring/advent-of-code/blob/master/2023/08/a/8a_test.go

pwaring, to random
@pwaring@fosstodon.org avatar

The more I think about it, the more I believe that HS2 is one of the worst-marketed infrastructure projects. The name is terrible (it's about capacity not speed), no one seems to know what the benefits are (moving fast trains off the busy mixed-use West Coast Main Line), and it's terrible at defending costs (hardly anyone complains that Crossrail cost nearly £20bn, even though it is about 1/5 the length, so £100bn for HS2 is not unreasonable).

pwaring, to golang
@pwaring@fosstodon.org avatar

TIL: Go doesn't support heredocs, unlike PHP (and other languages). You can create raw strings with backticks, but they retain indentation within the string (heredocs in PHP can be made not to). There are GitHub issues proposing it, which quickly descend into endless arguments over how things should be done (e.g. one guy insists that no one should write SQL queries in their code).

Fortunately someone has written a module:

https://pkg.go.dev/github.com/MakeNowJust/heredoc

pwaring, to php
@pwaring@fosstodon.org avatar

One of the downsides of doing PHP upgrades is that clients will check everything afterwards, find a bug, and assume I've introduced it (99% of the time it's always been there, but this is the first time someone has actually bothered to check everything).

pwaring, to golang
@pwaring@fosstodon.org avatar

Still working on day 11 part 1 of Advent of Code in Go (given up on day 10 for now). Expanding the universe is tricky - duplicating rows is trivial but columns is harder as there's no built-in way to extract columns in Go - really I want something like the PHP array_column function (really useful when combined with array_sum for easy totals of tabular data).

pwaring, to random
@pwaring@fosstodon.org avatar

Does anyone else enjoy working with legacy code and systems? I really like improving them, or working under the constraints (most of the time). It's often more fun than just installing the latest all-singing, all-dancing framework that does everything for me. But clients with old systems say they really struggle to get support.

pwaring, to random
@pwaring@fosstodon.org avatar

I wonder which has the lowest percentage market share now: Firefox for browsing or Linux for gaming? (possibly Firefox if you include devices like the Steam Deck where gamers use Linux without necessarily being aware of it)

pwaring, to random
@pwaring@fosstodon.org avatar

Can anyone recommend a shop in the UK which sells desks or tables at standing height? I usually buy from Ikea but all of their fixed height desks seem to be at sitting height.

I don't want an adjustable desk as they are too heavy for me to assemble and move by myself. I want a fixed height desk at standing height. Basically the same as any normal desk but with longer legs.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • JUstTest
  • Durango
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • lostlight
  • All magazines