Discover sonar static code analysis, include the articles, news, trends, analysis and practical advice about sonar static code analysis on alibabacloud.com
number of bytes by enlarging it.*/static inline size_t alignSize(size_t sz, int n){ return (sz + n-1) -n;}
This bit operation function is a very beautiful function in the computer. It perfectly utilizes the limited number of digits of Data Types in the computer. The source code comment shows that this function is aligned with n Bytes, A Brief Analysis: In al
the global objectwindow.jquery = window.$ = jquery;two JQuery library used in the process, the general use of two forms, one is $.ajax, $.noconflict, and the other is $ (method parameters) to useThe source shows that JQuery itself is a function, while $.ajax, $.noconflict can be thought of as a static method added by the function object, and the use of $ () is equivalent to calling the $ function method. jquery = function (selector, context) {//The j
Android4.4 Component Analysis-service component-bindService source code analysis6.1.1. bindService
Because the code implementation process of startService is analyzed earlier, the Code Analysis of bindService is not described in detail. When introducing the process, you shou
The last few days decided to look at the CI Framework source code, because it is lightweight, the structure of the code file is clearer, and index.php as a portal, loading all the base classes in the codeigniter.php file, so I looked at each class drop, and looked at the time to analyze each step Key process, and the original English annotation was translated, now the main document has been translated, and
type, it calls result. mTask. finish (result. mData [0]) method. We can see that the result type is AsyncTaskResult. The source code is as follows:
@SuppressWarnings({"RawUseOfParameterizedType"}) private static class AsyncTaskResultWe can see that mTask is the AsyncTask object. When the finish method of the AsyncTask object is called, onPostExecute is called again. At this time, the entire execution p
can be seen that it is an Entry array. The initial value is an empty array {}. The length of the main array must be a power of 2. Why, detailed analysis will be provided later. Transient Entry
Entry is a static internal class in HashMap. The Code is as follows:
Static class Entry
Therefore, the overall structure of
main static method was called, and the starting process for the entire systemserver was started. The Startotherservice method is called by calling the Mactivitymanagerservice.systemready () method.//Systemserver.javaPrivate voidstartotherservices () {...//We now tell the activity manager It's okay to run third party//code. It would call back into us once it had gotten to the state//where third party
Author: zhanhailiang Date: 2014-10-20
Application analysis
In daily development, the php.ini configuration session.auto_start=0 closes the session by default if you want to open the session to call Session_Start:
Kernel analysis By checking the source code, we know that session_start is defined as follows: 1881/* {{proto bool Session_Start (void
Zhanhailiang Date: 2014-10-20Application analysisIn daily development, the php.ini configuration session.auto_start=0 closes the session by default if you want to open the session to call Session_Start: Session_Start (); //...Kernel analysisBy checking the source code, we know that session_start is defined as follows:1881 /* {{{proto bool Session_Start (void) 1882 Begin session-reinitializes freezed variables, registers browsers etc */ 1883
helpful to specify a status for the entire workflow instance, which is independent of the Process execution steps. Osworkflow provides "meta-states" that can be included in some workflow instances ". These "meta-states" can be created, activated, suincluded, killed, and completed. When a workflow instance is created, it is in the created state. Then, as long as an action is executed, it will automatically become activated. If the caller does not explicitly change the instance status, the workfl
the pool is available for lending. If this information is invalid, a negative number is returned
Getnumactive
Returns the number of objects from the loan. If this information is not available, a negative number is returned
Clear
Clears all idle objects in the pool, optionally releasing their associated resources. Clearing idle objects must use the Pooledobjectfactory.destroyobject method
Close
Close the pool and release the associated res
Android thread asynchronous communication mechanism source code analysis, android source code
This article first analyzes the message transmission mechanism between threads in Android from the overall architecture, and then introduces the functions and tasks of each component from the source code perspective. The basic
Java Collection --- HashMap source code analysis, java --- hashmap source code
1. HashMap Overview
HashMap is implemented based on the Map interface of the hash table. This implementation provides all optional ing operations and allows the use of null values and null keys. (Except for not synchronizing data and allowing null, The HashMap class is roughly the same
ThreadLocal source code analysis, threadlocal source code
1. Overview
ThreadLocal, which can be understood as a local variable of a thread, is used to provide a copy of the variable value for every thread that uses the variable. Each thread can change its own copy independently, it does not conflict with copies of other threads.
How does ThreadLocal maintain cop
The first step:
//path: phpcms/modules/content/content.php
//Construction method public
function __construct () {
parent::__ Construct ();
$this->db = Pc_base::load_model (' Content_model ');//content Model database operation class
$this->siteid = $this->get_siteid (); Current site ID
$this->categorys = GetCache (' Category_content_ '. $this->siteid, ' Commons ');//Detailed configuration information for all columns under the current site
//Permission Judgement
if (isset ($_get[' cati
Analyze and parse the seven major PHP code tools and parse the php code. The seven major tools for analyzing and parsing PHP code, parsing php code has become one of the most popular programming languages nowadays, however, many PHP programmers cannot find the right tools to help them analyze and parse PHP
Otto source code analysis, otto source codeOtto, an open-source project, is an event bus message framework used for communication between various modules of the program.Reduces coupling between modules.This project is an open-source project of payment company square hosted on github.Https://github.com/square/ottoThe basic model is that Android components can register listeners, send messages, and receive me
product?
What modules are the product framework divided? What is the relationship between modules?
If the main purpose of code analysis is to study the specific implementation details of a module or function, we should focus on the following aspects:
What algorithm is used for implementation? What are the ideas and principles of algorithms?
What data structure is used to describe the implementation?
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.