principle of "short circuit", such as the first expression in is false to not handle the second expression, and | | Just the opposite. JS also follows the above principles. But what's interesting is the value they return. Code: var attr = True 4 "AAA"; Then the result of the run attr is not simple true or this false, but "AAA" to see again | | : code: var attr = attr | | This operation is often used to determine whether a variable is defined, and to give an initial value if there is no defin
concise methods in js:
1).var add_step = 12;var add_level = (add_step == 5 1) || (add_step == 10 2) || (add_step == 12 3) || (add_step == 15 4) || 0; console.log(add_level);2).var add_step = 120;var add_level = {'5':1,'10':2,'12':3,'15':4}[add_step] || 0; console.log(add_level);
Of course, | there are many other applications, which are far from limited to those listed above. In fact, js | is very powerful.However, it should be noted that the features of | and in js help us
is defined, and if it is not defined, give him an initial value, which is useful when defining a default value for a function's parameters. Again remind you to remember the above principle: if the argument needs to be 0, "", null, False, undefined, Nan, it will also be false to handle.if (a >=5) { This is done with a single line of code. But one of the points to note : JS | | And features help us streamline the code while also bringing down the re
During the O M work, we found that the Linux system cannot be immediately put into the production environment after installation, which usually requires optimization by our O M personnel.
Next, I will briefly explain some basic optimization operations on Linux after installation.
Note: This optimization is based on CentOS (5.8/6.4 ). I will mention the minor differences between 5.8 and 6.4 During optimization.
Optimization entry:
Modify the IP address, gateway, host name, DNS, and so on to d
[type-safe callback function]
About delegation: exception {the anonymous method cannot be converted to the type "System. Delegate" because it is not the Delegate type}
The anonymous method cannot be converted to the type "System. Delegate" because it is not the Delegate type.
Reflection and delegation (simple instance)
Streamline your code with Delegation
Streamline your code with Delegation
The truth give
AlignRight to be able. D: Code abbreviation CSS code abbreviations can improve the speed at which you write code. Streamline the amount of your code.There are many attributes that can be abbreviated in CSS. Contains margin,padding. Border. Font,background and color values, and so on, let's say you learned the code abbreviation. Can be written in code:
li{ font:1.2em/1.4emArial,Helvetica,sans-serif; Padding:5px0 10px5px; }
li{Font:1.2em
record the Exception log and turn to the error page (the level of detailed slightly of the exception is determined by the specific requirements)All asynchronous requests that return JSON data require not only logging the Exception log, but also returning the JSON-formatted error message to the client instead of turning to the error page (the asynchronous request may not be able to turn to the error prompt page)Using AOP to understand the decoupling of anomaliesTry to
: Writing Efficient CSS1. Place CSS at the Top of the code page (put stylesheets at the upper)The official explanation I feel is somewhat vague. This article is actually related to the user's access expectations. CSS to the top of the browser can be targeted to the HTML page from top to bottom to parse and render. No one likes to wait, and the browser has taken this into account.2. Avoid CSS expressions (Avoid CSS Expressions)What the individual thinks can be done through CSS expressions can be
, a lot of puzzling questions to record first, and then try to find the answers to those who can at least convince you of your reasons.3: More recording inspiration, inspiration can make your knowledge system of blind spots have the effect of finishing touch.4: Organize and streamline your notes. The beginning of the note will be more and more, the follow-up will continue to streamline, so that it less and
also make it easier for other developers to get the job done quickly when modifying your code.
An example to illustrate inline style in html
3. Optimize CSS CodeAdding more than one CSS file to a Web site is now a common practice. However, when a Web site contains too many CSS files, it can slow down the response time of the site. The workaround is to streamline the code and optimize multiple CSS files to merge them into one file.
After the operating system starts, some services and programs are started automatically. Some of these programs are not required for the server to function properly.For the server, running redundant services and programs, which do not add points to the server, but will bring other hidden dangers:1. Occupy Resources: One more service per run, more than a share of resources.2. Security vulnerabilities: Every service, there may be a vulnerability or a potential vulnerability. Excess service will in
can define func directly on the type parameter ($attr =5). Again remind you to remember the above principle: if the argument needs to be 0, "", null, False, undefined, Nan, it will also be false to handle.if (a >=5) {Alert ("Hello");}Can be written as:A >= 5 alert ("Hello");This is done with a single line of code. But one thing to be aware of is: JS | | And features help us streamline the code while also bringing down the readability of the code. T
on.The specific learning methods derived are, and are not limited to, thinking, documenting summaries and inspirations, and arranging notes. When you lie in bed in your eyes when you sleep in the mind can review the C language knowledge system and can implement the program, and then want to talk about what to say when you are learning to live C language.Small series recommended a learning C language/c++ study Skirt "730, 130, 221", whether you are Daniel or small white, is to change careers or
Introduction: From IBM Rational Team Concert 2.0, the REST API is officially supported (the experimental version is published in the RTC 1.0.1). While the functionality provided by the rest API is still limited, it is sufficient for general integration requirements, and enhancements to the rest API will continue to be available in subsequent releases. This article will lead the reader to understand the functionality provided by the REST API in the RTC 2.0.0.2 and related concepts. and provides a
Modify Content(No functional cracking, just streamlined landscaping)1. Streamlining irrelevant components2. Disable Update hints3. Hide Bottom Bar discovery4. Go to start Page ads5. Home Page Top Image modification6. Remove the red dot hint7. Streamline all sound effects8. Streamlining the language of other countries9. Change the interface background10. Set the content alignment11. Streamline large volume d
Now all kinds of software have "parent mode", so that parents to guide the safe use of minors in the Internet, reflecting the parents of their children in meticulous love. and children grow up, busy their careers and family, is not what to do to repay the parents of grace? Like "parent mode", let's Make a "parental model" browser for them.
Although 50 or 60 years old is hale and hearty, but they are in the age of contact with less knowledge, computer operation is very unfamiliar. At the same ti
.
if (a >=5) {
Alert ("Hello");
}
Can be written as:
A >= 5 alert ("Hello");
This is done with just one line of code. But the point to note is: JS in | | And features help us streamline code while also bringing down code readability. It's up to us to weigh it.
On the one hand, the streamlining of JS code, can substantially reduce network traffic, especially the large number of applications of the JS Public Library. The personal comparison recommend
. val (),
K = 3,
cookiestring = ' Somecookiesplease ',
I
J
MyArray = {};
Please use on
In the new Jslite, a shorter on ("click") is used to replace a function like click (). In the previous version, on () is bind (). On () the preferred method of attaching an event handler. However, for consistency reasons, you can simply use the on () method entirely.
Copy Code code as follows:
Bad
$first. Click (function () {
$first. CSS (' border ', ' 1px solid red ');
On the official website of struts, the following two paragraphs are written:
Apache Struts 2 is a elegant, extensible framework for creating Enterprise-ready Java Web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining Applicatio NS over time.
Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities jo
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.