working on it ...

Filters

Explore Public Snippets

Sort by

Found 228 snippets matching: deprecate

    public by micheleaiello  263149  0  6  1

    Mark methods as deprecated

    Mark a method (or a whole class) as deprecated. Works in Xcode v4.2 and higher.
    __attribute((deprecated("Use xxx: instead")))
    
    examples:
    
    @interface MyClass : NSObject
      - (void)myOldMethod:(id)param __attribute__((deprecated));
    @end
    
    __attribute__((deprecated))
    @interface MyOldClass : NSObject
    @end
    
    __attribute__((deprecated))
    void myOldFunction(...) {
    }

    public by Geometry  890  0  5  0

    FormatImage: Format an image.

    Format an image. Source image to format. Formats the image to one of the formats, which are supported by the AForge.Imaging library. The image is left untouched in the case if it is already of Format24bppRgb or Format32bppRgb or Format32bppArgb or Format48bppRgb or Format64bppArgb format or it is grayscale, otherwise the image is
    /// <summary>
    /// Format an image.
    /// </summary>
    /// 
    /// <param name="image">Source image to format.</param>
    /// 
    /// <remarks><para>Formats the image to one of the formats, which are supported
    /// by the <b>AForge.Imaging</b> library. The image is left untouched in the
    /// case if it is already of
    /// <see cref="System.Drawing.Imaging.PixelFormat">Format24bppRgb</see> or
    /// <see cref="System.Drawing.Imaging.PixelFormat">Format32bppRgb</see> or
    /// <see cref="System.Drawing.Imaging.PixelFormat">Format32bppArgb</see> or
    /// <see cref="System.Drawing.Imaging.PixelFormat">Format48bppRgb</see> or
    /// <see cref="System.Drawing.Imaging.PixelFormat">Format64bppArgb</see>
    /// format or it is <see cref="IsGrayscale">grayscale</see>, otherwise the image
    /// is converted to <see cref="System.Drawing.Imaging.PixelFormat">Format24bppRgb</see>
    /// format.</para>
    /// 
    /// <para><note>The method is deprecated and <see cref="Clone(Bitmap, PixelFormat)"/> method should
    /// be used instead with specifying desired pixel format.</note></para>
    /// </remarks>
    ///
    [Obsolete("Use Clone(Bitmap, PixelFormat) method instead and specify desired pixel format")]
    public static void FormatImage(ref Bitmap image)
    {
        if (
            (image.PixelFormat != PixelFormat.Format24bppRgb) &&
            (image.PixelFormat != PixelFormat.Format32bppRgb) &&
            (image.PixelFormat != PixelFormat.Format32bppArgb) &&
            (image.PixelFormat != PixelFormat.Format48bppRgb) &&
            (image.PixelFormat != PixelFormat.Format64bppArgb) &&
            (image.PixelFormat != PixelFormat.Format16bppGrayScale) &&
            (IsGrayscale(image) == false)
            )
        {
            Bitmap tmp = image;
            // convert to 24 bits per pixel
            image = Clone(tmp, PixelFormat.Format24bppRgb);
            // delete old image
            tmp.Dispose();
        }
    }

    public by p.kontalis  1236  0  6  0

    Replace Assembly.LoadWithPartialName with Assembly.Load

    The Assembly.LoadWithPartialName has been deprecated. From now on you have to use Assembly.Load
    '###Till .NET Framework 2.0 you can Load an assembly by its name
    Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.LoadWithPartialName("System.Windows.Forms")
    
    '###After .Net Framework 2.0 you have to use Assembly.Load
    '###Therefore you have to give all the assembly information but the public token is not the same per pc
    Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.Load("System.Windows.Forms, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 7a84f7ac56134e3a")
    
    '###In order to bypass this wall either you retrieve it from the registry or you use the GetType(Form) for the retrieval.
    Dim AssemblyLoadString As String = GetType(Form).AssemblyQualifiedName.ToString.Substring(GetType(Form).AssemblyQualifiedName.ToString.IndexOf(",") + 2)
    Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.Load(AssemblyLoadString)                        

    public by papershredder432  304  0  4  0

    Error for Discord Bot

    (node:8748) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of null at CommandMessage.run (C:\Users\Ulti\Desktop\Misc\AngelicGaming\node_modules\discord.js-commando\src\commands\message.js:230:28) at at runMicrotasksCallback (internal/process/next_tick.js:115:5) at process._tickCallback (internal/process
    const commando = require('discord.js-commando');
    class EightBallCommand extends commando.Command {
        constructor(client) {
            super(client, {
                name: '8ball',
                group: 'random',
                memberName: '8ball',
                description: 'Ever hear of an 8-Ball? Well that is what this command is.'
            });
        }
        async run(message, args) {
            var answers = [
                'Yes.', 'No.', 'Possibly.', 'Maybe.', 'Never.', 'Of course.', 'Reply hazy try again.'
            ];
            var answers = answers[Math.floor(Math.random() * answers.length)];
            message.reply(answer.toString())
            if(message.content === ""){
                bot.reply('There is nothing you are asking! Try again but ask a question this time')
            }
        }
    }
    module.exports = EightBallCommand;

    external by Ming-der Wang  2443  0  4  0

    chef 12 on poc deprecate

    chef 12 on poc deprecate: gistfile1.txt
    Deprecated features used!
      Cannot specify both default and name_property together on property path of resource yum_globalconfig. Only one (name_property) will be obeyed. In Chef 13, this will become an error. at 1 location:
        - /var/chef/cache/cookbooks/yum/resources/globalconfig.rb:76:in `class_from_file'
      Using an LWRP provider by its name (Ark) directly is no longer supported in Chef 12 and will be removed.  Use Chef::ProviderResolver.new(node, resource, action) instead. at 1 location:
        - /var/chef/cache/cookbooks/ark/resources/default.rb:26:in `initialize'
      checksum nil currently does not overwrite the value of checksum. This will change in Chef 13, and the value will be set to nil instead. Please change your code to explicitly accept nil using "property :checksum, [MyType, nil]", or stop setting this value to nil. at 1 location:
        - /var/chef/cache/cookbooks/elasticsearch/recipes/default.rb:92:in `block in from_file'
      chef_gem[chef-sugar] chef_gem compile_time installation is deprecated at 1 location:
        - /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:22:in `from_file'
      chef_gem[chef-sugar] Please set `compile_time false` on the resource to use the new behavior. at 1 location:
        - /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:22:in `from_file'
      chef_gem[chef-sugar] or set `compile_time true` on the resource if compile_time behavior is required. at 1 location:
        - /var/chef/cache/cookbooks/chef-sugar/recipes/default.rb:22:in `from_file'
      version nil currently does not overwrite the value of version. This will change in Chef 13, and the value will be set to nil instead. Please change your code to explicitly accept nil using "property :version, [MyType, nil]", or stop setting this value to nil. at 2 locations:
        - /var/chef/cache/cookbooks/python/recipes/pip.rb:52:in `block in from_file'
        - /var/chef/cache/cookbooks/python/providers/pip.rb:98:in `load_current_resource'
    
    
    

    external by justinwoo  202  0  2  0

    Deprecate Ember.String.fmt

    Deprecate Ember.String.fmt: deprecate-string-fmt.js
    var strFmt = Ember.String.fmt;
    var strFmtDeprecation = function (...args) {
      Ember.deprecate('Use of Ember.String.fmt is deprecated');
      return strFmt.apply(this, args);
    };
    Ember.String.fmt = strFmtDeprecation;
    
    // > Ember.String.fmt('32343 %@',['edf'])
    // DEPRECATION: Use of Ember.String.fmt is deprecated
    // "32343 edf"
    
    

    external by jmoody  106  0  2  0

    deprecate a ruby constant

    deprecate a ruby constant: a.rb
    def self.const_missing(const_name)
      if const_name == :FRAMEWORK_VERSION
        _deprecated('0.9.169', 'no replacement', :warn)
      end
      nil
    end
    
    
    
    

    external by Guillaume Hain  69  0  1  0

    Updated Right model with deprecate method

    Updated Right model with deprecate method: right.rb
    class Right
      …
      has_many :right_levels
      deprecate :levels, :right_levels
      …
    end
    
    

    external by Greg Xu  24  0  1  0

    update document after deprecate path attirubet in favor of filename

    update document after deprecate path attirubet in favor of filename: gistfile1.rb
    TenderBase::Document.find_each {|d| d.filename = d.filename.split("/").last; d.save}
    
    

    external by localhost8080  9  0  1  0

    deprecate a user function in php

    deprecate a user function in php: deprecate a user function in php
    PHP
    trigger_error('function '. __FUNCTION__ .' is gone', E_USER_DEPRECATED);
    
    
    • Public Snippets
    • Channels Snippets