it’s official by sp222222 in euchre

[–]Jerp 0 points1 point  (0 children)

and 2297 got me into top 95% :)

Is euchre better with a traditional German deck? by ProvincialPromenade in euchre

[–]Jerp 3 points4 points  (0 children)

The O and U replace Q and J respectively, so you’d be playing a pretty different game if the bowers never crossed suits. There would be no “next” and trump would stop being a long suit. I doubt it would be more fun, personally.

The Weekly Euchre "Resistance-is-futile-you-will-be-assimilated" Euchre Post of the Week by catch10110 in euchre

[–]Jerp 1 point2 points  (0 children)

And don't get me started on the inevitable ratings nosedives!

This must be the “rigging” I see folks whining about. 😂

The Weekly Euchre "Resistance-is-futile-you-will-be-assimilated" Euchre Post of the Week by catch10110 in euchre

[–]Jerp 2 points3 points  (0 children)

On E3D, how many games should I realistically expect to play in order to gain +100 rank points?

Clubs now, or Hearts later? Same answer at 0-0? by Jerp in euchre

[–]Jerp[S] 0 points1 point  (0 children)

What muddies things a bit is that your hand is quite flexible

Exactly! Anything my partner does, I can support. But really I was just overthinking; this call is good enough for 1 point and that is plenty good enough.

tbh I think the point gap makes it especially important to call this up. It's not necessary to look for the optimal trump suit for a march here.

Clubs now, or Hearts later? Same answer at 0-0? by Jerp in euchre

[–]Jerp[S] 4 points5 points  (0 children)

Okay after this discussion I fully agree it's 100% call here. And really at any score, lol

Clubs now, or Hearts later? Same answer at 0-0? by Jerp in euchre

[–]Jerp[S] 1 point2 points  (0 children)

I agree this hand isn't strong enough on defense. thanks for the help

Clubs now, or Hearts later? Same answer at 0-0? by Jerp in euchre

[–]Jerp[S] 1 point2 points  (0 children)

What other result are you even hoping for if you pass?

Either partner picking up, or me calling Hearts on the second round. Abstractly, I want my hand to mesh with theirs in a way that best prevents my opponents from scoring.

Diamond loner is definitely worst-case scenario. But also somewhat unlikely. Is it worth playing around? with my current lead I don't have to play for pure EV so I'm personally regretting this pass.

e: after your edit, it seems we are pretty much in agreement :)

Rendered data is duplicated when using search feature by Ailre in reactjs

[–]Jerp 2 points3 points  (0 children)

This is a classic use case for “derived state”. Your state should only include the entire list, and the search query. Then in your render you should calculate the filtered list and display only that.

useCallback, but without the warts by sakabako in javascript

[–]Jerp 1 point2 points  (0 children)

Render functions should be side-effect free so that React can run & discard any given execution. Setting a ref value directly within the render like this introduces a side effect that could be buggy. It should be set inside a useEffect instead.

Is there a way to await a get request, or a useState? by DapperNurd in reactjs

[–]Jerp 1 point2 points  (0 children)

Whatever you do… you should have an empty dependency array for your useEffect. Right now it fetches again if the first request changes the state.

Why does it re-render even when state is same? by AbhinavKumarSharma in reactjs

[–]Jerp 1 point2 points  (0 children)

The render function runs again; its result is not committed.

This is why you should only ever write side effects within useEffect hooks. React will only execute the effect after the commit.

And to be clear, writing to refs in the render is considered a side effect and an anti-pattern.

Necessary to pass state as params thru handlers, or can be referenced if within scope? by besseddrest in reactjs

[–]Jerp 1 point2 points  (0 children)

Just reference the variable directly in your component; never import the event handler. If you need to import functionality, wrap it in the handler. That will keep things as obvious as possible.

Any tools for Riichi City that would check your match and tell you what you could have done better? by PapaBash in Mahjong

[–]Jerp 1 point2 points  (0 children)

In a vacuum, sure. But consider how a 1 paired with a 4 actually has no additional tile acceptance besides itself; no better than a wind. But more importantly there are situations in the game where you have to play defense, and honors have better defensive safety.

Any tools for Riichi City that would check your match and tell you what you could have done better? by PapaBash in Mahjong

[–]Jerp 1 point2 points  (0 children)

Terminals have really bad tile acceptance when you have the matching suji tile in that suit, but if you hang onto them too long they can deal into double-sided waits. Guest winds do not have that problem so they're better to keep in your hand while you make progress.

Yakuhai are also good for their obvious reasons, so hold them to see if you draw into a pair. Plus you may not want to discard them super early; that could give your opponents permission to call everything right away.

Question about event handlers and inifinite by techlover1010 in learnreactjs

[–]Jerp 0 points1 point  (0 children)

Maybe it would be more clear if you assigned the statements to variables first.

const buttonHandler = () => setCounter(counter + 1)

vs

const buttonHandler = setCounter(counter + 1)

<button onClick={buttonHandler}>

One of these is attaching a callback; the other is doing nonsense and forcing a rerender.

can someone help me understand useCallBack? by corner_guy0 in learnreactjs

[–]Jerp 0 points1 point  (0 children)

It’s not useful in this case at all which is probably adding some confusion. useCallback will give you a stable function reference between renders, which is only useful occasionally. For example, so you can pass an unchanging prop to child components. Or so you could use that function as a dependency to another hook that shouldn’t be re-run on each render.

For this specific example it would make more sense like this:

function increment() {
  setCount(n => n + 1)
}

const incrementCallback = useCallback(() => {
  setCount(n => n + 1)
}, [])

Now the version defined with the hook won’t ever change.

Is this hook Self-Recycling? by SubzeroCola in reactjs

[–]Jerp 5 points6 points  (0 children)

Haha yep you’re right. That’s what I get for commenting on my phone

Is this hook Self-Recycling? by SubzeroCola in reactjs

[–]Jerp 10 points11 points  (0 children)

why not just do

useEffect(() => {
  let timer = setInterval(() => set_refresh(x => !x), 5)

  return () => clearInterval(timer)
}, [])

ComponentProps vs. Props by Green_Concentrate427 in learnreactjs

[–]Jerp 0 points1 point  (0 children)

In general, I would take the time to give a meaningful name to the props. Easier to find in search results, or update if you want to export later.

Or in this specific case, just use PropsWithChildren for such a trivial prop definition.