小编Dan*_*hea的帖子

远程主机可能不满足 vs code 服务器对 glibc 和 libstdc++ vscod 的先决条件

我当时在主机服务器上工作。直到昨天一切都很好,今天当我启动服务器时,VS 代码突然出现错误。而且我的服务器不再连接了。我应该怎么办?我尝试了一切,但没有一个对我有用。我附上错误日志以供参考。这是cmd中出现的错误

enter code here
[14:54:16.433] Log Level: 2
[14:54:16.435] remote-ssh@0.65.8
[14:54:16.435] win32 x64
[14:54:16.453] SSH Resolver called for "ssh-remote+155.230.28.121", attempt 1
[14:54:16.453] "remote.SSH.useLocalServer": false
[14:54:16.453] "remote.SSH.showLoginTerminal": false
[14:54:16.453] "remote.SSH.remotePlatform": {"155.230.28.121":"linux"}
[14:54:16.453] "remote.SSH.path": undefined
[14:54:16.453] "remote.SSH.configFile": C:\Users\USER\.ssh\config
[14:54:16.453] "remote.SSH.useFlock": true
[14:54:16.453] "remote.SSH.lockfilesInTmp": false
[14:54:16.453] "remote.SSH.localServerDownload": auto
[14:54:16.454] "remote.SSH.remoteServerListenOnSocket": true
[14:54:16.454] "remote.SSH.showLoginTerminal": false
[14:54:16.454] "remote.SSH.defaultExtensions": []
[14:54:16.454] "remote.SSH.loglevel": 2
[14:54:16.454] SSH Resolver called for host: 155.230.28.121
[14:54:16.454] Setting up SSH remote "155.230.28.121"
[14:54:16.470] Using commit id "c13f1abb110fc756f9b3a6f16670df9cd9d4cf63" and quality "stable" for …
Run Code Online (Sandbox Code Playgroud)

ssh server visual-studio-code

30
推荐指数
4
解决办法
5万
查看次数

在 VSCode 测试资源管理器中运行 Django 测试?

我正在尝试在 VSCode 测试资源管理器中运行 Django 单元测试,此外,我希望 CodeLens 的“运行测试”按钮出现在每个测试上方。

在此输入图像描述

但是,在测试资源管理器中,当我按“播放”按钮时,会显示错误:“没有进行任何测试”没有进行任何测试

我的目录结构是:

  • 工作区_文件夹
    • 设置.json
    • 回购协议
      • python_模块_1
        • 子模块
          • 测试
            • 测试_a.py

我正在使用单元测试框架。我的 Settings.json 如下所示:

{
    "python.pythonPath": "/Users/nbonilla/.local/share/virtualenvs/koku-iTLe243o/bin/python",
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        "${workspaceFolder}/python_module_1/sub_module/"
    ],
    "python.testing.pytestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.unittestEnabled": true,
}
Run Code Online (Sandbox Code Playgroud)

当我按下绿色的“播放”按钮测试资源管理器播放按钮时 ,Python 测试日志输出显示消息“由以下人员启动的 线程中出现未处理的异常” 我正在使用 pipelinev 虚拟环境。如何在 VSCode 测试资源管理器中运行这些 Django 测试?

我看到使用 pyTest 是 unittest 的替代品,如何轻松地将其设置为替代品?

django unit-testing virtualenv visual-studio-code pipenv

17
推荐指数
1
解决办法
1万
查看次数

ASP.NET Core 6.0 Web API 错误状态:400 标题:“发生一个或多个验证错误。” 对于由于外键而导致的 POST 请求

我一直在开发一个使用 .NET 6.0 和 SQL 的项目,并且遇到了状态:400 标题:“发生一个或多个验证错误”。每当我尝试对治疗表发出 POST 请求时,都会出现错误,如下所示(使用 Swagger)。

400 - Undocumented
Error: response status is 400

Response body
Download
{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "traceId": "00-471d5fa9b5bd60df0f6dddef0dcd44ad-4ed5f5f29428b83e-00",
  "errors": {
    "TblPet": [
      "The TblPet field is required."
    ],
    "Procedure": [
      "The Procedure field is required."
    ]
  }
}
Response headers
 content-type: application/problem+json; charset=utf-8 
 date: Thu,14 Jul 2022 11:25:42 GMT 
 server: Kestrel 
