我正在尝试实施一个正则表达式,允许我检查一个号码是否是一个有效的法国电话号码.
一定是这样的:
0X XX XX XX XX
Run Code Online (Sandbox Code Playgroud)
要么:
+33 X XX XX XX XX
Run Code Online (Sandbox Code Playgroud)
这是我实施的但是错了......
/^(\+33\s[1-9]{8})|(0[1-9]\s{8})$/
Run Code Online (Sandbox Code Playgroud) 我有一个PHP脚本,通过邮件发送以下HTML:
<html class="no-js" lang="en">
<body>
<div style="width: 70%;background-color: #060b2b;margin: auto;flex-direction: column;display: flex;">
<h1 style="margin-top: 50px;color: white;margin-left: auto;margin-right: auto;">Vous avez reçu une nouvelle notification.</h1>
<div style="width: 80%;padding: 50px;margin-top: 50px;background-color: #222;margin-left: auto;margin-right: auto;display: flex;">
<p style="color:white;margin: auto;text-align: center;">{{$notification}}</p>
</div>
<a href="" style="margin-top: 50px;margin-bottom: 50px;margin-left: auto;margin-right: auto;color: white;padding:15px;background-color: #0E0E0E;">Accéder à mon compte</a>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但收到的电子邮件(当我检查主要div时)并未显示该属性 flex-direction: column;
似乎gmail过滤了那些属性?
这是正常的吗?
我正在尝试通过 Insomnia API 使用 HTTP 查询来查询我的 Firestore 数据库:
https://firestore.googleapis.com/v1/projects/typebot/databases/(default)/documents/users
用这个身体:
{
"structuredQuery": {
"from": [
{
"collectionId": "users"
}
],
"where": {
"fieldFilter": {
"field": {
"fieldPath": "email"
},
"op": "EQUAL",
"value": {
"stringValue": "email@test.com"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
HTTP 查询:HTTP/2 帧层中的流错误
知道出了什么问题吗?
我正试图在我的网站上的SVG中触发旋转动画.它肯定会起作用,但问题是当我移动我的鼠标时,我正在悬停元素它取消动画.
所以我包含一个对象svg元素:
<object type="image/svg+xml" data="branching4.svg" id="branching">
Your browser does not support SVG
</object>
Run Code Online (Sandbox Code Playgroud)
这是一个很长的SVG文档,但这里附有样式表:
#rectangle1, #rectangle2, #rectangle3{
perspective: 1500px;
}
#rectangle1.flip .card, #rectangle2.flip .card, #rectangle3.flip .card {
transform: rotateX(180deg);
}
#rectangle1 .card, #rectangle2 .card, #rectangle3 .card{
transform-style:preserve-3d;
transition:1s;
}
#rectangle1 .face, #rectangle2 .face, #rectangle3 .face{
backface-visibility: hidden;
}
#rectangle1 #front1{
transform: rotateX(0deg);
}
#rectangle1 #back1{
transform: rotateX( 180deg );
}
#rectangle2 #front2{
transform: rotateX(0deg);
}
#rectangle2 #back2{
transform: rotateX( 180deg );
}
#rectangle3 #front3{
transform: rotateX(0deg);
}
#rectangle3 #back3{
transform: …Run Code Online (Sandbox Code Playgroud) 我正在尝试像这样初始化 gpg:
BIN = C:/cygwin64/bin/gpg.exe
HOME = C:/cygwin64/home/Administrator/.gnupg
gpg = gnupg.GPG(binary=BIN, homedir=HOME)
Run Code Online (Sandbox Code Playgroud)
我的钥匙圈位于C:/cygwin64/home/Administrator/.gnupg但每当我使用list_keys命令时:
public_keys = gpg.list_keys()
private_keys = gpg.list_keys(True)
print ('public keys:')
print(public_keys)
print ('private keys:')
print(private_keys)
Run Code Online (Sandbox Code Playgroud)
它向我输出空的空数组。
所以我尝试通过这种方式指定环的特定路径:
gpg = gnupg.GPG(binary=BIN, homedir=HOME, ignore_homedir_permissions=True,
keyring='C:/cygwin64/home/Administrator/.gnupg/secring.gpg',
secring='C:/cygwin64/home/Administrator/.gnupg/pubring.gpg')
Run Code Online (Sandbox Code Playgroud)
同样的错误。
以下是每当我尝试解密文件时出现的错误:
stderr: gpg: WARNING: unsafe permissions on homedir `C:/cygwin64/home/Administrator/.gnupg'
gpg: invalid key resource URL `C:/cygwin64/home/Administrator/.gnupg/pubring.gpg'
gpg: keyblock resource `(null)': general error
gpg: invalid key resource URL `C:/cygwin64/home/Administrator/.gnupg/secring.gpg'
gpg: keyblock resource `(null)': general error
gpg: no valid OpenPGP data found. …Run Code Online (Sandbox Code Playgroud) 在我的项目中,我需要在 2 个不同的屏幕中显示 2 个不同的组件。所以我打开两个浏览器窗口并显示这些组件。我想知道是否可以从第一个窗口中的组件交互到第二个窗口中的另一个组件?
我尝试Subject在服务中创建一个。但是每当我尝试在另一个窗口的组件中订阅此主题时,它都不起作用。这是我所做的:
export class MyService {
public navigationTrigger: Subject<NavigationParams> = new Subject();
constructor(private _http: Http) {
this.navigationTrigger.next(params);
}
}
Run Code Online (Sandbox Code Playgroud)
在我订阅的一个组件中:
this.watsonService.navigationTrigger.subscribe((navigation) => {
this.updateNavigation(navigation);
});
Run Code Online (Sandbox Code Playgroud)
但不起作用。我不确定如何实现我所需要的。
Map我正在尝试从字典创建一个对象string,function。
const entityTagDictionnary = [
['GRAPH_ADD_PROPERTY_SUBTYPE', (entity) => {
console.log('addSubtype called!');
return entity;
}],
['GRAPH_IGNORE_PROPERTY_SENTENCE', (entity) => {
console.log('ignore property called!');
return entity;
}],
['GRAPH_FORMAT_DATES', (entity) => {
console.log('formatDates called!');
return entity;
}],
];
const entityMap : Map<string, Function> = new Map(entityTagDictionnary);
Run Code Online (Sandbox Code Playgroud)
我有以下错误:
Argument of type '(string | ((entity: any) => any))[][]' isn't matching the argument 'Iterable<[string, Function]>'.
Run Code Online (Sandbox Code Playgroud)
我做错了什么吗?
我正在尝试禁用网页上的每个点击事件。
document.addEventListener("click", function (e) {
e.preventDefault();
e.stopImmediatePropagation();
let clicked = e.target;
console.log(clicked);
});Run Code Online (Sandbox Code Playgroud)
这应该可以防止每次点击事件,对吗?但我仍然发现它被忽略的情况(主要是链接)。
我缺少什么?
我有一个多forEach循环的函数:
async insertKpbDocument(jsonFile) {
jsonFile.doc.annotations.forEach((annotation) => {
annotation.entities.forEach(async (entity) => {
await this.addVertex(entity);
});
annotation.relations.forEach(async (relation) => {
await this.addRelation(relation);
});
});
return jsonFile;
}
Run Code Online (Sandbox Code Playgroud)
我需要确保forEach调用该this.addVertex函数的循环中的异步代码在执行下一个函数之前已经完成.
但是当我记录变量时,似乎this.addRelation在第一个循环真正结束之前调用了该函数.
所以我尝试await在每个循环之前添加术语,如下所示:
await jsonFile.doc.annotations.forEach(async (annotation) => {
await annotation.entities.forEach(async (entity) => {
await this.addVertex(entity);
});
await annotation.relations.forEach(async (relation) => {
await this.addRelation(relation);
});
});
Run Code Online (Sandbox Code Playgroud)
但同样的行为.
也许是日志函数有延迟?有任何想法吗?
我找不到Dataframe从多列返回一列的pandas函数DF。我需要一个确切的相反功能drop([''])。
有任何想法吗?
我想实现受保护的路由,并使用 firebase 进行身份验证。我的浏览器冻结了这段代码:
const App: React.FC = () => {
const [authentication, setAuthState] = useState({
authenticated: false,
initializing: true
});
firebase.auth().onAuthStateChanged(user => {
if (user) {
setAuthState({
authenticated: true,
initializing: false
});
} else {
setAuthState({
authenticated: false,
initializing: false
});
}
});
if (authentication.initializing) {
return <div>Loading</div>;
}
return (
<Router>
<div>
<Switch>
<Route exact path="/login" component={Login} />
<PrivateRoute
path="/"
component={Home}
authenticated={authentication.authenticated}
/>
<PrivateRoute
path="/join"
component={Join}
authenticated={authentication.authenticated}
/>
<PrivateRoute
path="/create"
component={Create}
authenticated={authentication.authenticated}
/>
</Switch>
</div>
</Router>
);
};
Run Code Online (Sandbox Code Playgroud)
我是 …
$string = "#hello";
Run Code Online (Sandbox Code Playgroud)
我试图hello没有#.我还想要一个函数来验证字符串是否包含#.
str_replace("#", " ", $string);
Run Code Online (Sandbox Code Playgroud)
也没有
strstr($string,"#")
Run Code Online (Sandbox Code Playgroud)
有任何想法吗 ?