HNHacker News
TopNewBestAskShowJobs

EvilTerran

1,298 karma · joined March 27, 2012

submissionscomments
EvilTerran··on Making Firefox's right-click not suck with about:config
You can add a screenshot button to the toolbar from the "Customise Toolbar" screen, does the exact same thing as that context menu item.
EvilTerran··on Tech terms I was pronouncing wrong
Same!

I also enjoy reading SciPy as "skippy".

EvilTerran··on AutoHotkey v2 Official Release Announcement
Back when I played Minecraft, I wrote one I was pretty pleased with:

If you have a stack of items, you can pick up half of them by right-clicking on it, which is very convenient when you're dividing out a stack on the crafting grid to make many copies of a recipe that needs that item in 2 or 4 slots; but for some recipes, you need to put the same item in 3 or 6 slots, and there's no built-in way to divide a stack into thirds.

So I made an AHK script that, when I held down a key, would

- pick up half of the items in the stack I'm pointing at (right-click) - move the mouse one inventory space to the right - put them down (left-click) - pick up half of them again - move back one inventory space left - put them down, adding them back to the original stack - and repeat

and it would only stop after one of the "pick up" steps; so, after a few iterations, you'd be left with the stack divided into equal thirds, two in your inventory & one on the mouse.

Eg, starting with a stack of 60, it goes 30/30, 45/15, 22/38, 41/19, 20/40, 40/20, 20/40, 40/20... then release the key, and you've got three stacks of 20.

EvilTerran··on A little bit of plain JavaScript can do a lot
Others have already mentioned that you can replace "for (const k in props) elem[k] = props[k]" with "Object.assign(elem, props)"; further to that, in modern browsers, you can replace "for (const kid of kids) elem.appendChild(kid)" with just "elem.append(...kids)" - with the added benefit that plain strings passed to .append() get turned into text nodes automatically, so you probably wouldn't need $T any more:

https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/...

EvilTerran··on SQLite as an Application File Format (2014)
I guess you could send changes to the DB on-the-fly inside a transaction, so when the user clicks "save" it's just a matter of running COMMIT? Not sure what effect that would have on performance as the transaction grows, though.
EvilTerran··on Firefox extensions to make remote work and school a little better
I believe you're thinking of the "Facebook Container" addon - it's "official", in that it's made by people at Mozilla & has their corporate blessing, but it's not installed by default.

AIUI, the only "container" functionality built-in to the browser is... infrastructure, I guess you'd call it: Firefox provides all the tools for addons to do stuff with containers, but doesn't actually do anything with them itself.

EvilTerran··on Firefox extensions to make remote work and school a little better
Could you not use permissions.request() [0] to ask for access to a given site on-the-fly, when the user actually visits it? That seems to be how, for example, Reddit Enhancement Suite goes about getting perms for all the various sites it supports embedding content from (imgur, twitter etc) - you get a prompt when you click to open an embed for a site you haven't granted the permission for already.

[0] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

EvilTerran··on Port knocking
Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize.

https://news.ycombinator.com/newsguidelines.html

EvilTerran··on Incremental Regular Expressions (2012)
I find PCRE's rule easy enough: for a character you want to be taken literally, if it's punctuation backslash it, if it's not then don't; any unbackslashed punctuation (or backslashed non-punctuation) may be a metacharacter.

Compare to, say, POSIX or Vim[0] REs, where some punctuation characters are special with a backslash, others are special without, and I can never remember which is which.

[0] Regardless of the state of the "magic" option - the only way to get consistent behavior is to start every single RE with either \v (which works like PCRE) or \V (which works like your proposal).

EvilTerran··on 'Horrible hybrids': the plastic products that give recyclers nightmares
> For instance most spray cleaners come in bottles made of high-density polyethylene, which can be readily recycled. But first consumers must remove the spraytops, as they are made from different plastics and are not recyclable. Then consumers must find a way to pry off the brightly-colored, printed plastic wraps that packagers are increasingly wrapping around bottles to make the labeling more attractive.

