4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions
comment 5y ago · link · parent
Never browse the web, read e-mail or otherwise run any Internet client from any machine with data on it and instead use a separate machine or if unavoidable a VM on top of a reasonably secure hypervisor to run the browser.
Secure every single systems assuming that the network is compromised.
Restrict access data to only those who need it.
Avoid software written in C/C++ for anything security critical at all costs unless there is no alternative.
Only hire competent programmers and sysadmins.
Invest in proper physical security.
comment 5y ago · link · parent
On top of that you can use transaction ids or manual transaction serials to get only new rows (but of course note that transactions can be long-running, so you need to either accept potentially unbounded repeated data, or serialize all write transactions on a single serial assignment single-row table, or record the whole set of committed transactions whose data you have processed rather than a single serial number).
comment 5y ago · link · parent
"Microsoft SQL Server on Ubuntu delivers an optimised, cost-effective database platform"
Of course not, it's not free so it's not cost effective compared to the best database, which is PostgreSQL.
Integration with Active Directory group policy seems also a really bad idea since it allows insecure proprietary software to control your Linux machines.
comment 5y ago · link · parent
Just reverting those patches (which may well be correct) makes no sense, you and/or other maintainers need to properly review them after your previous abject failure at doing so, and properly determine whether they are correct or not, and if they aren't how they got merged anyway and how you will stop this happening again.
Or I suppose step down as maintainers, which may be appropriate after a fiasco of this magnitude.
comment 5y ago · link · parent
I mean, sneakily introducing vulnerabilities obviously only works if you don't start your messages by announcing you are one of the guys known to be trying to do so...
comment 5y ago · link · parent
If they instead considered drivers who never use Autopilot vs those who sometimes use Autopilot, it would make more sense, but then it might be biased in other ways due to self-selection.
The only reasonable way to do this test is to randomly deny the use of Autopilot to some drivers who would otherwise use it and compare accident rates between those two groups (this still only applies to people who would want to use Autopilot, but it would be unethical to force people to use it since it's dangerous).
comment 5y ago · link · parent
In general the String type is not very good, and you should use something appropriate to your use of strings for any string that is used more than a constant times in your program, which can be, for instance:
- String
- Box<[str]>
- Cow<'static, str>
- Cow<'a, str>
- Interned strings
- Rc<[str]> or Arc<[str]>
- A rope data structure
In fact I think putting String in the standard library might have been a mistake since it's almost always a suboptimal choice for anything except string builders in local variables.
comment 5y ago · link · parent
PrEP is a good thing because people who are on PrEP can be required to test frequently as a condition to obtain new medication (not sure if that happens in the US, but it does elsewhere).
comment 5y ago · link · parent
mRNA vaccines are apparently better and don't seem to have serious side effects, so only using those is correct if it doesn't delay immunity too long.
According to the article, this might cause a 4 weeks delay: currently Denmark has around 2 deaths per day, thus possibly causing 60 additional deaths, which would match a vaccine death rate of 1/100000.
Denmark has a 6 million population, and it seems AstraZeneca kills around 1/1000000 so it seems COVID is only 10x more lethal than the vaccine in the general population.
However death rates for COVID are much higher in the elderly while vaccine clot rates are much higher in young people, so the AstraZeneca vaccine might be more lethal in present day Denmark for young people.
Even among elderly people they can eliminate their COVID risk by isolating but they would be forced to take the vaccine risk if the government only offers the AstraZeneca vaccine.
Finally any vaccine deaths can be more easily attributed to the person who made the decision to continue using the vaccine thon COVID deaths.
comment 5y ago · link · parent
diff --git a/cli/src/test.rs b/cli/src/test.rs
index ac4807bf..8b9882ab 100644
--- a/cli/src/test.rs
+++ b/cli/src/test.rs
@@ -410,16 +410,17 @@ fn parse_test_content(name: String, content: String, file_path: Option<PathBuf>)
.map(|b| String::from_utf8_lossy(b).to_string())
.map(|s| escape_reserved_regex_chars(&s));
- let suffixHeaderPattern : Option<String> = suffix
+ let suffixHeaderPattern : Option<String> = suffix.as_ref()
.map(|s| String::from(r"^===+") + &s + r"\r?\n([^=]*)\r?\n===+" + &s + r"\r?\n");
- let suffixDividerPattern: Option<String> = suffix
+ let suffixDividerPattern: Option<String> = suffix.as_ref()
.map(|s| String::from(r"^---+") + &s + r"\r?\n");
- let headerRegex = suffixHeaderPattern
- .and_then(|s| ByteRegexBuilder::new(&s[..]).multi_line(true).build().ok())
- .as_ref()
- .unwrap_or(&HEADER_REGEX);
+ let headerRegexFromSuffixHeaderPattern = suffixHeaderPattern.as_ref()
+ .and_then(|s| ByteRegexBuilder::new(&s[..]).multi_line(true).build().ok());
+
+ let headerRegex = headerRegexFromSuffixHeaderPattern
+ .as_ref().unwrap_or(&HEADER_REGEX);
// Identify all of the test descriptions using the `======` headers.
for (header_start, header_end) in headerRegexcomment 5y ago · link · parent
2. Given you mention "maps of option", probably you are doing something like opt.map(|x| &x.field) or equivalent which is obviously invalid (since you are returning a reference to a subobject of a function argument). Instead, you need to do opt.as_ref().map(|x| &x.field) (or as_mut() if it's mutable).
comment 5y ago · link · parent
Just do the first regex search, then escape into a String with regex::escape, then build a regex from the String and search with it.
Of course what you are doing is probably wrong since you should use a string matching crate rather than escaping characters and using a regex matching crate.