我希望在单击“登录”按钮时显示加载微调器
下图显示了这一点
目前我正在尝试
<Fragment>
{isLoading == true ? <CircularProgress /> : <div></div>}
<Paper variant="outlined" className={classes.root}>
<Box px={3} py={2}>
<Typography variant="h6" align="center" margin="dense">
Login
</Typography>
<Typography variant="inherit" color="textSecondary">
{errors.non_field_errors?.message}
</Typography>
<Grid container spacing={1}>
<Grid item xs={12} sm={12}>
<TextField
required
label="Email"
fullWidth
margin="dense"
/>
<Typography variant="inherit" color="textSecondary">
{errors.email?.message}
</Typography>
</Grid>
<Grid item xs={12} sm={12}>
<TextField
required
label="Password"
type="password"
fullWidth
margin="dense"
/>
<Typography variant="inherit" color="textSecondary">
{errors.password?.message}
</Typography>
</Grid>
</Grid>
<Box mt={3}>
<Button
variant="contained"
color="primary"
onClick={handleSubmit(onSubmit)}
>
Login
</Button>
</Box>
</Box>
</Paper>
</Fragment>
Run Code Online (Sandbox Code Playgroud)
我得到的是
我有以下HTML代码:
<div>
<p> linux version</p>
<h1> new tool </h1>
Run Code Online (Sandbox Code Playgroud)
还有一些CSS应该选择,<h1>但不选择任何东西.
*:not(div p) {
font-family: sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
以下内容也不起作用:
*:not(div>p) {}
Run Code Online (Sandbox Code Playgroud)
我<div> <p>在HTML中有这么多这样的东西,而以下选择并应用字体:
div p {
font-family: sans-serif;
}
Run Code Online (Sandbox Code Playgroud) 我有两个视频(.mp4)文件.一个上传到whatsapp而另一个不上传.
使用ffmpeg我检查了他们的属性:
a)上传视频的属性:
Duration: 00:00:56.45, start: 0.148000, bitrate: 1404 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1080, 1359 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s (default)
Metadata:
handler_name : SoundHandler
At least one output file must be specified
Run Code Online (Sandbox Code Playgroud)
b)不上传到whatsapp的视频(因为它的格式不支持)
Duration: 00:00:56.10, start: 0.000000, bitrate: 543 kb/s
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p, 1080x1080 …Run Code Online (Sandbox Code Playgroud) 使用材质设计如何使用背景图像创建工具栏.
以下是我想要的:
我正在尝试以下代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/actionBar"
android:layout_width="match_parent"
android:layout_height="200dp"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
android:minHeight="200dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageViewplaces"
android:src="@drawable/puri"
android:layout_gravity="center"/>
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)
而我得到的是:
我正在尝试将一些多行字符串(例如 ssh 私钥)存储在.gitlab-ci.yml文件的变量中
我有一个 ssh 私钥
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAriS0+ayniFDo+y7GcNb62mupuM4EFBX+gdCEr/K8wZd/mFxY
mSGoVX2CdCDy6k+LSWbBBFtus575187fHNy045gJzI5D0PSGmPsWYqu/Rst43Qgr
R6CAOBqapM9LVBopH0pjPTv5/8iJA/G+Mw6MXGzQAAuA0ZyJoDy7d3GSVKG+k/k0
smZ+FKjDxZ3gn/e3nc5XABSywZlT91RHT6BImrxizvgHkkks1J8RBl9QoIvMSiwD
7sEElAABAoGBAN7kSADAK5vtqvFQsMAPEJLXdv5mP0IEe3IamL3MNlUYpb7yGqBr
6Jmopg+vpbkXZeMpC6uYu9F5Y6etV8yslTERxhP3yE+Fg2FFXc53jDOzkkCu+aey
PypGWE9hZXK5Wx9rqi83b9d59bCcMY5kouDSUNTmYVC3H+OxuX+2hgnJAoGBAMgC
toxjVLp+gDhRUqxe1MuTznq4GGzXB9/LuGYI078pHlYjHmWIKfHtKv5O6HqYz2pi
8mMNqt0vZC+Wbt5kZnE3Om1CgEvAPsxMUaAWq7iXSfEhqRvfwE5uJwkSxiTnRRWH
4tzSjGCP3+GqVYxUliELvwMdS1Qbo103lwVgoR4iLSrr/vWTb5NG3ms=...
-----END RSA PRIVATE KEY-----
Run Code Online (Sandbox Code Playgroud)
和输出ssh-keyscan domain.com
# xx.xx.xx.xx:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
xx.xx.xx.xx ssh-rsa AAAX20sVRmUkgOn8Db46ikEhC2zBZYZ7Lv2AsaHV+isNB3QYfNKGDEMj9CvWByezJR/3DqCgK/IGLH0JfMZK9H9HR7/P1aeY7bVAg07Gdt/vYrgQtaNtkdK3qD/C0oUSQAE1a2vOzBGx1HZgtORTh8eN/h5bKW0/2GVlS+9K1MR7peECpgOBo3fu2RPwB/KFlUcrtZkdE8Em/thbXFWE/VGBwh/eoNB1
# xx.xx.xx.xx:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
xx.xx.xx.xx ecdsa-sha2-nistp256 LhpT93b8rE/exS/M9QyoyjoeEuioXhffu62Ayxxl4UewOuASHaF4ylQIJSNlK+groH6Iv1QvPVKFe/n1uF1Xvk=
# xx.xx.xx.xx:22 SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
xx.xx.xx.xx ssh-ed25519 AAAAC3Nz/O/Dod2CitLhIqnePT51H
Run Code Online (Sandbox Code Playgroud)
我知道这些可以存储在 gitlab CI/CD 变量中
但我如何将其存储在 yml 文件中。
喜欢
image: creatiwww/docker-compose:latest
services:
- docker:dind
variables:
ssh_private_key: <private key text here but its multiline>
ssh_known_hosts: <out put of ssh-keyscan which is also …Run Code Online (Sandbox Code Playgroud) 我正在使用交错网格布局。以下是代码:
StaggeredGridLayoutManager glm= new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
glm.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);
Run Code Online (Sandbox Code Playgroud)
我GAP_HANDLING_NONE用来避免图像从一列交换到另一列。
当我启动应用程序时,屏幕的开头是:
向下滚动到底部后,当我回到顶部时。随机以下三张图片显示布局(它不断变化)
在Firebase控制台中,我看到了使用app"com.example"(其中com.example是应用名称)向User Segement发送通知的选项.
如图所示:
但是如何使用FCM REST API从服务器端执行此操作:
我知道如何在使用 html 单击按钮时下载文件
<a href="./abcf32x.pdf" download="How-to-download-file.pdf">
<button>Download File</button>
</a>
Run Code Online (Sandbox Code Playgroud)
但是使用 Material-UI 组件我该如何做到这一点
我有以下组件
<div>
<Button
variant="contained"
color="#ffa726"
size="large"
startIcon={<GetAppIcon />}
>
Download Sample Method File
</Button>
</div>
Run Code Online (Sandbox Code Playgroud)
现在我想下载一个文件,其url是http://localhost:8000/static/sample_method.py
我不想在浏览器中打开链接然后另存为,而是应该直接下载。
我正在使用 postgresql 9.6。我正在尝试了解 ts_rank
我有一个短语“一二四”,我的搜索查询是“一二三”所以我试图获得所有可能组合的 ts_rank 如下。
select
ts_rank(to_tsvector('one two four'), to_tsquery('one')) AS one,
ts_rank(to_tsvector('one two four'), to_tsquery('two')) AS two,
ts_rank(to_tsvector('one two four'), to_tsquery('three')) AS three,
ts_rank(to_tsvector('one two four'), to_tsquery('one | two | three')) AS oneortwoorthree,
ts_rank(to_tsvector('one two four'), to_tsquery('one & two & three')) AS oneandtwoandthree,
ts_rank(to_tsvector('one two four'), to_tsquery('(one & two)')) AS mix2_1,
ts_rank(to_tsvector('one two four'), to_tsquery('(two & three)')) AS mix2_2,
ts_rank(to_tsvector('one two four'), to_tsquery('(one & three)')) AS mix2_3,
ts_rank(to_tsvector('one two four'), to_tsquery('(one & two) | three')) AS mix3_1, …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个卷
docker volume create postgresql_db
Run Code Online (Sandbox Code Playgroud)
现在我在 docker-compose.xml 中使用它
services:
postgresql:
image: "postgres:11-alpine"
volumes:
- type: volume
source: postgresql_data
target: /var/lib/postgresql/data
volume:
nocopy: true
environment:
PGDATA: '/var/lib/postgresql/data/pgdata'
networks: # connect to the bridge
- postgresql_network
command: ["postgres", "-c", "log_statement=all","-c", "log_destination=stderr"]
volumes:
postgresql_data:
external: true
Run Code Online (Sandbox Code Playgroud)
有时我想停止并清理 docker 系统。
所以我尝试跑步
docker stop $(docker ps -aq) # stop all containers
docker rm $(docker ps -a -q) # remove all containers
docker container prune
docker image prune
docker network prune
docker volume prune #<-- remove …Run Code Online (Sandbox Code Playgroud)