RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-215335

Tvolex's questions

Martin Hope
Tvolex
Asked: 2020-04-14 19:15:58 +0000 UTC

CPU 负载 100%。vmlinuz,汇合服务器

  • 2

一般来说,情况是这样的,在 DO 上有一个服务器正在运行 confluence 服务器。今天有一段时间磁盘空间用完了,因为服务器没有响应。我删除了几个备份,可用内存增加了 20-25GB。我重新启动了服务器,一切似乎都很好。

但 2 分钟后,他再次停止响应。我再次去了服务器并查看了 htop。

在此处输入图像描述

这些 vmluniz 进程愚蠢地挂起,仅此而已。以为我得等一会儿,但没有

也试图杀死这些进程,但它们又出现了。

我不太了解他们的工作和用途,但我确信我需要帮助)

linux
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-09-20 00:53:09 +0000 UTC

Vue.js 滚动跟踪

  • 2

你好,我对这样一个问题感兴趣,如何跟踪我滚动到一个块,然后到第二个块,或者如何跟踪我当前正在查看的第三个块?

http://gabegsell.com/anchors/ - 像这里一样,滚动 - 你会得到 .push('#anchors2') 等。...

如何在 Vue 中实现这一点?谢谢)

scroll
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-08-03 23:05:36 +0000 UTC

MongoDB Driver + Express.js 简单注册 MongoError: E11000

  • 0

你好。

在充满回调的 MongoDB Driver 上有一个简单的注册,我决定使用 asyc / await 重写。但是有一个错误。它与什么有关,我不明白。有人可以解释吗?谢谢)

蒙戈错误:

index: name_1 dup key: { : null }E11000 重复键错误集合:FirstApp.users

编码:

const config = require ('../config');
const mongodb = require ('mongodb');
const ObjectId = require('objectid');
const express = require ('express');
const router = express.Router();
const MongoClient = mongodb.MongoClient;
const DBurl = config.DBurl;

const SaveUser = async function (UserEmail, UserPassword, sessionID) {

    const User = {
        //_id: new ObjectId(),
        "UserEmail": UserEmail,
        "UserPassword": UserPassword,
        "SessionID": sessionID,
    };

    console.log(User);

    try {
        const db = await MongoClient.connect(DBurl);

        const collection = db.collection('users');

        //collection.createIndex({"name" : 1}, {"unique" : true});
        const result = await collection.insertOne(User);

        if (result.acknowledged)
            return {save: true};

        else
            return {save: false};

    } catch (e) {
        return e;
    }
};

const Register = router.post("/", async (req, res) => {
    const UserEmail = req.body.UserEmail;
    const UserPassword = req.body.RegisterPassword;
    const UserConfirmPassword = req.body.confirmPassword;
    const sessionID = req.sessionID;

    if (UserPassword === UserConfirmPassword) {

        const result = await SaveUser(UserEmail, UserPassword, sessionID);

        result.save ?
            res.status(200)
                .json({isBusy: false}) :
            res.status(500)
                .json({error: result, isBusy: true});
    }

    else if(UserEmail || UserPassword || UserConfirmPassword === undefined)
        res.status(400)
            .send('Bad request');

    else if (UserConfirmPassword !== UserPassword)
    res.status(400)
            .send('Wrong confirm password');
});
module.exports = Register;
node.js
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-07-31 19:05:27 +0000 UTC

MongoDB。如何从不同的集合中获取字段

  • -1

你好。

我想编写一个聚合或一种方法lookup来从不同的集合中获取数据。但我不知道如何)

比方说

收藏users

{
    _id: 951ddd10834e28097f2d67d5,
    name: "aladin",
    phone: 123123,
}

收藏items

{
    _id: 596wde31434e755097f2w22e4,
    title: "asd",
    description: "sub asd"
    author: 951ddd10834e28097f2d67d5   // id такой же как и в aladin
}

我想得到:

{
        title: "asd",
        description: "sub asd",
        author: "aladin"
}
node.js
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-07-09 22:44:31 +0000 UTC

vue.js 2.获取请求并导出到数据?

  • 0

你好!

您需要发送获取请求、获取响应并处理响应。大致应该是这样的代码,请求是用axios实现的。但这是唯一不起作用的代码。错误:Uncaught ReferenceError: regeneratorRuntime is not defined。

如何发送请求并将其输入data?谢谢)

编码:

import Axios from 'axios';
import async from 'async'


export default {
    name: 'app',
    data: async () => {
        let items = await Axios.get('/getItems');
        return {
            items: items
        }
    }
}
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-07-08 00:23:36 +0000 UTC

Vue.js 2. Vue.use is not a function 错误

  • 1

你好!

开始使用vue-router,但遇到错误:

Vue.use 不是函数

谷歌搜索,一无所获(谷歌上的白带)。

所有路径均已正确配置,模块已安装。

为什么会出现这个错误?

代码:

index.js(主文件,webpack 的入口点)

//require modules
const Vue = require('vue');
const VueRouter = require('vue-router');

// require components
const Index = require('../public/components/Index.vue');
const Items = require('../public/components/Items.vue');
const Users = require('../public/components/Users.vue');

