The parse_config_file function analyzes the *. rc configuration file and forms the parameters in it into a linked list. The following code is analyzed carefully:
#001 int parse_config_file (const char * fn)
#002 {
The input parameter is the path of the file name.
#003 char * data;
#004 data = read_file (fn, 0 );
#005 if (! Data) return-1;
This Code reads data from the file and saves the pointer of the data Buffer in data.
#006
#007 parse_config (fn,
sUser 0m0. 006 sSys0m0.032s~ $ Time grep-c and tmp/a/longfile.txt2811Real 0m0. 013 sUser 0m0. 006 sSys0m0.005s~ $In addition to the speed factor, the-c option is a good way to execute the count. For multiple files, grep with the-c option returns a separate count for each file, with one count per row. For wc pipelines, the total number of combinations of all files is provided.However, regardless of the spee
a high load, start looking for all the files from the root directory. $ find/-name "*"-print if you want to find the file name in the current directory with two lowercase letters, followed by two digits, and finally the. txt file, the following command will be able to return a file named Ax37.txt: $find. -name "[A-z][a-z][0--9][0--9].txt"-print2. With PERM optionFollow the file permission mode with the-perm option to find files by file permission mode.It is best to use the octal permission nota
I've done this once before, but it's been a long time and forgotten.Today with ch340 in Linux debugging, with a previously written serial debugging program can not send data. Just remember window under the need to install the driver, the actual Linux also need to drive to normal use. The default Linux has this driver, but some old, not used.In today's commissioning process, first plug the ch340 one end into the computerInput command: lsmod | grep usbserialOutput: usbserial 53248 1 ch341Successfu
attributes and methods will belong to the window object.If we do not use the new operator, use the function directly, for example, the following code:// In-depth analysis function 1 www.2cto.com
Function Obj (id1, name1, teststring1){This. id = id1;This. name = name1;This. teststring = teststring1;This. sayHello = function (){Console. log ('Id: '+ this. id + '@! @ Name: '+ this. name + '@! @ Teststring: '+ this. teststring );}}Obj ('006 ', 'My Name i
javascript is special, especially because it is simplified compared with the traditional object-oriented language, and simplified to directly using constructors to create objects;
In javascript, a function can be used as a function or a constructor identifier (you can also view it as a class ), the difference between the constructor and the function is new;
If the constructor is used to create an object, it is encapsulated like other object-oriented languages. In other words, the attributes o
$Avoid sending grep to wc-l in a pipeline to count the number of output rows. The-c option of grep provides a count of rows that match a specific pattern and is generally faster than sending data to wc through pipelines, as shown in the following example:Listing 17. example of good habit 8: Using and without grep row counting~ $ Time grep and tmp/a/longfile.txt | wc-l2811Real 0m0. 097 sUser 0m0. 006 sSys 0m0. 032 s~ $ Time grep-c and tmp/a/longfile.t
method of the Basefont class CreateFont (String name,string encoding,boolean Embedded) to re-encode the text. When working with Chinese, name is the specific Chinese font name, and the encoding value is unigb-ucs2-h,embedded with the font constant not_embedded. 2. Add page numbers to the documentExample code:public class Pdf06c {/*** @date July 7, 2015 3:19:34*/public static void Main (string[] args) {Document document = new document ();try {Pdfwriter.getinstance (document, New FileOutputStream
11 questions about Hash in Ruby and rubyhash
Recently I am studying Rails because the java language I learned is the Getting Started language. a little uncomfortable. in particular, Ruby's Hash. however, you will be able to think about it in detail. basically, all are passed Key-Value. there is no big problem except that it is not suitable for writing at the beginning. this is a log I saw on the Internet.
1. How to Create a Hash?
Copy codeThe Code is as follows:X = Hash. newX = {}X = {: a => 1,:
('Id: '+ this. id + '@! @ Name: '+ this. name + '@! @ Teststring: '+ this. teststring) ;}} Obj ('006 ', 'My Name is obj6', 'test obj6'); sayHello (); // id: 006 @! @ Name: My Name is obj6 @! @ Teststring: Test Obj6window. sayHello (); // id: 006 @! @ Name: My Name is obj6 @! @ Teststring: Test Obj6console. log (id); // 006console. log (name); // My Name is obj6c
good at Fundraising
001. Communication skills allow you to use the unlimited power of the outside world(Excellent)002. Contact excellent people(Excellent)003. Be able to get along with others in harmony004. Do not do what you want005. Be a listener(Excellent)006. Be brave in accepting others' opinions007. Give a chance to change
001. Wisdom is an invaluable fortune in life002. rational decision-making and action003. Tips for solving everythi
intelligence
Communication Intelligence
Smart thinking
Business Intelligence
Successful Intelligence
001. Pursuing the East(Excellent)002. The "Special People" of the Emperor(Excellent)003. You cannot starve other days for a chicken, duck, or fish meal.004. Place your hand on the Bible005. Keep your promise006. No contract destruction is allowed.007. Liquidated damages must be retaliated008. Don't attribute your inclement to external factors.009. Time is money010. Goo
use the unlimited power of the outside world(Excellent)002. Contact excellent people(Excellent)003. Be able to get along with others in harmony004. Do not do what you want005. Be a listener(Excellent)006. Be brave in accepting others' opinions007. Give a chance to change
001. Wisdom is an invaluable fortune in life002. rational decision-making and action003. Tips for solving everything004. Smash the barrier stone and use it as the key(Excellent)
grep to wc-l in a pipeline to count the number of output rows. The-c option of grep provides a count of rows that match a specific pattern and is generally faster than sending data to wc through pipelines, as shown in the following example:
Listing 17. Example of good habit 8: Using and without grep row counting
~ $ Time grep and tmp/a/longfile.txt | wc-l
2811
Real 0m0. 097 s
User 0m0. 006 s
Sys 0m0. 032 s
~ $ Time grep-c and tmp/a/longfile.txt
2811
Code generation tool to generate XML configuration documents. The following is an example of ing:#001 #002 #003 #004 #005 #006 #007 #008 #009 #010 #011 #012 #013 #014 #015 #016 #017 #018 #019 #020 #021 All XML mappings require the use of nhibernate-mapping-2.0 schema. The current schema can be found in the Resource path of nhib.pdf or the Embedded Resource (Embedded Resource) of nhib.pdf. dll. Nhib.pdf always preferentially uses schema files embedded
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.