草庐IT

E_DEPRECATED

全部标签

c++ - 警告 : deprecated conversion from string constant to 'char*' '

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:Howtogetridofdeprecatedconversionfromstringconstantto‘char*’warningsinGCC?我使用库中的以下函数,但我无法更改:HRESULTDynamicTag(char*pDesc,int*constpTag);我使用它如下。我已经创建了实现上述功能的库提供的类的对象。inttag=0;g_pCallback->DynamicTag("MyLogger",&tag);我收到以下警告:warning:deprecatedconversionfromst

node.js - ExpressJS 错误 : Body-Parser Deprecated

问题我正在尝试构建Node.jsAPI,在编写server.js文件时,我的代码如下所示:varexpress=require('express');varexpress=require('body-parser');varapp=express();app.use(bodyParser.json());app.get('/api/posts',function(req,res){res.json([{username:'oscar',body:'hello'}])})app.listen(3000,function(){console.log('ServerListeningon',

node.js - 全新 express 项目 doctype 5` is deprecated, you must now use ` doctype html` 上的错误

通过在windows命令提示符下运行以下命令创建了一个全新的express.js项目npminstallexpress-gexpressnewprojectcdnewprojectnpminstallnodeapp然后我打开浏览器窗口到http://localhost:3000/并得到以下错误500Error:c:\projects\newproject\views\index.jade:53|blockcontent4|h1=title>5|pWelcometo#{title}`doctype5`isdeprecated,youmustnowuse`doctypehtml`3|blo

javascript - DeprecationWarning : Calling an asynchronous function without callback is deprecated. - 如何找到 "function:"在哪里?

我最近将我的Node更新到7.2.1并注意到有一个警告来了:(node:4346)DeprecationWarning:Callinganasynchronousfunctionwithoutcallbackisdeprecated.这个4346是干什么用的?我的js文件里只有2000行,所以不能是行号。在哪里可以找到代码? 最佳答案 您可以使用--trace-deprecation或--throw-deprecation选项。例如:node--trace-deprecationapp.js或:node--throw-depreca

node.js - 弃用警告 : Buffer() is deprecated due to security and usability issues when I move my script to another server

脚本移动到其他服务器时出错。(node:15707)[DEP0005]DeprecationWarning:Buffer()isdeprecatedduetosecurityandusabilityissues.PleaseusetheBuffer.alloc(),Buffer.allocUnsafe(),orBuffer.from()methodsinstead.当前版本:Ubuntu16.04.4LTSNode-v10.9.0NPM-6.2.0以前的版本:Ubuntu14.04.3LTSNPM-3.10.10Node-v6.10.3exports.basicAuthenticati

node.js - express 抛出错误为 `body-parser deprecated undefined extended`

在我的Node应用程序中,我使用的是express。一切正常,但我在cmd中遇到错误。我使用的都是更新的模块...我的代码:varexpress=require('express');varbodyParser=require('body-parser');varjade=require('jade');varapp=express();app.set('viewengine','jade');app.set('views',__dirname+'/views');app.use(express.static(__dirname+'/public'));app.use(bodyPars

python - future 警告 : Using a non-tuple sequence for multidimensional indexing is deprecated use `arr[tuple(seq)]`

我已经搜索了S/O,但找不到答案。当我尝试使用seaborn绘制分布图时,我收到了一个future警告。我想知道这里可能是什么问题。importpandasaspdimportnumpyasnpimportseabornassnsimportmatplotlib.pyplotasplt%matplotlibinlinefromsklearnimportdatasetsiris=datasets.load_iris()df=pd.DataFrame(iris.data,columns=iris.feature_names)df['class']=iris.targetdf['specie

python - future 警告 : Using a non-tuple sequence for multidimensional indexing is deprecated use `arr[tuple(seq)]` instead of `arr[seq]`

我不想将非元组序列用于多维索引,以便脚本在这种情况发生变化时支持Python的future版本。以下是我用于绘制图形的代码:data=np.genfromtxt(Example.csv,delimiter=',',dtype=None,names=True,converters={0:str2date})p1,=host.plot(data["column_1"],data["column_2"],"b-",label="column_2")p2,=par1.plot(data["column_1"],data['column_3'],"r-",label="column_3")p3,

python - 如何修复 : W602 deprecated form of raising exception

如果我使用pylint(通过sublimerlinter),我会收到以下警告消息:W602已弃用的引发异常的形式这是我在代码中使用异常的方式:ifCONDITION==True:raiseValueError,HELPING_EXPLANATION 最佳答案 像这样提出你的异常:ifCONDITION==True:raiseValueError(HELPING_EXPLANATION)来自PEP8--StyleGuideforPythonCode-ProgrammingRecommendations:Whenraisinganexc

python - python标准库中的装饰器(特别是@deprecated)

我需要将例程标记为已弃用,但显然没有可弃用的标准库装饰器。我知道它的配方和警告模块,但我的问题是:为什么这个(常见)任务没有标准库装饰器?附加问题:标准库中是否有标准装饰器? 最佳答案 以下是一些片段,根据Leandro引用的片段进行了修改:importwarningsimportfunctoolsdefdeprecated(func):"""Thisisadecoratorwhichcanbeusedtomarkfunctionsasdeprecated.Itwillresultinawarningbeingemittedwhen