Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jemfinch
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
89 ms
·
781.
▲
by
jemfinch
16y ago
> The problem is that there is a latency hit required for a thread running on node 0 to access memory on node 1. Furthermore, this uses Hypertransport on AMD or QPI on Intel, which has limited bandwidth so if you get too many off-node m
782.
▲
by
jemfinch
16y ago
> it's far more likely that the object passed was None than that it was a completely different type than the one expected. FYI, None is a completely different type than the one expected.
783.
▲
by
jemfinch
16y ago
And the point that was made in the other branch of this thread is that if the author intends to guard against None (who knows why?) then he should say, explicitly, "if L is not None". That's what PEP8 recommends precisely to avoid ambiguit
784.
▲
by
jemfinch
16y ago
You are aware that asserting `len(L) == 1` excludes the possibility that it's empty, right? You know what "redundant" means, right?
785.
▲
by
jemfinch
16y ago
> Well, that stddev function could be much less verbose: Sure, it could, but I was demonstrating what it looked like without the use of functions. Your example proves my point just as mine does: sum(), like mean() or variance() in my e
786.
▲
by
jemfinch
16y ago
> A function that squares a number is simple, one that computes the standard deviation is definitely more complex. I'm talking about the complexity difference between this: def stddev(pop): total = 0 count = 0 for x in p
787.
▲
by
jemfinch
16y ago
Yes, you should definitely should be more explicit if that's what you intend to check: PEP8 makes that explicit. I'm not sure why you'd defend against None anyway. Why defend against None, but not against 3.1459 or 4j or ''?
788.
▲
by
jemfinch
16y ago
Functions should not be complex. Functions should be simple, and they should be composed by other simple functions to do more complex things.
789.
▲
by
jemfinch
16y ago
> I'd avoid doing this, because people who'll read your code would have to check themselves what the `get_single` function does. This is an argument against using functions at all. If it works against get_single, it works against all f
790.
▲
by
jemfinch
16y ago
> assert l and len(l) == 1 This is redundant: if a list's length is 1, then it's true in a boolean context. Also, please stop naming your lists 'l'. On a vast array of fonts, it differs only in a few pixels from '1'. Use "L" instead :
791.
▲
by
jemfinch
16y ago
No doubt! But since we're on the subject of "how to make code like this better" it seems appropriate to discuss what's really wrong with the code, rather than just what sort of duct tape style guidelines we can use to patch over its flaw
792.
▲
by
jemfinch
16y ago
Then it should make a method which returns its known, sole entry. Returning a list of entries from a widget which will always contain only one entry is the logical equivalent to converting a function return value to a string and then expec
793.
▲
by
jemfinch
16y ago
> Your comment is interesting at a number of levels. And by interesting, I mean that I can hardly fathom you wrote it I imagine a great many people will be "interested" in your response, then. And really, you choose to be uncivil over a
794.
▲
by
jemfinch
16y ago
The reason it's not in the Python style guide is because it's a symptom of other problems in code. Lists are for holding multiple values of the same type. If you know that a list will always have one and only one value, it's not conceptu
795.
▲
by
jemfinch
16y ago
The real solution is not to arbitrarily encode your types as lists of exactly one item. If you find yourself passing around such lists with enough regularity that you feel the need to develop an idiom for deconstructing them, you're doing s
796.
▲
by
jemfinch
16y ago
Why are either of you hypothesizing about publicly available data? Read the patent application yourself: http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Se... .
797.
▲
by
jemfinch
16y ago
Did you ever end up testing Varnish in the polling solution?
798.
▲
by
jemfinch
16y ago
Given youngsters' propensity for rebellion I wonder if furtive nighttime reading by flashlight actually encourages the behavior.
799.
▲
by
jemfinch
16y ago
Yes, really. The original sentence was this: "Stressing scalability so much put somewhat in shadow what in the 80's was one of the most interesting meters of software coolness [...]" This parses perfectly fine with this meaning: "The stres
800.
▲
by
jemfinch
16y ago
Wrong again (as you've been this whole thread): we use meter in that sense all the time: "gas meter" (both the name of the thing that measures the natural gas usage by a household and the thing that measures the remaining gasoline in a car)
801.
▲
by
jemfinch
16y ago
For a start, you could publicize the name of the faithless company and give them some bad press (and prevent others here at HN from potentially encountering the same problem).
802.
▲
by
jemfinch
16y ago
How in the world can someone get away with paying $100/week for childcare? I couldn't find that price (as a buyer) even in smalltown Kansas early this year.
803.
▲
by
jemfinch
16y ago
> "Stressing scalability so much put somewhat in shadow what in the 80's was one of the most interesting meters of software coolness [...]" This parses correctly, just with difficulty. It's not exactly a garden path sentence, but it ha
804.
▲
by
jemfinch
16y ago
A note for those reading me above: I'm wrong. It turns out that merchants are stiffed in cases of CC fraud.
805.
▲
by
jemfinch
16y ago
It seems to have firsthand knowledge that this data has been stored permanently by Bloglines; what I'm curious about is why you think it wasn't stored by any other companies that crawl the web for a living.
806.
▲
by
jemfinch
16y ago
> The CC company bears absolutely no burden for fraud beyond the administrative hassle, and it is wholly on the merchant's backs. I've done some research, and I was misinformed on that point.
807.
▲
by
jemfinch
16y ago
> I bet quite a bit of that data doesn't exist anywhere else. You'd really put money on that?
808.
▲
by
jemfinch
16y ago
[citation needed]
809.
▲
by
jemfinch
16y ago
> Why is the fact that it's a well known Bay Area address of any significance at all? Which do you think seems more fraudulent? This address: 1600 Amphitheatre Pkwy, Mountain View, CA 94043 Or this one? Hospital Road, P.M.B. 2155 Kadun
810.
▲
by
jemfinch
16y ago
> You are assuming that "better fraud detection" means "fraud detection that isn't triggered". It means "fraud detection that catches actual fraud and doesn't bother me otherwise. > Credit card companies aren't as concerned about as
More ›