I wanted to get a nim before, but because it was for personal use, I would keep repairing.

Source: Internet
Author: User

The advantages of asynchronous methods: the client and the server are decoupled from each other, and the two sides can not produce dependencies. The disadvantage is that because of the introduction of message middleware, the difficulty factor is increased when programming. In addition, the reliability, fault tolerance and robustness of message middleware are often the decisive factors in this kind of architecture.

Fortunately, the programmer this profession is not as fierce as the athlete, borrowing the above scoring standards, if the computer industry to lay the foundation of the number of Turing award-winning programmers defined in the 90~100 sub-file, then many of our programmers rely on encoding for living in the basic distribution between the 1~10, and the amateur just write The Demo programmer may be between 0.x~0.x. So, to enter the workplace first we need to increase the score from small to integer, and then continue to work hard to get the double digits, do not make it into a vertical segment of the industry a small number of famous experts.

So what if we don't have two points every time? Of course the real situation is not really do this, then we consider a poor situation each time the original array is divided into 1:9 division. At this time the number of recursive layer is log (10/9) (n), the specific proof can see the previous two fork tree description, draw a diagram can understand. The final algorithm complexity is O (N*log (10/9) (n))--->o (n*log (n)). That is, even if the division is so bad every time, the final result is O (N*log (n)) This magnitude, but there is a hidden parameter. And actually even 1:99 is the result. and the actual operation of the division is certainly not so exaggerated and close to the two points. So what will really lead to a worst case scenario? You are not good to choose the pivot element, each time the smallest (big) of the one. For example, every time you select the first element of a hub, and this array is exactly a non-descending array, then the algorithm complexity is O (n^2).

As an example of my work, I would like to explain to you: the product ordering center in mobile business, every time a user through certain channels (office, kiosk, etc.) opened, ordered a package, if these packages involved in third-party platform dispatch, the product ordering center will initiate order request operation to the third party platform. Imagine, if the peak processing time period, due to the proliferation of business processing, resulting in a number of peripheral systems response speed decreased (such as the Business Gateway response speed is not timely, network delay and so on), the end user to open a package in the main process will be extended a lot of time, this will create a very bad user experience, May eventually lead to acceptance failure. In the above scenario, we can well introduce a message queue for business decoupling, specifically, the product ordering center as long as "notify" the third-party platform, our package opened successfully, and do not necessarily have to wait for its real open processing to complete. Because of this, Message Queuing is becoming the main means of communication in the current system module.

Does not require a passing score, the programmer can get a good sense of accomplishment and reward. Only need to be the pinnacle of the One-tenth or One-twentieth, the basic can surpass the number of people around. Looking at the far-off peak to go near, over the front foot of a small hill, and then unconsciously beyond their own.

Grow up as wild and fast as a weed.

So, in the end, we know that the rapid sequencing of the pivot element selection is not good, it completely lost the fast sort of "fast" advantages. There are two best ways to choose:

1, a random one in the current array

http://www.cnblogs.com/hrtujw/
http://www.cnblogs.com/jtrie/
http://www.cnblogs.com/jtdyiw/
http://www.cnblogs.com/wdtuj/
http://www.cnblogs.com/jserue/
http://www.cnblogs.com/jertuwe/
http://www.cnblogs.com/kjgrtu/
http://www.cnblogs.com/hsrtjw/
http://www.cnblogs.com/wytiew/
http://www.cnblogs.com/nyctu/
http://www.cnblogs.com/jrdtjw/
http://www.cnblogs.com/rgerh/
http://www.cnblogs.com/hertj/

2, the first element in the current array, the middle element, and the last element that is centered on the size of the selected one.

This will effectively avoid picking one of the smallest (big) elements at a time. Of course, my code uses a rather stupid approach (take the first element at a time).

Add, delete, modify, view, search function of the article is done

The search function, is a fuzzy search, that can search the title of the article, you can also search the article's label

But how to search the full text, I have not thought well, hope to see the code of Friends, help to guide;

See this procedure, we all know the smile, the original Java so processing to take the remainder calculation ah, according to the above simulation to find out, when the input-1, the result of the operation is-1, of course not equal to 1, so it is judged to be even, that is, our judgment is wrong. The problem is clear, the correction is also very simple, instead of judging whether it is an even number.

This is because floating-point numbers may be inaccurate in a computer (note that it is possible), and it can only be infinitely close to the exact value, not completely accurate. Why is it so? This is determined by the storage rules of floating-point numbers, let's take a look at 0.4 how this decimal decimal number converted to binary decimals, using the "Multiply 2 rounding, order" method (do not understand, this is not a recruit, this is too basic), We found that 0.4 could not use the binary accurate representation, in the binary world it is an infinite loop of decimals, that is, "display" Can not "show", let alone in memory (floating-point storage includes three parts: sign bits, digits, mantissa, specific no longer described), it can be understood, In the decimal world there is no way to accurately represent 1/3, then in the binary world of course it is not possible to accurately represent 1/5 (if the binary is also a fraction of the words can be expressed), in the binary world 1/5 is an infinite loop of decimals.

I wanted to get a nim before, but because it was for personal use, I would keep repairing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.