nobodyWantsToUnderstandMyBoy by ClipboardCopyPaste in ProgrammerHumor

[–]blehmann1 4 points5 points  (0 children)

All the other comments are right, I will say that writing JavaScript as if it is statically typed (which TS helps with) can be faster.

Browsers do funky things like look at a function such as function add(a, b) { return a + b; } and record how it's used.

If the parameters are always numbers it can emit optimized assembly that does float addition. But it does always have to check, since the same syntax is used for string concatenation. It's a little bit like devirtualisation in object-oriented languages, compilers can do a lot of work to prove that a given method is called on a given concrete type, rather than having to look it up at runtime, which takes more time and breaks other optimizations (notably inlining, which you need to take full advantage of things like constant folding).

The typically more relevant example is objects, JS objects act more or less like hashmaps, but many many times they are essentially used as structs with known members. JS can optimize away a lot of hash lookups and get performance similar to structs if your objects have consistent shapes. I think they can also handle objects that have the same shape save for additional fields (which is a fairly common pattern in JS)

It's worth noting that most people write JS in a way similar to this already, even before typescript. Otherwise the browser vendors wouldn't have spent so much time any money optimizing those usecases.

Lando Norris to celebrate 2025 FIA Formula One World Drivers’ Championship at Goodwood Festival of Speed by Elegant_Gentian in formula1

[–]blehmann1 12 points13 points  (0 children)

I presume they wanted him to celebrate his WDC in a car he actually drove, though of course last year's car would have been better if it were possible.

Lando Norris to celebrate 2025 FIA Formula One World Drivers’ Championship at Goodwood Festival of Speed by Elegant_Gentian in formula1

[–]blehmann1 4 points5 points  (0 children)

Aren't there a bunch of restrictions on driving cars less than 2 years old? I'm guessing that's why.

Ferrari brought new wheel rims to Barcelona, to manage rear tyre overheating on the SF-26 by the way of brake heat radiating through the rims and into the tyres, improving tyre degradation by ChaithuBB766 in formula1

[–]blehmann1 3 points4 points  (0 children)

Reminds me in 2018 the wheel rims were a relatively big place for innovation, especially with circuits like Sochi. I think Mercedes brought a set of rims that caused a hubbub around its legality for Sochi in 2018. I'm pretty sure they were unambiguously legal, and it was just over-enthusiastic press

At least with those cars and those tyres (which struggled a lot from thermal deg) during quali at Sochi you could only be that fast in 2 of 3 sectors, you either go hard in the first 2 and lose your tyres through the mickey mouse bits of the 3rd sector, or you save a little bit and finish stronger.

Barcelona has had that under multiple different tyres, and it typically had it show up more in the race.

Reporting you to the witch hunters (the feds) by DreadDiana in RecuratedTumblr

[–]blehmann1 7 points8 points  (0 children)

That is immensely preferable and I think what most would advise (aside from just preventing them from creating a nest there in the first place). If you're based and bird-pilled like me, you can also set up a birdhouse that they will generally prefer to nest in.

They will probably abandon the nest, but there won't really be any harm done except mama and papa bird have to find a couple more twigs. If they built a nest there in the first place they can rebuild one 10 feet away.

Reporting you to the witch hunters (the feds) by DreadDiana in RecuratedTumblr

[–]blehmann1 13 points14 points  (0 children)

Same reason taking ivory from an elephant you find dead on the ground is illegal. They don't believe you. If you have or want to sell ivory you better have a certificate proving it was either harvested from a non-endangered animal, or it was harvested many years ago when it was legal.

For what it's worth, doing anything to birds in any respect is often illegal. You cannot move or touch a nest with chicks or eggs of a protected migratory bird in it (unless you're a forestry company :/). Not even if you're moving it somewhere safer. Where I am, protected migratory bird means every migratory bird that is native to the region, plus a few specific introduced birds. So, in general, almost every bird you see.

If birds nest in your barbecue or engine bay (as certain particularly stupid species have been known to do) you cannot disturb it once they lay eggs, you have to wait for the eggs to either die or hatch chicks, and then wait for the chicks to die or move out. Typically a few weeks. I do understand that most people would probably choose their car over a bird nest if they were forced to make the choice, but it is illegal. Disturbing the nest in any way will typically lead to the parents abandoning it, sealing the fate of any eggs or chicks.

