Two Wrongs
two-wrongs.com · Personal blog · on HN since 2015
Two Wrongs is a personal blog on statistics, software design, Emacs, Awk, and decision-making.
What HN saysCommenters cite its Awk state machine parser pattern and statistical literacy essay, and one flags a site that copies its content.
74HN people shared it
13linked it in comments
184stories submitted
3.1Kstory points
2 years agolast shared
2015people per year2026
Most-shared posts
- 1Statistical Process Control: A Practitioner's Guide (2022)5 people · 89 points · first shared 2022 · 46 comments on HN
- 2Practices of Reliable Software Design5 people · 17 points · first shared 2024 · 1 comments on HN
- 3Buying into the Emacs Platform (2018)4 people · 258 points · first shared 2018 · 133 comments on HN
- 4The Awk state machine parser pattern (2018)4 people · 175 points · first shared 2018 · 27 comments on HN
- 5Huffman Codes – How Do They Work?4 people · 9 points · first shared 2023 · discussion on HN
- 6The Misunderstood Kelly Criterion4 people · 5 points · first shared 2023 · discussion on HN
- 7Tindall on Software Delays4 people · 4 points · first shared 2023 · discussion on HN
- 8The Bug in the Physical Building3 people · 167 points · first shared 2016 · 32 comments on HN
- 9SI Units for Request Rate3 people · 140 points · first shared 2024 · 91 comments on HN
- 10Common Mistakes in Modularisation3 people · 104 points · first shared 2024 · 26 comments on HN
- 11The “What Are Monads?” Fallacy3 people · 45 points · first shared 2015 · 86 comments on HN
- 12Parser Combinators: Parsing for Haskell Beginners3 people · 8 points · first shared 2016 · discussion on HN
- 13Event Sourcing and Microservices – Unix Style3 people · 5 points · first shared 2023 · discussion on HN
- 14Homepage3 people · first shared 2018
- 15Code reviews do find bugs2 people · 224 points · first shared 2024 · 160 comments on HN
What HN people wrote when they linked it
kqr · 2024-09-05
Statistical/empirical thinking for one: https://two-wrongs.com/statistical-literacy
> It emphasises how logic alone might not lead us to the right conclusions, because there are more things at play in reality than in our mental models.
> It suggests that we choose actions by carefully studying outcomes rather than based on what ought to yield the best outcome.
> It tells us that differences in outcomes may not be a signal of differences in controllable antecedents: it is often just the natural variation of the process.
ncruces · 2024-06-08
Yes, you are, if you can't “afford” the loss. And this does not mean that loosing the car bankrupts you.
It just means that reimbursing you for your loss is worth more to you than the insurance company, because it's harder for you to recover form a (e.g.) $10k loss than for the insurance company.
When priced correctly, and depending on your wealth, on average insurance can be a win-win (i.e. profitable) transaction for both parties. That's why it's economically useful.
See: https://two-wrongs.com/the-misunderstood-kelly-criterion.html
mtmail · 2023-06-15
Given that https://www.japedge.xyz/2023/06/top-down-vs-bottom-up-programming.html is a copy of https://two-wrongs.com/top-down-vs-bottom-up-programming.html I recommend blocking the whole domain.
flukus · 2019-03-07
It's usable inline and is great for state machine stuff (https://two-wrongs.com/awk-state-machine-parser-pattern.html), both useful for text processing.
Ethan_Barry · 2024-06-11
You got it! By approximate category and in no particular order:
## MISCELLANEOUS
- [Low Tech Magazine](https://solar.lowtechmagazine.com), a solar-powered website showcasing the amazing low-tech things you can do with a little ingenuity,
- [Stephen Wolfram's Blog](https://writings.stephenwolfram.com) on math, compsci, and everything else,
- [Cool Macrophotography](https://www.barrywebbimages.co.uk/Images/Macro/Slime-Moulds-Myxomycete… for amazing pictures of tiny things (WARNING: Time Sink!),
## COMPUTER SCIENCE
- [While-True-Do](https://blog.while-true-do.io) has lots of stuff on Linux administration and self-hosting,
- [Backend Banter](https://www.backendbanter.fm) for a great podcast on backend development,
- [Two Wrongs](https://two-wrongs.com) for statistics and functional programming,
- [Math ∩ Programming](https://www.jeremykun.com/) where math and programming intersect! Written by a Googler...
- [Paul Bourke's site](https://paulbourke.net/) where you can get happily lost exploring old pages on every topic CS touches,
- [Jason Punyon's blog](https://jasonpunyon.com) for some fun algorithms and things,
- [Yossi Kreinin's blog](https://yosefk.com/blog) for C, Python, and plenty of non-technical topics,
- [Adrian Sampson's academic blog](https://www.cs.cornell.edu/~asampson/blog) for an academic's perspective,
- [Cool polyhedra viewer project](https://georgehart.com/virtual-polyhedra/vp.html) if you like geometry,
- [Another academic blog on…
ptsneves · 2024-06-09
Insurance can benefit the insured and insurer according to Kelly’s criterion depending on respective wealth and risk probability. Have a look at this blog for intuitive examples where insurance is beneficial for both the insurer and insured.
https://two-wrongs.com/the-misunderstood-kelly-criterion.html
The thing that makes or breaks the Kelly criterion is the correct evaluation of risk. If the risk is incorrect then it is garbage-in garbage-out. Due to this uncertainty, people tend to use fractional Kelly criterion.
For a car example, my current car price is a significant proportion of my total wealth and the risk of totalling it is perceived by me to be high, so I pay insurance. I say perceived because in 15 years of driving I never totalled a car.
But now that I understand the Kelly criterion I will account for how expensive it is proportionately to my wealth and figure the cutoff price where I need to get total coverage insurance and how much it costs. It also explains by cell phone insurance and similar are normally not a good deal, the insured asset is worth a small proportion of my wealth.
jacques_chester · 2024-03-06
Oh hey, this is me.
The background is that I've thought about applying SPC to software behavior for a long time[0]. While I was at Shopify I began to think about using it for detecting regressions in the YJIT benchmark suite[1]. My first thought was to code a Ruby library (Shopify is a Ruby on Rails outfit), but I decided that it would be more accessible to more folks if it worked inside a database instead. I got caught in a 20% layoff at Shopify and that somewhat took the wind out of my sails, which is why it's been dormant for a year.
There are some limitations to be aware of in a software context.
First, sample sizes have to be constant. In a world of unreliable systems and networks this is a pretty tough constraint. It could be achieved by taking fixed subsamples at random from a varying larger sample (eg, normally we get 100, pick 50 at random). Switching to variable sample size would be possible, but it will be a lot of work and I haven't had the motivation to tackle it yet. It's also only lightly treated in the main textbook I've worked from, because the usual focus is manufacturing operations where fixed sample sizes are common.
Second, it doesn't deal with non-parametric distributions. Classical SPC is rooted in the Normal distribution, and continues to work quite well with any distribution that has some kind of centrally-located mass that tapers off to the edges. But a lot of software behavior follows power laws, especially Pareto distributions. There is SPC…
robcohen · 2019-11-08
You are correct, that purely functional data structures are slower, but the differences is not as meaningful as you might actually think. Haskell is actually pretty fast, and I'd say for the vast majority of applications, Haskell is just fine performance-wise. See a few examples here: https://two-wrongs.com/on-competing-with-c-using-haskell
inamberclad · 2018-03-15
There's a free compiler called Gnat, but the community is still rather small. I think it's something of a catch-22. Most of the resources you'll find on the internet are old (mid-90s) blogs and educational sites.
Here's some of the better ones I've found:
https://www.adacore.com/gems/
https://blog.adacore.com/
https://two-wrongs.com/tags.html#ada
The official reference manual is freely available too, but it's quite dense.
papaly1983 · 2017-12-31
neonsunset · 2024-08-29
> I've been using .NET for far over a decade now. I even was at one of the hackathons for Windows Phone developers back in the day.
This conversation comes up from time to time. It is sometimes difficult to talk to developers who have a perception of .NET that predates .NET Core 3.1 or so and newer. Windows Phone and its tooling is older. I am sad UWP has died, the ecosystem needs something better than what we have today, and the way Apple does portability with MacCatalyst is absolutely pathetic. In a better timeline there exists open and multi-platform UWP-like abstraction adopted by everything. But these were other times and I digress.
The package distribution did not change significantly besides small things like not having to write .nuspec by hand in most situations. Nuget was already good and far ahead of the industry at the time it was introduced.
The main change was the switch to SDK-style projects files. Kind of like Cargo.toml but XML.
Adding a file to a nuget package (or anything else you build) is just adding a <Content ... /> item to an <ItemGroup>.
Adding custom MSBuild stage or behavior is done via .targets file for packaging purposes: https://learn.microsoft.com/en-us/nuget/concepts/msbuild-props-and-tar…
Which is why I linked you Whisper.net. It has a .targets file that manages platform-specific dependencies: https://github.com/sandrohanea/whisper.net/blob/main/Whisper.net.Runti…
As you can see, it is possible to make…
modernerd · 2019-10-06
This blog post may help some but readers shouldn't expect it to magically flick a switch that allows them to use or create monads.
Instead, I really like:
1. Stephen Diehl's “Eightfold Path to Monad Satori” from “What I Wish I Knew When Learning Haskell”:
http://dev.stephendiehl.com/hask/#monads
“Much ink has been spilled waxing lyrical about the supposed mystique of monads. Instead, I suggest a path to enlightenment:
1. Don't read the monad tutorials.
2. No really, don't read the monad tutorials.
3. Learn about Haskell types.
4. Learn what a typeclass is.
5. Read the Typeclassopedia.
6. Read the monad definitions.
7. Use monads in real code.
8. Don't write monad-analogy tutorials.
In other words, the only path to understanding monads is to read the fine source, fire up GHC, and write some code. Analogies and metaphors will not lead to understanding.”
2. Chris/kqr's “The ‘What Are Monads?’ Fallacy?”, which mirrors the advice from Stephen Diehl:
https://two-wrongs.com/the-what-are-monads-fallacy
“Instead, learn to use specific monads. Learn how Maybe a works, learn how Either e a works. Learn how IO a and [a] and r -> a works. Those are all monads. Learn to use them with the >>= operator and with do notation.
Once you've learned how to work with all of those, you'll have a really good idea of how monads can be used.
Asking "What is a monad?" to learn how to use monads is as wrong as asking "What is a musical instrument?" to learn how to…