programmer group

Store global variable attention points globally

Background: When making applets, there is a shop interface that calls on almost every page, so take it out and put it in App.js lower But in the process, take notes to save a complete picture. 1. Because only in App.js Down, the show interface is adjusted. On other subpages, global variables stored in the shop are used, so if this interface is not invoked successfully or asynchronously not synchronized quickly at this time, it will...

programmer group

switch statement usage in C ා

1 not every case needs to contain break. If the case statement is empty, it can not contain break, and the control flow will continue the subsequent case until the break is encountered. char grade = 'C'; switch (grade) { case 'A': case 'B': case 'C': Console.WriteLine("CCC"); break; case 'D': Console.WriteLine("DDD"); break; default: Console.WriteLine("Invalid grades"); break; } Output CCC no matter grad = A or B...

programmer group

Vector vector container (summary of commonly used methods)

As for the learning of vector container in STL, it's better to watch the code after compiling and running, and see the execution result at the same time. I still want to say that it's better to watch other people's code 100 times, rather than write it by yourself. Vector vector container can not only access elements randomly like array, but also insert elements in the tail at any time. It is simple and efficient, and can completely...

programmer group

Analyzing and mastering python ornaments (2)

After reading (1), you must already have a basic concept of decoration.In (2), I will do some research on the advanced usage of decorative ornaments. 1. Decorators with other parameters Next to the example above, we hope that not everyone has permission to use this calculation function, only certain people can. def checktype(personname=None): def decorate(func): def wrapper(*args,**kwargs): count = 0 ...