Run Code Online (Sandbox Code Playgroud)

该项目遵循此 ERD:

在此输入图像描述

该 API 是使用 Visual Studio 2022 构建的,它创建了许多public virtual项目,这些项目很可能是已设置的所有外键的结果。因此,我的 …

c# sql asp.net-core-webapi asp.net-core-6.0

16
推荐指数
1
解决办法
2万
查看次数

使用 BERT 文本分类时,出现 ValueError: Too muchDimensions 'str' 错误

尝试使用 BERT 模型制作文本情感分类器,但得到ValueError : too many dimensions 'str'

这是列车数据值的 DataFrame;所以它们是train_labels

0   notr
1   notr
2   notr
3   negative
4   notr
... ...
854 positive
855 notr
856 notr
857 notr
858 positive
Run Code Online (Sandbox Code Playgroud)

并且有代码产生错误

train_seq = torch.tensor(tokens_train['input_ids'])
train_mask = torch.tensor(tokens_train['attention_mask'])
train_y = torch.tensor(train_labels.tolist())
Run Code Online (Sandbox Code Playgroud)

At train_y = torch.tensor(train_labels.tolist());出现错误: ValueError: too many dimensions 'str'

你能帮我吗

在此输入图像描述

在此输入图像描述

python text-classification tensor mlp bert-language-model

15
推荐指数
2
解决办法
4万
查看次数

如何在vite/vue3中使用其他组件的sass全局变量

我想使用和更改其他组件的全局变量,我的文件结构如下所示......

在此输入图像描述

我的变量位于 global.sass 文件中,但无法访问其他组件中的变量。

variables sass vue.js vuejs3 vite

13
推荐指数
2
解决办法
3万
查看次数

位于reducerPath“api”的 RTK-Query API 的中间件尚未添加到商店

我正在创建一个反应本机应用程序,并且收到此警告。位于reducerPath“api”的 RTK-Query API 的中间件尚未添加到商店中。自动缓存收集、自动重新获取等功能将不可用。

我看到我的 api 没有被重新获取。

这是我的 rootReducer.ts 文件

import {combineReducers} from '@reduxjs/toolkit';
import { storiesApi } from 'src/services/storiesService'

const appReducer = combineReducers({
  [storiesApi.reducerPath]: storiesApi.reducer,
});

const rootReducer = (state, action) => {
  if (action.type === 'RESET_APP') {
    state = undefined;
  }
  return appReducer(state, action);
};

export const resetAppAction = () => dispatch => {
  console.log('Reset Redux Store');
  dispatch({type: 'RESET_APP'});
};

export default rootReducer;
Run Code Online (Sandbox Code Playgroud)

这是我的 store.ts 文件

import { useDispatch as useReduxDispatch, useSelector as useReduxSelector } from 'react-redux';
import …
Run Code Online (Sandbox Code Playgroud)

react-native rtk-query

12
推荐指数
2
解决办法
2万
查看次数

如何在 nivo 图表设置中添加自定义颜色主题

我在我的一个项目中使用 Nivo 图表,并且我已经实现了 nivo 图表设置,就像他们在其网站中实现的那样。但是,除了 nivo 提供的功能之外,我还想添加一些我自己的自定义颜色主题选项。为了更清楚起见,我附上此屏幕截图

在此输入图像描述

现在,我们从 nivo 包中导入颜色:

import {
    categoricalColorSchemeIds,
    divergingColorSchemeIds,
    sequentialColorSchemeIds,
    colorSchemes,
} from '@nivo/colors'
Run Code Online (Sandbox Code Playgroud)

现在我在某处读到我们可以将自定义对象注入为颜色主题,任何人都可以帮助我展示如果我想添加名称为 CustomTheme 且颜色为“#000、#fff、#ff0000”的新主题,这将是如何实现的”。我们该怎么做,任何帮助都会有帮助。提前致谢

javascript reactjs nivo-react

11
推荐指数
1
解决办法
9956
查看次数

