rikudou

joined 2 years ago
MODERATOR OF
[–] rikudou@lemmings.world 1 points 45 minutes ago

Yeah, their work-the-workers-literally-to-death culture is top notch.

[–] rikudou@lemmings.world 2 points 2 hours ago

Yep, pretty much, though the particle itself is the energy, not some kind of energy it gives off.

Mass and energy are convertible between each other, so you can think of it as the black hole losing mass equal to the mass of the particle, if it helps.

[–] rikudou@lemmings.world 2 points 8 hours ago

A funny way to describe Linus going from 0 to nuclear sub 1 second whether someone is being mildly obtuse.

[–] rikudou@lemmings.world 20 points 22 hours ago

Well, simply not possible. Might not be what you want to hear, but iOS simply isn't for you if you're not prepared to pay for pretty much everything.

Unlike Android there's not a lot of good free stuff and you can't pirate anything on iOS.

[–] rikudou@lemmings.world 8 points 22 hours ago* (last edited 22 hours ago)

It's not a particle in the regular sense you might know, like an electron. The pair that comes into existence is meant to annihilate immediately (meaning there's zero energy gain or loss) but because of where it appeared it can't.

When it appears as I described, there suddenly exists a real particle in the universe outside the black hole, so the universe gained +1 in energy.

But energy can't be created or destroyed, so that +1 means somewhere there must be a -1. And that somewhere is the black hole which caused the particle to exist in the first place by swallowing its pair.

It's not very intuitive, that's the fun part about quantum mechanics: nothing is intuitive.

[–] rikudou@lemmings.world 20 points 22 hours ago

Depends on your definition of "true". Is it scientifically true? No. Is it the actual science simplified a lot so it can be read by a non-physicist human being? Yes.

[–] rikudou@lemmings.world 3 points 22 hours ago (1 children)

Are you talking about a mercenary group in general or this particular mercenary group which is kinda famous for raping?

Why the ad hominem? What's sensible is an opinion, not an objective truth.

I'm not saying to kill him but to send him back. Sure, the end result might be the same, but that piece of shit doesn't deserve anything from us.

[–] rikudou@lemmings.world 4 points 1 day ago* (last edited 1 day ago) (3 children)

Or maybe not, because that's exactly why they murder us but we keep them in nice prisons instead.

He's a commander in a mercenary group, how much more proof do you need?

[–] rikudou@lemmings.world 9 points 1 day ago

Well, that's just a blog. WordPress comes to mind, though try not abusing it by installing too many plugins and transforming it to an abomination that takes 3 seconds to hack.

There are probably more modern alternatives, I personally wrote my own blog system that uses ActivityPub to synchronise with Lemmy and others.

[–] rikudou@lemmings.world 10 points 1 day ago (5 children)

Murdering and raping is over, time to seek some protection. They should put him back to Russia with a big sign saying "Hey, Putin, this guy tried to flee Russia! Wouldn't it be a shame if he fell out the window?"

[–] rikudou@lemmings.world 8 points 1 day ago

Ah, the traditional Russian values of hiding the truth from your superiors because there's a culture of shooting the messenger of the bad news. Can't see this going wrong when training an AI.

[–] rikudou@lemmings.world 59 points 1 day ago* (last edited 1 day ago) (13 children)

Very often a virtual particle–antiparticle pair appears and because they're very happy they started existing, they immediately hug each other not knowing that will cause them to annihilate each other and disappear.

Every once in a while, the pair appears in a very interesting position: one is outside the event horizon of a black hole (let's call this one Pinocchio) and the other inside it (let's call it 3735928559). Because nothing can escape a black hole, they can't really hug, so Pinocchio says "I'm a real ~~boy~~ particle" and stops being virtual and becomes real, while 3735928559 continues its descent into ~~madness~~ singularity.

Unfortunately, the process means there now exists something (Pinocchio) where there wasn't anything before and that takes energy. And that energy comes from the particle that stayed behind which is now part of the black hole, so it effectively takes energy out of the black hole. You may have heard that energy cannot be created or destroyed, only transformed, that's essentially what happens here.

The Pinocchios go away from the black hole, so they can end up basically anywhere in the universe.

As for the timescales, they entirely depend on the black hole's size. Really tiny black holes evaporate in a matter of seconds, the supermassive ones in a matter of trillions of trillions of trillions of trillions... years.

In fact, black holes will be the last macroscopic structures to exist in the universe because the evaporation is extremely slow - every planet and every star and every gas cloud and every atom will cease to exist long before the last black hole evaporates.

 
 

The time flies really fast! Exactly 2 years ago I was the one and only user of this instance and now there are thousands of us! So happy birthday to Lemmings.world and hope you all enjoy our small corner of the internet!

 

