rikudou

joined 2 years ago
MODERATOR OF
[–] rikudou 6 points 1 day ago* (last edited 1 day ago)

Well, no, consciousness is not independent on brain. It's not magic or stored anywhere. Pretty simple proof: people with brain damage very often have a huge personality shift.

Anyway, even if you forget stuff, the pathways between neurons have already been made. And sometimes you remember things randomly after many, many years.

 

They auto-translated Original Poster as Původní plakát where "plakát" does mean "poster" but only the kind that you hang on a wall.

Another win for auto translation.

[–] rikudou 9 points 2 days ago (5 children)

Boomers haven't had them for quite a bit longer. Wouldn't say it helped much.

[–] rikudou 1 points 2 days ago

Also lemmygrad. Nice.

[–] rikudou 3 points 3 days ago (1 children)

Jedi were pretty fucking wrong, like there's so much wrong with that cult that it's surprising that someone didn't murder them all sooner.

Though it's no surprise Anakin was deemed too old for their brainwashing.

I always took it as Jedi being initially good but with no real opponent they got a bit of god complex and eventually became pretty evil.

[–] rikudou 1 points 3 days ago

Cold once pushed us irl much closer to extinction than the thinking machines ever did and we're not banning winter sports.

I get what you're saying, I'm just saying that 10,000 years is way too much time. Like, just look how much we changed in the last 10,000 years and how much has stayed the same or at least very similar.

[–] rikudou 6 points 4 days ago

In other news, Redis is dead(ish) and everyone(ish) moved to Valkey.

[–] rikudou 2 points 4 days ago

That one's true, I always buy so many unnecessary things.

[–] rikudou 6 points 4 days ago

Seconding caddy, it's extremely simple.

[–] rikudou 7 points 4 days ago (3 children)

Nothing beats caddy for simplicity, IMO.

[–] rikudou 5 points 4 days ago (3 children)

If you're on your home WiFi, try the private IP, it will most likely start with 192.168, though it's possible it will start with 10 or 172.

If you're accessing it over an external IP, you need to forward ports to the host that runs Immich. Note that not all ISPs support it, you might be out of luck.

But accessing it on the same network (like the same WiFi) should always be possible, you just need to know the correct IP address.

[–] rikudou 9 points 5 days ago (1 children)

Ah, so the shitstorm begins. I'm kinda surprised it didn't happen sooner, though.

[–] rikudou 3 points 5 days ago

It is the point, I'm merely stating that while 10,000 is a nice round number, it's unrealistic that the dogma would keep that long.

Especially when it forces rich people to follow the rules of the guild and they don't like the rules.

 
 
25
submitted 1 month ago* (last edited 1 month ago) by rikudou to c/rareinsults@lemmy.world
 
 

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 (self.bot_playground_2)
submitted 1 month ago by rikudou to c/bot_playground_2
 

test

view more: next ›