I was fired the next day because I changed int to Integer

This article is excerpted from the Flyweight Pattern of "design patterns should be learned in this way"1 story backgroundBecause a programmer changed a method parameter in the production environment and changed the int type to Integer type, because money was involved, the company suffered heavy losses and the programmer was dismissed. ...

Posted by AStrangerWCandy on Mon, 01 Nov 2021 22:36:23 -0700

Do programmers need to write code comments?

"Don't comment on bad code - rewrite it." - Brian W. Kernighan and P. J. Plaugher Nothing is more useful than well placed comments. Nothing is more capable of messing up a module than messy comments. Nothing is more destructive than old, misinformed comments. Notes are not like Schindler's list. They are not "pure good". ...

Posted by pdn on Sun, 31 Oct 2021 23:30:07 -0700

[C language] super detailed explanation of string function & & memory function (detailed explanation + code demonstration + simulation implementation)

This article mainly introduces some commonly used string functions and memory operation functions. If there is a problem with what is written, please comment catalogue preface 1, strlen First, experience it through the following code   Function declaration The following error demonstration Simulation Implementation About const ...

Posted by dizzy1 on Sun, 31 Oct 2021 17:42:00 -0700

Why does Ali have to ask Redis for an interview? Alibaba architect's Redis distributed lock actual combat sharing

1, What is a distributed lock? We all know the concept of lock when learning Java, such as synchronized lock based on JVM implementation and a set of code level locking mechanism lock provided by jdk. We often use these two locks in concurrent programming to ensure the correctness of code running in multi-threaded environment. However, these l ...

Posted by DJ Judas on Sat, 30 Oct 2021 11:10:29 -0700

To hacker: you are so awesome, why don't you come and play this CTF

The path of painful penetration 0x00 Preface The CTF was very sour this time. There were 7 WEB penetration topics, which was also the beginning of pain. Good audit, why add so many high thresholds. 0x01 Pentest-homework-200 http://homework.sctf.xctf.org.cn/ Open the complete page, that is, log in to the registration page. Name, age, uplo ...

Posted by ntjang on Wed, 27 Oct 2021 23:06:31 -0700

Advanced Python: Python's object-oriented attribute method

This time, we mainly introduce various properties defined in the class, such as class properties, instance properties, private properties of the class, and various methods, such as instance methods, class methods, static methods, and   Property property method and other related knowledge. 🚀 Look at a piece of code class Tool(object): ...

Posted by Straterra on Mon, 25 Oct 2021 00:47:52 -0700

Want to thoroughly understand how large manufacturers achieve Redis high availability? It's enough to read this article

High Availability HA (High Availability) is one of the factors that must be considered in the architecture design of distributed systems. It usually refers to reducing the time when the system cannot provide services through design. Assuming that the system can always provide services, we say that the availability of the system is 100%. If the ...

Posted by Retired Bill on Fri, 22 Oct 2021 22:19:40 -0700

Stock market senior Daniel wrote a stock price real-time MacOS application in Python! Real time monitoring!

introduction While Python is good for building many things, MacOS applications are certainly not one of them. I wonder if I can use Python to build a menu bar application for MacOS. I found it not only possible, but also "very simple". In this tutorial, we will build a real-time MacOS application for stock prices -- all in Python. ...

Posted by SuisydeKing on Wed, 20 Oct 2021 19:37:51 -0700

Summary of knowledge points of interview questions of BAT large factory for Android post in 2021, and complete knowledge system

1, Picture 1,Picture library comparison 2,LRUCache principle 3,Picture loading principle 4,How to implement the picture library by yourself? 5,Glide Source code analysis 6,Glide What cache is used? 7,Glide How does the memory cache control its size? 2, Network and security mechanism 1.Network framework comparison and source code analysis ...

Posted by Jahren on Wed, 20 Oct 2021 10:45:32 -0700

How does MongoDB perform performance testing? Take a look at this summary

01 MongoDB test procedure description This paper mainly tests the efficiency of mongodb inserting data. Using the mongodb secondary development interface provided by a teacher. The data structure is: Struct keyvalmeta{ Char name[64]; Int valType; DateTime nStartTime; DateTime nEndTime; Int nUserDefMetaSize; Char* pUserDefMetaDat; } ...

Posted by centenial on Tue, 19 Oct 2021 23:24:09 -0700