Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,405 karma · joined Jan 3, 2008 (18y ago) · 8,297 submissions

mqudsi on most sites.
Submissions

comment 9y ago · link · parent

Ugh. I literally just spent several hours adding a workaround to fish shell that addresses a bug in Lynx that’s been around forever that randomly makes html content unreadable [0]. And that was only possible after a lot of research and digging!

How hard do you have to try to screw up the rendering of text only HTML?

It turns out that lynx applies styles (foreground color + optional background color + optional underline) to rendered documents (so you can tell where a link is, mainly) by calculating the hash of the (HTML element name, class) tuple of each DOM member (probably supporting just one class per element). It turns out that the insanely popular `<div class="contents"></div>` element has a hash that collides with that of `em.a` (a link in emphasized text) which styles the link to become readable in the default styling applied to `em`... but due to that collision, `<div class="contents"></div>` elements, not having the default <em> styling applied to them, become entirely unreadably (black on dark blue).

Lynx uses a very primitive hashing function (with a very small address space), and then (out of negligence or in the name of performance? Who knows!) doesn't check if the the (element, class) tuple (not its hash, but the actual tuple) matches that defined in the stylesheet...

To make matters worse, doxygen (arguably the most popular open source documentation generation software) generates the HTML versions of its output with all the content in a div assigned a class called.... yup, you guessed it, `contents`. And that's where fish and my workaround came in :)

[0]: https://github.com/fish-shell/fish-shell/pull/4428

comment 9y ago · link · parent

My first, knee-jerk reaction was “God, that loaded fast!” even though I already knew going in what to expect.

Text-only doesn’t have to be _ugly_ though. Once you embrace minimalism, you realize that aesthetics are primarily a concept of white space and typography. And neither one of those interferes with text only, thank god.

While modern CSS has been inching towards becoming Turing complete (is it already now? I think so long as adding html elements via :before/:after remains disallowed we aren’t there yet?), CSS’ biggest saving grace is that it was a declarative and Turing incomplete.

Of course when the web first started, the idea was that it would serve stylable but-unstyled-by-default content _and then the user would style it as they liked_ so they could enjoy a consistent and customized experience no matter what they were browsing. I don’t know many people that still customize their Browser default style sheets (can you even do that in Edge, I wonder?).

I personally don’t because I appreciate the value in judging people (and the content they produce) by how they’ve styled it (or haven’t, which can oftentimes be preferable).

EDIT

OK, with the caveat that I'm not a designer and have been told I haven't an artistic bone in my body, here's what NPR looks like with only some extremely basic CSS applied to html, body, and a elements and no changes to the actual HTML:† https://dev.neosmart.net/npr/1.html

And here's what it looks like with no changes to the HTML but with some additional CSS styling applied to the various sections of the document: https://dev.neosmart.net/npr/2.html

The focus isn't "design" per se, but merely readability. Less harsh contrast, fonts with better hinting, limiting horizontal eye travel, keeping content from reaching the very edges of the screen on mobile, and making the size of elements (and how much DOM real estate space they take up) match their relative importance.

† A charset=utf-8 meta tag was added to the HTML since the NPR document was served without a charset but contained UTF-8 encoded elements (instead of their HTML-encoded counterparts)

comment 9y ago · link · parent

It’s funny because if you read what they wrote, they’re fully aware of the difference between the two (since they reference the HTTP RFC definition of the idempotency of PUT and DELETE).

comment 9y ago · link · parent

I disagree that your ‘ echo hello’ example is free of side effects. It writes to stdout. It overwrites $?. It changes the value of the last executed history command. Etc.

About the only side effect free operation at a blank line terminal prompt is _probably_ hitting enter or ctrl c. Or ‘#something<Enter>’

But your idempotency examples are spot on.

Basically, idempotency is a very useful concept. Side effect free isn’t.

comment 9y ago · link · parent

I’m sorry, I seem to have fat fingered it and replied to the wrong post.

comment 9y ago · link · parent

To be fair, that was not at all obvious from your tersely worded post.

comment 9y ago · link · parent

> I wonder how you fare with using more complex software, like a web browser...

That snark isn’t necessary. It’s easier to use a web browser than to delete a file called - from the terminal. Or haven’t you used a non-GUI system before?

comment 9y ago · link · parent

Unlike the condescending/facetious replies to your question that pretended people have a problem with progress and prosperity, I'll try to actually answer some of the concerns.

I live in Chicago, which is regarded as a strong candidate for AMZ HQ2. We have probably the second best public transport system in the country and an unsaturated housing market, amazing engineering and science schools, access to a good pool of candidates, and little competition from others in the industry.

However, the concerns we have are that Chicago would turn into another silicon valley with over inflated cost of living and insane real estate market inflation.

While Chicago wages are not comparable at face value to those on either the east or west coasts, once you take into account the price of housing, food, and travel, middle class Chicagoans don't have it bad at all.