> “Who does all that? Nobody,” said Sanborn.

I do! It's a little fiddly, but any sharp knife with a point you can slip under the label does a good enough job of slicing those off.

Good to know that helps, actually - I've often wondered whether I was wasting my time bothering with it.

EvilTerran··on In space, no one can hear you kernel panic
This post was your 22nd submission in the space of about an hour, in which time there were only 37 submissions from everyone else put together. One point in the new queue features six of your submissions in a consecutive row.

Per the Guidelines, https://news.ycombinator.com/newsguidelines.html:

Please don't submit so many links at once that the new page is dominated by your submissions.

EvilTerran··on Confessions of a Used Programming Language Salesman (2007)
> python came up without a platform to support it

What about numpy (+ its ecosystem, scipy/pandas/etc)? I get the impression that's contributed a lot to Python's growth over the years.

EvilTerran··on When debugging, attitude matters
So I changed the z-index of Div A to be 5 or something. But it didn’t work! In Firefox, div A was on top, but in Chrome, Div B was on top. Argh! Why?

... why indeed? I can't think of any (presumably fairly simple) scenario where that would happen.

EvilTerran··on Secure Rust Guidelines
Sure, I don't disagree - I meant only to add context for anyone reading who was unfamiliar with Haskell, lest they come away with the impression that the lack of a .get()-equivalent was some kind of egregious oversight.
EvilTerran··on Secure Rust Guidelines
> Hoogle doesn't seem to find me a function like Rust's .get() in the standard library

In practice, you don't really need one - the safe alternative to "xs !! n" is pattern-matching on the result of "drop n xs", as that's [] if xs has ≤n elements:

https://www.haskell.org/onlinereport/standard-prelude.html#$...

EvilTerran··on It never makes sense to use foldl on lists in Haskell (2019)
> if you're reducing the list to a scalar, you lose all the benefits this article wants to claim.

Not quite - for example, these both benefit from foldr, despite each producing a scalar:

  and, or :: [Bool] -> Bool
  and = foldr (&&) True
  or = foldr (||) False
... as they can both "bail out early" without evaluating the entire list (if they find a False or a True, respectively).

The distinction lies not so much in "are you reducing to a scalar?" as "can your binary operation be productive without evaluating its second parameter?" - or, if you prefer, "is it ever lazy in its second parameter?". If so, then foldr may be appropriate.

EvilTerran··on Awesome-ld-preload: List of resources related to LD_PRELOAD
Neat! I can see myself using several of these.

Erratum: the link meant for "openssl-hook" actually takes you to "otherport".

EvilTerran··on Kill Sticky Headers (2013)
Speaking of "concise", in modern browsers you can replace el.parentNode.removeChild(el) with just el.remove():

https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/r...

EvilTerran··on Dark matter nightmare: What if we are just using the wrong equations?
The point, as I understand it, is that we've found cases of galaxies that look like they should be about the same mass as each other based on the light they're putting out themselves, but gravitational lensing measurements indicate a significant mass discrepancy. That's what's hard to explain without "maybe there's a bunch of matter we can't see" - if it was more of a "maybe gravity just works differently at galactic scales" situation, that scenario would be impossible.
EvilTerran··on Ask HN: Searching for Functions via Type Signatures
There's Hoogle, for Haskell: https://hoogle.haskell.org/

I don't know if it implements any techniques from that paper, but it does let you search for definitions by type signature. Of note, it also does a pretty good job of finding results with different-but-compatible types, which is very valuable in a Haskell context given all the polymorphism.

EvilTerran··on Acute Effects of Electronic Cigarette Aerosol Inhalation on Vascular Function
Here's one: https://www.jneurosci.org/content/25/38/8593

Abstract:

