Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
codebje
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
23 ms
·
391.
▲
by
codebje
6y ago
GHC's REPL supports turning type errors into crashes when the ill-typed expression is used, which lets you test one part of code while another part is broken. I think you can even extend that to compiled code, for an authentic "it
392.
▲
by
codebje
6y ago
CircuitHub is apparently built with Haskell. It's the most polished PCB manufacturing quote system I've seen, but "significance" is relevant. (Plus I've never actually used their service, since it's not priced
393.
▲
by
codebje
6y ago
Carrier grade NAT puts thousands of users behind the same IP address - that's what it's for. You can't put 10k people behind each IP and not have problems. That's 6.5 ports per person, you need one for each connection. P
394.
▲
by
codebje
6y ago
I'm afraid I don't recall. I suspect that they could not have been, based on best practices for performance at the time and the fact that the problem existed at all. I did, however, find a reference to the problem: https:/&#
395.
▲
by
codebje
6y ago
There's something like a 256 count limit on total websockets, and 30 per domain, in Chromium. A malicious website could open up 256 websockets and as many HTTP connections as the browser allows, and that might be enough to swamp cheape
396.
▲
by
codebje
6y ago
You can overwhelm a NAT in several ways. UDP is connectionless, but typically a UDP communication is bidirectional. This means a NAT needs to inspect UDP packets and retain a mapping to direct incoming UDP packets to the right place. With n
397.
▲
by
codebje
6y ago
One delegates authority, not accountability.
398.
▲
by
codebje
6y ago
The only place I can find that makes the 3-SAT claim is this comment thread. Nevertheless, there's two answers I can think of here. The first is simple (but IMO probably not right): 3-SAT is (probably) exponential, but the language def
399.
▲
by
codebje
6y ago
I assume GP means general recursion. Recursion in a pushdown automata (the equivalent machine for a CFL) is bounded by the input words being consumed, since each state transition consumes one input token. Since all input words are finite, i
400.
▲
by
codebje
6y ago
> The problem is I'd rather make a medium size changes to a simple system than a minor change to a complex system. The risk there is you (or someone else less disciplined on your team) doesn't make the medium size change. They
401.
▲
by
codebje
6y ago
You may prefer for foo in maybeFoo { ... } This (AIUI) isn't valid Dart code though, but this would be: maybeFoo.forEach((foo) { ... })
402.
▲
by
codebje
6y ago
A programmer will still need to write correct code, but in your first example the error happens at the boundary between two modules. In the second example, the error is fully contained within one module. One of those two is easier to spot,
403.
▲
by
codebje
6y ago
Java's checked exceptions aren't (usefully) polymorphic. You can't write, for example: R process<R, E extends Exception>(ThrowingFunction<Long, R, E> processor) throws E { ... } You could write "proc
404.
▲
by
codebje
6y ago
This is true, but I also attach some value to avoiding the electronic waste of throwing out an iPad with mostly working parts.
405.
▲
by
codebje
6y ago
A new iPad is around AU$500, a replacement LCD is around $35, a replacement digitiser around $25, and the tool set around $15. The expensive part is labour. If you're willing to risk some time and money on failure you can have a go you
406.
▲
by
codebje
6y ago
When I say range types I mean a type like '5..23' - a sub-range of some other type. Haskell doesn't have these. Most languages don't - one example that does is Ada: https://en.wikibooks.org/wiki/Ada_
407.
▲
by
codebje
6y ago
In the Length case I'm more suggesting to use an unsigned integer type than any more complex type system trickery to specifically limit the range. There are type systems that let you declare a new type to be a sub-range of an existing
408.
▲
by
codebje
6y ago
Can you subtract lengths as in "let length3 = length1 - length2" ?
409.
▲
by
codebje
6y ago
You're combining acceptable structural representations with validated as correct inputs - this is a trap to be careful of. It's real-world data, which is rarely 100% clean and correct. If you can only represent clean and correct d
410.
▲
by
codebje
6y ago
In Haskell, you would use an algebraic data type that can only hold legal values. You would typically only use a newtype when you're just giving a new name to the same type. Having a Magnitude newtype over Int doesn't change the r
411.
▲
by
codebje
6y ago
If you wanted to be able to test your MS Paint clone, you might implement your drawing core without being dependent on a window existing. An off-the-cuff approach might be to have the core define a canvas interface with the rendering primit
412.
▲
by
codebje
6y ago
Hemangioma in my case. I had an MRI but in the end it was a surgeon with the right experience looking at an earlier ultrasound that diagnosed it. I had trouble believing he'd diagnosed it when he glanced at the ultrasound and calmly sa
413.
▲
by
codebje
6y ago
I had pain and weakness in my right wrist for years, and also had many rounds of misdiagnosis. It turned out to be a benign tumour. Surgery was my answer, but it's only a partial one. It's a soft tissue tumour, the surgeon didn&#x
414.
▲
by
codebje
6y ago
Thanks, I'd forgotten the Gameboy wasn't actually a z80 and never knew about the master system!
415.
▲
by
codebje
6y ago
That would have been a specific machine built around the Z80. The Z80 CPU has a 16-bit address bus and can handle 64K of memory. It has an 8-bit I/O bus, but it was common for Z80-based machines to use memory-mapped I/O like the 6
416.
▲
by
codebje
6y ago
If you can, you should. If you can't, it's (IMO) because you're stuck with the burden of having to write and maintain that code. If it's an asset, why not just write more?
417.
▲
by
codebje
6y ago
I mean that source code comes with costs, often substantial, but has no direct benefits. It's easy for us as developers to think that source code is valuable - but this leads to problems like never removing code "in case it's
418.
▲
by
codebje
6y ago
A company's codebase is a liability, not an asset - it needs to be maintained, and as you point out, it needs money spent on tooling and infrastructure to be most effective. Unless you happen to be one of the very rare companies that s
419.
▲
by
codebje
6y ago
Type systems limit the set of programs accepted by the compiler. A sound type system will reject every bad program - but also may reject some good programs. Type systems therefore also will have escape hatches to let the programmer overrule
420.
▲
by
codebje
6y ago
Scott Meyer's "Magic 2.0" series is more or less this idea.
More ›