• Go trap for loop iteration variable


    Reprinted from the originalGo trap for loop iteration variable Capture iteration variables It’s learningGo programmingIt’s an important warning that I encountered in the project. This is a trap of the go language’s lexical scope rules. After watching it, I feel that it’s really a confusing place. So make a special record. You can see from […]

  • Go – map set


    summary A map set is an unordered key value data structure. The key / value in the map set can be of any type, but all keys must belong to the same data type, all values must belong to the same data type, and the data types of key and value can be different.Declaration map […]

  • Leetcode 67. Binary summation | Python


    67. Binary summation Title Source: leetcode https://leetcode-cn.com/problems/add-binary subject Give you two binary strings and return their sum (in binary). The input is a non empty string and contains only the numbers 1 and 0. Example 1: Input: a = – 11 “, B = – 1” Output: “100” Example 2: Input: a = – 1010 […]

  • Unit testing on Android studio 1.5 (simple)


    1、 Note: Unit testing on Android studio (hereinafter referred to as as) is very convenient and does not require additional configuration. It’s all configured by itself. 2、 Test package generated automatically by as: After the package is opened, it will look like the following. You need to inherit the applicationtest class in the future 3、 […]

  • Appdelegate. M lifecycle


    AppDelegate.m // // AppDelegate.m // FirstIOS // // Created by MaTsonga on 14-2-23. //Copyright (c) 2014 matsonga. All rights reserved // #import “AppDelegate.h” @interface AppDelegate () @end @implementation AppDelegate – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { Nslog (@ “program started…); return YES; } – (void)applicationWillResignActive:(UIApplication *)application { Nslog (@ “program will lose focus…); // Sent when […]

  • C# Convert.ToDouble Problems in different regions


    Use in different areas Convert.ToDouble Problems may arise. string str = “20.0”; double val = Convert.ToDouble(str); For example, in some regional languages, the result is 200 Thread.CurrentThread.CurrentCulture =new CultureInfo(“vi”); The correct way is to ignore the region and use overload string str = “20.0”; double val = Convert.ToDouble(str, CultureInfo.InvariantCulture); The result is the correct 20.0

  • Php8 has introduced some major changes. What are the new features and performance optimizations?


    Article from:mp.weixin.qq.com/s/iBw-Jfz0b2tOn63…Xiaobian organized a PDF document:【Notes on new features of php8.0】   PHP 8.0.0 is currently the latest major version. It introduces some major changes, as well as many new features and performance optimizations1. PHP 8.0 introduces the much anticipated just in time (JIT) compiler, which can further improve the execution speed of PHP scripts 2. […]

  • Using fetch API and promise to call restful interface for post


    Basic Concept Promise Overview Promise is a js standard built-in object. Promise is used for asynchronous computations. A Promise represents a value which may be available now, or in the future, or never. A Promise is in one of these states: pending: initial state, not fulfilled or rejected. fulfilled: meaning that the operation completed successfully. […]

  • Regular expressions that you can understand (expressed in JavaScript)


    I am a front-end minion, and I often use regular expressions in my work, so I took time to learn the basics of regular expressions. Today, I will share what I have learned with you. I will first show you some small examples to lead you to gradually understand regular expressions. Then, on the basis […]

  • Implementation of Oracle row result total


    The implementation of Oracle row result total is mainly applied to the collection of date results. The following is the specific implementation code. With AA as (   select ‘A’ tNo ,  10 B from dual   union   select ‘B’ ,  20 from dual   union  select ‘A’ ,  30 from dual ) select […]

  • IOS strong reference


    KCPerson.h #import @interface KCPerson : NSObject @property (nonatomic,assign) int no; @end KCPerson.m #import “KCPerson.h” @implementation KCPerson -(NSString *)description{ return [NSString stringWithFormat:@”no=%i”,_no]; } @end main.m #import #import “KCPerson.h” int main(int argc, const char * argv[]) { @autoreleasepool { //strong __strong KCPerson *person1=[[KCPerson alloc]init]; __strong KCPerson *person2=person1; person1.no=1; Nslog (@ “% @”, person2); // result: no = […]

  • Oeasy teaches you to play Linux 010212 pipe


    What did we talk about in the last part? Cowsay Cows can have all kinds of expressions You can customize your eyes It can become all kinds of other small animals You can think of cowthink We also want cattle to say what it feels like to draw characters Review character drawing Download figlet and […]