rikudou

joined 2 years ago
MODERATOR OF
[–] [email protected] 12 points 1 day ago

Perhaps The Crew, sounds like the kind of game that makes you support it.

[–] [email protected] 11 points 1 day ago (1 children)

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

[–] [email protected] 3 points 1 day 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.

[–] [email protected] 3 points 1 day ago

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

[–] [email protected] 21 points 2 days 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.

[–] [email protected] 8 points 2 days ago* (last edited 2 days 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.

[–] [email protected] 21 points 2 days 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.

[–] [email protected] 5 points 2 days 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.

[–] [email protected] 5 points 2 days ago* (last edited 2 days ago) (5 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?

[–] [email protected] 10 points 2 days 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.

[–] [email protected] 10 points 2 days ago (7 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?"

[–] [email protected] 8 points 2 days 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.

24
submitted 3 days ago* (last edited 3 days ago) by [email protected] to c/[email protected]
 
 

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/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/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}"));
 

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}"));
2
Test (lemmings.world)
 

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 ›