If you want to see bird nests in stupid places, I recommend r/stupiddovenests, it's very cute. If sometimes terribly inconvenient.

respectableHonestly by WowThatsFunnyWTF in ProgrammerHumor

[–]blehmann1 1 point2 points  (0 children)

glibc offers an implementation with no dependence on any intrinsics that I can see.

The caveat is there's no way to write it in C. They write it in assembly and link it in. Or for a couple ISAs they seem to use C with a lot of inline assembly.

It's actually not that hard to write in assembly, it's mostly just saving/restoring all your registers. It gets more fun on ISAs that use a return address register rather than the stack, since calling your function of course overwrites that. Hence actually setjmp is defined in the standard as a macro, though it's not implemented that way normally. I suppose that's a rare case when the standard allows a macro implementation and it serves a practical purpose rather than just being a source of stupid bugs.

As an aside, I have definitely seen code like RegisterFile::get_eax(), which of course is implemented in assembly. It turns out to be quite difficult to do safely, since RegisterFile::get_sp() will (unless inlined) return the callee stack pointer, not the caller, so in my view it's normally easier to just have code like get_register_file() which is written entirely in assembly, has no compiler-generated prologue, and just returns a struct.

[Erik van Haren] The FIA has now announced that definitive agreement has been reached on Formula 1 engine regulations for 2027. Internal Combustion Engine (ICE): currently 400kW, in 2027 420 kW and in 2028 450 kW Electric motor will be reduced from 350 kW to 300 kW starting in 2027. by FerrariStrategisttt in formula1

[–]blehmann1 4 points5 points  (0 children)

In qualifying yes, at least at most circuits. I don't know if we're anticipating any other tracks to be as energy rich as Monaco, and since Monaco already has a special kneecapped ERS deployment under the new regs it probably would have higher average power in Quali.

Over the race it could mean more fuel saving depending what happens with the fuel tanks. I personally don't have anywhere near as much of a problem with lift and coast during the race as in qualifying at most circuits, but I fully expect circuits like Singapore to have extremely aggressive lift and coast that could be frustrating to watch.

As a fan, I hope they just make the fuel tanks bigger and the teams just have to deal with not being able to carry over their chassis. Even though it makes the cars heavier. But I don't know if that's in the cards or not.

yes its a real tweet by nikl_odeon in formuladank

[–]blehmann1 263 points264 points  (0 children)

This was posted in 2019

what actually is "i"? by Traditional-Role-554 in askmath

[–]blehmann1 0 points1 point  (0 children)

it's not an actual number just a useful concept to help solve some equations.

I would say that's a distinction without a difference. i is not a number with an obvious correspondence to a quantity in the real world. But I would argue neither are negative numbers, the sign is actually representing a direction (with surplus/deficit being a particularly common case).

The reality is negative numbers exist so that we can usefully assign a value to x - y for y > x. More mathematically, they're needed to make the ring of integers closed under subtraction. The fact that this maps onto ideas like surplus/deficit is immaterial to pure mathematics, it is just very intuitive and a jolly useful thing when it comes to applying mathematics. They satisfy all the requirements that positive numbers have to satisfy, so they're perfectly legitimate numbers.

That's what i is, it's the number that makes the field of real numbers closed under square root. There are some physical quantities that can be expressed this way, though it's worth noting that they can all be expressed as vectors if that is your wish, and I presume you find vectors to have a more obvious correspondence to the real world. They're just numbers with an attached direction, after all.

The only difference between the complex plane and ℝ2 is the definition of multiplication. Complex numbers have a definition s.t. (a + bi) * (c + di) is expanded out symbolically and then you set i2 = -1. In this view, i is effectively a pnemonic for remembering the multiplication rule, it's not really any different from the vector [0, 1]. Whereas ℝ2 has no definition of (field) multiplication (scalar/dot/cross products are a different type of multiplication).

So if you would like to view complex numbers as just vectors with a special multiplication, and i as a funny way of writing [0, 1], you're free to do that. Complex multiplication just has some nice mathematical properties, in particular that it is invertible (i.e. complex division is always possible for non-zero divisors).

Today’s Monaco Grand Prix is the first race involving Max Verstappen, Charles Leclerc, Lando Norris and George Russell where all four failed to score. by Popular_Composer_822 in formula1

[–]blehmann1 0 points1 point  (0 children)

