Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
fantod
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
fantod
6y ago
I don't really see how this is a reason not to carefully consider the type of an object when using truthiness.
62.
▲
by
fantod
6y ago
For the basic sequence types (list, tuple, and range), len is definitely not expensive to compute. For custom types, it will depend on your implementation of __len__ (but then, computation of bool(...) will also depend on your implementatio
63.
▲
by
fantod
6y ago
If you know that "something" is a sequence, then is the idiomatic thing to do. The point is that any time you rely on truthiness of a value, you need to think (sometimes quite carefully) about what type of value you're dealin
64.
▲
by
fantod
6y ago
To be fair, using "if something" in Python is pretty much always a good way to trip yourself up.
65.
▲
by
fantod
6y ago
Yeah, the Python language favors an imperative style due to the absence of features necessary for writing more functionally, like lambdas that can do more than return an expression, tail call optimization, and lexical scope. This last one,
66.
▲
by
fantod
6y ago
How much coffee were you drinking? I have 1-2 cups a day (for many years) and always felt fine.
67.
▲
by
fantod
6y ago
Unhealthy food can be hard to avoid.
68.
▲
by
fantod
6y ago
You made me realize, I think of the brackets as saying "where". vec[2] is vec where the index is 2. vec[vec > 5] is vec where the entries of vec are greater than 5, etc.
69.
▲
by
fantod
6y ago
Both are overloaded (__gt__ and __getitem__). My question to you is: How would expect this to be written (in Python)?
70.
▲
by
fantod
6y ago
This lines up remarkably well with something I've thought about myself. People often argue about what the "best" first programming languages to learn is. I think it depends on what your goals or interests are: 1. Interested i
71.
▲
by
fantod
6y ago
Why would that even be blocked?
72.
▲
by
fantod
6y ago
Opening in private mode usually works for Medium link (never understood why they reward people who hide their cookies, but ok).
73.
▲
by
fantod
6y ago
Itamar Turner-Trauring's blog has a number of good articles on Docker best practices: https://pythonspeed.com/docker/
74.
▲
by
fantod
6y ago
Yes, I understand that Docker caches layers. Like I said, if docker system prune is clearing a huge amount of space, it's like a large number of different images and containers that might not share layers. If you're build, running
75.
▲
by
fantod
6y ago
So maybe I was quick to comment, but I glanced at the images I have sitting around and python:3.7 is 876MB. However, python:3.7-slim is 112MB (still nearly twice the size of the image you describe, though). But it's conceivable that ma
76.
▲
by
fantod
6y ago
Agreed, there are many things to get right about using Docker. But if you're just deploying an app to a somewhere, does it really matter if the image is a bit bloated (within reason)?
77.
▲
by
fantod
6y ago
I mean it could just be very many containers that add up. And in many cases you'll have loads of images close to 1GB unless you go to great lengths to try and shrink them (e.g. anything that uses Python).
78.
▲
by
fantod
6y ago
If you're referring to the monkeypatching, I would generally try to avoid it unless but that doesn't mean I wouldn't ever do it. Not sure why you would do this in this example though.
79.
▲
by
fantod
6y ago
Yeah, these are great.
80.
▲
by
fantod
6y ago
This is great! There aren't enough references on Python internals, I find. Not sure you're at all interested in going in this direction, but I (and likely many people) would be really interested in a similar explanation of NumPy i
81.
▲
by
fantod
6y ago
Sorry, I was referring to the assertion that "they wouldn't share the feedback on her paper".
82.
▲
by
fantod
6y ago
I think the logic is that the paper would need to be retracted, rectified, and then resubmitted. Since the submission deadline was already passed, resubmission would be impossible.
83.
▲
by
fantod
6y ago
From Dean's email: "A cross functional team then reviewed the paper as part of our regular process and the authors were informed that it didn’t meet our bar for publication and were given feedback about why. It ignored too much re
84.
▲
by
fantod
6y ago
Not every lockdown entails tracking of individuals.
85.
▲
by
fantod
6y ago
IIRC the number of hidden units required scales exponentially in the desired approximation error.
86.
▲
by
fantod
6y ago
Agreed, I find this to be a great use case for voice assistants. Or on the occasion I feel like napping after lunch "Hey Siri, wake me up in an hour".
87.
▲
by
fantod
6y ago
I'm not a web developer but whenever this kind of thing happens I just wonder why there isn't a single standard library in every common web language to deal with this and if there is, why it's not being used more often.
88.
▲
by
fantod
6y ago
Really? My only experience with Julia was porting a simulation from Python and the speedup was incredible. Admittedly, that's an instance of numerical computing, but I would wonder why it was slow for you.
89.
▲
by
fantod
6y ago
Why don't you just exclusively subscribe to the subreddits that interest you?
90.
▲
by
fantod
6y ago
Have you actually met a person from Europe? They play on stereotypes constantly.
More ›