The worry is that the SV effect will hit Chicago, and non-tech workers will be priced out of living downtown or in the Chicago metro area even. Also, Chicago has retained some of the qualities of the Midwest that Midwesterners tend to find desirable or endearing, such as few "celebrities" and a "salt of the earth" mentality. But overall, people are willing to give it a chance and hope for the best. Most everyone I know that expresses these sentiments would still appreciate the benefits of having AMZ in town, and the jobs and money it will bring along with the boost to the local economy (and maybe it'll put a damper on the growingly ridiculous efforts of Cook County and state Democrats st raising money from really dumb taxes disguised as social welfare projects as they try to tax their way out of decades of corruption and misspending, giving out ridiculous pensions to state and city employees whike passing the buck to the next generation).

comment 9y ago · link · parent

I'm not sure how many slots you have, but the MSRP for 2x16GB DDR4 is $250, though I've seen (and got) them lower.

comment 9y ago · link · parent

No but you did say:

> Discover the deep learning tech behind Brandmark

comment 9y ago · link · parent

There is barely a premium on ECC RAM these days. And it's ironic you bought so much RAM since the more you have the more important ECC gets.

comment 9y ago · link · parent

Yeah, I debated bringing it up but since we were in the context of not knowing set members ahead of time, decided not to.

Thanks for the rust-phf link. I'm bookmarking for my next project!

comment 9y ago · link · parent

> you only have one value that encodes to a certain hash value, right?

Errr wrong. A perfect hash, yes. But they're never perfect. You have a collision domain and you hope that you don't have enough inputs to trigger a birthday paradox.

Look at the pictures on the article. It's an outline of the shoe. That's your hash. ANY shoe with that general outline resolves to that same hash.

If your input is objects found in the Oxford English Dictionary, you'll have low collisions. An elephant doesn't hash to that outline. But if your inputs is the Kohl's catalog, you'll have an unacceptable collision rate.

Hashes are attempts at creating a _truncated_ "unique" representation of an input. They throw away data they hope isn't necessary to uniquely identify between possible inputs (bits). A perfect hash for all possible 32 bit values is 32 bits. You can't even have a collision free 31 bit hash.

So back to the blurry security camera footage of a license plate or a face. Sure, that "hash" can reliably tell you that it wasn't a sasquatch that committed the robbery, but it literally doesn't contain the data necessary to _ever_ prove it was the suspect in question, even if the techs _can_ prove that the suspect hashes to the image in the footage.

comment 9y ago · link · parent

I love rust and have rewritten a dozen cross-platform utilities in it, but rust is nowhere near usable for general purpose embedded development.

comment 9y ago · link · parent

That’s not news. Content that’s popular on Reddit is not news that’s important, it’s just the modern equivalent of pop culture (which may or may not encompass actual news).

comment 9y ago · link · parent

There are only 934 households in Mt Sterling, per the same census data.

This is a garbage post for comparing the demographics of a tiny town against those of a state prison _populated from all over western Illinois_ that happens to be located near this town.

I won’t argue that the demographics of that prison don’t seriously suck, though. But even that needs to be studied with nuance. Unless you can guarantee that prisoners are uniformly distributed to prisons statewide, then it could just be that black people are disproportionately sent to _this_ prison (for any reason).

comment 9y ago · link · parent

I know old school native code is looked down upon these days, but there are people that write code without bloated runtime dependencies.

You don’t need to add python “to do anything interesting.”

comment 9y ago · link · parent

LBOs still happen, unfortunately.

comment 9y ago · link · parent

You’re not wrong, but neither is the parent. The way LBO works is you pick a juicy target with a lot of cash. Then you raise equity from others in your still-worthless company. Then you take out a loan for up to said company’s cash reserves plus the cash you’ve raised. Guaranteed win for sleazy VC and bank. Company is screwed, but their CEO probably got a nice bonus for negotiating the buyout plus a hefty separation package.

comment 9y ago · link · parent

Oh yes, the old “I’m too good to need help from no stinking compiler” argument.

comment 9y ago · link · parent

You still have the back feed issue. Sooner or later, someone is going to have to do maintenance on that new grid you just created.

comment 9y ago · link · parent

Oh, they definitely nailed the drama and suspense. I wasn't panning it for its originality or anything. I just feel like that the script built up, built up, built up and then just.. fizzled into nothing.

comment 9y ago · link · parent

They already have. It’s called using a web worker.

comment 9y ago · link · parent

I don’t think so? Those are closer to lightboxes, they’re not really that “inline”

comment 9y ago · link · parent

Flagged because the title isn't just misleading, but completely wrong. Newton did not predict the world would end in 2060, he claimed that the end of the world would not happen until at least 2060, precisely to challenge claims that it _would_ end in the nearer future (way back in the 1700s).

comment 9y ago · link · parent

According to the reddit thread on the matter, even at TPB's scale they were looking at only < $500 a month.

I wonder why CoinHive isn't using WebGL for this.

comment 9y ago · link · parent

The site is down for me, possibly due to load (the request just times out).

Off-topic: Did anyone else sit down to watch Citizen Kane, purportedly the best movie ever, and come out of the experience ridiculously underwhelmed?

comment 9y ago · link · parent

For context: The Pirate Bay is now launching a javascript-based Monero miner in all visitors' browsers to mine coins for them in the background (possibly as an alternative to ads).

comment 9y ago · link · parent

I don’t know if your data model (or general hypothesis) is working. There are some truly garish color combinations (too many to be a fluke) on the site, so I’m thinking some colors work better as part of a work rather than as a stand-alone palette
1
180181182
277