5,109 karma · joined Jun 27, 2012 (14y ago) · 1,639 submissions
comment 7y ago · link · parent
class GetNoCacheDefaultCookieJarStrategy {
...
}
fetch('https://google.com', new GetNoCacheDefaultCookieJarStrategy())
over const my_usual_fetch_opts = {...}
fetch('https://google.com/', my_usual_fetch_opts)
There are almost no uses of the strategy pattern that aren't equivalent to a trivial first-class function like a filter predicate or equivalent to a trivial plain-old-key-value-options-object, so the non-pattern version is stylistically preferred in the 99% case where it's not actually necessary.comment 7y ago · link · parent
Stop thinking about the country with literally less than 1% of world internet users and start thinking of the reputational damage a less than charitable presentation of your collaboration with a totalitarian state against your users would do to the other 99%+ of your market.
comment 7y ago · link · parent
While you're monitoring for traffic/errors/latency throw in minimum success rate. Make a good estimate of how many successful operations monitored systems will do per minute on the slowest hour of the year and put in an alert if the throughput drops below that. You'd be surprised how many 0 errors/0 successes faults happen in a complex system, and a minimum throughput alarm will catch them.
comment 8y ago · link · parent
It does require extensive testing and permission by the FAA (and the aircraft manufacturer, and the airline, and others) and extensive support teams in terminals but it's done semi-routinely.
comment 8y ago · link · parent
Deep copy roughly means "If I do `dst = deepcopy(src)`, modifying anything in the world I can reach through a reference from dst should have no side effect visible through src" which is a reasonable thing to ask in some special cases (a tree of plain old javascript values, a DOM node) but not reasonable in others (a database connection object, a file descriptor, a user-id)
Like, what should a deep copy function do if it reaches a reference to the global object? or a function that closes over some references in the object being copied?
The answer is always "it depends on what the object will be used for later and what specific behavior you want"
comment 8y ago · link · parent
There's nothing inherently wrong with structured clone, but it's only for JSON-able objects with extensions for circular references and some built in value-like classes. It's also special-cased for safe transmission between Javascript domains so it has a bunch of undesirable behavior for local copies. (no dom, no functions, no symbols, no properties...)
Even primitive types can't be safely copied unless you know what they're going to be used for later, a nodejs file descriptor is just an integer but it's also a reference to an OS resource that can't be duplicated without a syscall.
comment 8y ago · link · parent
This isn't the eval attack where you accidentally pass attacker-controlled inputs into eval because of an escaping problem or something, the sole purpose of /run is to allow users to run arbitrary Lua in the UI
comment 8y ago · link · parent
It is extremely material to the narrow profit margins of farms, so you see a race to the bottom with importing slave labor, terrible practices, etc.
But enforcing labor standards and minimum wages wouldn't add much to the average American's food bill, even assuming farms couldn't avoid some of the hit by using less or more productive labor.
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
Where exactly are these kulaks getting their butter and flour to hoard? Why have the PSUV and Maduro's planned economy not decreed their monopoly over?
comment 8y ago · link · parent
The East Cut name originated from a neighborhood nonprofit group in San Francisco that residents voted to create in 2015 to clean and secure the area. The nonprofit paid $68,000 to a “brand experience design company” to rebrand the district. [...] and one of the East Cut nonprofit’s board members is a Google employee.
Inverted pyramid is for those other newspapers I guess
comment 8y ago · link · parent
Adding Linux features is just more cruft added to the kludge. Sells more units, particularly in Azure, not particularly part of some sort of strategic direction then, say, the Distributed Transaction Coordinator.
The UI and OS-level shovelware stuff on the other hand is a nightmare that might kill the not-quite-golden-anymore goose.