cross-posted from: https://chrastecky.dev/post/16

Starting with PHP 8.5, you'll be able to do the following:

 public function __construct(
    final public string $someProperty,
) {}

This wasn't possible before, as promoted properties couldn't be declared final.

Perhaps the more interesting part is that you can now omit the visibility modifier if you include final. In that case, the property will default to public:

 public function __construct(
    final string $someProperty, // this property will be public
) {}

Personally, I’m not a fan of this behavior — I prefer explicit over implicit. Fortunately, it can be enforced by third-party tools like code style fixers. Still, I would have preferred if the core required the visibility to be specified.

What do you think? Do you like this change, or would you have preferred a stricter approach?

 

cross-posted from: https://chrastecky.dev/post/13

This change is quite straightforward, so this won’t be a long article. PHP 8.5 adds support for annotating non-class, compile-time constants with attributes. Compile-time constants are those defined using the const keyword, not the define() function.

Attributes can now include Attribute::TARGET_CONSTANT among their valid targets. Additionally, as the name suggests, Attribute::TARGET_ALL now includes constants as well. The ReflectionConstant class has been updated with a new method, getAttributes(), to support retrieving these annotations.

One particularly useful aspect of this change is that the built-in #[Deprecated] attribute can now be applied to compile-time constants.

As promised, this was a short post, since the change is relatively simple. See you next time—hopefully with a more exciting new feature in PHP 8.5!

 

cross-posted from: https://chrastecky.dev/post/15

PHP has long had a levenshtein() function, but it comes with a significant limitation: it doesn’t support UTF-8.

If you’re not familiar with the Levenshtein distance, it’s a way to measure how different two strings are — by counting the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into another.

For example, the following code returns 2 instead of the correct result, 1:

var_dump(levenshtein('göthe', 'gothe'));

There are workarounds — such as using a pure PHP implementation or converting strings to a custom single-byte encoding — but they come with downsides, like slower performance or non-standard behavior.

With the new grapheme_levenshtein() function in PHP 8.5, the code above now correctly returns 1.

Grapheme-Based Comparison

What makes this new function especially powerful is that it operates on graphemes, not bytes or code points. For instance, the character é (accented 'e') can be represented in two ways: as a single code point (U+00E9) or as a combination of the letter e (U+0065) and a combining accent (U+0301). In PHP, you can write these as:

$string1 = "\u{00e9}";
$string2 = "\u{0065}\u{0301}";

Even though these strings are technically different at the byte level, they represent the same grapheme. The new grapheme_levenshtein() function correctly recognizes this and returns 0 — meaning no difference.

This is particularly useful when working with complex scripts such as Japanese, Chinese, or Korean, where grapheme clusters play a bigger role than in Latin or Cyrillic alphabets.

Just for fun: what do you think the original levenshtein() function will return for the example above?

var_dump(levenshtein("\u{0065}\u{0301}", "\u{00e9}"));
 

test

 

As I outlined in a previous post, the new major version is released!

The migration guide for self-hosters is here: https://github.com/RikudouSage/LemmySchedule/blob/master/migrating_v2.md


As mentioned in another post, I accidentally deleted all scheduled jobs on the https://schedule.lemmings.world/, so if you used that, you need to recreate your schedules from scratch.

 

You know how in the previous post I urged everyone to do proper backups? Well, guess what happened... If you use https://schedule.lemmings.world/ as your scheduler, all your posts were deleted, including recurring ones etc. Sorry for the inconvenience.

 

I've merged a significant rewrite into the main branch and will be releasing it soon.

Before I do so, I want to let everyone know that this will be a major release which means some old functionality will be left behind and some new is coming and you should take care when upgrading.

Namely, backup the volumes you have bound for runtime cache and uploaded files. Those are bound to these container directories:

  • /opt/runtime-cache
  • /opt/uploaded-files

The database format has changed completely and is incompatible with the old version, after you upgrade to the (soon-to-be-released) version 2, you won't be able to come back to any previous version. For that reason, the only way to downgrade in case of migration failure is by using the aforementioned backup.

I've tested it a lot and the migration works well, but there's always the possibility that your instance has some weird edge case I didn't think of.


On the off chance you used the serverless deployment to AWS, it's now unsupported and Docker (or manual deploy) are the only supported options now. To migrate from Dynamo DB cache backend, I've added a app:migrate-dynamo command you can use.


The reason for this rewrite is simple, back when this project started, only very simple use-cases were supported and using a cache instead of DB was fine, but now I've basically implemented a few relational database features into a key-value cache storage and then I thought "Hey, you know what else has relational database features? Relational databases!" so here we go.

Pretty much nothing else has changed (except some general modernization and a few unrelated bug fixes), but this will make it possible to implement new features without losing my sanity.

 
 
 
view more: next ›