# Python之NumPy（axis=0 与axis=1）

axis=0: vertical

axis=1: horizontal

# 修改Jupyter Notebook的默认打开目录

Jupyter启动之后默认打开的是C盘目录，如下：

• win + R 进入CMD模式，在cmd窗口中输入下面代码即可打开 E盘下的OpenTry文件夹
• cd /d E:\OpenTry
• jupyter notebook

jupyter启动目录就变成了 OpenTry，如下图：

https://blog.csdn.net/yefcion/article/details/79431760

# LaTeX如何正确输入引号:双引号“”单引号‘’

\documentclass{article}
\setlength \textwidth{150pt}
\begin{document}
\large
Pumas are “large, cat-like animals” which are found in America’. When reports came into London Zoo that a wild puma had been spotted forty-five miles south of London, they were not taken seriously. However, as the evidence began to accumulate, experts from the Zoo felt obliged to investigate, for the descriptions given by people who claimed to have seen the puma were extraordinarily similar.
\end{document}

http://blog.sina.com.cn/s/blog_5e16f1770100gusb.html

# Problems with the video writer

cv::VideoWriter outputVideo(“video.avi”, CV_FOURCC(‘M’, ‘P’,’E’,’G’), 10.0, cv::Size(rows, cols));

This may not write the video.

Try changing fourcc to -1. Then, it will give you a choice of video codecs to use for writing.

1. The image size and VideoWriter must be correct for framesize argument: OpenCV Error: Sizes of input arguments do not match (image size is different from the currently set frame size) in CvVideoWriter_VFW::writeFrame, file C:\build\2_4_winpack-build-win64-vc14\opencv\modules\highgui\src\cap_vfw.cpp, line 815
2. The image must be in BGR format or it will not write
3. Try to use ‘name.avi‘ file name

# How to Rotate and/or Flip (Mirror) Images in OpenCV

Obviously you’ll start by reading an image from disk, or grab it from a video frame and so on, similar to this:

After that depending on the required transformation use any of the following codes.

Flip (Mirror) Vertically

flip(image, image, 0);

Flip (Mirror) Horizontally

flip(image, image, +1);

Rotate 90 Degrees Clockwise

transpose(image, image);
flip(image, image, +1);

Rotate 90 Degrees Counter Clockwise (Same as -90 Degrees and 270 Degrees)

transpose(image, image);
flip(image, image, 0);

Rotate 180 Degrees (Same as Flipping vertically and horizontally at the same time)

flip(image, image, -1);

# Visual studio: set the path to a DLL file in Visual Studio?

1. Under Debugging, there’s an Environment field.
2. Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending PATH=%PATH%;\$(ProjectDir)\some-framework\lib or prepending to the path PATH=C:\some-framework\lib;%PATH%

https://stackoverflow.com/a/2119707

# [C++ Cookbook by Jeff Cogswell] Parsing a String Containing a Number in Scientific Notation

## Problem

You have a string containing a number in scientific notation, and you want to store the number’s value in a double variable.

## Solution

The most direct way to parse a scientific notation number is by using the C++ library’s built-in stringstream class declared in <sstream>, as you can see in Example 3-7.

Example 3-7. Parsing a number in scientific notation

#include <iostream>
#include <sstream>
#include <string>

using namespace std;

double sciToDub(const string& str) {

stringstream ss(str);
double d = 0;
ss >> d;

if (ss.fail()) {
string s = "Unable to format ";
s += str;
s += " as a number!";
throw (s);
}

return (d);
}

int main() {

try {
cout << sciToDub("1.234e5") << endl;
cout << sciToDub("6.02e-2") << endl;
cout << sciToDub("asdf") << endl;
}
catch (string& e) {
cerr << "Whoops: " << e << endl;
}
}

Following is the output from this code:

123400
0.0602
Whoops: Unable to format asdf as a number!`

https://www.safaribooksonline.com/library/view/c-cookbook/0596007612/ch03s06.html