const routes = [
    { path: '/', component: Index},
    { path: '/vue', component: Users},
    { path: '/news', component: Items}
];

//Setup routes
Vue.use(VueRouter);
const router = new VueRouter({
    routes,
    mode: 'history'
});

// Register components
new Vue({
    el: '#app',
    router,
    render: h => h(Index)
});

索引.vue

<template>
    <div id="app">
        <h1>Index</h1>
        <hr>
        <router-view></router-view>
    </div>
</template>

<script>
    export default {
        data: () => {return {}}
    }
</script>

错误:

在此处输入图像描述

webpack.config.js(可能不在配置中)

 const path = require('path');
const webpack = require('webpack');

module.exports = {
    entry: __dirname + "/public/index.js",
    output: {
        path: __dirname + "/public",
        filename: 'build.js',
        library: 'index'
    },
    module: {
        rules: [
            {
                test: /\.vue$/,
                loader: 'vue-loader',
                options: {
                    loaders: {}
                }
            }, {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/
            }, {
                test: /\.(png|jpg|gif|svg)$/,
                loader: 'file-loader',
                options: {
                    name: '[name].[ext]?[hash]'
                }
            }
        ]
    },
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.esm.js'
        }
    }
};
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-07-04 05:36:00 +0000 UTC

Vue.js 2. v-代表不工作

  • 2

你好!

v-for 不在 vue.js 2 中工作

<div id="app" v-for="user in users" >\{{user.userName}}</div>

let app = new Vue({
   el: "#app",
      data: {
         users: [
            {userName: "A"},
            {userName: "B"},
            {userName: "C"},
         ]
      }
});

只输出一个空字符串

在此处输入图像描述

在 jsfiddle 中它给出了一个错误:

在此处输入图像描述

vue.js
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-30 19:11:57 +0000 UTC

Vue.js 如何渲染页面?或者如何正确连接脚本

  • 2

你好!决定学习vue.js。我不知道如何呈现页面,在码头上不清楚。所以我对如何正确地将页面从服务器呈现到节点感兴趣。现在一切都设置成这样:

结构:

在此处输入图像描述

定制:

在此处输入图像描述

hello.html 内容:

在此处输入图像描述

如果启动服务器并访问/hello,则会呈现一个空页面。

但是如果你只是打开页面,那么铭文会立即呈现出来Hello Vue!。

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-20 23:56:58 +0000 UTC

C++读取文件夹内容

  • -1

大家好,您需要读取文件夹的内容,或者更确切地说,读取文件夹中所有文件的名称,并将它们推送到类型为 的变量中vector<wstring>。

我确实喜欢这样:

vector<wstring> readFolder(LPWSTR path) {
    vector<wstring> names;
    WIN32_FIND_DATA FindFileData;
    HANDLE hf;
    hf = FindFirstFile((LPCTSTR)path, &FindFileData);

    if (hf != INVALID_HANDLE_VALUE)
    {
        do
        {
            names.push_back((wstring)FindFileData.cFileName);
        } while (FindNextFile(hf, &FindFileData) != 0);
        FindClose(hf);
    }

    return names;
}

但是,如果您选择名为 test 的文件夹,那么结果是这样的:

例子

c++
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-16 23:03:18 +0000 UTC

在线程内循环。C++

  • 5

你好!

使用 C++11 标准,<thread>.

我有一个在后台运行的线程thread.detach()。在这个线程中有setWallpaper(bool status)一个无限循环的函数:

setWallpaper(bool status) {
   if(!status) {
       MessageBox(NULL, status, L"STOP", MB_OK);
   }
   while (status) {
       PVOID path = getPath(rand() % 8 + 1);
       SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, path, SPIF_UPDATEINIFILE);
       Sleep(min * 1000);
    }
}

如果我们调用这个函数并传递变量的值false,那么循环仍在运行,但应该已经结束了。为什么我不明白。你能告诉我吗?如何停止/结束循环?谢谢)

c++
  • 3 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-16 00:01:37 +0000 UTC

C++ 标准::线程。如何反转和结束流

  • 3

大家好,

如何通过id访问线程并要求它“完成”?

我使用 C++11 标准和库<thread>

谢谢)

c++
  • 1 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-15 19:05:19 +0000 UTC

C++ 异步无限循环

  • 3

你好。我有一个无限循环。在启动时,正如预期的那样,程序挂起,没有按下任何按钮。我怎样才能异步运行这个循环?我的C++不是很强,我需要一个简单的例子。谢谢)

for (size_t i = 0; i < INFINITY; i++) {
    somefunction();
}
c++
  • 2 个回答
  • 10 Views
Martin Hope
Tvolex
Asked: 2020-06-14 21:22:27 +0000 UTC

C++ 设置壁纸

  • 1

大家好,我需要更改桌面背景,我使用SystemParametersInfo() "Windows.h"连接的功能,我注册了路径,按下按钮应该放图片,但应该放黑色背景。我把图片改成bmp,加上其他的斜线,还是一样的结果。我将文件的左侧路径和黑色背景放在一起 :(

编码:

SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, (PVOID)"C:\\Users\\HP\\Pictures\\wallpaper.png", SPIF_UPDATEINIFILE);

c++
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5