我有一个在 Google Compute Engine 上运行的虚拟机实例 (Debian wheezy)。创建实例时,目录root中默认有 3 个用户(除了 )/home。例如,如果我的电子邮件 ID(用于登录 Google 云平台)是,ab@xyz.co则目录中的 3 个用户/home是ab、abxyz和ab_xyz_co。我不明白创建 3 个不同的用户有什么意义。
当我登录时,默认情况下我以用户身份登录到机器abxyz。我也不能假设其他两个用户(ab和ab_xyz_co)只是存在并且从未使用过,因为我可以在其他 2 个用户的主目录中看到一些文件夹,其大小随时间而变化。此外,这些文件夹的大小不同,即相同的内容不会添加到所有帐户中。
这是怎么回事?有任何想法吗?
cloud virtual-machine google-compute-engine google-cloud-platform
这是用 Jest (v20.0.4) 编写的测试套件。
前 3 个测试是预期行为,我的问题与 Test4 相关。
test('Test1: the list should contain 7', () => {
const data = [1, 2, 7, 9];
expect(data).toContain(7);
});
// > Passes as expected
Run Code Online (Sandbox Code Playgroud)
test('Test2: the list should contain 7', () => {
const data = [1, 2, 7, 9];
expect(data).toContain(8);
});
// > Fails as expected; Expected array: [1, 2, 7, 9] To contain value: 8
Run Code Online (Sandbox Code Playgroud)
test('Test3: the list should contain 7', (done) => {
function callback(data) {
expect(data).toContain(7);
done();
} …Run Code Online (Sandbox Code Playgroud) 在以下代码中,我在Material-UI中使用自定义主题:
import React from "react";
import ReactDOM from "react-dom";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
import Button from "@material-ui/core/Button";
import { purple, green } from "@material-ui/core/colors";
const theme = createMuiTheme({
palette: {
primary: purple,
secondary: green
}
});
function App() {
return (
<MuiThemeProvider theme={theme}>
<Button color="primary">Button1</Button>
<Button color="secondary">Button2</Button>
</MuiThemeProvider>
);
}
ReactDOM.render(<App />, document.getElementById("root"));
Run Code Online (Sandbox Code Playgroud)
我收到以下警告:
Warning: Material-UI: you are using the deprecated typography variants that will be removed in the next major release.
我没有使用任何排版(更不用说任何不推荐使用的排版变体)
为什么会收到此警告?有人可以解释一下。
在codeandbox上的完整演示:https ://codesandbox.io/s/r5v9pjxnq4 …
根据JavaScript 的运算符优先级表,我可以看到 的&&优先级高于||.
因此,对于以下代码片段:
let x, y;
let z = 5 || (x = false) && (y = true);
console.log(z); // 5
console.log(x); // undefined
console.log(y); // undefined
Run Code Online (Sandbox Code Playgroud)
我认为&&应该首先评估该部分,然后在该部分短路后&&,x将被分配值false。然后,||才会尝试进行评估。
但是,从 的输出中console.log,我可以清楚地看到这里的情况并非如此。
有人可以帮我吗?我在这里缺少什么?
提前致谢。