Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
xnorswap
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
721.
▲
by
xnorswap
2y ago
That's a top tip, thanks, I had no idea about that feature.
722.
▲
by
xnorswap
2y ago
If you don't have an automatic formatter, then you'll find you get messy diffs when it's worked on by someone who does have an automatic formatter. Worse still, you'll find you get messy diffs in constant ping-pong becau
723.
▲
by
xnorswap
2y ago
What prompts are you using for the space station? I think it pretty much nails it after some prompt tweaking. First attempt: https://cdn.midjourney.com/686f364f-188f-4065-813f-b45d21972... Tweaking to specify spokes around
724.
▲
by
xnorswap
2y ago
I have to say I'm very impressed. I've previously used free generators for generating scenery for my D&D campaign, and running a prompt here that previously took me dozens of tweaks to get something reasonable, instantly retur
725.
▲
by
xnorswap
2y ago
My favourite anti-pattern: Focus all your effort on catching errors that a linter and auto-formatter could catch. Shrug when questioned about architectural decisions, what really matters is that this field was PascalCase when it should be c
726.
▲
by
xnorswap
2y ago
Ah, thank you, navigating the nesting on here is difficult sometimes and this has proven a very contentious topic!
727.
▲
by
xnorswap
2y ago
I'm essentially assuming the UK lottery (from 96-200x) rules, where players: Pick 6 numbers from 49, so odds are independent, and roughly 1 in 14m. The prize jackpot is determined from a set percentage from the ticket sales, and is sha
728.
▲
by
xnorswap
2y ago
The key here is that you don't care what happens when you don't win, you don't care how much other people win. What you care about, is the expected amount you win, given that you have a winning ticket. Let's say there ar
729.
▲
by
xnorswap
2y ago
Right, I didn't spell out the format of the lottery. I'm assuming a "pick X numbers from Y" format, rather than a raffle style lottery. This allows for multiple independent winners.
730.
▲
by
xnorswap
2y ago
You said my conclusion was wrong (edit: Apologies, I confused the nesting level here), then proved it correct by calculating the expected number of winners given you win as 3/2.
731.
▲
by
xnorswap
2y ago
> Which is clearly impossible. It's just like the average pupil being in a larger than average class size, it's not impossible! Take a situation where you have 499 lotteries with zero winners, and 1 lottery with 1000 winners. T
732.
▲
by
xnorswap
2y ago
I haven't "snuck in" anything, I very explicitly stated that it's the conditional expectation I'm talking about. Expected(Number of winners | Pop size N and You win) = 1 + Expected(Number winners | Pop size N-1) Fo
733.
▲
by
xnorswap
2y ago
For anyone unconvinced, let's simulate this. Instead of 1 in 14 million, we'll just do 1 in 2, and 8 players. So we'll check how many bits are set in the average random byte: void Main() { byte[] buffer = new
734.
▲
by
xnorswap
2y ago
No, it's 1+average number of winners. If the odds of winning are 1 in 14 million, and 28 million tickets are sold, then you expect there to be 2 winners. If look at your ticket and see you've won the lottery, then the odds of winn
735.
▲
by
xnorswap
2y ago
My favourite corollary of this is that even if you win the lottery jackpot, then you win less than the average lottery winner. Average Jackpot prize is JackpotPool/Average winners. Average Jackpot prize given you win is JackpotPool
736.
▲
by
xnorswap
2y ago
Appears to be a blogspam version of the source it mostly quotes from: https://github.com/rayfrankenstein/AITOW
737.
▲
by
xnorswap
2y ago
Fair enough, I haven't had that experience, it was a fun read in any case.
738.
▲
by
xnorswap
2y ago
I agree, that section read as a post-hoc justification given how much effort went into it. If the effort to determine if something is "worth" entering is more than the effort to enter it, it would be better to just enter it rather
739.
▲
by
xnorswap
2y ago
Powershell fixed that issue and faces an incredible amount of snobbery and developers dismissing it because they mock the "Verbosity" of commands like: Get-Content -Tail 20 -Wait Nevermind that it has tab-completion of n
740.
▲
by
xnorswap
2y ago
This is way more common than you'd like, here's a scenario where it can happen even without outright incompetence: Someone (or some AI) copies an example auth implementation from stackoverflow. Being sensible they realise they sho
741.
▲
by
xnorswap
2y ago
Wouldn't Apple users have to pay $14.29 for there to be $10 left after a 30% cut?
742.
▲
by
xnorswap
2y ago
Is the advertising board behind faked then? Shouldn't that be static relative to the finish line, and therefore not really show up?
743.
▲
by
xnorswap
2y ago
Indeed, this article would read just as well after applying s/\bgo\b/C#/ig, or should I say: Regex.Replace(articleText, @"\bgo\b", "C#", RegexOptions.IgnoreCase); Or indeed most general purpose la
744.
▲
by
xnorswap
2y ago
Thanks for that correction.
745.
▲
by
xnorswap
2y ago
If they are small, then there can be a significant performance advantage to using a struct. Imagine you have a Dictionary<TKey,TValue>. (That is, a dictionary (hash lookup) from type TKey to type TValue ). Imagine your choice of key i
746.
▲
by
xnorswap
2y ago
While you're right that Silicon Zeroes is not the best as a zach-like puzzle game, I actually found it did a better job of teaching me about building a computer than most similar games. However, I played it years before Turing Complete
747.
▲
by
xnorswap
2y ago
Google "Safe Browsing" promoting incredibly unsafe habits. How long before someone recreates this "prompt" in a page or addon and cons people out of their passwords?
748.
▲
by
xnorswap
2y ago
There's a better rebuttal(*) of CAP in Kleppmann's DDIA, under the title, "The unhelpful CAP theorem". I won't plagiarize his text, instead the chapter references his blogpost, "Please stop calling databases CP
749.
▲
by
xnorswap
2y ago
Some recommendations: Shell: Powershell. It takes some getting used to dealing with objects rather than the "everything is a file/string" world of unix/linux but once you adjust to that, it's wonderful. Toy programm
750.
▲
by
xnorswap
2y ago
I've tried this exact scenario and they're really not great. They fall down when you want to partially collapse the trace. Mermaid supports either fully-collapsed, which will re-order your items, or not collapsed at all.
More ›