deprecation-warning

Contenting deprecated sizeWithFont:constrainedToSize to boundingRectWithSize:options:attributes:context:

允我心安 提交于 2019-12-02 18:57:59
问题 How can I convert CGSize labelHeighSize = [text sizeWithFont: [UIFont systemFontOfSize:16] constrainedToSize:maximumSize lineBreakMode:NSLineBreakByTruncatingTail]; to CGSize labelHeighSize = [text boundingRectWithSize:maximumSize options: attributes: context: 回答1: First of all the method: - (CGRect) boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context; returns CGRect not the CGSize so you

Groovy Deprecated Methods and Eclipse - sort

大城市里の小女人 提交于 2019-12-01 17:40:00
I've got the following code which I wrote in groovy 1.8 someListOfLists.flatten().sort().unique() I've moved over to groovy 2.3.x, and eclipse (using e4.4 GroovyEclipse plugin for Juno from snapshot release) is showing me the sort() method is now deprecated for sort(Collection<T> self) , to which the advice is to use the sort(Iterable<T> self) . How do I now chain methods like this together to avoid the deprecation warnings? My thinking was that as flatten() is returning an ArrayList ( which is an Iterable ) it should be fine. Also, I see doing ((Iterable) someListOfLists.flatten()).sort()

Groovy Deprecated Methods and Eclipse - sort

两盒软妹~` 提交于 2019-12-01 16:42:52
问题 I've got the following code which I wrote in groovy 1.8 someListOfLists.flatten().sort().unique() I've moved over to groovy 2.3.x, and eclipse (using e4.4 GroovyEclipse plugin for Juno from snapshot release) is showing me the sort() method is now deprecated for sort(Collection<T> self) , to which the advice is to use the sort(Iterable<T> self). How do I now chain methods like this together to avoid the deprecation warnings? My thinking was that as flatten() is returning an ArrayList (which is

C++ Hash Deprecation Warning

半城伤御伤魂 提交于 2019-12-01 11:03:19
I am very new to C++ and programming in general and am currently working through Bjarne Stroustrup's Programming: Principles and Practices using C++. I'm consistently receiving the error below Severity Code Description Project File Line Error C2338 is deprecated and will be REMOVED. Please use . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. I understand that the header file std_lib_facilities.h using some sort of deprecated function, but is there a way to bypass this? It looks like it wants me to define "_SILENCE_STDEXT_HASH

getCurrentPosition deprecated on Google Apps iFrame?

限于喜欢 提交于 2019-11-30 22:00:14
问题 I'm running a Google Map through an HTML template on Google Apps Script. This means that the entire web app exists within an iFrame created with the following: function doGet(e) { var template = HtmlService.createTemplateFromFile('index.html'); template.action = ScriptApp.getService().getUrl(); return template.evaluate().setTitle('Google Map on Apps Script').setFaviconUrl('https://developers.google.com/_static/907a9d4ef3/images/favicon.png').setXFrameOptionsMode(HtmlService.XFrameOptionsMode

Java Deprecated APIs and SuppressWarnings “deprecation” - practical approach

谁说我不能喝 提交于 2019-11-30 14:20:37
I have seen many examples of using the Deprecated annotation on APIs in order to mark them as 'need to be replaced soon'. However, in almost all of these cases the code developers not only kept using the deprecated APIs, but also suppressed the deprecation warning . It seems like the best intentions of the API developers end up creating more code which is irrelevant to the implemented business logic - if an API is deprecated but is continually used with the associated warnings being suppressed it seems like a degradation of the code at best and a potential application breaking point when

Python/matplotlib : getting rid of matplotlib.mpl warning

放肆的年华 提交于 2019-11-30 12:11:18
I am using matplotlib using python 3.4. When I start my program, I have the following warning message: C:\Python34-32bits\lib\site-packages\matplotlib\cbook.py:123: MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use import matplotlib as mpl instead. warnings.warn(message, mplDeprecation, stacklevel=1) As far as I know I do not use mpl, and all my imports concerning matplotlib are: import matplotlib.pyplot as plt import matplotlib.animation as animation Anything I should do ? You can suppress that particular warning, which is probably the preferred way:

React 16.7 - React.SFC is now deprecated

对着背影说爱祢 提交于 2019-11-30 10:44:38
I use to declare stateless components like this: const example: React.SFC<IExample> = ({propsType}) => (); However the SFC is now deprecated, maybe this twitter post from Dan Abramov explains why. What should we use now that SFC is deprecated? Doğancan Arabacı You should use React.FunctionComponent : Rename React's SFC to 'FunctionalComponent This PR renames React.SFC and React.StatelessComponent to React.FunctionComponent , while introducing deprecated aliases for the old names. So your example would become: const example: React.FunctionComponent<IExample> = ({propsType}) => (); or const

RemovedInDjango19Warning: Model doesn't declare an explicit app_label

大城市里の小女人 提交于 2019-11-30 03:20:34
问题 Have gone through Django 1.9 deprecation warnings app_label but answers couldn't fix my problem, so asking again. I have an app that is added to INSTALLED_APPS in settings. when ever I run manage.py runserver , I get this warning, [trimmed path to project]/catalog/models.py:9: RemovedInDjango19Warning: Model class catalog.models.Category doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will

How to warn about class (name) deprecation

左心房为你撑大大i 提交于 2019-11-29 23:34:15
I have renamed a python class that is part of a library. I am willing to leave a possibility to use its previous name for some time but would like to warn user that it's deprecated and will be removed in the future. I think that to provide backward compatibility it will be enough to use an alias like that: class NewClsName: pass OldClsName = NewClsName I have no idea how to mark the OldClsName as deprecated in an elegant way. Maybe I could make OldClsName a function which emits a warning (to logs) and constructs the NewClsName object from its parameters (using *args and **kvargs ) but it doesn