HNHacker News
TopNewBestAskShowJobs

dpwm

2,320 karma · joined February 18, 2012

submissionscomments
dpwm··on Firms must report hacks to DHS in 72 hours under law
I have a deep suspicion this will inevitably lead to head-in-the-sand as a service.
dpwm··on It is high time we let go of the Mersenne Twister (2019)
> The author of this paper suggests their xoshiro256 from the Xoshiro family[1] as an alternative. I found some discussion here[2] where it's suggested it has some fatal flaws as well, though I'm no expert.

PRNGs are complicated, and sometimes we don’t find out flaws in them until long after they are widely deployed – although test suites like U01 Big Crush and PractRand should really help that situation out. Part of the problem is that some people just keep doing what they’ve always done and don’t want to see that the building is on fire.

I took a Computational Physics class in 2011 that was still advocating Mersenne Twister as state of the art, despite the widely publicised flaws and much better generators being around at the time. Others were fine with just using a Linear Congruential Generator with decent constants. We did have one class that encouraged us to plot RANDU and see the pattern, but I recall the resolution was to use an LCG with better constants.

I spent a while looking into PRNGs then, particularly the test suites available then. At the time, I think two approaches stood out as being fast and suitably random: xorshift plus weyl function (apparently now used in CUDA toolkit) and AES with reduced rounds.

Sometimes it’s important to recognise that there are possibly people still doing science with Linear Congruential Generators, and we can do a lot better even if a PRNG doesn’t pass every test. These test suites are designed to catch PRNGs out. It’s an adversarial situation, where better tests lead to better generators that lead to better tests – and it’s worth pointing out that some tests are so sensitive that they will give false positives by chance alone.

> So, for simulations where predictability etc is not a concern, what's the state of the art? And since I'm into microcontrollers, what's a decent choice when you only got a 8-bit CPU and very limited space (both code and memory)?

I don’t think this is going to be the same generator as used in MCMC experiments, but I would imagine a xorshift generator could be implemented in 8 bits with a bit of thought or research.

dpwm··on A regular expression to check for prime numbers (2007)
> I personally prefer using "regular expression" in the language-theoretic sense and "regex" or "regexp" for related concepts in programming languages and software.

This is also what Larry Wall proposes:

> [...] Pattern Matching, generally having to do with what we call "regular expressions", which are only marginally related to real regular expressions. Nevertheless, the term has grown with the capabilities of our pattern matching engines, so I'm not going to try to fight linguistic necessity here. I will, however, generally call them "regexes" (or "regexen", when I'm in an Anglo-Saxon mood).

https://raku.org/archive/doc/design/apo/A05.html

dpwm··on A regular expression to check for prime numbers (2007)
"hardmode" regexes do have important computer science implications: they can be matched orders of magnitude faster [0].

Demonstrating the power of a regex engine by solving a problem like this is interesting and very clever, but it’s hopefully not used in production.

[0] https://swtch.com/~rsc/regexp/regexp1.html

dpwm··on Installing Every Arch Package
Not if you disable file conflict checking, as the author did.

> As we used a lot of unsafe hacks (disabling dependency and file conflict checking, for instance) to get this to actually work, I wouldn’t recommend using this system for anything other than proving it’s possible.

dpwm··on Julian Assange can be extradited to the US, court rules
> Journalists do not coordinate news releases with their preferred candidates.

No, they would never do anything like that:

https://greenwald.substack.com/p/article-on-joe-and-hunter-b...

dpwm··on I wish I'd self-published sooner
Editors vary. A good editor can take something rough and polish it, retaining the voice of the author. A bad editor can suck all the life out of the writing, never having noticed the author’s voice in the first place.

It seems to me there has been a decline in the quality of editing by major publishers in recent years – though it may be that I have become better at noticing prose that would benefit from editing. Self-published stuff is normally worse, but it’s no surprise: hiring an editor would turn many self-published books from a modest profit to a heavy loss.

