Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
benhoyt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
57 ms
·
631.
▲
by
benhoyt
12y ago
Thanks for the links -- slides were very helpful. This makes sense.
632.
▲
by
benhoyt
12y ago
What's the rationale for adding integers? I thought the rationale for not having them was to keep the language simpler, and integers 2^53 and less can be store exactly as a (64-bit) float anyway. Is the rationale for adding them so Lua
633.
▲
by
benhoyt
12y ago
Care to flesh that out a bit?
634.
▲
by
benhoyt
12y ago
Great write-up! I expected this to reference a few "normal" language features like static typing, operator overloading, or generics, but instead it was a list of some really neat off-the-beaten-track features: * Run regular co
635.
▲
Understanding JSON Schema
(spacetelescope.github.io)
3 points
by
benhoyt
12y ago
|
0 comments
636.
▲
by
benhoyt
12y ago
This satisfies your problem description: def function(unsorted1, unsorted2): return [1, 2, 3] ;-)
637.
▲
by
benhoyt
12y ago
It's a good thought, and it does seem a much better way to go at face value. However, I strongly suspect there are good technical reasons why you basically need to use canvas, to get the complete, pixel-perfect control over the layout
638.
▲
by
benhoyt
13y ago
Really, that's easy peasy? Looks terrible to a Python programmer. :-) with open('input') as fin, open('output', 'w') as fout: for line_num, line in enumerate(fin, 1): fout.write(
639.
▲
by
benhoyt
13y ago
I can see why you feel it's cheating, but I think it's simply using the right tool for the job -- instead of worrying about which headers to include and what the exact C++ type specification for a map iterator is ... in Python, yo
640.
▲
by
benhoyt
13y ago
I've been interviewing a fair bit lately, and I just really struggle with what you say above. To me if you can't write that simple program in some language without looking at an API or consulting Google at every turn, it feels l
641.
▲
by
benhoyt
13y ago
Yeah, those are nice -- and may actually be more efficient on smaller files, as you're only doing the lower() once on a big string. However, for big files you don't necessarily want to read the whole thing in at once. One nitpick:
642.
▲
by
benhoyt
13y ago
Deliberately-straightforward -- agreed. But "highly proficient" after writing one or two scripts? That's quite a stretch. For instance, one of the questions I give in phone screens is for the candidate to write a program to c
643.
▲
by
benhoyt
13y ago
Per the Python 3 docs (for some reason not in the Python 2 docs, but the same holds): "Only the memory consumption directly attributed to the object is accounted for, not the memory consumption of objects it refers to." Most of th
644.
▲
by
benhoyt
13y ago
Good question -- however, it's not completely static content. The hotel reviews and photos are more or less static (updated only on deployment), however a fair number of the features of the site are dynamic: user accounts, real-time pr
645.
▲
by
benhoyt
13y ago
I'm 2^5. My oldest code online is a Forth compiler I wrote when I was 2^4: https://github.com/benhoyt/third#readme
646.
▲
Saving 9 GB of RAM with Python's __slots__
(tech.oyster.com)
135 points
by
benhoyt
13y ago
|
43 comments
647.
▲
by
benhoyt
13y ago
Neat! Not quite the same thing, but see also this 9-line "spreadsheet" written in Python by Raymond Hettinger: http://code.activestate.com/recipes/355045-spreadsheet/
648.
▲
by
benhoyt
13y ago
Not bad, however with the ''.join(data) you're effectively doubling the amount of memory needed for large files, because it will build the entire output string in memory (and you've already got the list in memory). Bette
649.
▲
by
benhoyt
13y ago
Agreed that C++11 is better than C++Original. But no. It's still 19 non-blank lines, all of which you have to think about and maintain. Compare this to an idiomatic version written in a "real" scripting language like Python.
650.
▲
Svg.js: a lightweight library for manipulating and animating SVG (like Raphaël)
(reddit.com)
3 points
by
benhoyt
13y ago
|
0 comments
651.
▲
by
benhoyt
13y ago
It's a fair corrective, but don't forget Knuth -- a programmer who learned a lot about typography and designed quite a few good fonts ( http://en.wikipedia.org/wiki/Computer_Modern ). Arguably his fonts aren&#x
652.
▲
by
benhoyt
13y ago
Yeah, C# await/async is cool. But isn't Google Go's approach nicer? Keep standard lib calls blocking as is, and use the "go" statement when you want to run something async? It avoids all the extra DoWhateverAsync()
653.
▲
by
benhoyt
13y ago
Agreed about abbreviations. To distinguish "text_body" and "html_body", what about simply "text" and "html"? That's what we use internally. Also, how does one send To: multiple addresses with thi
654.
▲
by
benhoyt
13y ago
I don't know the history behind star args / kwargs, but I don't think what you're proposing is a good idea: * You wouldn't get TypeErrors for broken code. Most code doesn't use or need star args / kwargs,
655.
▲
by
benhoyt
13y ago
Okay, I tried it based on this. Ideally one could opt into this step, but I think if it either said 1) "view your contacts" or 2) you simply wrote "We never change your contacts or save them on our servers" or similar --
656.
▲
by
benhoyt
13y ago
Totally agreed about #1 and exceptions. In that defintion of DumpBinary, each bit of error handling takes three extra lines. Speaking of "cognitive load". Whereas here's what it'd probably look like in Python, with excep
657.
▲
by
benhoyt
13y ago
Totally agreed -- I'm skipping it for now. "View my contacts" would have been one thing, but "manage"? Be nice if one could try the tool and invite friends later.
658.
▲
by
benhoyt
13y ago
I'm silly, then. :-) I'm on Windows 7 (and XP before that), I've never used anti-virus software, but I'm careful about what I download and run. Many of my friends, who do use anti-virus software, are constantly complaini
659.
▲
by
benhoyt
13y ago
I'm not a heavy C# dev, but I don't understand why your first paragraph would be so: isn't that the point of implementing an interface like IEnumerable<T> -- so that you can implement Count() in an optimized, specialize
660.
▲
Yes, my credit card number does have spaces
(blog.brush.co.nz)
11 points
by
benhoyt
13y ago
|
0 comments
More ›