Tag:c

  • [redis5 source code learning] an analysis of the rename section of redis command

    Time:2020-4-1

    baiyan Command syntax Command meaning: change the key to newkeyCommand format: RENAME key newkey Command actual combat: 127.0.0.1:6379> keys * 1) “kkk” 2) “key1” 127.0.0.1:6379> rename kkk key1 OK 127.0.0.1:6379> keys * 1) “key1” 127.0.0.1:6379> rename kkk kkk (error) ERR no such key Return value: if the name change is successful, it will prompt OK, […]

  • Just for fun – nginx with Lua to write a hello world

    Time:2020-4-1

    Lua Characteristics of lua Compact: a complete Lua interpreter is no more than 200K Extensibility: Lua’s interpreter is written in 100% ANSI, which provides a very easy-to-use extension interface and mechanism. Therefore, Lua’s script can be easily called by C / C + + code, or vice versa Fast OpenResty Nginx is known for being […]

  • Two methods to realize the full screen of window in C

    Time:2020-4-1

    This paper shares the specific code of C ා to realize the full screen of the window for your reference. The specific content is as follows Method 1:However, there are some inexplicable bugs in this method //The program start path is in the same directory as the EXE file of the generated program public String […]

  • Generation and call of QT dynamic link library so

    Time:2020-3-31

    QT creates and calls shared library file.so under LinuxAfter a little effort, I finally got the new skill of writing shared library and calling it!The advantages of DLLs are self-evident. For a slightly more complicated program, good class library division at the top level of design can make the work very simple, while compiling different […]

  • Yezi technology python3 code is compatible with python2

    Time:2020-3-31

    Yezi electric competition data official website revised https://www.xxe.io/new debutPython3 code is compatible with python21. Use the future featureEach new version of Python will add new features or make changes to the original features. Some changes are not compatible with the old version, that is, the code running normally in the current version may not run […]

  • Brief introduction and difference of string and StringBuilder in C

    Time:2020-3-31

    Brief distinction The disadvantage of string is that every time the content of string variable changes, memory must be reallocated. Think about it. If you create a loop that iterates 100000 times, each iteration will connect a character to a string, so there will be 100000 strings in memory. Each string is only accompanied by […]

  • Summary of C + + structure and class pointer knowledge points

    Time:2020-3-31

    In a structure or class, the pointer accesses its member functions or variables through the ‘- >’ operator or by looking at the code comment section. The operation of the comment section is not recommended: #include <iostream> #include <cstring> using namespace std; struct STRUCT { string hello; }; int main() { STRUCT *str=new STRUCT; STR […]

  • Binder driven death notice

    Time:2020-3-31

    After the binder communication is established, the client side may need to know the survival status of the server side. When the server side hangs up, the client side needs to clean up the communication related data and behaviors. This cleaning process is realized through binder death notification mechanism. Registered death notice The application layer […]

  • C ා running speed test with string and StringBuilder and their common methods

    Time:2020-3-30

    Speed test for sting and stirngbuilder Use the methods in the stopwatch timer class (note the reference namespace system. Diagnostics;),Start()Start timing,Stop()Stop timing, propertiesElapsed: returns the time interval from start to end Then do the same thing with the variables of type sting and the objects of StringBuilder. I’m going to let them add 50000 characters […]

  • On the reference count in PHP string type

    Time:2020-3-29

    Author: Wang Shu Background introduction String type is also a commonly used type. Due to the characteristics of strings, in order to save memory, the same string variables usually share a block of memory space. By reference counting, multiple variables are marked to use this memory. However, after GDB tracking, it is found that not […]

  • Algorithm analysis and design of C + + Hanoi Tower

    Time:2020-3-29

    Recursive algorithm 3: Hanoi TowerProblem descriptionMove rule:Only one disc can be moved at a time;The disc can be inserted on any of the towers a, B and C;At no time can a larger disc be pressed against a smaller disc. Analysisboundary conditionWhen there is only one ring, just move the ring from the first tower […]

  • Using connection class to open / close database code instance in C ා

    Time:2020-3-29

    In order to access the database, the database connection class is provided. In C ා, it is implemented by the connection class Four types of connections SQLConnection ADOConnection OractleConnection ODBCConnection Connect the database in SqlConnection mode: SQL Server database Windows authentication Steps: Reference namespace using system.data.sqlclient; Declare the connection method in the value string Create […]