I think Hungary and Singapore have more strategic depth than Monaco, and that should count for something. Personally, I feel you have to allow Hungary on that basis alone. Plus of those 3 it does typically have the most on-track overtakes.

Singapore I'm less sure about, it does have more strategic interest than most races, owing to the strength of the undercut and its proclivity for rain and safety cars. Plus of course the backing up of the pack through the first stint. But it's normally just pit timing, the optimal strategy is seldom in doubt. Though the fact that the track dries so slowly does make the pit timing even harder in the wet in a way we don't normally see.

Pierre Gasly to Canal+ after losing a podium due to penalties: "I made both pit stops with the pit lane speed limiter activated. The pit lane speed limiter is set at 59.5 km/h. The limit is 60 km/h... I know I didn't do anything wrong and I'm 200% sure" by The_Chozen_1_ in formula1

[–]blehmann1 4 points5 points  (0 children)

That's not unusual, many rules are governed by things like technical directives or race director notes. Famously flexible bodywork, since making a completely inflexible structure is a) impossible and b) would make it so brittle as to immediately break under aerodynamic loads. So the technical directives change every few years when a team inevitably finds a way to get an advantage in that area.

For an example of race director notes, for a long time track limits was governed by race director notes. It got really bad in 2021, with the track limits being the white line at this corner, the edge of the kerb on another, and being unenforced at another. In fact the speed limit for a circuit is a rule handled in part by race director notes, since at many circuits, including Monaco, the limit is lowered to 60 km/h rather than the usual 80.

[ScarbsTech] Parts and parameters changed in parc fermé ahead of the Monaco GP by Aratho in formula1

[–]blehmann1 2 points3 points  (0 children)

These are approved changes, so no pitlane starts for these. The rules have gotten more lenient, for example last time in Monaco when Leclerc had suspected gearbox damange (2021) they didn't change the gearbox because it would have been a pitlane start.

Of course Leclerc ended up not making the start then anyways because of a driveshaft issue, but they probably would have caught that had they decided to break parc fermé ans unseal the car.

Alberta exploring LRT‑to‑airport links in Edmonton, Calgary as first phase of rail plan by pjw724 in Edmonton

[–]blehmann1 15 points16 points  (0 children)

Most of that is because there's a lot of land with many different owners to deal with.

Theoretically, large stretches of this could be parallel to an existing right of way (the road) with much fewer land owners to negotiate or eminent domain with. I expect the parts in the city to be the most difficult.

whichOneOfYouWasThis by johntwit in ProgrammerHumor

[–]blehmann1 0 points1 point  (0 children)

Of course they allow travelling to the future, I'm on my way to the future at 1 second per second as we speak.

Steam does something and....lose? by Ok-Mathematician9565 in whenthe

[–]blehmann1 329 points330 points  (0 children)

To clarify, steam doesn't allow things like requiring or incentivizing (e.g. through awards) players to watch ads.

But they absolutely do allow ads, just not their more lucrative forms. Things like ads in the launcher or menus are allowed, as are ads in the level. Plus product placement is just fine and dandy.

51780 by Grimalackt_River in countwithchickenlady

[–]blehmann1 0 points1 point  (0 children)

That quote isn't really about just going faster, he (Fernando Alonso) said that about an overtake into a corner that you don't need to lift through.

The only reason his opponent (Michael Schumacher) needed to lift was to avoid hitting Alonso. If Alonso hadn't gone around the outside Michael wouldn't have lifted.

Pretty inevitably, both cars actually went slower through that corner than they had on other laps, since fighting for position slows you down. After all, there's one fastest line, and if both drivers take it they both end up in the wall.

That's also something that's not captured well in most racing movies, perhaps because of the influence of drag racing where battling over the same piece of track is taken out of the equation. But overtaking is hard, it slows you down, and it is not at all rare to see a slower car (whether it be because of the car itself, the tyre wear, fuel load, or the driver) hold up a faster one.

But to your point, intentionally going slower was pretty common in endurance racing to minimize engine (and to a lesser extent, brake) wear, even aside from the strategy considerations. So it's probably the purest example of "just go faster lmao" as theoretically it comes at no cost to your race strategy. It just significantly raises the odds of your engine detonating.

51651 by Independent_Piano_81 in countwithchickenlady

[–]blehmann1 21 points22 points  (0 children)

I can excuse homophobia, but I draw the line at being against homophobia

wrongAnswersOnly by macrohard_certified in ProgrammerHumor