Nicotine is the major neuroactive compound of tobacco, which has, by itself, weak reinforcing properties. It is known that levels of the enzymes monoamine oxidase A (MAO-A) and MAO-B are reduced in the platelets and brains of smokers and that substances, other than nicotine, present in tobacco smoke have MAO-inhibitory activities. Here, we report that inhibition of MAO dramatically and specifically increases the motivation to self-administer nicotine in rats. These effects were more prominent in rats selected for high responsiveness to novelty than in rats with low responsiveness to novelty. The results suggest that the inhibition of MAO activity by compounds present in tobacco smoke may combine with nicotine to produce the intense reinforcing properties of cigarette smoking that lead to addiction.

EvilTerran··on 16M Americans will vote on hackable paperless machines
Very well. In the vast majority of the UK, you don't need ID. That checkmark on your list remains misleading at best.
EvilTerran··on 16M Americans will vote on hackable paperless machines
That list is wrong. I'm in the UK, we don't need ID to register or vote here.
EvilTerran··on Free Is Too High a Price for Facebook and Google
That's just known expenditures by the Internet Research Agency, though. For a full accounting, you'd not only need to know if that was all the IRA spent, you'd also need to include, say... how much Russia spent on hacking into the DNC's emails, and into 39 states' election infrastructure[1]; how much value they extracted from the polling data Manafort sent their way[2]; etc.

And even with all costs taken into account, it took a perfect storm of factors outside their control for their actions to actually change the result. I doubt they even expected that outcome themselves.

[1] https://www.bloomberg.com/news/articles/2017-06-13/russian-b...

[2] https://www.theatlantic.com/politics/archive/2019/03/mueller...

EvilTerran··on Free Is Too High a Price for Facebook and Google
> whatever, Russia bought a couple thousand dollars worth of ads.

The Kremlin internet propaganda project had, at its peak, a budget of more than $1.25 million per month. It was doing a lot more than just buying adverts.

https://www.theatlantic.com/politics/archive/2018/02/mueller...

EvilTerran··on Abusing SHA-1 collisions for Chromium updates
I have a similar problem on my firefox-on-android: when I load a mobile.twitter link, it usually pinwheels for a bit, then throws up an error - either "you're rate limited" or just "something went wrong" (or, occasionally, it just pinwheels forever); then, regardless of which way it failed, loading the page a second time almost always works - but only if I do a proper reload from the browser UI, the in-page "try again" button doesn't help.

I figure something's timing out on the first attempt, but various bits get downloaded & cached before it fails, meaning the second try runs fast enough to not hit the same timeout.

EvilTerran··on YouTube to Remove Thousands of Videos Pushing Extreme Views
The Atlantic have taken that principle & modernised it: every article ends not with a comments section, but an invitation to email them your thoughts; then they publish the cream of the crop on https://www.theatlantic.com/letters/.
EvilTerran··on Security Update
When a user whose password is hashed the old way logs in, after checking the password they just supplied against your stored old hash but before forgetting the plaintext, you can compute the new hash & update your records.

Of course, that only works for active users - it won't upgrade anyone that never logs in. Depending on just how weak the old hash is, you may want to eventually cut off any lingering un-upgraded accounts: just forget their old hash, requiring them to go through your password reset process should they ever come back. If you've left it long enough, those accounts will probably never be used again anyway, so that should be NBD.

EvilTerran··on Tor Browser disabled NoScript, but can't update
Well, true, but all this is a lot more conspicuously fishy than "flip a setting that the user might have legitimately flipped themselves". You're not going to get far hiding a whole new Firefox install in $HOME before someone asks why theirs suddenly got 200MB bigger, for one thing.
EvilTerran··on Tor Browser disabled NoScript, but can't update
That very page acknowledges your concern & presents their counterargument - namely, they consider security software to be part of the Windows model, and expect that to intervene in the case of modified binaries:

> By baking the signing requirement into the executable these programs will either have to submit to our review process or take the blatant malware step of replacing or altering Firefox. We are sure some will take that step, but it won’t be an attractive option for a Fortune 500 plugin vendor, popular download sites, or the laptop vendor involved in distributing Superfish. For the ones who do, we hope that modifying another program’s executable code is blatant enough that security software vendors will take action and stop letting these programs hide behind terms buried in their user-hostile EULAs.

(emphasis mine)

Page 1 of 17Next →