(In order to let more people see it, I hope you will send an old article again)
To facilitate the management of various types of blog postsCodeAnd tool resources. Now, these resources are migrated to Google Code. If you are interested, you can download them.
C ++
1. High-performance windows socket server and client components (download of source code and Test Cases)
Iocp-based general asynchronous Windows Socket TCP high-performance Server Component Design and Implementation
General asynchronous Windows Socket tcp client component design and implementation
Abstract: writing a Windows Socket tcp client is not difficult. Windows provides six I/O communication models for you to choose from. However, I have seen many clients in this module.ProgramBoth the socket communication and business logic are mixed together, and the logic is still messy. Every program can copy/parse similar code and then modify it. Therefore, this module uses some leisure time to write a general asynchronous Windows Socket TCP high-performance server component based on iocp and a general asynchronous Windows Socket tcp client component for you to see the detailed parameters, I hope to inspire everyone.
Resource: Visit the project homepage ^ _*
2. Windows C ++ general application log component (download of components and test programs)
Abstract: writing a common log component should focus on three aspects: functionality, availability, and performance. The following describes in detail the considerations for these issues when designing log components:
-
- Function: This log component is designed to meet the logging requirements of most applications. It outputs logs to files or sends them to applications, and does not provide complex but uncommon functions.
- Availability: This log component focuses on availability and makes it easy to use.
- Performance: performance is a hard indicator of whether the component is worth using. The performance optimization should be considered during the process from design to coding.
Http://ldcsaa.googlecode.com/files/VC_Logger.zip Resources
3. How to develop good C ++ programming habits (1)-memory management
Abstract: C/C ++ memory management seems daunting. The full screen new/delete/malloc/free and Output Window endless Memory Leak warnings, the strange 0x00000004 pointer of the program is abnormal. It seems that we were crying together that year. Can you hold it? In fact, the reality is not as bad as you think. As long as you give a little bit of attention, it's right! Just a little bit --Encapsulate memory access with C ++ classIt will solve most of your troubles and benefit you for life. Taking windows as an example, there are several main memory management methods:
-
- Virtual Memory(Virtual Memory)
- Default heapAndPrivate heap(Process heap & private heap)
- Memory ing File(File mapping)
- Process stack(Heap, in fact, uses malloc () or the default new operator to cut meat in a small part of process heap. ^_^)
- Stack(Stack, the memory is automatically managed by the caller or by the caller)
Resources: https://ldcsaa.googlecode.com/files/high_pfm_socket_server_and_client-2.0.1.zip (Source codeIn the common/src directory)
4. Message ing macro for Win32 programs (similar to MFC)
Abstract: For message ing macros, you don't need to talk about it. People who have used MFC are very clear about it. However, there are many programs that haven't used MFC for various reasons, so this post will discuss how to implement message ing macros similar to MFC in Win32 programs. In fact, the Windows header file "windowsx. H" (Note: it is not "windows. H") provides some useful macros to help us implement message ing. This module also implements message ing based on this header file.
Resource: https://ldcsaa.googlecode.com/files/high_pfm_socket_server_and_client-2.0.1.zip (source code in the common/src/win32helper. h file)
5. Use macro to implement the C ++ Singleton Model
Abstract: The Singleton design mode is widely used and easy to implement. It is nothing more than private several constructors, the "operator =" operator, and a static creation and destruction method. However, writing the same code for each class is intolerable for this module. Therefore, this module uses macros to encapsulate the entire Singleton mode, whether it is the definition of a class or the use of a class is extremely simple.
Resource: https://ldcsaa.googlecode.com/files/high_pfm_socket_server_and_client-2.0.1.zip (source code is in the common/src/singleton. h file)
6. C ++ private heap
Abstract: Private heap is a memory mechanism provided by windows. For applications that require frequent allocation and release of dynamic memory, private heap is a magic weapon to Improve the Performance of applications, using it can reduce the competition for new/malloc call queues and memory holes.
Resource: https://ldcsaa.googlecode.com/files/high_pfm_socket_server_and_client-2.0.1.zip (source code is in the common/src/privateheap. h file)
7. Windows program memory leakage detection tool based on CRT debug
Abstract: Windows program memory leak detection is a very important task. Gui-based applications usually have a memory leak report at the end of debugging, but this report is not comprehensive, the specific row number that generates the leak cannot be located. In fact, implementing a memory leak detection tool by yourself is very simple, but I have read many examples written on the Internet and there are two common problems:
-
- Either it is not comprehensive, it can be used in one environment, but it cannot work well in another environment, or the vulnerability report output method is unreasonable.
- It is either too conservative, for example: there is no need to do so in _ malloc_dbg () and _ free_dbg () use the criticalsection before and after the call (tracking the new and malloc code in a multi-threaded environment will understand ).
Resource: https://ldcsaa.googlecode.com/files/high_pfm_socket_server_and_client-2.0.1.zip (source code is in the common/src/debug/win32_crtdbg.h file)
Java
1. Portal-Basic Java Web Application Development Framework v3.0.1 officially released (source code, examples and documents)
Abstract: Portal-Basic Java Web Application Development Framework (portal-basic for short) is a set of fully functional and high-performance full-stack web application development frameworks, built-in stable and efficient MVC infrastructure and Dao framework (with built-in support for hibernate, mybatis, and JDBC ), integrates basic web application components such as Action interception, form bean/Dao bean/spring bean assembly, internationalization, file upload/download, and cache to provide a highly flexible pure JSP/servlet API programming model, perfect Integration with spring, supports action Convention "Zero Configuration", and can quickly develop traditional and restful web applications. The documentation and code are clear and complete, making it easy to learn.
Resource: Visit the project homepage ^ _*
2. Log cutting and cleaning tool implemented in Java (source code download)
Abstract: log cleaning is very important for routine maintenance of servers. If too many logs are left, disk space is seriously wasted and service performance is affected. Manual cleanup may take too much time and is difficult to meet actual requirements. For example, how do I cut a log file larger than 2 GB at every Saturday and keep the latest MB log records? No log cutting tool can meet the requirements of this seat on the Internet, so I spent some time writing one by myself. Because it needs to be used on multiple platforms, Java is used for convenience. This tool is namedLogcutterAnd has the following features:
-
- Supports all common operating systems such as Linux, Mac, and windows.
- Supports interactive command line running.
- Supports non-interactive running in the background (daemon process implementation in Linux/Mac, and system service implementation in Windows)
- Two log cleanup methods are supported (delete log files or cut log files)
- Support for gb18030, UTF-8, UTF-16LE, UTF-16BE and other common log file types cut (not cut off half a character)
- Highly configurable (program execution cycle, log file expiration time to be deleted, log file threshold to be cut, and retained size)
Http://ldcsaa.googlecode.com/files/LogCutter.zip Resources
3. Design and Implementation of General Java file upload and download Components
Abstract:File upload and download are a common feature in Web applications. I believe you have written code related to this aspect more or less. However, I have seen many people unconsciously tangle with the business logic of the program when implementing the upload or download function. Therefore, when these functions are used elsewhere, the copy/PASE operation is inevitable and then modified. This ugly practice makes it very easy to make mistakes. The bigger problem is that it is a serious waste of time to repeat similar work. This is absolutely intolerable. Ah, life is short. It is really not worth wasting time on repetitive work. Why don't you save the time to play a few Rome or play a ball? To this end, this book uses some leisure time to compile a general file upload and File Download component. The implementation method is purely Based on JSP, and there is no high technical difficulty. In short, it is recommended to be honest. I want to introduce the design ideas and implementation methods to you, and hope that they will inspire you to think creatively.
Resource: http://code.google.com/p/portal-basic/downloads/list (as the first part of portal-basic, code in COM. Bruce. util. http package)
4. In-depth analysis: automatic assembly of Java pojo bean objects and web form forms
Abstract: Nowadays, many web frameworks have implemented the automatic assembly function of form fields and Java object attributes. This function is indeed very useful. If this function is not provided, requests will inevitably flow everywhere. call of the getparameter () series and type conversion methods. Duplicate code is large, error-prone, and not beautiful, affecting city appearance. The question is, how do these frameworks implement automatic assembly? How can we implement these frameworks without them? Especially for those pure JSP/servlet applications, it would be nice to have the automatic assembly function! I am well aware of your expectations and decided to introduce the principles and implementation methods of automatic assembly.
Resource: http://code.google.com/p/portal-basic/downloads/list (as the first part of portal-basic, code in the com. Bruce. util package)
5. Install MySQL/MySQL master-slave backup in Linux
Http://ldcsaa.googlecode.com/files/services.zip Resources
Codeproject