Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mtlynch
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
56 ms
·
781.
▲
by
mtlynch
3y ago
I tried it out, but it froze up my browser on Firefox + Windows on a pretty well-resourced desktop. The page loaded fine, but when I hit "Play" everything ground to a halt, and even scrolling the page up and down had a 3-5 second
782.
▲
by
mtlynch
3y ago
> The dual problem would be any function which forgets to accept a ParsedString instead of a string can skip parsing. > Both cases appear to depend on there being a "checkpoint" all data must go through to cross over to the
783.
▲
by
mtlynch
3y ago
Thanks for that explanation! I hadn't appreciated that aspect of "parse, don't validate," before. But even with that understanding and from re-reading the post, that seems to be an extra safety measure rather than the es
784.
▲
by
mtlynch
3y ago
I'm not a Haskell developer, so it's possible that I misunderstood the original "Parse, Don't Validate" post. > If you are doing the validation inside of a constructor, you are still doing validation instead of p
785.
▲
by
mtlynch
3y ago
The problem is that pattern "fails open." If anyone on the team forgets to define an untrusted string as UnvalidatedString, the data skips validation. If you default to treating primitive types as untrusted, it's hard for som
786.
▲
by
mtlynch
3y ago
In Go, capitalized identifiers are exported, whereas lowercase identifiers are not. In the example I gave above, clients outside of the package can instantiate Username, but they can't access its "value" member, so the only w
787.
▲
by
mtlynch
3y ago
The problem there is that you lose the guarantee that the parser validated the string value. A caller can just say: // This is returning an error for some reason, so let's do it directly. // username, err
788.
▲
by
mtlynch
3y ago
I'm not familiar with that package structure, unfortunately. It might be good, but I'm not sure what the reasons are for structuring the project that way.
789.
▲
by
mtlynch
3y ago
> The Valid method takes a context (which is optional but has been useful for me in the past) and returns a map. If there is a problem with a field, its name is used as the key, and a human-readable explanation of the issue is set as the
790.
▲
by
mtlynch
3y ago
Not OP, but I design my Go projects with a very similar pattern that I learned from OP's 2018 post. I think this is a pretty good example of a real-world implementation: https://github.com/mtlynch/picoshare Partic
791.
▲
by
mtlynch
3y ago
I really like Mat Ryer's work, and I've applied most of the ideas in the 2018 version of this article to all of my Go projects since then. The one weak spot for me is this aspect: > NewServer is a big constructor that takes in
792.
▲
by
mtlynch
3y ago
> I ended up just setting up an endpoint that reverse-proxies the RSS feed served by the platform on my own domain. I did the same thing and eventually felt like it was too complicated to maintain a service just for that, so I switched
793.
▲
by
mtlynch
3y ago
Yes! That's the one. Thanks so much. That had been gnawing at me.
794.
▲
by
mtlynch
3y ago
I recall a HN user whose GitHub username was some common word related to software development (like @deploy or @prod, but I can't recall the right name). There was a thread about six months ago mentioned that they get @'ed constan
795.
▲
by
mtlynch
3y ago
I've had a heat pump in my home in the US for the past five years, and it's worked pretty well, but one of the things I've found frustrating is that either the pumps or the installers assume you need to run every indoor unit
796.
▲
by
mtlynch
3y ago
Yes, but I don't really think of that as hidden control flow. I know that if foo() returns, bar() will execute next, but foo() might not return (due to panic, program shutdown, or infinite loop). From my experience, when there's s
797.
▲
by
mtlynch
3y ago
It means that control flow is determined by the code you're looking at. "if" and "switch" determine control flow, but you can see the control flow when you're reading that code. In languages like C++ and Java,
798.
▲
ArchiveBox Is Super Cool
(mtlynch.io)
3 points
by
mtlynch
3y ago
|
4 comments
799.
▲
by
mtlynch
3y ago
I'd love to adopt this strategy as well, but I worry about the clinic eventually forcing me to pay somehow and adding a bunch of penalties on top. Is there a way to mitigate that risk? Or is that risk unlikely in a way I'm not con
800.
▲
by
mtlynch
3y ago
> I made an newsletter where I dump all my really good business ideas onto that I don't have the time to go do. I feel like the people who typically generate ideas like this tend to be disconnected from actually executing ideas and
801.
▲
by
mtlynch
3y ago
> Maybe I'm a whistleblower with thousands of files, but I don't want to release them all right now. This tool allows you to easily prove that a file you release later was part of the original collection. That makes it more co
802.
▲
by
mtlynch
3y ago
> Use case > Let's say you have a bunch of files in your ~/Documents folder, some public, some private. Run merkdir on the directory, and you get a root hash which anonymously represents all your documents. Now you can publ
803.
▲
by
mtlynch
3y ago
This is neat! Thanks for sharing! One thing I've been looking for (and would pay money for) is a tool/game that helps me improve my typing speed in real-world scenarios, especially writing code and/or editing documents. I pur
804.
▲
by
mtlynch
3y ago
I would agree that people are giving Medvednikov an unreasonably hard time if he learned from his mistakes, but everyone kept bringing up his past anyway. But it just seems like Medvednikov keeps repeating the same patterns over and over. H
805.
▲
by
mtlynch
3y ago
The creator of V repeatedly appears on HN with incredible claims about a new thing they're going to supposedly release soon. I don't think it's "rehashing the past" to point out that a person's new incredible c
806.
▲
by
mtlynch
3y ago
Ah, yes. My mistake.
807.
▲
by
mtlynch
3y ago
I make one that I put a lot of effort into documenting: https://github.com/tiny-pilot/tinypilot It's pretty easy to extend since it's just Python and vanilla HTML/JS/CSS, so there's not much of
808.
▲
by
mtlynch
3y ago
Isn't the JS exfiltration part trivial? The attack assumes that the victim is visiting an attacker-controlled web server. If the attacker can put secret data in the DOM within the victim's browser, the attacker can also add JS on
809.
▲
by
mtlynch
3y ago
I found this a bit too abstract to follow. It would be helpful if the article explained a practical scenario where you'd want to use this technique. The only explanation is "Packet redirection is taking a packet from one network i
810.
▲
by
mtlynch
3y ago
Using it to benchmark C is a cool idea. I hadn't thought of that! Thanks for sharing!
More ›