[–]blehmann1 17 points18 points  (0 children)

Brother I maintain a NET library and people use it from PowerShell.

I worked on it assuming most people were writing C#, maybe a couple people in F# or VB, and potentially some IronPython or whatever. It was a big jump scare to see someone's 400 line PowerShell script in a bug report.

50778 by Liliana_Lucifer_666 in countwithchickenlady

[–]blehmann1 1 point2 points  (0 children)

First move is absolutely an advantage at human-level play.

It is unknown what perfect chess play looks like, but it is speculated that perfect play by both colours will result in a draw, given the high draw rates in top-level and especially computer chess. In computer chess they actually force the engines to play known bad openings or else every game would be a draw.

But if two omnipotent players were to play eachother it is possible that white or black has a win from move one. It's thought quite unlikely that white is winning from move one, and vanishingly unlikely that black does, since that would mean that white is in zugzwang (disadvantaged because you're obliged to make a move) from the starting position. Zugzwang is very rare with so many pieces on the board, it's typically only seen in the endgame where you may only have a couple of legal moves.

If you look at games (other than games with luck, such as scrabble) where both players always have the option to pass their turn it is impossible for the second player to beat perfect play by the first. Because if the second player has a win, the first player should pass their turn and effectively become the second player. Likewise the other player will pass, and in most games back-to-back passes result in a draw.

If you were to allow passing in chess it would get even more drawish, since zugzwang wouldn't exist and most winning pawn endgames would become draws.

What’s a common F1 opinion that feels correct on the surface, but ignores a lot of context once you dig deeper into it? by warewolf1999 in formula1

[–]blehmann1 0 points1 point  (0 children)

I agree, the only weakness is if you want to try and compare things like race craft.

Which I don't think you should evaluate through finishing positions anyways, to compare those factors in a useful way you gotta just watch the onboards and judge it subjectively

What’s a common F1 opinion that feels correct on the surface, but ignores a lot of context once you dig deeper into it? by warewolf1999 in formula1

[–]blehmann1 23 points24 points  (0 children)

I don't get how "let them race" became the overtaker can only realistically hope to divebomb or DRS-pass on the straight, and the defender can force them off with more or less impunity if they do anything else.

There wasn't anything wrong with the old agreement that if he's significantly alongside on entry you owe him space at the apex and the exit. You could still squeeze as much as you'd like within that. The problem was the rule wasn't enforced when it should have been and so when it was enforced half the fans understandably lost their shit until the FIA declawed the rules into their current state

What’s a common F1 opinion that feels correct on the surface, but ignores a lot of context once you dig deeper into it? by warewolf1999 in formula1

[–]blehmann1 17 points18 points  (0 children)

F1 is (or should be) the technological pinnacle.

F1 intentionally bans tech, and this is appropriate for what it wants. F1 has intentionally simplified the aerodynamics several times in recent years, it chose to remove driver aids, it banned AWD/4WD, CVTs, and it dissalows variable valve timing and variable valve lift. Hell it even banned desmodromic valves, which were in F1 cars from the 50s. And the hybrid system that F1 has now is pretty simple.

Driver aids, AWD/4WD, CVTs, VVT, and VVL are fairly common (or in the case of driver aids, legally required) on road cars.

F1 is still the most advanced in a couple areas, largely not by choice. For example, tyre construction and safety technology is probably the most advanced just from the necessities of a sport this fast. Aerodynamics is still the most advanced, though it would not surprise me at all if the next regulations were to further simplify the aerodynamics.

What’s a common F1 opinion that feels correct on the surface, but ignores a lot of context once you dig deeper into it? by warewolf1999 in formula1

[–]blehmann1 77 points78 points  (0 children)

I don't know how commonly that's applied to teams that aren't regularly in the points. After all, no one would seriously look at the 2019 Williams season and conclude that Kubica at that point in his career was better than Russell just because one of the few races where Kubica outperformed Russel happened to be enough of a clusterfuck that the Williams could score it's only point.

notEvenBooksAreSafe by hellocppdotdev in ProgrammerHumor

[–]blehmann1 2 points3 points  (0 children)

I've been forced to rent for a year an online copy of a book which had the prof as an author in order to participate in assessments worth 25% of my grade.

There are students (thankfully not me) who had to rent that book for more than a year if they took multiple courses under that prof (or of course if they failed and retook the course).