HackerTrans
TopNewTrendsCommentsPastAskShowJobs

onetoo

no profile record

comments

onetoo
·6 месяцев назад·discuss
The equivalent in python-metaphor-land would be that python files clearly designate whether they are py2 or py3, and a single python interpreter can run both py2 and py3 scripts, as well as cross-include files of each version without issue.

Rust editions only (and rarely!) break your code when you decide to upgrade your project's edition. Your public API stays the same as well (IIRC), so upgrading edition doesn't break your dependents either -unless they don't have a new enough version of the compiler to support said newer edition.
onetoo
·в прошлом году·discuss
IIRC it's a single ministry with not a lot of machines (in the order of 100). Definitely not as newsworthy as it's being made out to be, but viability has to be confirmed before a larger rollout can be done, I suppose.
onetoo
·в прошлом году·discuss


  > Even more annoying is that I have to duplicate the iterator code: as I often work with frames that may be flipped bottom-up I want to write code like
  >
  >    let mut iterator = if !flipped {
  >       data.chunks_mut(stride)
  >    } else {
  >       data.chunks_mut(stride).rev()
  >    };
  >    for line in iterator { ... }
  >
  > but I can’t since objects have different type (and probably size) and there’s no realistic way to coerce them to the same interface.
For this specific case there is a relatively ergonomic solution using dynamic trait objects + temporary lifetime extensions, available since Rust 1.79:

  let iterator: &mut dyn Iterator<Item = _> = if !flipped {
    &mut data.into_iter()
  } else {
    &mut data.into_iter().rev()
  };
  for line in iterator { ... }
Alternatively, if this is not a feasible solution (e.g. we want to return the new iterator to an outer scope, or the overhead of dyn indirection is unacceptable in this context), one can consider using itertools::Either instead:

  use itertools::Either;
  fn conditionally_flip_iter<I: DoubleEndedIterator>(
      data: I,
      flipped: bool,
  ) -> impl Iterator<Item = I::Item> {
      if !flipped {
          Either::Left(data.into_iter())
      } else {
          Either::Right(data.into_iter().rev())
      }
  }
  // ...
  let mut iterator = conditionally_flip_iter(data, flipped);
  for line in iterator { ... }
onetoo
·2 года назад·discuss
This doesn't necessarily find the best parameters, and it doesn't necessarily do it easily. From my reading, it will converge on a local optimum, and it may take some time to do that.

In theory, I don't see why the kernel couldn't have a parameter-auto-tune similar to this. In practice, I think the kernel has to work in so many different domains, it'd be impossible to land on a "globally good enough" set of tuning heuristics.

I'm far from a kernel developer, so I'm ready to be corrected here.

IMO if we ever see something like this deployed widely, it will be because a popular distribution decided to install it by default.
onetoo
·2 года назад·discuss
I obviously can't speak for everyone, but I personally don't know anyone who strongly dislikes the US, and especially not US citizens.

The sentiment I personally hear when talking about the US (and, again, I don't speak for everyone) is more akin to the kind of sympathetic concern you might have for a friend who's become an alcoholic: It pains you to see them hurt themselves like that, but their temper flares when you suggest that maybe they drink just a little bit too much. But they can't be helped until they're ready to admit that they have a problem, unfortunately. So until then, all you can do is pray they don't crash when drunk driving.
onetoo
·2 года назад·discuss
> e.g. it hasn't yet happened in Britain

Granted, I don't follow it closely, but from what discourse I've observed things on the other side of the pond don't seem quite harmonious to me.

> I'm not that sure it was entirely true even in the US between 1940 and 1980 either.

Which does not necessarily disprove the argument. Things were arguably less polarized and better working in the past, but my argument is exactly that the political incentives of a two-party system will eventually cause things to degenerate. The fact that things were once "reasonable politics" but have, over the course of decades, degenerated to "our policy is whatever is the opposite of their policy" is exactly the issue.

> Is it radically different in multiparty systems, though? If you are outside the government coalition you have similar incentives.

Similar, yes, but not necessarily the most effective political move.

If a disenfranchised voter can vote for a third (or fourth) party without their vote "being wasted", a strategizing disenfranchised voter no longer "has" to vote for a "least-worst" option in order to avoid the "most-worst" option.

In that case, painting your opponent as "even worse" does not necessarily win you votes. If it does, it likely also gives votes to the other parties in your political sphere, and if they get enough votes to make a coalition government without you, why should they bother to include someone whose primary policy is being a troublemaker?

---

To be clear, no system is perfect. I don't know what the best is, I just know it's not FPTP. The primary argument I am trying to make is that the polarization we see now is the inevitable (long-term) outcome of a two-party system, and that a two-party system is the inevitable outcome of winner-takes-all FPTP.
onetoo
·2 года назад·discuss
> Thankfully US has all sorts of checks and balances and it might take a while for a single party to get control of the House, Senate, White House and the Supreme court

The fact that "it is good when government is deadlocked and ineffective" is an actual argument people use is baffling to me, but for the sake of the argument and out of assumed mutual respect, I'll do my best to stay objective for following:

> IMHO electoral systems matter but extreme polarization is the real problem

I absolutely agree that extreme polarization is a major issue.

I believe that FPTP inevitably leads to extreme polarization, when given enough time: FPTP inevitably converges to a two-party system (due to strategic voting), and a two-party system inevitably leads to extreme polarization (due to strategic politicians playing into strategic voting).

The argument for the latter goes something like this: Disenfranchised voters can be coaxed to vote for a least-worst option when the most-worst option looks worse enough. So it becomes more politically effective to demonize your opponent rather than argue your own politics.

Additionally, it is politically beneficial for you when things stay bad while your opponent is in charge, and especially so if things get worse. You can use their perceived incompetence as ammunition to further demonize them. So it becomes beneficial to use what government power you might have in order to hinder your opponent's attempts at improving things, even if what they're trying to do is something you agree with and would yourself do if you were the one in power.

Depending on your preferred political party, I'm sure you can think of examples of the above.
onetoo
·2 года назад·discuss
Not from Berlin, but I imagine it is similar: It is usually the case that the more shady your "kebab pusher" is, the more delicious the kebab is.

If the sign says one price, the cashier says a second, and the cash register says a third? You've found the best kebab in town.
onetoo
·2 года назад·discuss
Also from EU, additional tidbit: Not being a first-past-the-post two-party system allows for political parties to be more nuanced than a simplified left-right spectrum.
onetoo
·2 года назад·discuss
Not just private chat, almost any chat channel can be used[1]. It's quite common for certain addons to quietly share their versions upon e.g. joining a group, so that you get a notification if a new version is out. It's a bit of a longer explanation, but another fun example of out-of-band privileged information in World of Warcraft:

The "fight" between Blizzard's boss design and addon creators trivializing said encounters is long and not worth going deeply into. But, for example, if the strategy of a boss is "if you get a glowing glyph over your head, run over there and stand in a square formation with the other guys with glowing glyphs", an addon could use hard-to-ignore sounds and visuals to tell you that a) you have to run now, and b) exactly which corner of the square formation to run to.

I believe that in the latest raid, the developers tried restricted certain information from the API (e.g. "there is a glyph over the player's head") in an attempt to reduce that kind of strategy automation. The players then proceeded to manually feed this information (e.g. "i have a glyph over my head") into their addons using buttons mapped to API calls like this, allowing for partial automation (e.g. "your corner in the formation is top-left"). This stirred quite the drama, but the that's besides the point.

[1] https://wowpedia.fandom.com/wiki/API_C_ChatInfo.SendAddonMes...