-
Generally PDF figures are preferred for LaTeX code.
-
There are many useful commands in Linux for converting between different types of figures, e.g.,
convert,pdf2ps, etc. So it does not matter much which types of figures you produce. You can always convert them into other format when needed. -
The …
Check Whether an Email Address Is Valid in Java
See the following code.
String email = "test@test.com";
Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
Matcher m = p.matcher(email);
boolean matchFound = m.matches();
if(matchFound){
System.out.println("EMAIL OK");
}else{
System.out.println("EMAIL ERROR");
}
Useful Packages and Commands for LaTex

Math Packages
- \usepackage{amssymb}
- popular math fonts
- \usepackage{dsfont}
\mathdsfont
- \usepackage{bm} % bold math symbols
- bold math symbols
- \usepackage{amsmath}
- math formulas.
- \usepackage{amsthm}
- theorem environments
- proof enviroment
List Packages
- \usepackage{enumerate}
- universal list
Graphics Packages
- \usepackage{ifpdf}
- allow including figures without extensions and select the right type of …
Working with Class in C++
Illustrative examples for the following discussions can be found here.
-
It is suggested that you also provide a default constructor if you ever provide a user-defined constructor when writing a C++ class.
-
If you want to allow deleting a derived class from a pointer of the base class, you have …
Generating YYYYMM Formatted Dates Using Python
import monthdelta as md
import datetime as dt
import math as math
def quarter(month):
return int(math.ceil(month/3.0))
#end def
d0 = md.date.today()
dates = [d0 + md.monthdelta(i) for i in range(1, 20)]
yyyymms = [d.year*100 + d.month for d in dates]
yymms …Input and Output in C++
Check the io directory on the page https://bitbucket.org/dclong/cpp-learn/src
for some illustrative examples for the following discussions.
-
You can format output of numbers using functions
std::setpresicionandstd::setwin theheader. -
When you read data from a file into an array or write data …