flashback

How to detach from the parent process?

Ever wondered how does screen realize it's persistence, i.e. even when killing it's parent process (e.g. you detach screen and logout afterwards), you can restore the state in the moment of detachment by reattaching the screen session.

The magic is done by setsid(2) by creating a new session with the current process as the only member.

Initialization of static data members of non-integral type in C++

class A
{
private:
static const int X = 42; //OK
static const char Y = 'Y'; //OK
static const char Z[]; //if you write here ="message" before the semicolon, you get a compile error saying 'invalid in-class initialization of static data member of non-integral type'
public:
//..
};
const char A::msg [] = "hello"; //this is the way it goes

Another tip: I could have defined Z as char *, but I didn't because it would waste resources. Because it is a constant string, I do not need to change where it points to, so I declare it as a simple array, and that way I skip the dereferencing of a pointer every time it get accessed.

difference between php_admin_flag and php_admin_value

The difference between the php_admin_flag and the php_admin_value apache directives are that the first one is for boolean values and the latter one for anything else.

Example:
php_admin_flag        safe_mode           Off
php_admin_flag        safe_mode_gid    On
php_admin_value     open_basedir       /tmp:/sites/thang.tld

Syndicate content