• For loop traversal in JavaScript


    General for loop traversal Define an array: Using the normal for loop traversal Can be used to traverse arrays Foreach traversal The traversal code is as follows This structure is more concise, but you can’t use break and other statements to jump out of traversal until all elements are passed to the calling function, but […]

  • Introduction to machine learning for programmers (10) – object recognition fast RCNN – recognition of face position and whether to wear mask


    Every time I see the news of big data face recognition catching fugitives, I will sigh that the technology is developing too fast, and the level of national public security is getting better and better. But that kind of system can’t be made by individuals. Today we just try to make a simple one, how […]

  • This points to the problem


    This direction in global environment under different development methods Tip: this point is dynamically bound when the code is running. This pointing to window in the lower global environment of browser //Testing console.log(this); // window This of the global environment in node points to global //Testing console.log(this) // global Under the strict mode of “use […]

  • How does mybatis implement streaming query?


    Basic concepts Streaming query means that after a successful query, it does not return a collection, but an iterator. The application gets a query result from the iterator each time. The advantage of streaming query is that it can reduce memory usage. If there is no streaming query, if we want to get 10 million […]

  • Tools for source code analysis of Android jar / Library


    catalog:Source code analysis of Android jar / Library  Bolts: effect:     It is used to chain execute cross thread code and transfer data Chestnut: Task.call(new Callable() { @Override public Boolean call() throws Exception { return true; } }, Task.UI_THREAD_EXECUTOR); Task.callInBackground(new Callable() { @Override public Boolean call() throws Exception { return false; } }); Task.callInBackground(new Callable() { […]

  • Difference between IOS class method and object method


    Object method [instance object method name] Call Represents an instance method, which is executed within the scope of a specific instance of a class. In other words, you must create an instance of a class before calling this method; Class method [class name method name] Call Represents the class method, which can be called directly […]

  • API cloud developer’s advanced road | [app development skills] DB module operation encapsulation JS class, super easy to use


    I encapsulate a JS class file specifically for operating DB modules. The encapsulated JS class file is as follows:`1. /** *@ version 1.0 SQLite operation file *@ todo to be solved: using object-oriented implementation, so that when splicing SQL, you don’t need to be affected by the last call to the same method, so that […]

  • Local reference and global reference knowledge of JNI memory management


    Recently, we have encountered some problems related to JNI reference in the development process. We have learned the relevant knowledge points of local reference and global reference background: project requirements, call the upper Android camera java interface in native C / C + + layer, and implement all operations including camera in native layer. However, […]

  • Using promise to solve the code nesting problem caused by multiple asynchronous Ajax requests


    problem The front-end students made a common mistake when they were making the page: they wrote down multiple Ajax requests in sequence, and the subsequent requests were dependent on the return results of the previous requests. As shown in the following code: var someData; $.ajax({ url: ‘/prefix/entity1/action1’, type: ‘GET’ , async: true, contentType: “application/json”, success: […]

  • Description method [dead loop]


    #import “MaTsonga .h” @implementation MaTsonga -(NSString *)description{ return [NSString stringWithFormat:@”{name:%@,age:%i}”,self.name,self.age]; } @end #import “MaTsonga .h” int main(int argc, const char * argv[]) { MaTsonga *ma=[[MaTsonga alloc]init]; ma.name= @”Is it like being silly”; ma.age=24; Nslog (@ “% @”, MA); // the object description method will be called to return the corresponding description information return 0; } […]

  • Singleton design pattern


    Singleton: a class can have only one instance object; How to implement singleton?1) Hungry man style: no matter whether the user needs the object or not, the object is created first; //① Enumeration public class SingletonPattern1 { public static void main(String[] args) { SingleEnum singleEnum1 = SingleEnum.INSTANCE; SingleEnum singleEnum2 = SingleEnum.INSTANCE; System.out.println(singleEnum1==singleEnum2);//true } } enum […]

  • Swift Animation: UI dynamic animator


    Swift Animation: UI dynamic animator yesUIViewAnimation of attributes UIViewPropertyAnimatorIt can realize the function of uiview elementframe, center, alpha, transformThe transformation of these attributes When using, call directlyUIViewPropertyAnimatorInrunningPropertyAnimatormethod UIViewPropertyAnimator.runningPropertyAnimator( withDuration: 2, delay: 0, options: [.curveEaseInOut, .allowUserInteraction], animations: { let animatingView = self.view.viewWithTag(100)! animatingView.center = CGPoint.zero }) { (animationPosition) in } be careful:animationThe code in is executed […]