// 这个part因为网络问题被吞了一部分

15.3 Exceptions

) Calling abort()
When you already know the conditions of failure, you may detect them and call abort() if true to terminate the program directly, without even returning to main():

// error1.cpp -- using the abort() function
#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) Returning an error code
A program could also use a function's return value to indicat a problem. In fact, every numeric value could be a valid return type:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) The exception mechanism
1 Throwing an exception : by using keyword throw followed with a string or an object, tells a program to jump to somewhere else.
2 Catching an exception with handler: by using keyword catch followed with a block of code, which means that if specific error is encountered, then code within the catch block would be executed.
3 Using a try block: identifies a block of code which might activate certain errors, usually followed by several catch blocks
Here comes an example illustrating the mechanism of exceptions:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

Noteworthy:
1 If any statement in the try block leads to an exception being thrown, the catch block after this will handle the exception. If there are multiple catch blocks after a try block, the compiler will search for the correct handler with the correct type which corresponds to what has been thrown.
2 If a program executes code in try block without any exceptions being thrown, it skips the catch blocks after it and jumps to the very next line of code.

) Using objects as exceptions
In the previous example, the throw follows a string. But most of time you want it to throw an object, because objects could store information and indicate which kind of error it is specifically. Here comes an example implementing the function of calculating harmonic mean and geometric mean of two numbers, also providing two type of exceptions:

// exc_mean.h -- exception classes for hmean(), gmean()
#include <iostream>
#include <cmath>class bad_hmean
{
private:double v1;double v2;
public:bad_hmean(double a = 0, double b = 0) : v1(a), v2(b) {}void mesg();
};inline void bad_hmean::mesg()
{std::cout << "hmean(" << v1 <<", " << v2 << "): " << "invalid arguments: a = -b\n";
}class bad_gmean
{
public:double v1;double v2;bad_gmean(double a = 0, double b = 0) : v1(a), v2(b) {}const char * mesg();
};inline const char * bad_gmean::mesg()
{return "gmean() arguments should be >= 0\n";
}double hmean(double a, double b);
double gmean(double a, double b);
int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;cout << "Enter two numbers: ";while (cin >> x >> y){try{z = hmean(x, y);cout << "Harmonic mean of " << x << " and " << y << " is " << z << endl;cout << "Geometric mean of " << x << " and " << y << " is " << gmean(x,y) << endl;cout << "Enter next set of numbers <q to quit>: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to plat any more.\n";break;}}cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}

) Unwinding the stack
In C++, a function normally returns to the function that calls it, with each function liberating its automatic variables as it terminates. If an automatic variable is an object, the destructor for that object is automatically called.
Suppose you now terminate a function via throw. After a function was terminated by throw, it ends immediately and pass back control to main().While freeing memory on the stack, instead of stopping at the first return address on the stack, the program continues freeing the stack until it reaches a return address which resides in the try block. This is to say, although a function is terminated by throw, the program would free all intermediate functions' automatic variables on the stack, otherwise the intermediate function's variables would be left unfreed.
This technique is called unwinding the stack, which is extremely important to exceptions.
Here comes the code illustrating unwinding the stack:

// error5.cpp -- unwinding the stack
#include <iostream>
#include <cmath>
#include <string>
#include "exc_mean.h"class demo
{
private:std::string word;
public:demo(const std::string & str){word = str;std::cout << "demo " << word <<" created\n";}~demo(){std::cout << "demo " << word << " destroyed\n";}void show() const{std::cout << "demo " << word << " lives!\n";}
};double hmean(double a, double b);
double gmean(double a, double b);
double means(double a, double b);int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;{demo d1("found in block in main()");cout << "Enter two numbers: ";while (cin >> x >> y){try{z = means(x,y);cout << "The mean mean of " << x << " and " << y << " is " << z << endl;cout << "Enter next pair: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to play any more.\n";break;}}d1.show();}cout << "Bye!\n";cin.get();cin.get();return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}double means(double a, double b)
{double am, hm, gm;demo d2("found in means()");am = (a + b) / 2.0;try{hm = hmean(a,b);gm = gmean(a,b);}catch (bad_hmean & bg){bg.mesg();std::cout << "Caught in means()\n";throw; // rethrow the exception}d2.show();return (am + hm + gm) / 3.0;
}

) More exception features
In previous code, while throwing and exception, you used this code:

try
{super();
}
catch (problem & p)
{...
}
...
void super()
{...throw problem(); //notice!
}

