HNHacker News
TopNewBestAskShowJobs

superbatfish

521 karma · joined June 11, 2014

submissionscomments
superbatfish··on Nevada cops use civil forfeiture to steal a veterans life savings
Yes, it’s I’ll-advised to keep one’s savings in cash, but a shockingly large number of people do it.[1]

It’s not surprising that some people would also choose to keep the money “safe” by keeping it with them when they travel.

The fact that it’s irrational is irrelevant. It’s quite common, and therefore this is a great example of abusive civil forfeiture. Corrupt cops have surely become aware that such behavior is commonplace. They’ve learned how to sniff out such victims and prey upon them.

I can’t think of a better example than this case.

[1]: https://slate.com/business/2015/02/keeping-cash-at-home-way-...

superbatfish··on Pythonic monotonic
If-statements are for the weak :-)

This uses numpy, but it's the shortest answer presented thus far.

    In [1]: from itertools import chain, zip_longest
       ...: import numpy as np
       ...:
       ...: def f(l):
       ...:     a = np.array([-np.inf, *l])
       ...:     up = a[:-1] <= a[1:]
       ...:
       ...:     pos = (up[1:] != up[:-1]).nonzero()[0]
       ...:     pos = [0, *(1+pos), len(l)]
       ...:
       ...:     up_runs = (l[x:y] for x,y in zip(pos[0::2], pos[1::2]))
       ...:     down_runs = (l[y-1:x-1:-1] for x,y in zip(pos[1::2], pos[2::2]))
       ...:
       ...:     pairs = zip_longest(up_runs, down_runs)
       ...:     return [*filter(None, chain(*pairs))]
       ...:
       ...: f([1, 2, 3, 2, 1, 4, 5, 6, 7])
    Out[1]: [[1, 2, 3], [1, 2], [4, 5, 6, 7]]
superbatfish··on Pandas Manual [pdf]
I agree with you in spirit. Having separate names is preferable to context-specific semantics for the []. In pandas, using [] alone is discouraged, in favor of using .loc or .iloc. But admittedly, that only partially improves the situation. Both accept multiple types (int vs int-list vs bool-list).

Last year, I had an in-person discussion with a numpy core developer in which I proposed adding pandas-like syntax to numpy, e.g. allowing the author to use:

a.boolmask[b == c]

(but maybe not so verbose).

A problem immediately arises: An array can have multiple axes, and each could be indexed with a different type within the same slicing call.

One idea might be to allow the author to explicitly wrap the arguments with some dummy class to make clear what types they’re using:

a[np.boolmask(b == c), d, np.intlist(e)]

(Again, perhaps choosing shorter names in practice.)

The idea would be that the wrapper merely “looks like” the thing it wraps, but contains an assertion to verify the type of the argument.

Anyway, I agree that notebooks (or REPLs in general) are great for verifying your assumptions about how little snippets will behave. But I think they would be useful even in a fully statically-typed compiled language, too.

superbatfish··on Pandas Manual [pdf]
Your complaint applies to array processing libraries in general. It applies to numpy. Yet those syntactic niceties are exactly what make them so convenient. Sure, it takes time to get comfortable writing array-oriented code. But it isn’t a good idea to optimize for complete beginners. Some familiarity with the general domain is a prerequisite to using array (and dataframe) libraries.
superbatfish··on Pandas Manual [pdf]
Honestly, I thought you were going to say it’s the latter. It’s great. It has a huge API because it solves a lot of problems.

Does some stuff get complicated? Sure. Sometimes there are edge cases that get messy. The other day I was surprised to see my categorical labels implicitly converted to strings if they were used in a multi-level index. But for me, at least, that’s a fairly esoteric use-case. It stands out to me now precisely because pandas so rarely does something I didn’t expect.

superbatfish··on Brood X Periodical Cicadas FAQ
Yes, it will take time. In my yard here in Reston, VA, they’ve been emerging in small but increasing numbers each night for the past seven days. I was just outside a few minutes ago — it looks like like tonight will be a big night for them!

That said, it also depends on where you are. They can only grow in soil that remained mostly unmolested (no construction) for 17 years. Recently constructed neighborhoods will not have many cicadas. Also, they feed on tree roots, so areas with few trees will have few cicadas.

superbatfish··on U.S. Labor Secretary throws support behind classifying gig workers as employees
Here's a great podcast on this question (regarding Uber and Lyft drivers specifically), from Julia Galef:

http://rationallyspeakingpodcast.org/show/episode-255-are-ub...

She interviews three experts on the subject. Here's the description of the episode:

>How much do Uber and Lyft drivers really earn, after expenses? Are they getting a raw deal by being classified as 'independent contractors' instead of employees? I explore the debate over these questions with three guests: Louis Hyman (Cornell), Veena Dubal (UC Hastings College of the Law), and Harry Campbell (The Rideshare Guy).

superbatfish··on U.S. Labor Secretary throws support behind classifying gig workers as employees
In most discussions around this topic, Uber and Lyft are highlighted as typical examples. This article is no exception. But it includes the following quote from Labor Secretary Marty Walsh:

>“These companies are making profits and revenue and I’m not (going to) begrudge anyone for that because that's what we are about in America. But we also want to make sure that success trickles down to the worker,” he said.

If he's referring to Uber and Lyft specifically, then he's mistaken. Uber and Lyft remain breathtakingly unprofitable.

Would that fact change the way people think about this issue? I think it does... and advocates for reform think it does, too. Otherwise, why would they keep making this "mistake" when they talk about this issue?

As a side note: it's pretty poor journalism on Reuters' part to include that quote without any context or criticism, especially since they mention Uber and Lyft by name in the opening paragraph. Or, if he wasn't talking about Uber and Lyft, then Reuters' presentation makes him look like a liar, or at least embarrassingly misinformed. (He's the Labor Secretary after all -- he ought to know what he's talking about.)

superbatfish··on Donate Unrestricted
I agree that fungibility is a hugely under-appreciated (or cynically de-emphasized) concept when it comes to funding governments via special taxes. (Great example.)

The concept also applies to non-profit donations more broadly, but only under the assumption that the size of the donation is small enough that it doesn't exceed the total amount that the non-profit would have spent on that cause anyway.

If you're donating a large amount that exceeds the current budget for your chosen cause, then your donation does make a difference -- but it's not quite as large as it seems. It might only be the difference between the previous spending level and the new level (after your donation and after some budget refactoring).

To use your example, if the state was spending $1B on on schools previously, then donating less than $1B doesn't necessarily make a difference to school funding -- they can just push money around. But if you donate $1.2B, then you have made a difference -- of $0.2B.

If you're donating to a small non-profit, though, then maybe it's easier to find targets in which you could dwarf the existing spending on your topic of choice. (Not to say that you should, though. I agree with Graham's argument.)

superbatfish··on What’s Wrong With The Honeywell Humidifier
I own this model, and use it to humidify a small room. I sympathize with the author's complaints with respect to the difficulty of cleaning it, though mine just doesn't need cleaning very often. And the wick DOES get moldy if you let it sit in wet water for weeks on end.

But her other complaints puzzle me:

I don't find it to be messy to refill. What is she doing wrong?

It's even more baffling that she thinks it "doesn't work". I mean, she refills the tank every night, so we know the water is disappearing from the tank... where does she think the water is going? Isn't that proof enough that it does, in fact work?

superbatfish··on Firefox 85
Not sure, but I think he is referring to a programmatic API for doing it (e.g. so he can give users a "click here to copy image" button).
superbatfish··on Will R Work on Apple Silicon?
Fair enough. My snide question was uncalled for. Sorry. Thanks for the additional info.
superbatfish··on Will R Work on Apple Silicon?
The article contradicts your assertion. Did you read it?
superbatfish··on Will R Work on Apple Silicon?
It sounds like R's design decision to use a non-standard NaN value to represent NA is an obscenely bad one. Wasn't it obvious that this would become a problem someday?
superbatfish··on Will R Work on Apple Silicon?

    flights[["year", "month", "day"]].head(10)
superbatfish··on Contrarian view on closing files
The Python standard makes no guarantee, but in CPython, the example above is deterministic. The cycle-detecting garbage collector is not involved in this case. Just refcounting.
superbatfish··on Contrarian view on closing files
I'd like to emphasize the point even further for CPython users. Here's the author's closing sentence:

>Your setup script is not going to run out of file descriptors because you wrote open("README.md").read().

In CPython, files are closed (if necessary) in __del__, so the descriptor is released immediately after that line executes, thanks to CPython's reference-counting mechanism. That idiom wouldn't cause you to run out of descriptors even in a long program.

(The author knows this. Their point is that even if you're NOT using CPython, you STILL shouldn't worry about it too much, and I think I agree.)

I know, I know, CPython's reference-counting behavior is considered an "implementation detail", but for RAM-intensive workloads which are common in Scientific Computing (especially biological imaging), it's often a necessity. So if I were to force myself to use context managers in cases like this, I'd be losing the benefits of terse code without actually preserving portability. (I didn't have portability in the first place.)

In other words, if you're dependent on ref-counting anyway, you may as well admit it and enjoy the benefits that come with it!

superbatfish··on We need to do the math, even on “small” projects
I'm also wondering about this. Maybe some "outside-the-box" ideas could achieve it. Just spitballing here:

If the street were made to be one-way instead of two-way, could it be narrower, leaving room for the sidewalk AND the ditches? Also, it isn't clear from his description, but maybe that would eliminate the need for "additional utilities improvements due to [the sidewalk and widening]".

It would inconvenience the residents on that street and motorists who pass through. But presumably that's better than bankruptcy.

Or here's an even crazier idea: Could the underground drainage be avoided if the city annexed a strip of land from the adjacent properties? That would surely piss them off, but if it were implemented city-wide, as part of a "we're all in this together" kind of campaign to revitalize the city without going bankrupt, maybe it would be more palatable. At least it might seem more "fair" if everyone loses a little land, rather than only some streets. And if owners were compensated monetarily, heck, some might even like it.

superbatfish··on Genes, blood type tied to risk of severe Covid-19
FWIW, The blood type correlation had already been found by a months-old study in China. But that was via ordinary blood type tests, not GWAS. I guess it lends credibility to this method that their findings are consistent with the other study.

As the proud owner of ~5 liters of type-A blood, I’m less than pleased to see this finding confirmed.

superbatfish··on Tools you’d miss if you left a company
Couldn’t it be argued that all software is built with more “glue” than non-glue? That’s just the nature of the beast. If a user wants to, say, view a record from a remote database in her web browser, how many separate layers of code does that involve? (Several.) How many of them aren’t “glue”? (I dunno, like two?)

Perhaps it’s true that most glue is poorly written, but doesn’t that imply that writing good glue is, in fact, difficult, and therefore it’s as hard — or maybe harder - than building “real” things?

superbatfish··on Roar (1981 Film)
Holy crap: https://www.youtube.com/watch?v=cny_D50Rr44
superbatfish··on Open Letter to the Linux Foundation
OK, but to imply that the response to the "fuzziness in the middle" should be the same as the response to an extreme violation is also absurd.
superbatfish··on Juul Shipped At Least 1M Contaminated Pods, New Lawsuit Says
One piece[1] on the meaning of "clickbait" described it as follows:

>When we talk about clickbait internally, we tend to focus on the idea of under-delivering on a misleading headline. The risk that a reader will feel she has been duped into clicking.

To your point, it also says:

>Others often seem to be using "clickbait" as a free-floating term of derision. There are many reasons one might dislike an article but calling it clickbait has become an all-purpose way of expressing that disapproval.

So which of those best describes this BuzzFeed article?

I don't think the headline is misleading, but BuzzFeed definitely under-delivered by not mentioning the contaminant. They showed their hand by not even acknowledging that they are missing that important detail.

Honestly, it's shameful. It's like they have so little respect for their readers that they think their readers won't notice that the most important detail in this story -- mentioned in the headline, no less -- is missing.

[1]: https://www.vox.com/2015/2/13/8033937/clickbait-explained

superbatfish··on Use plaintext email
Un-un-popular opinion: Top-posting is fine. Interleaved posting is great, too. Bottom posting is idiotic.
superbatfish··on PyQt5 Tutorial: Create a Python GUI in 2018
FWIW, conda is an easy way to get PyQt, too.
superbatfish··on Reading the NSA’s codebase: LemonGraph review
What's with the name??

There is already a well-known and popular library for graph analysis (in C++) named "Lemon Graph Library". It is 10 years old. As far as I can tell, this new library is not related in any way. (Am I mistaken?)

Did they not simply google for the words "lemon graph" before they published this code base? Or am I missing something?

superbatfish··on Freezing Python’s Dependency Hell
Indeed, Anaconda is too heavy. But he is aware of Miniconda and even mentions it in his last bullet point. He then dismisses it in short order, with a vague complaint about mysterious "best practices".

If he really believes that his tool is somehow better, fine. But since Miniconda is the de facto standard tool among data scientists for this use-case, the burden is on him to spend more words on exactly why it doesn't work for him.

superbatfish··on Freezing Python’s Dependency Hell
The author's justifications for using this home-grown tool over miniconda are weak at best, if not plain incorrect.

Conda really is the tool he wants; he just seems not to understand that.

superbatfish··on Freezing Python’s Dependency Hell
Indeed, using pip from within a conda environment is trivial.

But the preferred solution is to make a conda package for yourself, and it's really quite simple. You can host it from anaconda.org, or from a local directory for crying out loud.

superbatfish··on The Hidden Cost of Touchscreens
I'll take this opportunity to complain about my 2017 Honda HR-V. It has all of the problems described in the above piece.

It's the most dissatisfying thing about my car. In fact, it might be the only dissatisfying thing about the car, and yet it's still enough to make me reluctant to recommend the car to a friend!

← PreviousPage 2 of 5Next →