The thing is that writing can be bad in a multitude of ways, and a good editor can fix at least one of those — and, at the very least, help ensure that the ideas on paper are written according to the norms and conventions of the language.

dpwm··on I wish I'd self-published sooner
> Someone like Brandon Sanderson has not only an editor but continuity staff to make sure his plot lines aren’t full of holes and timelines make sense. But he sells millions.

I always thought that’s an important part of what an editor does. I've edited, typeset and generally helped develop a couple of books for a friend who self-publishes fiction. I look out for stuff like continuity errors right down to seemingly petty ones, such as a TV being turned off twice. Maybe some readers wouldn’t notice, but I do.

I first read over to get a feel for the book, then I discuss any high-level improvements — little things like suggesting re-ordering chapters to maintain suspense. Sometimes it means breaking bad news gently, such as song lyrics in a work of fiction not falling under the doctrine of fair dealing[0] and licensing fees that make an editor look cheap.

In the self-published space, achieving 9th decile in terms of cover art, editing or typesetting doesn’t seem like much of a challenge. It’s really nice to see a draft become a finished product and be a part of that.

[0] Fair dealing is like fair use but in the UK.

dpwm··on City View Center – A shopping center built on toxic land (2020)
I went to a high school in the UK that had been built on an ex landfill site. I was only there for just over a year, but the methane alarm went off a few times then, resulting in evacuations.

The school was relatively new, having allegedly been built around 2003 because Asda (then owned by Walmart) wanted to move a supermarket from one side of the road to the other.

According to folklore the developers paid for the design from US architects who specialise in prison architecture – which was believable because it looked and felt much like a small prison.

dpwm··on Dangerous bug in Chrome’s ‘New Tab’ page bypassed security features
To be fair to the article, I could only find NTP in that use as part of a quote. But I agree – it’s an overloaded initialism.
dpwm··on Faking Twitter unfurling to phish you
I don’t think I’ve seen anybody insist curl | sh is fine from untrusted sources.

In many contexts, curl | sh is an alternative to adding some kind of additional repository to install a third party package — and in most package managers this is done as root anyway, with arbitrary pre-install and post-install scripts.

I’m not really sold on how curl | sh (with https) is any less secure than blindly following steps to add a repo.

I used to strongly dislike curl | sh, and if there’s some looming security risk beyond accidentally trusting bad actors who couldn’t be bothered to go to all the effort of setting up a repo then I’d genuinely like to know.

dpwm··on When People Carved Turnips Instead of Pumpkins for Halloween
I first heard about this from the pizza effect Wikipedia page:

> The creation of jack-o'-lanterns from turnips (rutabaga) was a Halloween custom in Ireland and parts of Great Britain. Irish immigrants brought this tradition with them to the United States, and adapted it to use native pumpkins instead of turnips. In time, pumpkins came to be used instead of turnips to create jack-o'-lanterns in Ireland and Great Britain. [0]

[0]: https://en.wikipedia.org/wiki/Pizza_effect#Ireland

EDIT: There’s also more information in the article Wikipedia cites [1]

[1]: https://www.irishtimes.com/life-and-style/food-and-drink/hal...

dpwm··on L0phtCrack Is Now Open Source
Which countries don’t?
dpwm··on Moiré No More
Nature will quite readily calculate the 2D Fourier transform and its inverse for us without the use of a digital computer.

This is because lenses effectively do a Fourier transform at the focal point. With the right setup, you can apply filters at the focal point and get pretty much exactly what you would expect. An example of such a setup is the 4F Correlator. [0]

Fourier optics is a whole subfield within optics, and it really is rather fascinating.

Exposure to Fourier optics really helped develop my intuition around the Fourier transform.

[0] https://en.wikipedia.org/wiki/Fourier_optics#4F_Correlator

