1+1=10

记记笔记,放松一下...

Notes on MySQL

MySQL vs mysql

  • MySQL ==> the entire MySQL package
    • The MySQL server (mysqld)
    • MySQL client programs
    • MySQL client library
  • mysql ==> a client program of the MySQL package
    • The MySQL Command-Line Tool

Connecting to server

1
shell> mysql -h host -u user -p

If mysqld is running on the same machine:

1 …

Install MediaWiki on Windows

MediaWiki + Apache + php + MySQL

MySQL

Download and install the msi installer of MySQL 5.6 from http://dev.mysql.com/downloads/installer/

Apache

Download and install Apache 2.4 from http://www.apachelounge.com/download/

PHP

Download and install php 5.8.6 from http://windows.php.net/download/

Rename …

Install Bugzilla on Windows

According to the documentation of Bugzilla 5.0, the following applications should be installed first:

  • ActiveState Perl 5.18.2 (5.12.4 or higher)
  • Apache 2.4 (2.2.x or higher)
  • MySql 5.6 (5.0.15 or higher)

Download Bugzilla

1
git clone --branch 5.0 https …

Hello Pelican

Octopress is a great blog system, but it's not easy to maintain for users who don't familiar with ruby. So I switch to Pelican, which is written in Python.

“Pelican” is an anagram for calepin, which means “notebook” in French. ;)

Notes on OpenSSL and Qt

In Qt, working with SSL can be frustrating because of the inconsistent naming of the corresponding binary dynamic libraries, and Qt defaults to dynamically loading them, without providing any indication if they are missing.

Libraries name of openssl?

The "library" portion of OpenSSL consists of two libraries.

On posix system …

How to use QThread in the right way (Part 2)

There are two way to use QThread:

  • Subclass QThread and reimplement its run() function
  • Use worker objects by moving them to the thread

As the QThread::run() is the entry point of worker thread, so the former usage is rather easy to understand.

In this article, we will try to …

How to use QThread in the right way (Part 1)

A short history

Long long ago, subclass QThread and reimplement its run() function is the only recommended way of using QThread. This is rather intuitive and easy to used. But when SLOTS and Qt event loop are used in the worker thread, some users do it wrong. So Bradley T …

left shift operator overloading for QDebug()

Consider that we have create a custom type:

1
2
3
4
5
6
struct Point
{
Point(int x, int y):x(x),y(y){}
int x;
int y;
};

If we want to make it work with qDebug(), we need to implement a streaming operator:

1
QDebug operator<<(QDebug dbg …

Link Confilict between SDL and Qt under Windows

Someone complain that, when using SDL and Qt in the same project under Windows, the linker will generate link error.

SDLmain.lib(SDL_win32_main.obj):-1: error: LNK2005: _WinMain@16 already defined in qtmaind.lib(qtmain_win.obj)

What happened behined this?

1
2
3
4
5
6
#include <QApplication>
#include <SDL …