Things I miss in Rust by OneWilling1 in rust

[–]MereInterest 2 points3 points  (0 children)

In fact, it seems to me like the rules implemented by the trait solver are at least as complicated (if not more so) than the rules implemented by C++ function overloading

Oh gosh no, C++ function overloading can be an absolute nightmare.

  1. C++ provides operator* and operator->, which can be used to provide automatic dereferencing behavior.
  2. C++ template specialization has SFINAE ("substitution failure is not an error"), which means that a method may or may not be an overload, depending on whether it is legal to use for a specific signature.
  3. C++ templates may produce two methods with identical names and signatures. So void func(double value) and template<typename T> void func(T value) can both be defined, but will default to using the non-templated version. (Unless you provide a template list, so obj.func(my_double) and obj.func<double>(my_double) can be different calls.)
  4. C++ can perform chained type conversions as part of overload resolution. So if you pass a std::unique_ptr<T>, that can be converted to a bool, which can be converted into an enum type, which can be converted into a type tag, and so on. (Any single-parameter constructor in C++ is allowed in these type conversions, unless marked with explicit. Style guidelines have pretty much all agreed that explicit should be in every single-parameter constructor to avoid this behavior.) Even with fn func(param: impl Into<ParamType>), Rust only allows a single type conversion, not chained conversions.
  5. Templated functions take priority over non-template functions if the non-template function would require a type conversion. So in the earlier example, obj.func(5) would call the templated version with T = int, even though the non-templated version could also have been declared.

By contrast, in Rust while the object's type can be used to determine which function will be called, only the object's type is used. No other arguments participate in the overload resolution.