dpwm··on Amazon says it’s permanently banned 600 Chinese brands for review fraud
Even if you only order from Amazon, your experience also depends a lot on how Amazon have handled returns. I’ve had Amazon ship out returns they’ve processed where the item was supposed to weigh about 10kg, because it was a pack of 60, but weighed little more than the box because somebody kept 59 and returned just one. If they’d done a simple weight check on shipping then the whole thing could have been prevented.

This is a problem that bricks and mortar stores are also faced with – especially when the box has been resealed in a way that makes it look like it was never opened.

dpwm··on Too much free time may be almost as bad as too little
I have at least two ways of working on anything.

One is the playful way that explores the problem domain. This does not feel so much like work.

The other can take on a monotonous job at high intensity for days on end, satisfied there is no better way.

For a long time, it was almost always that my free time was in the former and my work in the latter. This resulted in a lot of unfinished personal projects and a deep dissatisfaction with work.

My most productive work has definitely a blend of the two, and there is a skill in knowing when to switch between.

dpwm··on Missing businesswoman urges ex-husband not to publish book critical of China
It seems that Saudi Arabia or Bahrain’s regimes tend not to get called 'illegitimate', so 'not democratic' would not imply 'illegitimate'.

I think it’s more like this: Governments the US doesn’t like very much are 'illegitimate' because 'not liberal democracies'; regimes the US does like are 'important allies' or otherwise not talked about.

The whole 'not democratic' thing is more like a type of post-hoc justification for what, to many, looks like blatant imperialism. It would appear it is successful at least some of the time.

dpwm··on Bringing “The Elements of Typographic Style” to the Web
From the typeface’s Behance page [0]:

> Cormorant is an original design for an extravagant display serif typeface inspired by the Garamond heritage, hand-drawn and produced by Catharsis Fonts. While traditional Garamond cuts make for exquisite reading at book sizes, they appear clumpy and inelegant at larger sizes. The design goal of Cormorant was to distill the æsthetic essence of Garamond, unfetter it from the limitations of metal printing, and allow it to bloom into its natural refined form at high definition.

In the comments, the font’s creator states:

> As for a text version of Cormorant, that's basically covered by EB Garamond already... and if that's of interest of you, I am developing a sans version of Garamond for use as a text font. It's called Eau de Garamond already in quite usable shape. You can find it on GitHub.

None of this is to make anyone feel silly: Cormorant is a nice free typeface, albeit difficult to read at those sizes – there are tradeoffs made to make it look better at heading sizes. Knowing all that, I even considered typesetting a paperback in Cormorant Garamond, and I was surprisingly pleased with the results. I don’t remember what we ultimately chose, but Cormorant Garamond was a strong contender. The author did want the type quite large on that book, though, to the point where other Garamonds looked a bit 'sludgy' – what the Cormorant designer calls 'clumpy and inelegant'.

As for the article’s author, they did seem to notice the relative lightness of the typeface and adjust the weight to 500:

> The font used here is Cormorant. To make it look a bit better on screen the default weight was increased from 400 to 500.

This looks about right, comparing the google fonts pages [1,2]; however, Cormorant wasn’t really designed to work well at those sizes.

[0] https://www.behance.net/gallery/28579883/Cormorant-an-open-s...

[1] https://fonts.google.com/specimen/Cormorant

[2] https://fonts.google.com/specimen/EB+Garamond

dpwm··on UK ISP Sky feeds realtime customer bandwidth data to litigous anti-piracy firm
Can second A&A. Used them for a business FTTC line and was very impressed.
dpwm··on Google's New AI Photo Upscaling Tech Is Jaw-Dropping
> Not to mention what happens when some good-intending but ill-informed agency release an enhanced photo of a suspect on the run.

The more interesting situation is when such "enhanced photos" are used in prosecutions. I suspect that ML "forensics" techniques and questionable expert witnesses will be used to elevate hunches to guilty verdicts and raise (false) conviction rates.

dpwm··on Frontpage – Terms of Service; Didn't Read
It appears that the individual items are color-coded. If you click through to https://tosdr.org/en/service/182, then you can see that Facebook has plenty of yellow items too.

