• Scrapy’s download Middleware


    Download Middleware brief introduction Downloader, unable to execute JS code, does not support proxy itself Download the middleware framework for hooks to enter the request / response processing process of scratch, a lightweight underlying system for global modification of the request and response of scratch The download Middleware in the scratch framework is a class […]

  • How to unit test C project in VS


    scene Spring boot + JUnit implements unit test of querying database in idea: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/92780716 How to use junit4 + spring test to write unit tests in SSM: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/85112004 Realize paging and JUnit unit test in SSM: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/85113289 In Java, refer to the above for unit testing, then under the. Net platform, how to use VS […]

  • C-covariance and inversion


    Microsoft official overview: In C, covariance and inversion can realize implicit reference conversion of array type, delegate type and generic type parameters. Covariant preserves allocation compatibility, while contravariant preserves allocation compatibility. Covariance: the ability to use a more derived type than the originally specified derived type. Contravariant: able to use less derived types. Official example: […]

  • The difference and summary of static self in PHP


    /*** static self difference and summary * summary: * 1. In PHP, when there is no inheritance, you use self:: class and static:: class to get the current class name. *2. If inheritance is used and the method is written in the parent class, you need to get the current parent class name and unknown […]

  • [original] advanced IOS development (Tang Qiao) reading notes (2)


    Part 3: the underlying principles of IOS development 1. Objective-C object model 1.1 isa pointer Code of nsobject. H: NS_ROOT_CLASS @interface NSObject { Class isa; } Code of objc. H: typedef struct objc_class *Class; typedet struct objc_object { Class isa; } *id; Each object has a pointer named isa to the object’s class The flow […]

  • Efficient memory allocation of high performance go service


    Efficient memory allocation of high performance go service Manual memory management is really a problem (such as C C + +). Fortunately, we have a powerful automation system that can manage memory allocation and life cycle, thus freeing our hands. However, if you want to solve the problem by adjusting the JVM garbage collector parameters […]

  • Common usage of pymysql


    The difference between cursor. Fetchone() and cursor. Fetchall(): Cursor. Fetchone(): only one data can be displayed Cursor. Fetchall(): to display all the data found Other common methods of pymsql import pymysql #Connect to database db = pymysql.connect(“localhost”,”admin”,”[email protected]”,”dbpymysql”) #Create a cursor object using the cursor () method cursor = db.cursor() #Executing SQL statements using the execute() […]

  • A brief introduction to the preparatory work of the development project


    Install the node version required by the project. When installing a node, the NPM package management library will be downloaded automatically. Install Git Because git’s default theme color is much better than PowerShell’s, see the following: The way to change terminal in vscode is: CTRL +, open vscode’s settings panel, enter shell in the search […]

  • Learning notes of classic examples of C ා concurrent programming-2.9 handling exceptions of async void method


    problem Exceptions passed from the async void method need to be handled. Solution In the book, it is recommended not to write async void. If you have to, try to catch all the code inside the method, that is, handle all the possible exceptions inside the method. Of course, there is another way to deal […]

  • PHP simply determines what browser is currently in use


    PHP is a simple way to judge what browser is currently used and the type of browser. It is convenient to count the proportion of Web site users using the browser. Judge browser type method function userBrowser() { $user_OSagent = $_SERVER[‘HTTP_USER_AGENT’]; if (($user_OSagent, “Maxthon”) && ($user_OSagent, “MSIE”)) { $visitor_browser = “Maxthon(Microsoft IE)”; } elseif (($user_OSagent, […]

  • waiting_520


    As a programmer, you must have encountered NullPointerException, which is inevitable for new comers or experienced people in the Jianghu, but it is so powerless. In order to solve it, you can only judge a value before using it. However, this will make the code become bloated. Fortunately, jdk8 introduces optional to deal with the […]

  • On JavaScript Navigator object properties


    Navigator object properties You can use the following properties on the Navigator object: attribute describe appCodeName Return the code name of the browser appName Returns the name of the browser appVersion Return version information of browser cookieEnabled Determine if cookies are enabled in the browser geolocation Returns the geolocation object that can be used to […]