标签: warnings

PhpStorm 中是否有确认文件在远程主机上移动的选项?

我每天在工作中使用 PhpStorm,我们公司使用 SFTP 编辑远程存储的文件...在远程主机查看器中浏览文件时,我总是不小心将不同的文件和文件夹“拖放到”随机位置,而没有注意到!然后它就变成了搜索这些文件的最终位置(浪费大量时间)

PhpStorm 是否有设置在将文件移动到远程主机之前警告您?如果是的话它位于哪里?

我在网上搜索过但找不到任何东西,感谢任何帮助!

settings warnings phpstorm

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

即使不使用 Python self 参数也需要它吗?


我可以理解Python要求self作为第一个参数,而不是什么。然而,我对 PyCharm 告诉我方法“hello”需要 self 作为第一个参数(当它甚至没有被使用时)感到困惑。

举个例子:

class Example:
    def hello():
       return "hello world"
Run Code Online (Sandbox Code Playgroud)

这会给我一个错误,说“方法必须有第一个参数,通常称为 self”

即使函数/方法没有使用它,我是否仍然应该将 self 作为参数包含在内,还是应该忽略此错误/警告?这是因为该方法位于类内部吗?

python warnings self

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

摆脱“浮点上下文中的整数除法”警告

是否可以在这行代码中消除“浮点上下文中的整数除法”警告:

int num = 14;
int roundedValue = (Math.round(num / 10) * 10); 
Run Code Online (Sandbox Code Playgroud)

java warnings intellij-idea suppress-warnings

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

VueJS 3警告在'@/components/...vue'中找不到导出组件

我正在使用 VueJS 3 应用程序,其中使用vue-routervuecore-js应用程序,我想在其中使用组件。我的视图目录Home.vue文件如下所示:

<template>
  <div class="wrapper">
    <section v-for="(item, index) in items" :key="index" class="box">
      <div class="infobox">
        <PictureBox image="item.picture" />
        <PropertyBox itemProperty="item.properties" />
      </div>
    </section>
  </div>
</template>

<script>
import { ref } from 'vue'
import { data } from '@/data.js'
import { PictureBox } from '@/components/PictureBox.vue'
import { PropertyBox } from '@/components/PropertyBox.vue'

export default {
  components: {
    PictureBox,
    PropertyBox,
  },
  methods: {
    addRow() {
      console.log('This add new row into table')
    }, …
Run Code Online (Sandbox Code Playgroud)

javascript warnings vue.js vuejs3 vue-composition-api

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

C++ 中的警告:尝试分配新的 int32_t 时必须检查指针持有的值

我试图学习 C++ 中的动态内存分配。我的程序可以编译并运行,但 Visual Studio 向我抛出这些警告。

他们的意思是什么?

Warning C28193  'ptr' holds a value that must be examined.
Warning C28182  Dereferencing NULL pointer. 'ptr' contains the same NULL value as 
'new(1*4, nothrow)'
Run Code Online (Sandbox Code Playgroud)

我的代码:

#include <iostream>
#include <cstdint>

int main()
{
    int* ptr = nullptr;

    if (!ptr) {
        ptr = new (std::nothrow) int32_t;
        *ptr = 10;
    }

    std::cout << *ptr << "\n";

}
Run Code Online (Sandbox Code Playgroud)

c++ warnings pointers new-operator dynamic-memory-allocation

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

如何标记在下一版本中已过时的方法?

是否有类似Obsolete或 的属性Deprecated指示某个方法在下一版本的 C# API 中已过时或已弃用?否则,是否有一个标准来表明这一点,例如将其添加到方法文档的注释中?

c# attributes warnings deprecated obsolete

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

Pandas 1.5.3 中的SettingWithCopyWarning 不起作用

我知道有一些关于此的线程,但我在实际SettingWithCopyWarning本身上遇到了麻烦,所以它们都没有任何帮助。

我最近对我的机器进行了核攻击,并且正在重新安装 Pycharm 和所有库等。在运行我的一些脚本时,我不断收到与抑制SettingWithCopyWarning.

import warnings
from pandas.core.common import SettingWithCopyWarning
warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
Run Code Online (Sandbox Code Playgroud)

这些是我正在运行的行,它们会导致以下错误消息:

ImportError: cannot import name 'SettingWithCopyWarning' from 'pandas.core.common'
Run Code Online (Sandbox Code Playgroud)

我查看了该common.py文件,没有看到任何对SettingWithCopyWarning. 我使用的是 Python 3.8 和 Pandas 版本 1.5.3。

干杯

python warnings pandas pandas-settingwithcopy-warning

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

什么是“this-escape”警告,我该如何处理它?

我很难找到这方面的资源,但是,当我在最新的 Java (21) 上编译代码时,我的很多类都遇到了这个错误。

这是一个代码示例。

public class ThisEscapeExample
{

        public Object o;

        public ThisEscapeExample()
        {

                this.overridableMethod();

        }

        public void overridableMethod()
        {

                this.o = new Object();

        }

}
Run Code Online (Sandbox Code Playgroud)

这是我的编译命令。

javac -Xlint:all ThisEscapeExample.java
ThisEscapeExample.java:9: warning: [this-escape] possible 'this' escape before subclass is fully initialized
                this.overridableMethod();
                                      ^
1 warning
Run Code Online (Sandbox Code Playgroud)

java warnings scope compiler-warnings this-pointer

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

哪个gcc开关禁用"逗号的左手操作数无效"警告?

它是更大的代码库的一部分,它强制-gerror上的错误.此警告是在不应更改的第三方代码中生成的(我实际上知道如何修复它),但我可以禁用特定警告.这次男人gcc让我失望了,所以请让一些gcc高手赐教.TIA.

gcc warnings

0
推荐指数
2
解决办法
1568
查看次数

我对延迟加载的方法有缺陷吗?

平台:带有Resharper 4.1,.NET 3.5的Visual Studio 2008 SP1

我有一个静态方法的类,GetProperty<T>它懒惰地返回一个属性值.

private static T GetProperty<T>(T backingField, Func<T> factory) 
    where T : class 
{
    if (backingField == null)
        backingField = factory();
    return backingField;
}
Run Code Online (Sandbox Code Playgroud)

但是,当我使用上述方法返回属性时,我收到两条警告,指出未分配私有支持字段.但是只有在需要时才会分配它们.

替代文字

这个警告是否可以忽略
- 或者 -
我的加载财产是否存在缺陷?

c# resharper warnings lazy-loading

0
推荐指数
2
解决办法
444
查看次数