Tag:Single case

  • [Android 10 design pattern] series — “single example”

    Time:2020-8-7

    preface Due to the large amount of code for source code analysis, the content display pages of most Blog websites are relatively narrow, and the effect displayed is extremely ugly. Therefore, you can also read this article directly from thinking in Android. I hope this article can help you sort it out“Singleton mode”。 1、 Overview […]

  • Remove the binding from all events

    Time:2020-8-7

    In the single example, in order to prevent error reporting when asynchronous trigger is caused by multiple registration events, we searched the Internet for a circle and did not find the desired method. [exception type]: argumentexceptionException information: the delegation must have one target (and only one target). Combined with the online data, the method is […]

  • Sdwebimage source code analysis of sdwebimage annotation of sdwebimage Manager

    Time:2020-7-20

    /*  * This file is part of the SDWebImage package.  * (c) Olivier Poitrey  *  * For the full copyright and license information, please view the LICENSE  * file that was distributed with this source code.  */ #import “SDWebImageCompat.h” #import “SDWebImageOperation.h” #import “SDWebImageDownloader.h” #import “SDImageCache.h” typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {     /**      * By default, when a URL fail to be downloaded, the URL is blacklisted so the library won’t keep trying.      * This flag disable this blacklisting.      */     /**      *By default, if a URL fails to download, the URL will be added to the blacklist, and the library will not try to download it again. This flag will prevent the library from adding the failed URL to the […]

  • Integrating laravel with swoole, shadowfax does this

    Time:2020-7-11

    We have recommended shadowfax as an extension package. Now let’s talk about how shadowfax integrates laravel and swote. Why PHP is slow As we all know, PHP is an interpretive language. The characteristic of interpreted language is to compile at run time. When PHP script is executed, Zend engine parses and builds syntax tree, then […]

  • ASP. Net core dependency injection

    Time:2020-6-24

    Why use dependency injection? With dependency injection, we can manage the dependencies between classes, help us follow the design principles when building applications, and ensure code maintainability and scalability ASP.NET In the whole core architecture, the dependency injection framework provides the core capabilities of object creation and life cycle management. The components cooperate with each […]

  • Video playback demo

    Time:2020-6-10

    Source code of gtvideoplayer: GTVideoPlayer.h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN /** player */ @interface GTVideoPlayer : NSObject /** 全局player单例 */ + (GTVideoPlayer *)Player; /** stop playing */ – (void)stopPlayer; /** Play video through URL on specified view */ – (void)playVideoWithUrl:(NSString *)videoUrl attachView:(UIView *)attachView; @end NS_ASSUME_NONNULL_END GTVideoPlayer.m #import “GTVideoPlayer.h” #import <AVFoundation/AVFoundation.h> @interface GTVideoPlayer () @property (nonatomic, […]

  • Manually encapsulate the C ා logger class

    Time:2020-6-10

    Manually encapsulate the C ා logger classSingle case mode: /// <summary> ///Log class /// </summary> class Logger { /// <summary> ///Singleton object /// </summary> private static readonly Logger logger=new Logger(); /// <summary> ///Folder name /// </summary> private static string FilePath; /// <summary> ///File name /// </summary> private static string FileName; /// <summary> ///Privatization self constructor […]

  • Differences of several providers in angularjs

    Time:2020-5-27

    Original text: https://xebia.com/blog/differ… What is provider?Definition of provider in angularjs document:Provider is a$get()Method. Injector call$getMethod to create an instance of a new service. There are other ways to configure a provider. Angularjs use$provideRegister a new provider. Providers basically create a new instance, but each provider creates it only once.$provideThere are six ways to create custom […]

  • Reflection, double down method

    Time:2020-5-26

    1、 Reflex The concept of reflection was first proposed by Smith in 1982. It mainly refers to the ability of a program to access, detect and modify its own state or behavior (introspection). The introduction of this concept soon led to the research on application reflection in the field of computer science. It was first […]

  • Interpretation and use of IOC built in asp.net core

    Time:2020-5-1

    When I came into contact with the concepts of IOC and Di, I was lucky to have the first contact with Java in 2016. At that time, I was very vague about these two concepts. Later, I went back to the base camp of. Net for various reasons, and I came into contact with IOC […]

  • Design pattern notes (1): single pattern

    Time:2020-4-28

    Preface Design pattern is a simple and elegant solution to specific problems in the process of object-oriented software design. Each design pattern can solve a specific kind of problems, which is very helpful to improve the ability of programmers to solve problems. Therefore, recently, we started to sort out the design patterns. This is the […]

  • JavaScript Design pattern part 1: Singleton pattern

    Time:2020-4-25

    What is singleton mode Singleton pattern ensures that a class has only one instance and provides a global access point to access it Singleton pattern is a simple and easy to understand pattern in design pattern, but its usage scenarios are very extensive, including famous onesVuexThe singleton mode is also used. This article introduces two […]