You used throw problem() here because the compiler would always generate a temporary copy while throwing exceptions. Another reason is that you could use base-class reference to point to derived-class objects, so a reference could handle all exception objects in the hierarchy. Meanwhile, the order of catch blocks should also be considered, you shoule put derived-class catch blocks in advance of base-class catch blocks, because the program first reaches the derived-class catch block, and it the type matches, it will run the code and ignore the remaining, empowering you to treat exception objects of different classes separately.

)The exception class
C++ incorporates exception class to support exception features. Generally, logic_error and runtime_error classes derives from exception, which separately contains some sort of exception classes.
The logic_error class contains:
1 domain_error class, just as functions have domain and range, if you violate that you could throw a domain_error object.
2 invalid_argument class, when your function receives data which is not desirable or not fit the rules, you could throw a invalid_argument object.
3 length_error class, indicating that not enough space is available for the desired action.
4 out_of_bounds class, indicating indexing errors, such as array index out of range.
Each of these classes mentioned above have a constructor.
You could also derive your own exception objects from logic_error or runtime_error classes.

---恢复内容结束---

##15.3 Exceptions
) Calling abort()
When you already know the conditions of failure, you may detect them and call abort() if true to terminate the program directly, without even returning to main():

// error1.cpp -- using the abort() function
#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) Returning an error code
A program could also use a function's return value to indicat a problem. In fact, every numeric value could be a valid return type:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) The exception mechanism
1 Throwing an exception : by using keyword throw followed with a string or an object, tells a program to jump to somewhere else.
2 Catching an exception with handler: by using keyword catch followed with a block of code, which means that if specific error is encountered, then code within the catch block would be executed.
3 Using a try block: identifies a block of code which might activate certain errors, usually followed by several catch blocks
Here comes an example illustrating the mechanism of exceptions:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

Noteworthy:
1 If any statement in the try block leads to an exception being thrown, the catch block after this will handle the exception. If there are multiple catch blocks after a try block, the compiler will search for the correct handler with the correct type which corresponds to what has been thrown.
2 If a program executes code in try block without any exceptions being thrown, it skips the catch blocks after it and jumps to the very next line of code.

) Using objects as exceptions
In the previous example, the throw follows a string. But most of time you want it to throw an object, because objects could store information and indicate which kind of error it is specifically. Here comes an example implementing the function of calculating harmonic mean and geometric mean of two numbers, also providing two type of exceptions:

// exc_mean.h -- exception classes for hmean(), gmean()
#include <iostream>
#include <cmath>class bad_hmean
{
private:double v1;double v2;
public:bad_hmean(double a = 0, double b = 0) : v1(a), v2(b) {}void mesg();
};inline void bad_hmean::mesg()
{std::cout << "hmean(" << v1 <<", " << v2 << "): " << "invalid arguments: a = -b\n";
}class bad_gmean
{
public:double v1;double v2;bad_gmean(double a = 0, double b = 0) : v1(a), v2(b) {}const char * mesg();
};inline const char * bad_gmean::mesg()
{return "gmean() arguments should be >= 0\n";
}double hmean(double a, double b);
double gmean(double a, double b);
int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;cout << "Enter two numbers: ";while (cin >> x >> y){try{z = hmean(x, y);cout << "Harmonic mean of " << x << " and " << y << " is " << z << endl;cout << "Geometric mean of " << x << " and " << y << " is " << gmean(x,y) << endl;cout << "Enter next set of numbers <q to quit>: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to plat any more.\n";break;}}cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}

) Unwinding the stack
In C++, a function normally returns to the function that calls it, with each function liberating its automatic variables as it terminates. If an automatic variable is an object, the destructor for that object is automatically called.
Suppose you now terminate a function via throw. After a function was terminated by throw, it ends immediately and pass back control to main().While freeing memory on the stack, instead of stopping at the first return address on the stack, the program continues freeing the stack until it reaches a return address which resides in the try block. This is to say, although a function is terminated by throw, the program would free all intermediate functions' automatic variables on the stack, otherwise the intermediate function's variables would be left unfreed.
This technique is called unwinding the stack, which is extremely important to exceptions.
Here comes the code illustrating unwinding the stack:

// error5.cpp -- unwinding the stack
#include <iostream>
#include <cmath>
#include <string>
#include "exc_mean.h"class demo
{
private:std::string word;
public:demo(const std::string & str){word = str;std::cout << "demo " << word <<" created\n";}~demo(){std::cout << "demo " << word << " destroyed\n";}void show() const{std::cout << "demo " << word << " lives!\n";}
};double hmean(double a, double b);
double gmean(double a, double b);
double means(double a, double b);int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;{demo d1("found in block in main()");cout << "Enter two numbers: ";while (cin >> x >> y){try{z = means(x,y);cout << "The mean mean of " << x << " and " << y << " is " << z << endl;cout << "Enter next pair: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to play any more.\n";break;}}d1.show();}cout << "Bye!\n";cin.get();cin.get();return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}double means(double a, double b)
{double am, hm, gm;demo d2("found in means()");am = (a + b) / 2.0;try{hm = hmean(a,b);gm = gmean(a,b);}catch (bad_hmean & bg){bg.mesg();std::cout << "Caught in means()\n";throw; // rethrow the exception}d2.show();return (am + hm + gm) / 3.0;
}

) More exception features
In previous code, while throwing and exception, you used this code:

try
{super();
}
catch (problem & p)
{...
}
...
void super()
{...throw problem(); //notice!
}

You used throw problem() here because the compiler would always generate a temporary copy while throwing exceptions. Another reason is that you could use base-class reference to point to derived-class objects, so a reference could handle all exception objects in the hierarchy. Meanwhile, the order of catch blocks should also be considered, you shoule put derived-class catch blocks in advance of base-class catch blocks, because the program first reaches the derived-class catch block, and it the type matches, it will run the code and ignore the remaining, empowering you to treat exception objects of different classes separately.

)The exception class
C++ incorporates exception class to support exception features. Generally, logic_error and runtime_error classes derives from exception, which separately contains some sort of exception classes.
The logic_error class contains:
1 domain_error class, just as functions have domain and range, if you violate that you could throw a domain_error object.
2 invalid_argument class, when your function receives data which is not desirable or not fit the rules, you could throw a invalid_argument object.
3 length_error class, indicating that not enough space is available for the desired action.
4 out_of_bounds class, indicating indexing errors, such as array index out of range.
Each of these classes mentioned above have a constructor.
You could also derive your own exception objects from logic_error or runtime_error classes.##15.3 Exceptions
) Calling abort()
When you already know the conditions of failure, you may detect them and call abort() if true to terminate the program directly, without even returning to main():

// error1.cpp -- using the abort() function
#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) Returning an error code
A program could also use a function's return value to indicat a problem. In fact, every numeric value could be a valid return type:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

) The exception mechanism
1 Throwing an exception : by using keyword throw followed with a string or an object, tells a program to jump to somewhere else.
2 Catching an exception with handler: by using keyword catch followed with a block of code, which means that if specific error is encountered, then code within the catch block would be executed.
3 Using a try block: identifies a block of code which might activate certain errors, usually followed by several catch blocks
Here comes an example illustrating the mechanism of exceptions:

#include <iostream>
#include <cstdlib>
double hmean(double a, double b);int main()
{double x, y, z;std::cout << "Enter two numbers: ";while (std::cin >> x >> y){z = hmean(x, y);std::cout << "Harmonic mean of " << x << " and " << y << " is " << z << std::endl;std::cout << "Enter next set of numbers <q to quit>: ";}std::cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b){std::cout << "untenable arguments to hmean()\n";std::abort();}return 2.0 * a * b / (a + b);
}

Noteworthy:
1 If any statement in the try block leads to an exception being thrown, the catch block after this will handle the exception. If there are multiple catch blocks after a try block, the compiler will search for the correct handler with the correct type which corresponds to what has been thrown.
2 If a program executes code in try block without any exceptions being thrown, it skips the catch blocks after it and jumps to the very next line of code.

) Using objects as exceptions
In the previous example, the throw follows a string. But most of time you want it to throw an object, because objects could store information and indicate which kind of error it is specifically. Here comes an example implementing the function of calculating harmonic mean and geometric mean of two numbers, also providing two type of exceptions:

