php append to file
I like php’s file_put_contents function, which can write a string to a file with single line of code: file_put_contents(“file.txt”,”content”); Few languages have such powerful function. In C language, you need […]
I like php’s file_put_contents function, which can write a string to a file with single line of code: file_put_contents(“file.txt”,”content”); Few languages have such powerful function. In C language, you need […]
The qDebug()<<“aaaaa” is working perfectly on Windows, but when I compile the same program on CentOS, it suddenly stops working. I cannot see anything displayed on the console. Why qDebug […]
The random number generation functions are always confusing. We often use the C rand() function to generate an integer number between 0 and RAND_MAX. We call it several times and […]
How to bind to variable number of variables in mysqli_stmt_bind_param() in one statement? mysqli_stmt_bind_param() itself can accept variable parameters. The prototype of mysqli_stmt_bind_param is: mysqli_stmt_bind_param ( mysqli_stmt $stmt , string […]
A null QString is an uninitialized QString while an empty QString is a QString initialized with an empty string(reference). QString s1; QString s2(“”); if(s1==s2) qDebug()<<“same”;//same else qDebug()<<“not same”; qDebug()<<s1.isNull();//true qDebug()<<s1.isEmpty();//true […]
WordPress image attachment is a little complicated thing. In a post that is inserted an image attachment, you can edit some attributes like alt text, height, width of the inserted […]
I miss the old days when <img> has only a few simple attributes and you only need to know that src is used to store the url of the image. […]
We usually use the following function to bind an event handler to a jQuery object on some event: $( “button” ).on(“click”, function(event){}); The .on method actually has another form: $( […]
QTexStream::readLine() function is a convenient function that can read a line from a file at a time. However, you must pay attention to so called new line. You may find […]
In this post, I talked about the best practice to use forward declaration or include file for a class: only include header files for base class and value member class […]