12,994 karma · joined June 4, 2008
You can, but I'd avoid it. If you want to offer multiple levels of abstraction, you'll want to offer a code point abstraction in between graphemes and bytes. And for several reasons you'll probably want to either have, or have the ability to emit, fixed-width units.
Python does this internally (3.3 and newer): the internal storage of a string is chosen at runtime, based on the widest code point in the string, and uses whichever fixed-width encoding (latin-1, UCS-2 or UCS-4) will accommodate that. This dodges problems like accidental leakage of the low-level storage into the high-level abstraction (prior to 3.3 Python, like a number of languages, would "leak" the internal implementation detail of surrogate pairs into the high-level string abstraction).
UTF-8 is a non-starter because it encourages people to go back to pretending "byte == character" and writing code that will fall apart the instant someone uses any code point > 007F. Or they'll pat themselves on the back for being clever and knowing that "really" UTF-8 means "rune == code point == character", and also write code that blows up, just in a different set of cases.
And yes, high-level languages should have string types rather than "here's some bytes, you deal with it". Far too many real-world uses for textual data require the ability to do things like length checks, indexing and so on, and it doesn't matter how many times you insist that this is completely wrong and should be forbidden to everyone everywhere; the use cases will still be there.
You have a Brex card, you offer to pay for something: "Sure, I'll just Brex it..."
Here's the documentation for the most recent thing I released:
https://django-registration.readthedocs.io/en/3.0/
And the one before that:
https://pwned-passwords-django.readthedocs.io/en/1.3.1/
Here's the next of my packages that I'm working on, not because the code needs work but because the documentation isn't up to my standards anymore (in fact, I'm doing a rolling refresh of all my personal packages right now):
https://webcolors.readthedocs.io/en/1.8.1/
I don't expect everyone else to match my output in documentation. I do expect people to write some type of prose documentation covering more than just "here's an auto-generated API reference, good luck", or "here's a README with a couple examples, good luck". And I absolutely treat quality of documentation as a predictor for quality of code, because it tends to be a pretty strong predictor.
Want to tell me how "entitled" I am?
People who put in the effort to have good documentation are more likely to also be producing good software that's worth the time I'll put into trying to learn it.
And no matter how righteous you want to get here on HN in proclaiming that to be "toxic" and trying to read it uncharitably, I'd bet all the money in my wallet right now that you have 30-second heuristics you use to judge whether a piece of software is worth your time to explore.
Except for all the things you need to know in order to use the code. Which are why you still write actual real honest-to-God prose documentation. Or, if you don't, is why I don't bother trying to use your code.
Politicians of explicitly right-wing alignment control:
* The US Presidency
* The US Senate
* The US House of Representatives
* 33/50 US governorships
* Legislatures of 26/50 US states
and are about to install a conservative-leaning majority into the US Supreme Court.
Rosa Parks you ain't, bud.
Much of what you're trying to do is impose one-size-fits-all enforcement on both types. Controlled-access roads forbid pedestrians and bicycles, so arguments about protecting pedestrians and bicyclists on those roads fall flat. They should be using 85th-percentile metrics, in combination with the known design speed of the road, to set limits. But because controlled-access roads tend to have higher speeds, they're also the most tempting targets on which to run speed traps (i.e., if you can set a stretch of road to 25mph when the rest of it is 55mph, and park a hidden camera or cop right at the boundary, you can make a lot of money for your municipal budget, and precisely zero dollars of it will have been justified by increased "safety").
For the non-controlled-access roads, most of the real solutions the strongtowns/walkable/bikable/etc. movements want are going to come down to radically different infrastructure which have nothing whatsoever to do with speed limits. Speed limits are at best a non sequitur there.
1. Not actively providing resources to a position you dislike
2. "Using your power to silence" positions you dislike
I know you've said these are equivalent, because you're arguing that certain people owe other people a platform and associated services (1), and you've used the language of (2) to shame them for not doing it.
The only thing left to do at this point is ask if you're willing to practice what you preach.
Red-light cameras in the US opened up all sorts of issues nobody thought about when they were just "totally for" ticketing people who ran red lights. We got issues like local governments tinkering with timing of traffic lights in order to increase the number of violations, because violations are lucrative and who wants to defend red-light runners? People who run red lights are bad people who do dangerous things, and they should be punished!
There are also the ongoing studies into whether red-light cameras actually increase collisions, by incentivizing people to stop unsafely.
And that's without getting into the due-process issues, or the way offenses start creeping into more expensive categories (see California cities which have been "upcoding" various other offenses, like rolling turns, into full-on red-light violations in order to collect larger fines).
Speed limits have a number of notorious issues; they tend to be set for political, rather than safety, reasons, and very few US jurisdictions actually follow the general best practice of setting limits based on 85th-percentile speeds. Some smaller towns infamously derive almost all of their municipal budget from running speed traps (i.e., a 55mph highway passes by, the town annexes a tiny strip of it and sets a far lower temporary limit, then tickets as many unsuspecting drivers as possible). What you're asking for is to industrialize all of those issues.
I'll arrange for you to tithe in support of organizations promoting those causes. I'll also arrange for someone to show up at your home, every day, and deliver a one-hour lecture on the ideas you dislike.
I'm sure you'll do this because, after all, you believe in free speech and you believe you must "uphold" it by requiring people to support ideas with which they disagree, Yes?
The reply is always "yes, you can CSRF yourself, because it's not supposed to protect against that; it's supposed to protect you from other people". In exactly the same way, CORS is there to protect you from other people. You can always hack your own user-agent to disregard CORS, but the only person you can harm that way is yourself.
The suit filed after he rejected the first settlement included the threat of banning him from serving as a director.
Turning those companies into smoking holes in the ground doesn't require anyone to upgrade their equipment. All it takes is willingness on the part of lawmakers and regulators to track them down and make them regret their business practices.
Python introduced the annotation syntax (for everything except variables/attributes) in 3.0. The annotation syntax for variables/attributes was introduced in 3.6.
Many many years ago, Python had two separate type hierarchies, similar to what you see in Java. There was one hierarchy for Python's built-in types, and another hierarchy for classes. Among other things, this meant you couldn't subclass the built-in types (this is why, for example, there used to be a 'UserDict' class you could use to write things that mostly acted like subclasses of dict).
Python 2.2 began the process of unifying the two hierarchies. This was accomplished, ironically, by creating a split in Python's classes.
To opt in to the new approach, you wrote a class which had 'object' among its ancestors, either as its direct parent or as a grandparent, great-grandparent, etc. These were called "new-style classes", to distinguish from "old-style" (pre-2.2 behavior) classes.
class Foo:
pass # This is an old-style class
class Bar(object):
pass # This is a new-style class
"New-style classes" provided the rich data model, including special protocol methods, Python programmers are now used to, along with the ability to subclass built-in types.In Python 3, the distinction was finally removed (because it was backwards-incompatible, it had to wait for Python 3), and now all classes are "new-style", regardless of whether they explicitly have 'object' somewhere in their ancestors.
Any codebase that's already Python 3+ only does not need to subclass 'object' to get the expected behavior. Any codebase that still supports Python 2 should continue to subclass 'object' to get new-style classes, until such time as it can migrate to Python 3+ only.
The only part of a DMCA takedown that's under penalty of perjury is the assertion that you are the copyright holder, or are authorized to act on behalf of the copyright holder.
The infamous Diebold case -- where they did get penalized for a false DMCA notice -- involved Diebold more or less admitting openly in court "yeah, we knew it was wrong but we sent a notice anyway". Which means it's extremely difficult to get someone on a false DMCA notice.
For example: the US was in World War I for 574 days (declared war on Germany on April 6 1917, and the war ended on November 11 1918), and entered the conflict with the Zimmerman telegram and German submarine attacks as its casus belli.
But the US had been aiding the Allied powers prior to that, and from the German perspective the resumption of unrestricted submarine warfare, and the resulting attempt to enlist Mexico to join the war against the US, was a defensive move to stem the flow of supplies from the neutral-but-obviously-biased US to Germany's existing opponents.
Suppose you say any system that can be used for communications must have a way to tap when a warrant is issued.
This means any encrypted communications system must have a back door built in that the government can access. And not just some single highly-regulated federal task force: any federal, state or local court in the US could in theory issue a warrant for someone's communication data, so the backdoor would have to be accessible to all of them.
Which means there's no encryption. There's no way that many separate people and agencies, all with access, would be able to maintain operational security; sooner or later it's going to blow wide open and anyone who wants to get access to someone else's communications will be able to with little effort.
That's what you're arguing for. Is that what you want to argue for?
And this is not idle abstract hypothetical slippery-sloping here. When the legal fight was happening, to try to force Apple to decrypt the San Bernardino shooter's phone, news came out that local police agencies around the country were literally lining up things like "someone was in a car crash, decrypt their phone for us so we can see if they were texting while driving" requests in anticipation of Apple being forced to decrypt phones in response to court orders. The instant you open up and force a backdoor/decrypt for one case, it will be wide open for every case, everywhere, and then we're back to effectively no encryption.
The whole point of it is to override and render invalid/unenforceable terms which try to forbid posting honest reviews of companies.
One can say "this is not a revolutionary thing" without simultaneously saying "this is utterly worthless". Avoiding the hero worship and the personality cult does not require throwing out any idea of useful things coming from SpaceX or Tesla.
"This is not the revolutionary act of genius people portray it as"
and
"This is so trivially easy anyone could do it"
Tesla and SpaceX are trying to do things that have potential utility. Things which will advance the state of their respective arts even if they fail. There is no shame in "merely" doing that! There's also no need to inflate it into something it isn't.
Typically, an employer can run a criminal background check in a "ban the box" jurisdiction, but only later in the process (for example: after completing interviews and provisionally deciding this is someone you'd like to hire). There may also be other rules in place about how you can use information from the background check, and what you have to do if you decide to revoke the offer of employment based on the result of the check.
When I was in college I used to teach friends the importance of encryption by just showing them a live dump of packets on the dorm's LAN. You could see everything: here are the IMs coming to you and getting your away message as a reply, there's your computer refreshing the news site you were looking at a minute ago... it opened their eyes in a big way.
Encryption -- even without checking seventeen forms of government-issued ID from the person on the other end -- does in fact stop that passive surveillance, and like it or not that's a gigantic use case.
The realistic threat model for most people in terms of active MITM is something like their ISP trying to inject ads and tracking into what they browse, or their home router getting compromised. It takes very very little in terms of identity verification to shut that down; DV certs, which you can get by the truckload, for free, from Let's Encrypt -- will handle it just fine. Which means you don't need EV for that.
As to Snowden, I'm reminded of James Mickens' famous breakdown of threat models. All the Ultra-Verified Premium Secure XP+ Guaranteed™ certificates in the world ain't gonna help if a major government decides to come for you.
EV is snake oil. It literally does not solve any realistic problem the average person has when using the internet; all it does is line the pockets of the cert vendors. DV is the absolute most you need to shut down the things you can shut down, and encryption in general -- even without verification! -- is just fine, thanks. I know I might have a secure channel to Satan. I care about the "secure" part, not the "Satan" part.
Also, as I often do when faced with a true believer, I'll ask you: how many times have you initiated an SSH session with some host for the first time and just accepted past the initial warning? If encryption without rigorous verification is "objectively worse than no encryption at all", why didn't you just telnet instead?
I suppose if you read literally anything other than absolutely fawning worship of Elon Musk as history's most titanic genius as a "tear down", I could see that.
But... it is absolutely true that his business model is incremental improvements + economies of scale. Tesla and SpaceX aren't in the business of inventing fundamentally new things. They're in the business of making improvements to already-invented things, and mass-producing them to try to bring costs down. This is only a troubling thing to read if you're deeply invested in his cult of personality.