Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ChrisSD
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
91 ms
·
901.
▲
by
ChrisSD
7y ago
There is an option but you have to use Firefox to enable it. For whatever reason Google doesn't give AMP links to Firefox users.
902.
▲
by
ChrisSD
7y ago
That's in the best case. It's worse when a link gets broken or redirects to an irrelevant page. They seem to break a large chunk of links every year or so.
903.
▲
by
ChrisSD
7y ago
Previous discussion: https://news.ycombinator.com/item?id=20240106
904.
▲
by
ChrisSD
7y ago
> You do realise an enum can have any number of variants, not just 2? Yes, that's what makes it more generic than Result. Indeed that's the only practical difference except for a few helper functions and a #[must_use] (which on
905.
▲
by
ChrisSD
7y ago
What Result? Result is a generic not a specific type. It's essentially a shorthand instead of manually writing out the enum yourself. More fundamentally I disagree that Either makes Result redundant. Result has semantic meaning that&#x
906.
▲
by
ChrisSD
7y ago
var ASM_CONSTS = [(function(){ var err = new Error; print('Stacktrace: \n'); print(err.stack) } // ... The issue is that print call. They expect it to call their own print function.
907.
▲
by
ChrisSD
7y ago
Rust's "generic as possible" type is an enum. Result is a specialization meant for common error handling.
908.
▲
by
ChrisSD
7y ago
It's not even testing prefixes, it's testing the whole string. It's the equivalent of: process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' Though I don't know enough about V8 to
909.
▲
by
ChrisSD
7y ago
The first commit on git boils down to: function isWindows() { if (typeof process === 'undefined' || !process) { return false; } return process.platform === 'win32'; }
910.
▲
by
ChrisSD
7y ago
I think learning some assembly is essential for any student that wants to use a low level programming language. It's a good way to learn not only about pointers but also the stack, registers, etc. I don't mean they need to be able
911.
▲
by
ChrisSD
7y ago
I'm semi-convinced the reason many people have a problem understanding pointers is because C makes them needlessly confusing. Or at least in my experience people struggle more with C pointers than they do with learning assembly.
912.
▲
by
ChrisSD
7y ago
That said, Mozilla did use to have the experimental `mozmm` unit that attempted to accurate represent the millimetre. However it was removed a few versions back.
913.
▲
by
ChrisSD
7y ago
The trouble with bookmarks is they take conscious effort to create and maintain. The trouble with history is that it's a soup of every random page you've ever visited. The trouble with tabs is they're a collection of web page
914.
▲
by
ChrisSD
7y ago
That's weird I was about to disagree with you but then I refreshed the page and had the same problem. The debug console showed a lot of content security policy violations for inline scripts. After some more refreshes it came back. The
915.
▲
by
ChrisSD
7y ago
Chrome and AMP do seem to be part of Google's long term strategy. I don't see them dropping either anytime soon. Well ok they may drop AMP if they finally get it all integrated into the various web specs. but that's a distinc
916.
▲
by
ChrisSD
7y ago
It is different but not necessarily better. Where IE got really bad is when they stopped developing it. Development really slowed after 5.5 and once 6 was the undisputed champion they just left it to rot. Whatever else can be claimed about
917.
▲
by
ChrisSD
7y ago
Yeah, on reflection you're right about that. At the time when the language matched the hardware the abstraction was much more literal. It was only when they diverged that optimizing compilers were needed and all the complexity was intr
918.
▲
by
ChrisSD
7y ago
C can be quite complex once you get into all the abstractions it's using. And even for newbies I think the whole syntax around pointers is unnecessarily confusing (or at least people are often confused by it in a way they usually aren&
919.
▲
by
ChrisSD
7y ago
IMHO, mostly due to history and some caution. A thoroughly oversimplified history would go something like this: In days past a lot of medicine was based on what seems to work or what ought to work. Unless the effect is really obviously disa
920.
▲
by
ChrisSD
7y ago
I'm sorry if I was unclear but my point was that when you receive a string from the Windows API you cannot make any assumptions about it being valid UTF-16. Therefore converting it to UTF-8 is potentially lossy. So if you then convert
921.
▲
by
ChrisSD
7y ago
Wikipedia is wrong on the technical details. E.g. the filesystem accepts any sequence of WCHARs, whether or not they're valid UTF-16: https://docs.microsoft.com/en-us/windows/desktop/FileIO/nami...
922.
▲
by
ChrisSD
7y ago
That very much depends on what you're doing. Constantly reencoding between UTF-16 and UTF-8 would be pointless. Not to mention that "UTF-16" on Windows usually means UCS-2, so you risk losing information if you reencode. But
923.
▲
by
ChrisSD
7y ago
There's also the issue that it will lie to you if the alogrithm decides it simply doesn't like you. Which means you'll end up doing at least a couple of rounds before it decides to let you through.
924.
▲
by
ChrisSD
7y ago
Sure it has its uses for simple obfuscation but in that case my central point is relevant. It's only good for obfuscating ASCII letters. Btw what's commonly known as Caesar cipher (aka shift cipher) is a generalisation of Caesar&#
925.
▲
by
ChrisSD
7y ago
Caesar ciphers? I believe they are well defined, yes. Although ROT13 itself only dates back to maybe the 70's or 80's. Besides, I was honestly just using this as an excuse to make a more general point. I've grown frustrated w
926.
▲
by
ChrisSD
7y ago
Technically ROT13 can only handle 26 characters. The "good" version would be to deny any inputs outside an accepted character set. Ok so this doesn't really matter for a joke algorithm like ROT13 but in more serious cases it&
927.
▲
by
ChrisSD
7y ago
That is how PATH works. An installer would have to be doing something seriously wonky to get that wrong.
928.
▲
by
ChrisSD
7y ago
No. This feature is essentially just a link to the Microsoft Store page for Python. The C89 issue is completely unrelated.
929.
▲
by
ChrisSD
7y ago
Indeed. The blog link gives much more detail and context then the guide.
930.
▲
by
ChrisSD
7y ago
I find this interesting because it's an easy pattern in Rust and yet very difficult to emulate in most other languages.
More ›