这些是我的文件。我收到此错误有人可以帮助我。
Error: src/app/app.component.html:5:123 - error TS4111: Property 'fName' comes from an index signature, so it must be accessed with ['fName'].
<input id="name" type="text" formControlName="fName" class="form-control" [ngClass]="{'is-invalid':submitted && f.fName.errors}"/>
Run Code Online (Sandbox Code Playgroud)
组件.html
<form [formGroup]="surveyForm" (ngSubmit)="onSubmit()">
<div>
<label>Name:</label>
<input id="name" type="text" formControlName="fName" class="form-control" [ngClass]="{'is-invalid':submitted && f.fName.errors}"/>
<div *ngIf="submitted && f.fName.errors" class="form-control">first name is required</div>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
组件.ts
import { Component, OnInit } from '@angular/core';
import { FormControl, FormBuilder, FormGroup, Validators} from '@angular/forms';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements …Run Code Online (Sandbox Code Playgroud) 我有一个pandas DataFrame , df_test. 它包含一个列'size',表示以字节为单位的大小.我使用以下代码计算了KB,MB和GB:
df_test = pd.DataFrame([
{'dir': '/Users/uname1', 'size': 994933},
{'dir': '/Users/uname2', 'size': 109338711},
])
df_test['size_kb'] = df_test['size'].astype(int).apply(lambda x: locale.format("%.1f", x / 1024.0, grouping=True) + ' KB')
df_test['size_mb'] = df_test['size'].astype(int).apply(lambda x: locale.format("%.1f", x / 1024.0 ** 2, grouping=True) + ' MB')
df_test['size_gb'] = df_test['size'].astype(int).apply(lambda x: locale.format("%.1f", x / 1024.0 ** 3, grouping=True) + ' GB')
df_test
dir size size_kb size_mb size_gb
0 /Users/uname1 994933 971.6 KB 0.9 MB 0.0 GB
1 /Users/uname2 109338711 106,776.1 KB 104.3 MB …Run Code Online (Sandbox Code Playgroud) 我已成功上传单个文本文件Google Cloud Storage。但是当我尝试上传时whole folder,它允许denied error.
filename = "d:/foldername" #here test1 is the folder.
Error:
Traceback (most recent call last):
File "test1.py", line 142, in <module>
upload()
File "test1.py", line 106, in upload
media = MediaFileUpload(filename, chunksize=CHUNKSIZE, resumable=True)
File "D:\jatin\Project\GAE_django\GCS_test\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "D:\jatin\Project\GAE_django\GCS_test\apiclient\http.py", line 422, in __init__
fd = open(self._filename, 'rb')
IOError: [Errno 13] Permission denied: 'd:/foldername'
Run Code Online (Sandbox Code Playgroud) 我正在尝试从我的 react-native 应用程序的输出中删除 console.log 输出,但是当我运行时
ENVFILE=.env.production react-native run-android --variant=release
和
亚行日志猫
我仍然看到我的应用程序的数据被记录到控制台。
我使用了以下文档:https : //facebook.github.io/react-native/docs/performance.html#using-consolelog-statements。
这是我的 .babelrc 文件:
{
"presets": ["react-native"],
"env": {
"production": {
"plugins": ["transform-remove-console"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?我在 react-native 0.60.3 上使用 "babel-plugin-transform-remove-console": "^6.9.4",
我最近用InfluxDB设置了Grafana。我想展示一个面板,指示发生事件以来已经有多长时间了。
例子:
我可以使用以下代码轻松获得一个指标:
SELECT time, last("duration") as last_duration FROM custom_events ORDER BY time DESC
但是我似乎无法让Grafana在时间领域上做我想做的事情。
有什么建议么?
是否有任何工具类似于Django Souh,但对于Node?
Noe我正在与Sequelize合作,如果我做对了,Sequelize没有选择根据现有模型创建迁移文件.那么,创建一个新的模型/表步骤是:
sequelize model:create <model meta>.创建模型.up.sequelize db:migrate.运行迁移.我正在寻找可以基于现有模型创建迁移文件的东西,这类似于South可以为Django做的事情.
有什么选择吗?
iOS 上的 PDFKit 是否公开了 PDFView 的底层 UIScrollView 或者是否有任何其他方法可以直接检测用户是否滚动了 PDFView?
我的用例是在滚动文档时隐藏导航栏,因此作为一种解决方法,我已将自己的平移手势识别器添加到 PDFView 的父级,并在gestureRecognizerShouldBegin 中隐藏并始终返回 false 但我希望有更像 UIScrollViewDelegate 的东西我在文档中遗漏了。
我在 Celery 中有一些使用 Celery Beat/Crontab 安排的任务,如下所示:
CELERYBEAT_SCHEDULE = {
'task-1': {
'task': 'tasks.run_task1',
'schedule': crontab(hour=5, minute=30, day_of_week='mon-fri'),
},
'task-2': {
'task': 'tasks.run_task2',
'schedule': crontab(hour=12, minute=0, day_of_week='sun-fri'),
},
}
Run Code Online (Sandbox Code Playgroud)
有时我关闭了 Celery 进程,当我在下午 4:00 重新打开它时,它将运行当天早些时候的任务。我怎样才能让这些任务只在实际安排的大约 5 分钟内运行,而不是在当天晚些时候开始运行?
我在配备 M1 Max 芯片的 MacBook Pro 上通过 MiniForge 管理的虚拟环境中运行 Python 3.9.7 和 TensorFlow 2.5。(由Jeff Heaton设置)。
\n我的模型中有一个自定义损失函数。这段代码在我的另一台机器(基于 Ubuntu 的 Pop!OS)上运行良好。
\n当我从 Keras 运行 model.fit 时,偶尔会出现以下错误。有时它运行得很好。知道是什么原因造成的,为什么它只是有时发生,以及如何解决它?
\n此外,它仅从我的自定义损失函数中产生此错误。不是来自任何 Keras 本地人。
\n谢谢!
\n:5:10: error: invalid length (0) for size 20 | 0.00/1.00 [00:00<?, ?batch/s]\n-:5:10: error: \'mps.slice\' op failed to fold or infer return types\n-:5:10: note: see current operation: %2 = "mps.slice"(%arg0) {axis = 0 : si32, length = 999 : i32, start = 1 : …Run Code Online (Sandbox Code Playgroud) 我有以下控制器:
createCollection(
@UploadedFile() file,
@Body() createCollectionDto: CreateCollectionDto,
@GetUser() user: User,
): Promise<Collection> {
this.logger.verbose(
`User "${
user.username
}" creating a new collection. Data: ${JSON.stringify(
createCollectionDto,
)} of "${user.username}"`,
);
if (file) {
return this.collectionService.createCollection(
createCollectionDto,
user,
file,
);
} else {
throw new InternalServerErrorException('File needed');
}
}
Run Code Online (Sandbox Code Playgroud)
第一个问题:如何将文件连同图n°1中显示的数据一起发送?
我搜索了另一个 API 请求工具,我找到了Postwoman
但响应总是相同的:它不检测数据。(即{ name: foo, color: bar})
第二个问题:我该如何解决这个问题?是否可以将数据放在文件中?如果有可能,我如何在 NestJS 中实现这一目标?
非常感谢您阅读我的问题:) 任何帮助将不胜感激。
我想为其内容制作水平滚动的表格,并且我尝试whitespace-nowrap对具有长内容的表格单元格使用类,并对所有表格使用overflow-x-auto,例如:
<div class="editor_listing_wrapper_bix_width">
<table class=" overflow-x-auto p-1 m-1 d2">
<thead class="bg-gray-700 border-b-2 border-t-2 border-gray-300">
<tr>
<th class="w-1/12 py-2">Id</th>
<th class="w-4/12 py-2">Name</th>
<th class="w-4/12 py-2">Description</th>
<th class="w-1/12 py-2"></th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td class="whitespace-nowrap">
Laptops
<small class="pl-2 pt-1">
( Used in 2 ad(s) )
</small>
</td>
<td class="whitespace-nowrap p-1">Laptops description Lorem ipsum dolor sit amet,
consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua....
</td>
Run Code Online (Sandbox Code Playgroud)
但看起来水平滚动适用于所有区域,不适用于我的桌子
请看笔:https ://codepen.io/sergeynilov/pen/eYgjVgM
我使用 tailwindcss 2.1.0。
谢谢!
python ×4
angular ×1
apple-m1 ×1
babeljs ×1
celery ×1
celerybeat ×1
cocoa-touch ×1
components ×1
django ×1
grafana ×1
influxdb ×1
ios ×1
ios-pdfkit ×1
keras ×1
nestjs ×1
node.js ×1
pandas ×1
postgresql ×1
postman ×1
react-native ×1
reactjs ×1
sequelize.js ×1
tailwind-css ×1
tensorflow ×1