// exc_mean.h -- exception classes for hmean(), gmean()
#include <iostream>
#include <cmath>class bad_hmean
{
private:double v1;double v2;
public:bad_hmean(double a = 0, double b = 0) : v1(a), v2(b) {}void mesg();
};inline void bad_hmean::mesg()
{std::cout << "hmean(" << v1 <<", " << v2 << "): " << "invalid arguments: a = -b\n";
}class bad_gmean
{
public:double v1;double v2;bad_gmean(double a = 0, double b = 0) : v1(a), v2(b) {}const char * mesg();
};inline const char * bad_gmean::mesg()
{return "gmean() arguments should be >= 0\n";
}double hmean(double a, double b);
double gmean(double a, double b);
int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;cout << "Enter two numbers: ";while (cin >> x >> y){try{z = hmean(x, y);cout << "Harmonic mean of " << x << " and " << y << " is " << z << endl;cout << "Geometric mean of " << x << " and " << y << " is " << gmean(x,y) << endl;cout << "Enter next set of numbers <q to quit>: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to plat any more.\n";break;}}cout << "Bye!\n";return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}

) Unwinding the stack
In C++, a function normally returns to the function that calls it, with each function liberating its automatic variables as it terminates. If an automatic variable is an object, the destructor for that object is automatically called.
Suppose you now terminate a function via throw. After a function was terminated by throw, it ends immediately and pass back control to main().While freeing memory on the stack, instead of stopping at the first return address on the stack, the program continues freeing the stack until it reaches a return address which resides in the try block. This is to say, although a function is terminated by throw, the program would free all intermediate functions' automatic variables on the stack, otherwise the intermediate function's variables would be left unfreed.
This technique is called unwinding the stack, which is extremely important to exceptions.
Here comes the code illustrating unwinding the stack:

// error5.cpp -- unwinding the stack
#include <iostream>
#include <cmath>
#include <string>
#include "exc_mean.h"class demo
{
private:std::string word;
public:demo(const std::string & str){word = str;std::cout << "demo " << word <<" created\n";}~demo(){std::cout << "demo " << word << " destroyed\n";}void show() const{std::cout << "demo " << word << " lives!\n";}
};double hmean(double a, double b);
double gmean(double a, double b);
double means(double a, double b);int main()
{using std::cout;using std::cin;using std::endl;double x, y, z;{demo d1("found in block in main()");cout << "Enter two numbers: ";while (cin >> x >> y){try{z = means(x,y);cout << "The mean mean of " << x << " and " << y << " is " << z << endl;cout << "Enter next pair: ";}catch (bad_hmean & bg){bg.mesg();cout << "Try again.\n";continue;}catch (bad_gmean & hg){cout << hg.mesg();cout << "Values used: " << hg.v1 << ", " << hg.v2 << endl;cout << "Sorry, you don't get to play any more.\n";break;}}d1.show();}cout << "Bye!\n";cin.get();cin.get();return 0;
}double hmean(double a, double b)
{if (a == -b)throw bad_hmean(a,b);return 2.0 * a * b / (a + b);
}double gmean(double a, double b)
{if (a < 0 || b < 0)throw bad_gmean(a,b);return std::sqrt(a * b);
}double means(double a, double b)
{double am, hm, gm;demo d2("found in means()");am = (a + b) / 2.0;try{hm = hmean(a,b);gm = gmean(a,b);}catch (bad_hmean & bg){bg.mesg();std::cout << "Caught in means()\n";throw; // rethrow the exception}d2.show();return (am + hm + gm) / 3.0;
}

) More exception features
In previous code, while throwing and exception, you used this code:

try
{super();
}
catch (problem & p)
{...
}
...
void super()
{...throw problem(); //notice!
}

You used throw problem() here because the compiler would always generate a temporary copy while throwing exceptions. Another reason is that you could use base-class reference to point to derived-class objects, so a reference could handle all exception objects in the hierarchy. Meanwhile, the order of catch blocks should also be considered, you shoule put derived-class catch blocks in advance of base-class catch blocks, because the program first reaches the derived-class catch block, and it the type matches, it will run the code and ignore the remaining, empowering you to treat exception objects of different classes separately.

)The exception class
C++ incorporates exception class to support exception features. Generally, logic_error and runtime_error classes derives from exception, which separately contains some sort of exception classes.
The logic_error class contains:
1 domain_error class, just as functions have domain and range, if you violate that you could throw a domain_error object.
2 invalid_argument class, when your function receives data which is not desirable or not fit the rules, you could throw a invalid_argument object.
3 length_error class, indicating that not enough space is available for the desired action.
4 out_of_bounds class, indicating indexing errors, such as array index out of range.
Each of these classes mentioned above have a constructor.
You could also derive your own exception objects from logic_error or runtime_error classes.

转载于:https://www.cnblogs.com/fsbblogs/p/9973300.html

