32,405 karma · joined Jan 3, 2008 (18y ago) · 8,297 submissions
comment 9y ago · link · parent
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 :)
comment 9y ago · link · parent
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
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 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
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
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
comment 9y ago · link · parent