Original source: http://blog.csdn.net/chenzhenyu123456/article/details/44519943Stack:(a) header file #include (ii) Definition of stack stack(iii) Use1:s.empty () stack is null returns TRUE, otherwise returns false;2:s.size () returns the number of elements in the stack3:s.pop () removes the top element of the stack without returning its value4:s.top () returns the element at the top of the stack without deleting the element5:s.push () pushes a new element at the top of the stackQueue:(a) header
result, return End method body, jump directly outside the method body, so cannot printThe second usage of return: A method that returns a value1$(function ()2 {3$ ("#hello"). Click (function ()4 {5 varINum = 0;6 for(vari = 1; I )7 {8 if(i = = 5)9 {TenI=A (i); One } AINum + =i; - } - alert (iNum); the }); - //the second use of return is that a method returns a value - functionA (i) - { +i + = 5; - re
JavaScript Asynchronous Programming method------"callback function"This is the most basic method of asynchronous programming.Assume that there are two functions F1 and F2, which wait for the result of the former execution.F1 ();F2 ();If F1 is a time-consuming task, consider rewriting F1 and writing F2 as the F1 callback function.Function F1 (callback) {SetTimeout (function () {//F1 task code callback ();}, 1000);}The execution code becomes the following:F1 (F2);In this way, we turn the synchrono
Judged to be empty Method One: Most people use a method, intuitive, convenient, but inefficient.1:if (s = = NULL | | s.equals (""));Method Two: Compare string length, high efficiency, is the best I know of a method.2:if (s = = NULL | | s.length () Method Three: Java SE 6.0 only begins to provide methods that are nearly equal in efficiency and method two, but for compatibility reasons, the recommended method of use3:if (s = = NULL | | s.isempty ());Determines whether a string is emptyStringuti
1.python2 character encoding#Coding:utf-8" "The above code sets the environment encoding to utf-8, without the above code, the Environment default encoding will be used, the environment default encoding can be obtained by sys.getdefaultencoding ()" "s='China' #S is str in UTF-8 format because the code above sets the environment encoding to Utf-8u= S.decode ('Utf-8')#U is a Unicode objectS.encode ('GBK')#equivalent to S.decode (' Utf-8 '). Encode (' GBK ')" "in computer memory, Unicode encoding i
passed to a function, the function receives the memory address of the original value instead of a copy of the value. Therefore, if the function modifies the parameter, the original value in the calling code changes accordingly.1. Objects are passed by reference2. Java applications have and only one parameter passing mechanism, that is, passing by value3, passing by value means that when a parameter is passed to a function, the function receives a copy of the original value4. Passing by referenc
One, LinQ distinct a field to go heavyNew class Goodsidcomparer, inheriting Iequalitycomparer Public classGoodsidcomparer:iequalitycomparer { Public BOOLEquals (Goods x, Goods y) {if(x = =NULL) returny = =NULL; returnX.gproducer = =Y.gproducer; } Public intGetHashCode (Goods obj) {if(obj = =NULL) return 0; returnobj. Gproducer.gethashcode (); }}//Depending on the origin ( gproducer) Go heavyWhen you use it, you only
){ SmsMessage message = SmsMessage.createFromPdu((byte[])pdu); // 获取短信的正文内容 final String content = message.getMessageBody(); //获取短信的发送者 final String address = message.getOriginatingAddress();
The usage service for the 164 component service is running in the main thread. Configuring Components in AndroidmanifestStart-up service: Intent Intent = new Intent (this,phonelistenservice.class); StartService (Intent); 1 implement phone monitoring in service:
Life c
,tom,jiafei; assign values when defining variables, such as: Boolean S=true,tom=false,jiafei;2. Integer typeInteger types include: int, Byte, short, and long.(1) INT typeUse the keyword int to define an int type integer variable. for type int variables, memory allocates 4 bytes (byte), 1 bytes consist of 8 bits (bit) and 4 bytes is 32 bits. Bit has two states, each with 0, one to represent.(2) Byte typeUse the keyword byte to define a byte type integer variable, you can define a few at a time, y
3
\ r
Return to position
4
\ t
TAB tab
5
\\
Reverse Slash
6
\‘
Single quotation marks
7
\‘‘
Double quotes
8
\ n
Line break
7. Any data type "+" operation that encounters a string variable will automatically program the string typeExample: String type + int type + Double type = string8. About |(1) on the logical operation:: Mean and , a
exactly the same way.Of course, how to use shtml in Visual Studio is a small problem. (especially simple)1. CreateIf you haven't used it, you'll never expect it.When you add a project to Visual Studio, you cannot find the option to shtml the file at all.The way to create shtml, is directly in, the creation of HTML when renamed to Xx.shtml.2. UseThere's nothing to say about this thing, for a simple example.Like whatI want to quote top.html in index.shtml. and footer.html. Just add such a senten
without error, when defining a JSON object, It's best to use double quotesDeployment
Run the JavaScript validator with JSLint to make sure there are no syntax errors or that the code does not have the potential to ask
Compression tools are recommended to compress JS files before deployment
UTF-8 for Unified file encoding
The JavaScript program should be placed in the. js file as much as possible in the form of
Never ignore the code optimization work, refactoring is a
first, the simple development process(1) define the problem to be solved;Clearly define the problem to be solved, such as the specific implementation of what Functions.(2) designing methods to solve problems;What are the characteristics of a good method:1. The method is clear;2. normalization; (has been verified)3. Strong modularity, easy to modify and maintain;4. Strong Program robustness;(3) design procedures to implement the above methods;Note: syntax, fonts, file naming, and so On.(4) Compil
Encapsulation refers to data hiding, the key is that the method in the class must not be allowed to access other classes of the instance domain, the program only through the object's methods and object data to interact.Among the classes, the most common relationships are:
Dependency: A method of one class manipulates another class object
Aggregation: An object that contains objects of some other class
Inheritance: Subclasses and Parent classes
Local variables cannot be initialized
To record some small algorithmic knowledge that seems interesting to meIdentify valid parenthesis stringsIn parentheses, for example, if only the parentheses are removed as a feature, "()", "" "(empty string)," ((() (() (() (())), "These are valid parentheses strings, although nested but not messy, each opening parenthesis can find the correct closing parenthesis pairand ") (())", "((", "" ("and so on, these strings are illegal.A valid parenthesis string should have a 1 requirement. The number o
# # #HTTPBrother-: The Transport Layer protocol uses TCP by defaultSmall knowledge:1. The server is being asked to set the address of the proxy server itself. Each request from the client is sent directly to the proxy server, and the proxy server requests the target resource (the LAN machine commonly used in the firewall to access the Internet or XXX is using forward)2. The reverse proxy is set on the server side. The client does not need to make any settings.2.1 Principle: Use a proxy server to
", [[NSString Stringwithformat:format, # #__VA_ARGS__] utf8string]); #else #define NSLog (...) #endif16, UITableView Click on the appearance of gray but immediately disappear.Clicking that moment can indicate which line is clicked and the gray stop disappears for a second.// 1. Set cell click Time for Gray Cell.selectionstyle = uitableviewcellselectionstylegray; // 2. In the TableView proxy method The Didselectedrow method writes this -(void) TableView: (UITableView *) TableView Didselecterowa
Before the study time did not write a blog, now began to review, remember some easy to forget the small knowledge itA Java reserved two-bit decimal method1> BigDecimal methodDouble F = 11.3156;BigDecimal B = new BigDecimal (f);f = B.setscale (2,bigdecimal.round_half_up). Doublevalue ();2> DecimalFormat FormattingDouble F = 11.3156;DecimalFormat df = new DecimalFormat ("#.00");Df.format (f);3> String methodDouble F = 11.3156;string s = string. Format ("%.2f", f);F = double.valueof (s);Two Create
1. Show hidden folders (enter the following code on the MAC command line):1) Show hidden foldersDefaults write Com.apple.finder appleshowallfiles Yes killall Finder2) do not show hidden foldersDefaults write Com.apple.finder appleshowallfiles No killall Finder2. View Native IPIpconfig3. UNIX basic commands> CD: Changing the working directory> pwd: View current path> ls-l: View display files> ls-a: Show All Files> ls-g: With color display> Touch file name: Create file> mkdir folder name: Create
# # #判断linux系统是32位还是64位You can use "getconf word_bit" and "getconf long_bit" to get the digits of WORD and LONG, and 64-bit systems should be 32 and 64 respectively.If [$ (getconf word_bit) = ' + '] [$ (getconf long_bit) = ' 64 ']; ThenEcho 64ElseEcho 32Fi# # #在当前脚本中调用另外的脚本文件Method: (English point). + file name or source + file nameFist.sh:#!/bin/bashEcho ' Your is in first file 'Second.sh:#!/bin/bashEcho ' Your is in second file 'SOURCE First#或者用下面的方法# # #列出当前目录下最大的10个文件[Email protected] ~]# D
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.