Cpp Chapter 15: Friends, Exceptions, and More Part2相关推荐

  1. halcon算子盘点:Chapter 15灰度分割

    Chapter 15:Segmentation 15.1 Classification 1. add_samples_image_class_gmm  功能:将从图像中获取的测试样本添加到高斯混合模型的 ...

  2. chapter 15 运算符详解

    15.1位运算符 1.位运算符都是要做Usual Arithmetic Conversion(其中有一步是Integer Promotion),所以在c语言中并不存在8为整数的位运算,操作数在进行运算 ...

  3. python--从入门到实践--chapter 15 16 17 生成数据/下载数据/web API

    1.随机漫步 random_walk.py from random import choice class RandomWalk():def __init__(self, num_points=500 ...

  4. 《C++ Primer》 chapter 15 TextQuery

    <C++ Primer>中第15章为了讲解面向对象编程,举了一个例子:设计一个小程序,能够处理查询给定word在文件中所在行的任务,并且能够处理"非"查询," ...

  5. Part 2 Linux programming:chapter 15:套接字和标准I/O

    第十五章:套接字和标准I/O 15.1 标准I/O函数 这里需要熟练掌握一些文件操作时使用的函数(fopen.feof.fgetc.fputs等) 啥是标准I/O函数呢? 下面列出一些常用的 fope ...

  6. 《A Graduate Course in Applied Cryptography》Chapter 15 Elliptic curve cryptography and pairings (1)

    原文教材 与 参考资料: Boneh Dan , Shoup Victor . A Graduate Course in Applied Cryptography[J]. 该书项目地址(可以免费获取) ...

  7. Chapter 15 Outcome Regression and Propensity Scores

    文章目录 15.1 Outcome regression 15.2 Propensity scores 15.3 Propensity stratification and standardizati ...

  8. Cpp Chapter 16: The string Class and the Standard Template Library Part1

    (这已经是第二次博客园吞我东西了,有点心态爆炸) 16.1 The string Class ) Constructing a string Here is a table which shows t ...

  9. Chapter 15 配置服务器存储和群集 第1课

    了解直接连接存储.网络连接存储和存储区域网络的基本功能 了解"虚拟盘"服务的功能 了解简单卷.跨区卷.带区卷.镜像卷和RAID-5卷的功能 使用"磁盘管理"控制 ...

  10. Chapter 15 HMM模型

    1.1 定义 隐马尔科夫模型:可用于标注问题,在语音识别.NLP.生物信息.模式识别等领域被实践证明是有效的算法. HMM是关于时序的概率模型,描述由一个隐藏的马尔科夫链生成不可观测的状态随机序列,再 ...

最新文章

  1. C# WinForm使用乐器数字接口
  2. 房贷利率不断上涨,贷款买房如何才能节省利息?
  3. Dart 10-Day
  4. vue中使用百度地图,悬浮窗搜索功能
  5. TCP/IP学习笔记(2)-数据链路层
  6. sql 统计节点和子节点下面的数量_一次900万+数据量的 SQL 查询优化分析「上百倍性能优化」...
  7. windows下python xgboost 安装方法以及安装了xgboost,pycharm却不能自动补全问题解决
  8. C语言习题答案【3】(仅参考)
  9. 商城小程序源码_商城类小程序制作全过程,无需懂小程序商城源码
  10. 2019华为软件精英挑战赛总结
  11. 盘片式过滤器是盘式过滤器吗?
  12. 四,AXI总线协议解析
  13. 面象对象的系统设计之一
  14. Win11 DELL - G7 如何开启TPM模块
  15. 推荐一个简单好用的HTML编辑器
  16. 被低估的EIP-3074,以太坊用户的大利好
  17. pandas计算excel两列的日期差
  18. 计算机课拔线头检讨书,实验室检讨书.doc
  19. 手机wem文件转换软件_ww2ogg019下载-wem文件转换ogg文件工具(ww2ogg)下载0.22 官方最新版-西西软件下载...
  20. 3Dmax2017-OpenCOLLADA插件分享

热门文章

  1. 神经网络入门书籍推荐,神经网络的书籍推荐
  2. 2022电赛省赛C题-小车跟随行驶系统—视觉篇(openmv)心得体会
  3. [从头学数学] 第192节 导数及其应用
  4. 计算机网络_HTTP1.0、HTTP1.1和HTTP2.0的区别
  5. wordpress下载插件,安装失败,无法创建目录问题
  6. android显示每一年所有日期的功能,Android获取一天前的时间、一个月前的时间、一年前的时间...
  7. 最后的作业:STINGY SAT问题
  8. Mac illustrator 输入特殊字符(如希腊字符)
  9. 2018BNU校赛总决赛
  10. 蓝桥杯每日一真题——[蓝桥杯 2022 省 B] 扫雷(dfs+二分)