c#学习笔记

C# Parameter Modifiers Parameter Modifier Meaning in Life (None) If a parameter is not marked with a parameter modifier, it is assumed to be passed by value, meaning the called method receives a copy of the original data. out Output parameters must be assigned by the method being called (and therefore are passed by reference). … Read more

discuz Access denied

由于在把PHP 版本的discuz从7.0升级到7.2中忘记了备份config.inc.php而直接覆盖掉了原来的,升级完了之后出现了Access denied的问题,经过查找,发现了解决方法: 把ucenter目录的下的config.php里的UC_XXX配置部分复制到config.inc.php里,然后刷新就可以了。 原因可能是UC配置部分是程序在安装的时候自动生成的,但我却用最原始的配置文件覆盖了。 我复制内容如下: //应用的UCenter配置信息(可以到UCenter后台->应用管理->查看本应用->复制里面对应的配置信息进行替换) define(‘UC_CONNECT’, ‘mysql’); // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen(), mysql 是直接连接的数据库, 为了效率, 建议采用 mysql define(‘UC_DBHOST’, ‘localhost’); // UCenter 数据库主机 define(‘UC_DBUSER’, xxx); // UCenter 数据库用户名 define(‘UC_DBPW’, xxx); // UCenter 数据库密码 define(‘UC_DBNAME’, xx); // UCenter 数据库名称 define(‘UC_DBCHARSET’, ‘gbk’); // UCenter 数据库字符集 define(‘UC_DBTABLEPRE’, ‘`xxx`.uc_’); // UCenter 数据库表前缀 define(‘UC_DBCONNECT’, ‘0’); // UCenter … Read more

QT 学习笔记

The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots. Classes that use the Q_OBJECT macro must have moc run on them. This isn’t a problem because qmake automatically adds the necessary rules to the makefile. But if you forget to regenerate your makefile using … Read more

配置apache让用户登录

安装配置svn时得到了启发,当用户访问某页面时,如果要让用户输入用户名和密码,可以配置如下: <Location /XXX>   AuthType Basic   AuthName "AUTH NAME"   AuthUserFile /etc/auth-file   Require valid-user </Location> auth-file可以通过htpasswd生成, 也可以通过这个命令增加用户: 如 htpasswd -cm /etc/svn-auth-file gene htpasswd -m /etc/svn-auth-file pgj 我的svn在httpd.conf里的配置如下: <Location /svn>   DAV svn   SVNPath /var/svn   AuthType Basic   AuthName "Subversion repository"   AuthUserFile /etc/svn-auth-file   Require valid-user </Location>

启动apache出错 undefined symbol:sqlite3_open_v2

# service httpd start Starting httpd: httpd: Syntax error on line 206 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/httpd/modules/mod_dav_svn.so into server: /usr/local/svn/lib/libsvn_subr-1.so.0: undefined symbol: sqlite3_open_v2                                                                                                 [FAILED] 安装svn后,启动apache时,出现了上面的错误, 在网上找好久没找到答案,后来把 sqlite lib的路径加入到ld.so.config就行了, # cat /etc/ld.so.conf include ld.so.conf.d/*.conf 所以在ld.so.conf.d目录下新建了一个文件sqlite.conf 内容为 /usr/local/sqlite/lib #ldconfig # service httpd start Starting httpd:                                            [  OK  ] 终于重启成功了,搞了好久啊,记录下来,希望对别人有用。

c++ 学习笔记

1. Never Return a Pointer to a Local Object 2. Function Declarations Go in Header Files It may be temptingand would be legalto put a function declaration directly in each source file that uses the function. The problem with this approach is that it is tedious and error-prone. By putting function declarations into header files, … Read more

编绎gd-2.0.35出错

  $./configure $./make 用上面的命令出现了下面的错误: configure.ac:64: error: possibly undefined macro: AM_ICONV       If this token and others are legitimate, please use m4_pattern_allow.       See the Autoconf documentation. make: *** [configure] Error 1 解决方法, 用下面的命令: ./configure –enable-m4_pattern_allow ./make

Useful PHP Command line options

  Usage: php [options] [-f] <file> [–] [args…] php [options] -r <code> [–] [args…] php [options] [-B <begin_code>] -R <code> [-E <end_code>] [–] [args…] php [options] [-B <begin_code>] -F <file> [-E <end_code>] [–] [args…] php [options] — [args…] php [options] -a -a Run interactively -c <path>|<file> Look for php.ini file in this directory -n No … Read more

const Objects Are Local to a File By Default

When we define a nonconst variable at global scope, it is accessible throughout the program. We can define a nonconst variable in one file andassuming an appropriate declaration has been madecan use that variable in another file: // file_1.cc int counter; // definition // file_2.cc extern int counter; // uses counter from file_1 ++counter; // … Read more