当我的电脑崩溃时,我只丢了一个小时的工作.Visual Studio 2008中是否有定时自动保存功能?
如果是,则配置在何处.
这可能是显而易见的,但我找不到它.
如果我使用创建套接字
var socket = new UdpClient(0,AddressFamily.InterNetwork);
Run Code Online (Sandbox Code Playgroud)
然后我如何找到套接字的端口?
我可能很愚蠢,但我在MSDN /谷歌上没有运气(可能是因为星期五是4:42,太阳正在闪耀).
背景:
我想要做的是找到一个开放的端口,然后向另一个进程报告,以便在该端口上将消息转发给我.可能有多个客户端,所以我不想使用固定端口.
谢谢.
我有一个带有 Nrwl Nx 工作区的 Angular 项目。对于我的 e2e 测试,我使用带有 typescript 的 cypress。对于这个测试,我想使用 Gherkin 语法启用对功能文件的支持。
我在项目中添加了“cypress-cucumber-preprocessor”。当我用 js 编写绑定时,此设置工作正常。但是,一旦我尝试设置打字稿的步骤,就会出现错误并且无法使其工作。
js的设置:
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// Code Coverage
on('task', require('@cypress/code-coverage/task'));
// Preprocess Typescript
on('file:preprocessor', preprocessTypescript(config));
// Gherkin support
on('file:preprocessor', cucumber());
};
Run Code Online (Sandbox Code Playgroud)
ts 的设置:
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
const …Run Code Online (Sandbox Code Playgroud) 我正在设置SMPTAppender,以便在生产代码出错时通过电子邮件发送日志文件.有一些机器,例如本地的测试机器,我不希望发送电子邮件.
我试图在propertyfilter中使用环境变量COMPUTERNAME,但这不起作用:
<filter type="log4net.Filter.PropertyFilter">
<Key value="COMPUTERNAME" />
<StringToMatch value="myComputerName" />
<Accept value="false" />
</filter>
Run Code Online (Sandbox Code Playgroud)
我在这样的文件追加器中使用了ComputerName:
<file value="${HOMEDRIVE}\\loggingDirectory\\AppLogFile.${COMPUTERNAME}.log" />
Run Code Online (Sandbox Code Playgroud)
这也没有用(我也没想到):
<filter type="log4net.Filter.PropertyFilter">
<Key value="${COMPUTERNAME}" />
<StringToMatch value="myComputerName" />
<Accept value="false" />
</filter>
Run Code Online (Sandbox Code Playgroud)
有没有办法在属性过滤器中使用环境变量?欢迎其他建议.
我只需要一个来自匹配整数的验证。因此我使用pattern带有正则表达式的验证器(见下文)。此外,该字段不应为空,因此我添加了required验证器。
但pattern错误永远不会被触发。我阅读了 angular 文档并查看了 的源代码,pattern但对我来说仍然没有意义。此外,我已经阅读了几乎所有与此主题相关的关于 stackoverflow 的问题。但我仍然无法弄清楚为什么该模式不起作用。
或许有大佬可以帮帮我,谢谢!
这是我的代码 component.ts:
// definition of the formcontrol
hours = new FormControl('', [
Validators.required,
Validators.pattern('^[0-9]*$'),
])
// for debugging
log() {
console.log('required: ', this.hours.hasError('required'));
console.log('pattern: ', this.hours.hasError('pattern'));
console.log('Erros: ', this.hours.errors);
}
Run Code Online (Sandbox Code Playgroud)
模板:
<mat-form-field>
<input matInput [formControl]="hours" (input)="log()"
placeholder="Anzahl der ausbezahlten Überstunden" type="number">
<mat-error *ngIf="hours.hasError('required') && !hours.hasError('pattern')">
Anzahl der Überstunden fehlt!
</mat-error>
<mat-error *ngIf="!hours.hasError('required') && hours.hasError('pattern')">
Anzahl muss eine Ganzzahl sein!
</mat-error>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
例子inputValue="": …
我想在我的 angular8 应用程序中使用状态管理,在此之前我研究了状态管理库似乎是 NGRX、NGXS 和 akita。
但是我不知道该选择哪一个!
NGRS 最常用。
NGXS 有更多的可能性并且易于学习。
AKITA 使用较少,下载较少,根据 npm 下载历史和 github forked 和 issue,但它基于面向对象,易于学习。
你的选择是什么?请说出你的理由!