我在一个screen会话中有几个窗口,然后我想分离我的会话.这没有问题.
但我无法找到一种方法来恢复我之前分离的会话中的所有窗口.我可以看到我可以通过ID恢复其中一个.
但是,如何在其中的所有窗口中重新连接相同的会话环境?
-
Updated:
如果我键入screen -d -r,这就是说:
There are several suitable screens on:
21074.pts-7.atx (05/29/2010 02:26:32 PM) (Attached)
3420.pts-3.atx (05/29/2010 12:16:41 AM) (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
Run Code Online (Sandbox Code Playgroud)
我怎样才能重新连接所有这些?
我正在尝试在 NestJS 中创建一个可通过 GET HTTP 请求访问的控制器操作,该请求接收两个参数,但由于某种原因它们未定义。
如何解决?
@Get('/login')
login(@Param() params: LoginUserDto) {
console.log(params)
return 'OK'
}
Run Code Online (Sandbox Code Playgroud)
import { ApiModelProperty } from '@nestjs/swagger';
export class LoginUserDto {
@ApiModelProperty()
readonly userName: string;
@ApiModelProperty()
readonly password: string;
}
Run Code Online (Sandbox Code Playgroud) 我无法通过 websocket 将数据从服务器 NestJS 发送到客户端。什么都没有发出。
我的用例:
我的堆栈:
我的代码:
simple-web-socket.gateway.ts:
import { SubscribeMessage, WebSocketGateway, WsResponse, WebSocketServer, OnGatewayConnection, OnGatewayDisconnect, OnGatewayInit } from '@nestjs/websockets';
@WebSocketGateway({ port: 9995, transports: ['websocket'] })
export class SimpleWebSocketGateway implements OnGatewayConnection, OnGatewayDisconnect, OnGatewayInit {
@WebSocketServer() private server: any;
wsClients=[];
afterInit() {
this.server.emit('testing', { do: 'stuff' });
}
handleConnection(client: any) {
this.wsClients.push(client);
}
handleDisconnect(client) {
for (let i = 0; i < …Run Code Online (Sandbox Code Playgroud) 我是新手,遵循有关现代 webdev 工作流程的教程。我在控制台中收到此错误消息。TypeError: dest.on is not a function
我知道,这里有相关的问答。但我不明白他们。因为我不知道“dest.on”与什么有关以及它有什么作用。这是到目前为止的代码:
var gulp = require("gulp");
var sass = require("gulp-sass");
var sourcemaps = require("gulp-sourcemaps");
var autoprefixer = require("auto-prefixer");
var imagemin = require("gulp-imagemin");
var browserSync = require("browser-sync").create();
gulp.task("css", function() {
return gulp
.src("src/sass/**/*.scss")
.pipe(sourcemaps.init())
.pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError))
.pipe(
autoprefixer({
browsers: ["last 2 versions"]
})
)
.pipe(sourcemaps.write("./maps"))
.pipe(gulp.dest("dist/css"));
});
Run Code Online (Sandbox Code Playgroud)
谁能解释一下错误消息的含义以及我如何解决这个特定问题?我很抱歉冗余,但我在现有答案中没有找到解决方案。
编辑::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::: 也许它有助于添加 package.json
{
"name": "sitepointresponsivewebsite",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" …Run Code Online (Sandbox Code Playgroud) 我正在尝试向 REST API 发送发布请求。我注意到当我在curl中使用-d选项传递参数时一切正常。例子:
curl "https://mywebsite.com" -d "param1=x" -d "param2=y" -u "3SUHZb0sanKWrQ"
Run Code Online (Sandbox Code Playgroud)
但是,如果将参数作为 json 对象发送并使用 --data-binary,我会从 Api 收到错误(就好像没有收到参数一样)。例子:
curl "https://mywebsite.com" --data-binary $'{ "param1": "x", -d "param2":"y" }' -u "3SUHZb0sanKWrQ"
Run Code Online (Sandbox Code Playgroud)
我认为这两种方法具有相同的行为,但我认为我错了。这两种方法有什么区别?
PS:第二个请求是我在Google Chrome上选择选项时收到的curl请求copy as cURL,因为实际请求是Angular中的$http.post,其数据负载为JSON对象。我可以在 Angular 中做什么来让它工作?
var data = {
"param1": "x",
"param2": "y"
};
$http({
url: "https://mywebsite.com",
method: 'POST',
data: data
}).then(function successCallback(response){
console.log(response);
}, function errorCallback(response){
console.log(response);
});
Run Code Online (Sandbox Code Playgroud) 我试图在通过 NgRx 功能模块组合状态时注入功能减少器。
import { NgModule, InjectionToken } from '@angular/core';
import { StoreModule, ActionReducerMap } from '@ngrx/store';
import * as fromFeature from './reducers';
export const FEATURE_REDUCER_TOKEN = new InjectionToken<ActionReducerMap<fromFeature.State>>('Feature Reducers');
Run Code Online (Sandbox Code Playgroud)
我应该在这里返回什么?
export function getReducers(): ActionReducerMap<fromFeature.State> {
// map of reducers
return {
};
}
Run Code Online (Sandbox Code Playgroud)
我试过
export function getReducers(): ActionReducerMap<fromFeature.State> {
// map of reducers
return {
reducerA: FeatureAReducer
};
}
Run Code Online (Sandbox Code Playgroud)
但它给出了错误Object literal may only specified known properties。
其余模块代码:
@NgModule({
imports: [
StoreModule.forFeature('feature', FEATURE_REDUCER_TOKEN),
],
providers: [ …Run Code Online (Sandbox Code Playgroud) Rustchrono::Local包含本地时区信息,但似乎没有任何方法来获取字符串或秒数偏移量的值。
任何想法都是如何获得正确的局部偏移量,以便
DateTime::parse_from_rfc3339([iso8601 date] + [timezone]).unwrap().with_timezone(&Local)
Run Code Online (Sandbox Code Playgroud)
将返回DateTime运行代码的计算机的默认当前时区。
我在 Angular 应用程序中使用 ng-select,并且有一个非常不寻常的用例。我需要始终显示占位符,即使在选定的选项上也是如此。在当前代码中,占位符将替换为所选选项的值:
<ng-select
[(ngModel)]="selectedApplication"
class="application-switcher"
[attr.data-sel-id]="selId"
[clearable]="false"
appendTo="body"
[searchable]="false"
placeholder="{{ 'APP_TITLE' | translate }}"
[virtualScroll]="virtualScroll"
[markFirst]="false">
<ng-option *ngFor="let application of applicationList" [value]="application">
<div>
{{ getApplicationName(application) }}
</div>
</ng-option>
</ng-select>
Run Code Online (Sandbox Code Playgroud) 我在尝试检查文件是否已下载时遇到了一些问题。
单击按钮会生成一个 PDF 文件并开始下载。
我需要检查它是否有效。
赛普拉斯能做到这一点吗?
我正在开发一个 Nest.js 应用程序,这是我们拥有的 Dockerfile。当我运行它时,我npm run build在 docker的步骤中遇到错误。这是 package.json 中的构建任务。
"build": "nest build"
sh: nest: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! atom-qbuilder-api@0.0.1 build: `nest build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the atom-qbuilder-api@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Run Code Online (Sandbox Code Playgroud)
文件
# Build
FROM node:8-alpine as builder
COPY package.json …Run Code Online (Sandbox Code Playgroud) nestjs ×3
javascript ×2
angular ×1
angularjs ×1
automation ×1
curl ×1
cypress ×1
docker ×1
gnu-screen ×1
gulp ×1
json ×1
ngrx ×1
ngrx-store ×1
rust ×1
unix ×1
websocket ×1