如何将 ankhsvn 安装到 Visual Studio 2022 中?

参考AnkhSVN Visual Studio 2019的安装,虽然可以成功安装,但在Visual Studio 2022中仍然无法使用

在此输入图像描述

活动日志.xml:

包的 CreateInstance 失败 [AnkhSVN - Visual Studio 的 Subversion 支持]源:'mscorlib' 描述:无法加载文件或程序集 'file:///c:\users\xxxx\appdata\local\microsoft\visualstudio\17.0_1d0575ca\ Extensions\mhbmk1bf.g1d\Ankh.Package.dll' 或其依赖项之一。

visual-studio-extensions

11
推荐指数
2
解决办法
2万
查看次数

净::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200

请帮助解决这个问题。我正在使用 MERN 应用程序。在应用程序中,我使用 API 将图像上传到 cloudnary。然后我使用 secure_url 将图像上传到前端。它可以在 localhost 上运行,但不能在 heroku 上运行,即图像未上传

本地主机:

在此输入图像描述

赫罗库:

在此输入图像描述

浏览器控制台响应:

在此输入图像描述

其他图片:

在此输入图像描述 在此输入图像描述

上传.js

const express = require("express");
const router = express.Router();
const cloudinary = require("cloudinary");
const { verifyTokenTeacher } = require("./verifyToken");

cloudinary.config({
  cloud_name: process.env.CLOUD_NAME,
  api_key: process.env.CLOUD_API_KEY,
  api_secret: process.env.CLOUD_API_SECRET,
});

// upload image
router.post("/upload", verifyTokenTeacher, (req, res) => {
  try {
    console.log(req.files);
    if (!req.files || Object.keys(req.files).length === 0)
      return res.status(400).json({ msg: "Fayl yuklanmangan" });

    const file = req.files.file; // oxiridagi file bu query parametr
    if (file.size > …
Run Code Online (Sandbox Code Playgroud)

heroku node.js cloudinary mern cross-origin-embedder-policy

11
推荐指数
1
解决办法
2万
查看次数

Firebase 错误:TypeError:无法使用“in”运算符在未定义中搜索“_delegate”

我是 firebase 的新手,过去两天在查询和删除集合中的文档时遇到了一些困难。具体来说,每次启动服务器时,我都会尝试清除公司虚拟数据的整个集合,然后再循环虚拟数据并将其写入集合(以防止重复)。

我已经能够将我的公司虚拟数据写入我的“公司”集合中,没有问题。问题是当我尝试从集合中删除文档时;它不会删除,并且在将检索变量传递给 deleteDoc() 方法时似乎会引发以下错误。

注意:我决定先尝试仅删除一个文档。如果我能成功做到这一点并且它反映在 firebase 集合中,那么我应该能够毫无问题地清除整个集合。

类型错误:无法使用“in”运算符在未定义中搜索“_delegate”

据我所知,“in”关键字仅在检查对象上是否存在属性时才有效。我在函数的每个点记录了数据,以确保正确引用文档并将适当的数据类型传递给 deleteDoc() 函数(这将是一个对象)。

这是我将虚拟数据写入数据库的代码(工作正常):

export const dummyDataToFirebase = async() => {
  try {
    const batch = writeBatch(db);
    dummyData.forEach(doc => {
      addDoc(companyRef, doc)
      console.log(doc)
    })
    await batch.commit();
    console.log('success!')

  } catch (error) {
    console.error(error, 'try again!');
  }
} 
Run Code Online (Sandbox Code Playgroud)

这是我从数据库集合中删除文档的代码(问题)

const deleteOne = async () => {
  try {
    const docRef = doc(companyRef, '86e9cade14e2a972c526db4b7c828ed7')
    const retrieve = await getDoc(docRef)
    console.log(retrieve)
    await deleteDoc(retrieve)
    if(retrieve.exists()) {
      console.log('still exists')
    } else {
      console.log('it worked!')
    }
  } …
Run Code Online (Sandbox Code Playgroud)

javascript runtime-error firebase reactjs google-cloud-firestore

10
推荐指数
1
解决办法
1万
查看次数