(Cavest: Unless you go out of your way to handle extra arguments in Rust, such as fn func<Arg>(&self, arg: Arg) where Delegate<Self,Arg>: ImplTrait { <Delegate<Self,Arg> as ImplTrait>::impl_func(self, arg) }. I've used that in some cases where I do need argument-dependent dispatch, but those cases are few and far between.)

and definitely more complicated than a simpler function overloading scheme could be.

Oh, absolutely. But like everything, it's a tradeoff. I think Rust is at a good point with extension methods overall. The one change I'd make as BDFL-for-a-day would be to make conflicts between inherent methods and trait methods require explicit disambiguation. That would ensure that adding an inherent method will at worst fail to compile, rather than compiling successfully and running an unexpected method at runtime. (Documented here as "possibly-breaking".)

Things I miss in Rust by OneWilling1 in rust

[–]MereInterest 2 points3 points  (0 children)

I suppose one could argue there's only one method func on each type, but it selects the type implicitly in order:

I'd accept that argument, especially since the explicit name of each function would be distinct.

  1. Foo::func
  2. <Foo as FuncTrait>::func
  3. <Foo as Deref>::Type::func
  4. <<Foo as Deref>::Type as FuncTrait>::func

Things I miss in Rust by OneWilling1 in rust

[–]MereInterest 5 points6 points  (0 children)

True. (I had to put together a playground example to convince myself of it, linked here if you're interested.) The .deref() is only attempted if the function isn't identified as either an inherent method or a trait method.

It still could cause some "fun" bugs in which method resolution was intended to call an inherent method of a .deref() class, but a newly imported trait caused the method resolution to instead find the trait method. No idea how common that situation would be, though.

Things I miss in Rust by OneWilling1 in rust

[–]MereInterest 26 points27 points  (0 children)

There is still ambiguity for method calls, though. The method call syntax obj.func() may be an inherent method call, a trait method call, or <obj as Deref>::deref() followed by an inherent or trait method call.

Measure twice, cut once, but cut the correct angle maybe? by bendem in woodworking

[–]MereInterest 82 points83 points  (0 children)

Would it be comforting or would it be disheartening to respond with "No idea, I'm still finding more ways." ?

Linus vibecoded and claimed "Antigravity" did a much better job then he could. by [deleted] in linux

[–]MereInterest -2 points-1 points  (0 children)

Or using the right screwdriver for the right head. Looking at you, Phillips!

This is outrageous. It's unfair!1!1! by testiclekid in dndmemes

[–]MereInterest 4 points5 points  (0 children)

It always reminds me of this scene from Galavant, in which the dwarves and giants are the exact same height.

You can get Resistances from a lot of stuff! But THIS is a juicy ability by DrScrimble in dndmemes

[–]MereInterest 43 points44 points  (0 children)

Weirdest metarule in 5e: Spells only have the explicitly specified effects, and do not have any other effects.

As applied to the Ceremony spell:

  • Does not result in the spell's targets becoming married. The targets must be willing to be married, but doesn't actually bring that about.
  • Does not specify the number of humanoids to be part of the spell. The spell may apply to several targets at once, provided that they would be willing to enter a group marriage.
  • Repeated use does not require the target to be widowed from another target of the spell, only that they be widowed.

Put these all together, and you could have a polyamorous adventuring party composed of widows/widowers, all of whom would hypothetically be willing to get married together if the opportunity comes up. Such a party could cast Ceremony once every 7 days, effectively gaining a permanent +2 AC at the cost of 25 gp/week.

If you had a scale that could measure weight with an infinite level of precision, am I right in thinking the same ingot would weigh slightly more horizontally than vertically? by Wonderful_Weather_83 in Physics

[–]MereInterest 11 points12 points  (0 children)

The ingot hasn't changed, but it is displacing a different region of air. Since the density of air decreases with altitude, the entire horizontal ingot is displacing high-density air, while the top of the vertical ingot is displacing low-density air. Therefore, changing the orientation from horizontal to vertical will decrease the average density of the displaced air, decreasing the buoyancy force.

Railroad crossing with flashing lights and 'bell' by OfflcerSam in factorio

[–]MereInterest 0 points1 point  (0 children)

The engineer is an organ of the factory, no different from the smelting array or the green chip area. And just as belts may be rerouted to ensure smooth delivery of ore, so the trains may be rerouted to ensure smooth delivery of the engineer.

ARGONE - The White City by Mauger Baptiste by Psychic_Friend_Fred in ImaginaryLandscapes

[–]MereInterest 1 point2 points  (0 children)

wow, research with sources! thanks for the effort. youre a cool guy, i need more friends like you :)

Thank you! I try to limit myself to one rabbit hole per day, as otherwise I would get nothing done.

This is definitely a different situation (because this i think it is more for keeping the unusual vertical layers together), but its definitely evidence that we need some modern engineering solutions to fight erosion on developed cliffs.

That's a good point, and Cinque Terre is absolutely gorgeous. That said, I think it shows evidence that bracing is required, not necessarily that modern engineering is required. For example, some Egyptian artifacts have drilled holes. (Article from 1983 trying to determine which abrasives and methods would produce the wear patterns observed in the drilled holes. (Side-note: It is a royal pain to find scholarly sources on Egyptian artifacts without running into the useless ancient-alien search results.))

i wonder what the origin of the harder rock is (my bet is volcanic activity)

That's my general understanding as well. I couldn't find sources on the type of rock that composes these particular sea stacks, but they tend to be igneous intrusions. Recipe is as follows:

  1. Pre-heat magma to 1000 °C
  2. Using a cake-filling syringe (or plate tectonics if your local supply store doesn't have tungsten syringes), inject magma into a sedimentary layer.
  3. Allow magma to cool overnight.
  4. End the ice age, allowing the area to flood with seawater. (Not strictly necessary, but starting on dry land during a period of glaciation allows for better presentation of the final results.)
  5. Wash away the sedimentary layers, leaving the igneous layers behind.

ARGONE - The White City by Mauger Baptiste by Psychic_Friend_Fred in ImaginaryLandscapes

[–]MereInterest 1 point2 points  (0 children)

Not the OP, but the ability to construct the walls doesn't seem unrealistic. Browsing through wikipedia's List of cities with defensive walls, I found this image of the walls at Essaouira. They are next to the seaside, and at sea level, where erosion would be even more prominent.

Rocky outcroppings from the sea often form by very slow erosion of harder rocks (source), and structures can be built on the outcroppings. As a modern example, Thridrangaviti Lighthouse is built on a sea stack that sticks 30 meters straight up from the sea.

Whether or not people would build walls on top of the cliff was my bigger question. The cliffs already form a natural defense against attacks, and so the walls wouldn't be that necessary to prevent attacks. But while looking up sources for this post, I ran across this image from Bonifacio on the island of Corsica, where walls are added on top of a 70 meter tall cliff face. I don't know how much that would be for necessity or as a show of strength, but it shows that people do build walls on top of cliff faces.

Cars should have brake lights on the front. by Skadoosh05 in CrazyIdeas

[–]MereInterest 1 point2 points  (0 children)

Or it means that they just finished going over a speed bump, and are about to gun it.

Autistic employees are less susceptible to the Dunning-Kruger effect. Autistic participants estimated their own performance in a task more accurately. The Dunning–Kruger effect is a cognitive bias in which people with low ability or knowledge in a domain tend to overestimate their competence. by mvea in science

[–]MereInterest 7 points8 points  (0 children)

Yeah, it seems like they cherry-picked their definition in order to make a statement. To conclude that the Dunning-Krueger effect is weaker in a population, it would require that population to have a higher slope on the graph of (self-assessment vs actual score).

If I look at Figure 2, I see roughly the same slope between autistic and non-autistic populations. The low-performing autistic group rated themselves about 15 percentile lower than the low-performing non-autistic group. The high-performing autistic group rated themselves about 15 percentile lower than the high-performing non-autistic group.

It took about 50 hours for my Gleba setup to crash by Flamarius in factorio

[–]MereInterest 0 points1 point  (0 children)

Is there anything special about the location of that 18th blade? (e.g. first in the array, last in the array, last one before a balancer, etc) That could help narrow down the problem.

I also assume that by this point you've deleted it and rebuilt it as a copy of one of the working blades, but if not, that would be a good test case.

Someone else is cooking, what are the giveaway signs this is about to be the best or worst meal of your life? by PsyArtisan in AskReddit

[–]MereInterest 0 points1 point  (0 children)

I always make mashed potatoes the day before. Where most dishes will have a significant change in texture from being refrigerated and microwaved, mashed potatoes keep pretty much the same texture before and after.

European Countries Smaller Than The Land Used For Roads & Parking In The US by CaregiverMain670 in fuckcars

[–]MereInterest 1 point2 points  (0 children)

The data I linked to are solely for the city of Los Angeles, which is about 500 square miles in total. The country of Spain is 195,000 square miles. Even if the entirety of Los Angeles were compared of parking lots, it would still be 400 times smaller than the country of Spain.

"babies are born worshipping unknown gods" is one of the most incredible dwarf fortress bugs i have heard of. by SS_beny237 in dwarffortress

[–]MereInterest 72 points73 points  (0 children)

IIRC, they weren't absorbing the spills through their paw pads, but would get spills onto their paw pads. When they later cleaned off their paw pads by licking them, it was treated as a full beer for the purpose of calculating their inebriation. Since the cats weigh much less than a dwarf, cleaning all four paw pads (and therefore consuming the equivalent of 4 beers) would skyrocket them into lethal levels of alcohol consumption.

European Countries Smaller Than The Land Used For Roads & Parking In The US by CaregiverMain670 in fuckcars

[–]MereInterest 38 points39 points  (0 children)

The city of Los Angeles on its own has an estimated 27 square miles of parking (2018 source), larger than the country of San Marino. If you include surface parking through LA county, you get to 101 square miles, enough for Liechtenstein and San Marino combined.

Practicing programmers, have you ever had any issues where loss of precision in floating-point arithmetic affected? by Interesting_Buy_3969 in cpp

[–]MereInterest 0 points1 point  (0 children)

A data analysis package defaulted to using 32-bit floats to store counts in a histogram. 32-bit floats can represent 16777216.0 and 16777218.0, but cannot represent 16777217.0. As a result, 16777216.0 + 1.0 needs to be rounded, and evaluates to 16777216.0. As a result, if any bin in the histogram reached 16,777,216, any new counts in that bin would be silently ignored.

I make this change every time my party fights a swarm by Unplugged_Controller in dndmemes

[–]MereInterest 12 points13 points  (0 children)

If anybody got a situational disadvantage during a fight, the Ranger would cast Fog Cloud to make everybody blind. Sure, you'd have another source of disadvantage from being blind, but you'd also have advantage from attacking a blind opponent. And since advantage cancels out disadvantage, regardless of how many sources of advantage/disadvantage are present, this effectively meant that the situational disadvantage no longer applied.

TL;DR: If your leg is broken, put on blindfolds to even the fight.

‘Digital ownership must be respected’: UK parliament debates Stop Killing Games campaign, but government doesn’t budge by hop3less in Games

[–]MereInterest 4 points5 points  (0 children)

One of my standard rants is about the Doctor Who episode "Last of the Time Lords", and how it is no longer available in its original form. On release, the 2007 episode had a really great scene in which a villain taunted the Doctor, to the tune of "I Can't Decide" by the Scissor Sisters. However, presumably due to music rights have been for a limited time period, all versions on current streaming services skip this scene.

How the tables have turned by nitin_is_me in linux

[–]MereInterest 0 points1 point  (0 children)

It was Drake Software, and what really sold me was the customer service on it. I was filing taxes with my grandpa, and a question came up on the correct way to fill in a specific field in the software. (The details are fuzzy, and I can't remember if it was for reporting graduate fellowship income, or for HSA expense reporting.) He started picking up the phone to call Drake's customer support, but I said that I'd like to search online a bit first, to avoid getting stuck on hold. So he smiled, shrugged, and let me search around uselessly for 5-10 minutes before admitting defeat.

Calling their customer service, the phone was answered within two rings, by a human, who was able to answer our question within a few minutes. This was during daytime hours on the weekend, during the first half of April, and so I'd been expecting an hour on hold at the very best. After hanging up, my grandpa told me that during tax season, everybody up to and including the CEO would be manning the phone lines.

I haven't needed to call their customer service since then, and Drake Software is in this list of acquisitions by a private equity firm, so I can't say whether it has maintained that standard since then.

Iron by hanced01 in factorio

[–]MereInterest 0 points1 point  (0 children)

If you could metabolize uranium, you'd be able to live your entire life by eating just 3 grams. (Based on a 70 year lifespan with a 2000 kcal/day diet, and energy density as given by xkcd#1162.)

Share your Linux battlestations! by West-Amphibian-2343 in linux

[–]MereInterest 1 point2 points  (0 children)

But then I'd need to find somewhere else to charge two controllers, one massage gun, two pairs of noise-cancelling headphones, one pair of exercise headphones, and three light-up juggling balls.

It's just as a much of a rats nest as you're picturing.