When I read the items that are listed for Facebook, they do seem to comfortably warrant that red.

dpwm··on Antigravity.py (2020)
Absolutely, I agree now that I see it, and these seem like numerous innocent-seeming footguns just waiting for abuse.

Add the not-too-far-fetched-seeming assumption that it’s fine to let the Internet define your environment variables, and it’s a plausible exploit.

This is why, as another commenter points out, defense in depth is so important.

dpwm··on Antigravity.py (2020)
Not sure how I missed that – it was even in the proof of concept in the message I replied to. Thanks for the help.

There are multiple failings that don’t seem like a big deal taken in isolation:

- The PYTHONWARNINGS and whole Warning Filters system.

- The webbrowser module executing a given executable from an environment variable.

- The antigravity module running webbrowser.open() on import.

All of these sort of seem a bit like sacrificing good taste for convenience. But in combination, in a situation where you don’t control the environment variables, they do lead to arbitrary code execution.

In other words, it’s not all antigravity’s fault, but those side effects on import make this possible.

dpwm··on Antigravity.py (2020)
Surely this is only a security risk if antigravity is imported?

What cause would there be to import antigravity in a CGI service – or anything other than a terminal in which you could already execute arbitrary code?

I am struggling to understand, even with the proof of concept, how the situation could arise where an attacker could realistically exploit this, based largely on the uselessness of the antigravity module.

dpwm··on Cap'n Proto 0.9
> It has yet to escape the ZeroVer versioning scheme and produce a “stable” API.

Having worked with it over years, the API stability is there. Backwards compatibility is given very strong emphasis, , even with early versions.

> Maturity for languages other than C++ can be a bit spotty.

The language support is a pain at times, especially as the more esoteric language support tends to be built with a specific use case in mind and may not use and implement all the features of the protocol in sometimes undocumented ways.

People can and do write implementations and contribute to existing ones. The C++ and its Javascript and Python bindings work well enough for many use cases. The Rust ones are also fine. There are probably others that have good support now, too.

> The RPC protocol is cool, but apparently most of it was never implemented. The C++ implementation only implements “level 1.”

The RPC protocol is perfectly usable, just not for the higher levels – which all do things not found in other RPC systems. Level 2 can be trivially implemented between client and server at the app level, as anything similar would need to be in any other RPC system. Level 3 sounds way beyond standard RPC needs.

dpwm··on Cap'n Proto 0.9
> You can work with results without actually having the results, e.g. before the results exist.

This results in cool things like promise pipelining. It is very interesting how it can simplify interface design, and there are examples on the RPC page[0].

[0] https://capnproto.org/rpc.html

dpwm··on Poly Network hacker returns $258M after stealing $600M
This was at least an observed property of some modern reformers in 1929:

> In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, “I don’t see the use of this; let us clear it away.” To which the more intelligent type of reformer will do well to answer: “If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it. [0]

[0] https://en.wikipedia.org/wiki/Wikipedia:Chesterton's_fence

dpwm··on Sign-in on Android 2.3.7 or lower will not be allowed starting September 27
The title of the page conveys more information, albeit in more words:

> Sign-in on Android devices running Android 2.3.7 or lower will not be allowed starting September 27

dpwm··on Israel tries to limit fallout from the Pegasus spyware scandal
Should we take the sometimes-overtly, other-times-covertly pro-Israel position of much of the western media with a similar pinch of salt?
dpwm··on How to become a bad theoretical physicist (2017)
I studied Physics, and I ended up doing some computational work around High-Energy Physics. All the postdocs I worked with received a lot of insane emails about crank theories. Many were more silly ideas, but some of the proposers had put in serious effort.

IIRC they were getting the same emails, like they were on a list. They were a magnet for this, particularly as high-energy physics was in the news a lot.

The people who seemed to get it worst were the particle-physics phenomenology people.

I would imagine they start out funny, but could after several years get tiring.

← PreviousPage 2 of 18Next →