Problem: When try to store Chinese to mysql database, ??? was stored.
Solution:
– set names utf8;
– set character set utf8;
– set database field’s Collation to be “utf8_general_ci”
While using a Ubuntu linux machine, this can happen for a lot of people. This is the solution. Error Message: “Firefox is already running but is not responding …” The problem: Many packages (like firefox) create lock files in your account to prevent database corruption with multiple copies of the application. Look in your account … Read more
Problem: When try to store Chinese to mysql database, ??? was stored.
Solution:
– set names utf8;
– set character set utf8;
– set database field’s Collation to be “utf8_general_ci”
The API document only list the description of class, interface, and methods. If you want to trace back to the original implementation code by clicking “F3” button in Eclipse, then source file need to be attached. The source file under window is here: C:Program FilesJavajdk1.6.0_24src.zip http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-115.htm
What does ** mean in the following code?
char **argv; |
It declares argv as a pointer that points to a char pointer. It is equivalent to the following code.
char *argv[]; |
Pipe is neat. A pipe is a way to connect the output of one program to the input of another program without any temporary file. This simple test contains a Java program and a C++ program. The output of Java program is used as input for “wc” command, and the output is then used by … Read more
This shell program mainly demonstrate how to use $? to find out the exit status of command.
After a command executes, if you input to terminal: echo $?, you will get 0 or 1 to indicate the status of execution.
The following is a simple program with comments.
What is a process?
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.
Here is a example showing how to use constructor function in C++.
vs. Overall, dot(.) is for object itself, arrow(->) is for pointer. A good example worth a thousand words. The following example should be a good one. #include <iostream> using namespace std; class Car { public: int number; void Create() { cout << "Car created, number is: " << number << "\n" ; … Read more
Virtual keyword determines if a member function of a class can be over-ridden in its derived classes. Here is a simple example to show this.
Eclipse is a good tool for developing C++ programs in Windows. Setting up the environment sometimes cause problems for a lot of developers. Here are steps that can make it work under your Windows system. 1. update eclipse galileo to helios. 2. add CDT plugin 3. install MinGW 4. Create a sample project, and see … Read more
If you want to exclude a certain word/string in a search pattern, a good way to do this is regular expression assertion function. It is indispensable if you want to match something not followed by something else. A Simple Example String str = "programcreek"; Pattern p = Pattern.compile(".*program(?=creek).*"); Matcher m = p.matcher(str); if(m.matches()){ System.out.println("Match!"); … Read more
Can we have a function that can add two list to one, such as (add ‘(1 2 3) ‘(4 5 6)) = (5 7 9)
(defun add-two-list (l r) ; e.g. (1 2 3) (2 3 4) ; returns (3 5 7) (setf return-value '()) (loop for i from 0 to (- (length l) 1) do (setf return-value (cons (+ (nth i l) (nth i r)) return-value)) ) (reverse return-value) ) |
Just add h after begin tag. As simple as it is. H here means Place the float here, i.e., at the same point it occurs in the source text. begin{table}[h] center begin{tabular}{|l|l|} hline multicolumn{2}{|c|}{Schedule of This Week} hline Monday & SigNEW Tuesday & Artificial Intelligence, Compiler Wednesday & Research Meeting Thursday & Artificial Intelligence, … Read more