HNHacker News
TopNewBestAskShowJobs

Rangi42

444 karma · joined August 17, 2012

submissionscomments
Rangi42··on N-queen puzzle in 4 lines of Scala
Python 3's `yield from` lets you write that in one statement:

    def n_queens(n):
        yield from (p for p in permutations(range(n))
            if len({c + i for i, c in enumerate(p)}) ==
                len({c - i for i, c in enumerate(p)}) == n)
It also illustrates how much neater list comprehensions can be in Python versus map/filter since its lambda functions are fairly verbose (even though there's a straightforward correspondence between them):

    def n_queens(n):
        return filter(lambda p:
            len(set(map(lambda x: x[1] + x[0], enumerate(p)))) ==
                len(set(map(lambda x: x[1] - x[0], enumerate(p)))) == n,
            permutations(range(n)))
Rangi42··on More Than 40% of Student Borrowers Aren’t Making Payments
Not everyone wants or needs to get a well-rounded liberal arts education. The problem is that undergraduate degrees are more and more a prerequisite for getting any job, so there's pressure to make it easy for poorer people to earn a degree. Towards that end we have loans, grants, scholarships, subsidized city colleges and state universities...
Rangi42··on Determining Gender of a Name with 80% Accuracy Using Only Three Features
They never say which last letters are associated with which sex. I'm guessing that "o" is usually male and "a" is female, but, what about the other 24? Is "n" usually male ("-son")? Does "y" have a bias?

(Regarding sex vs. gender: yes, they aren't perfectly correlated and some people don't stay with their assigned gender, but AFAIK they often/usually choose a new name which probably matches their gender? Thus why "dead names" are a thing.)

Rangi42··on Schools Are Slow to Learn That Sleep Deprivation Hits Teenagers Hardest
Which is also not likely to change. Again: "Now adults have no immediate use for teenagers." Why move just for the sake of your kid's four years in high school?

This may not apply to urban families who take a train or bus to work. I commuted to high school on a subway by myself, and would have preferred leaving an hour or two later.

Rangi42··on Show HN: What every browser knows about you
<video> tags are a more standardized part of the web. Although I should be able to disable auto-buffering as well as auto-play.

Ideally the user can control whether all types of content get loaded—images, CSS, JavaScript, web fonts—or even allow/deny individual domains or files, but so far browsers require an extension like uMatrix for that.

Rangi42··on Where's the lane? Self-driving cars confused by shabby U.S. roadways
Do the third-world countries you're thinking of enforce traffic laws? Because I expect that an autonomous car could safely navigate an unmarked road if it were just paying attention to its destination and avoiding obstacles, not obeying detailed regulations.
Rangi42··on Computer programmers have the largest gender pay gap
$400 USD is equal to 26,766.18 Indian rupees. Adjusting for purchasing power parity[1], that will buy as much as $1,526 in the US, so her yearly salary is equivalent to just over $18,000. Which is still surprisingly low.

[1]: http://salaryconverter.nigelb.me/

Rangi42··on Is this c/10 spaceship known?
"A seething mass of undifferentiated matter" describes runaway exothermic reactions fairly well.

It also helps that Games of Life can be saved and reloaded. If your lab bench explodes, too bad, start over from scratch (assuming you're uninjured).

Rangi42··on Twenty years after Pokémon launched, its impact on Wikipedia remains
I see that you work in software security. Your list of sufficient criteria for Wikipedia relevance, alongside obvious ones like "been in the news" and "authored a book", also includes ones like "discovered a critical vulnerability (or blazed a trail of minor ones)" and "run security for a Fortune-500 company or government agency".

These are rather specific to your own field of interest, and probably someone unfamiliar with software security would say they aren't notable. Consider that you're doing the same thing in deleting well-written articles by other people, ignoring what makes them notable/relevant/useful because you're not familiar with the subject.

Rangi42··on Show HN: GitHub project structure visualizer
A treemap is a good static alternative to a literal tree of nodes. There are already programs like WinDirStat that use them to visualize file systems.

https://en.wikipedia.org/wiki/Treemap

http://windirstat.info/

Rangi42··on Pull request acceptance of women versus men
> Out of 4,037,953 GitHub user profiles with email addresses, we were able to identify 1,426,121 (35.3%) of them as men or women through their public Google+ profiles.

I wonder if there's a gender bias with regard to making your Google+ profile public (or having one in the first place).

Rangi42··on New string formatting in Python
Also not a fan. The two existing methods of string formatting are sufficient:

    "%s %s %s" % (a, b, a)
    "{} {} {}".format(a, b, a)
If you want placeholders to match variable names, you can do:

    "{a} {b} {a}".format(a=a, b=b)
    "{a} {b} {a}".format(**locals())
So this is just unnecessary (especially since the "f" prefix is easier to miss than a "format" method):

    f"{a} {b} {a}"
And this is downright obfuscated—putting operators inside of string literals:

    f"{a + ' ' + b + ' ' + a}"
Rangi42··on TempleOS: Naughty Fun with OS Internals [video]
Perhaps someone could sneak it in as "further support for FAT32 variants." According to Terry, RedSea is "similar to FAT32, but with absolute block addresses instead of clusters, fixed-sized 64-byte directory entries and no FAT table, just an allocation bitmap" [1].

[1]: http://www.templeos.org/Wb/Doc/RedSea.html

Rangi42··on Does Google crawl dynamic content?
This is a problem with a lot of paginated sites, such as Tumblr, various forums, and comment pages. Anything that's ordered from newest to oldest won't have a constant correspondence between URL and content.
Rangi42··on If You Do This, the NSA Will Spy on You
Okay, let's see what behaviors I should avoid...

> Searching for the Tails, operating system, another Windows alternative popular among human rights watchers, will also land you on the deep-packet inspectee list.

Oops. Too late.

These sort of criteria can't possibly narrow down a set of people enough to justify spying on them. It's like trying to surveil every adult male after a shooting because most shooters are adult men: technically true, and you've eliminated over half of all humans, but most of the people left are still innocent.

Rangi42··on Cable TV's plan to kill “over the top” internet streaming
That's not a practical metric, though. I'm on a campus with a 100Mbit/s connection, I frequently download large files (media and Linux ISOs), and still don't go above 200-300 GB/month. The 100Mbit/s figure is useful for informing me how fast a particular YouTube video will buffer, for example, but by your proposed metric, sustained 100Mbit/s would have to be advertised as 30TB/month. "20 Mbit/s with a 300 GB/month cap" is more informative.
Rangi42··on The Opposite of a Bloom Filter (2012)
So in short, the opposite of a Bloom filter is a hash-map where, if you add two items that have the same hash, the second one replaces the first instead of them both being stored in a linked-list bucket.

> The old id at that index is compared to the new id just added. If they differ, containsAndAdd returns false and the process should write the event. If the ids are the same, containsAndAdd returns true and the process can safely drop the event on the ground. Occasionally, two byte arrays may hash to the same index. When this happens, containsAndAdd will return false and a duplicate write will be emitted. However, since duplicate items come close together in time, this is relatively rare.

Rangi42··on The Hardest Logic Puzzle: A step-by-step guide to true, false, and random
Sam Hughes implemented this puzzle in Javascript to demonstrate how the solution works, and why some other proposed ones don't: http://qntm.org/gods
Rangi42··on Study: Women Twice as Likely to be Hired in STEM Tenure-Track Positions
Presumably the article's author is so used to "sexism" meaning "women are under-represented" that they don't realize "men are under-represented" is equally sexist.

Not that under-representation is necessarily evidence of bias, which is what the word "sexism" implies. The study's authors, Ceci and Williams, are aware of this:

> This led to their conclusion that gender bias did not cause the small number of women in STEM fields. They said the small representation of women in the sector was caused by their own reluctance to enter these fields.

Rangi42··on Surveillance planes spotted in the sky for days after West Baltimore rioting
There would have to be strong controls on the recordings so that (a) the police need a warrant to access it, and (b) they can only view the relevant time and place. And I don't mean "a person whose nominal job it is to control access," I mean actual incentives and technological barriers so that unauthorized access becomes difficult to impossible.
Rangi42··on Surveillance planes spotted in the sky for days after West Baltimore rioting
I think most people don't expect the police to do that to them either. No-knock raids are something that happens to other people. Riots could affect anyone. (Not commenting on the accuracy of this view, just its existence.)
Rangi42··on Academics sharing paywalled papers with a codeword on Twitter
It's parasitic because they're charging authors and readers. If publishing is a service to the author, then the author is paying to have their work seen, so it should be open access. If publishing is a service to the readers (as with book publishing), the author should get a share of each copy sold to a reader. Charging both parties is only a viable business model because there's no alternative—which is exactly what these linguists hope to fix.
Rangi42··on Show HN: Skod – FTP client for humans in C
The source code is very well-written from a readability perspective, and the commmand-line API looks well-designed too.
Rangi42··on Shinichi Mochizuki and the impenetrable proof
He's not obligated to do anything, but it's not surprising that other mathematicians are not too eager to retrace his steps to figure out if the proof is correct, given its length and unique notation.
Rangi42··on How to Analyze Every Reddit Submission and Comment, in Seconds, for Free
Which still fails if the values contain escaped quotes:

    Name, Age, Address
    "James aka ""Jim"", ""licensed"" attorney", 42, "New York"
That's three values:

    James aka "Jim", "licensed" attorney
    42
    New York
And there are other possible irregularities: zero or N spaces after the comma separators; unquoted values when they're not needed; backslash-escaped special characters; escaping newlines.
Rangi42··on Firefox 41 can screenshot a single DOM element
No, just the right edge. It also ignores the page zoom setting and screenshots the element at 100%. (User styles set by Stylish do apply, though.)
Rangi42··on Firefox 41 can screenshot a single DOM element
Someone in the comments says "I was doing this on a normal 1600×900 monitory and was still having issues with the right edge being cut off a little." I have the exact same problem on a 1600×900 ThinkPad W530, running Windows 8.1 at 100% DPI. Screenshots have their right edge missing.
Rangi42··on Why the Human Brain Project Went Wrong and How to Fix It
What would observe differently about your dog if he were self-aware? Self-awareness wouldn't automatically let dogs speak their minds or write philosophical treatises on existence. When a dog is just sitting still, I have no idea if they're being self-reflective or not.
Rangi42··on The real anti-Facebook is good old email
I check Facebook once in a while and keep getting alerts (via a userscript) that friends of mine have deleted their accounts. On the other hand, the mailing list that my close friends and I created in high school is still keeping us in touch years later.
Rangi42··on JSON Lines
Thanks for that info. I didn't know the module was written in C.
← PreviousPage 2 of 5Next →