- 浏览: 118648 次
- 性别:
- 来自: 北京
最新评论
文章列表
Wordpress确实非常好用啊!很漂亮,易用性和可定制性平衡得很好,插件安装很简单。
不过也遇到一些问题,记录在这里
1) 解决中文乱码问题
服务器环境是Windows Server 2003 + WAMP 2.0
解决办法:(转载自http://hjin.me/code/640/)
首先修改一下上传,打开 wp-admin/include/file.php 文件,找到311行
$new_file = $uploads['path'] . "/$filename";
将这一行修改为
$new_file = $uploads['path'] . "/" ...
一份很好的说明见这里:
http://viva-villa.org/2010/02/baby-step-giant-step.html
用这种方法实现的代码:
void exgcd(int m, int n, int &d, int &x, int &y)
{
if (n == 0) {
d = m, x = 1, y = 0;
} else {
exgcd(n, m % n, d, y, x);
y -= x * (m / n);
}
}
...
Generalized Chinese Remainder Theorem
来源:http://www.cut-the-knot.org/blue/chinese.shtml (IE only)
Theorem 1
引用
Two simultaneous congruences
n = n1 (mod m1) and
n = n2 (mod m2)
are only solvable when n1 = n2 (mod gcd(m1, m2)). The solution is unique modulo lcm(m1, m2).
(When m1 and m2 are c ...
错误提示:
codeblocks: relocation error: /usr/lib/libcodeblocks.so.0: symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8.2 not defined in file libwx_baseu-2.8.so.0 with link time reference
解决办法:Installing wxWidgets and wxPython On Ubuntu Or Debian
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian
ubu ...
#define ITER(x) __typeof(x.begin())
#define foreach(c, iter) for(ITER(c) iter = (c).begin(); iter != (c).end(); iter++)
更新grub
sudo update-grub,要是不好使就重启后进recovery mode然后有更新grub的选项
安装gcc
sudo apt-get install build-essential
重新安装ibus
ubuntu系统自带的ibus不好用,所以在新立得里删除掉所有带ibus的,然后sudo apt-get install ibus,然后在系统->系统管理->语言支持里将缺的拼音部分补上,最后注销重登录
参考:http://www.ihacklog.com/linux/ubuntu/drop-scim-and-kiss-ibus.html
安装ubuntu- ...
这道题又做得颇有感触...线段树好像总是很灵活,不过我觉得它应该也是有章可循的
这次用自己配的gvim写,感觉还不错
这次还学到一点技巧,就是无限WA时可以写个暴力程序对拍,对于这道题虽然没法一步一步跟踪数据,但是这样的对拍还是给了我许多启发
线段树应该记录cover表示当前节点是否覆盖,以及覆盖的类型
然后还是三部曲:进入子节点之前分配信息,递归调用子节点,从子节点回来合并信息
/*
* Author: rush
* Created Time: 2010年05月01日 星期六 15时17分10秒
* File Name: icpc/hdu/3397.cpp
*/
...
pku3667 Hotel
- 博客分类:
- ICPC
查询最左端的连续空房间,思想是二分,不过是在线段树上做的二分,所以线段树结点上需要记录一些附加信息,为二分提供条件
又WA了几次才过的,总结经验就是:
更新区间的过程,递归进入子节点前,如果父节点被完全覆盖(在之前的操作中整个区间被修改为住人或空房),那么要相应地修改子节点;从子节点回溯出来后,根据子节点的情况更新父节点。
查询区间的过程也是,要考虑父节点被完全覆盖的情况,这时就不用再往下递归了
#include <cstdio>
const int maxN = 50000 + 5;
struct node_t {
int ll, mm, rr;
} tre ...
将n分解为几部分,使得这几部分的最小公倍数最大,显然分解开的各部分应该有p^k的形式,其中p是素数
因为n最大为100,所以直接枚举即可,不过别人有说只用前9个素数就行,我不知道怎么证明
#include <cstdio>
#include <cstring>
#include <algorithm>
using std::sort;
const int maxn = 105;
bool isp[maxn];
int p[maxn], lp;
void make()
{
memset(isp, true, sizeof(isp)) ...
pku2528 Mayor's posters
- 博客分类:
- ICPC
又一道线段树
#include <cstdio>
#include <cstring>
#include <algorithm>
using std::sort;
const int size = 10000000 + 5, maxn = (10000 + 5) * 2;
int n, p[maxn * 2], lp, hash[size];
struct seg_t {
int li, ri;
} seg[maxn];
int A, B, color, tree[maxn * 2 * 3];
bool exist[maxn];
...
也是线段树经典题,不过做了好久...
这道题与之前的3468最大的区别在于它需要在递归前根据情况更新子节点的值,也就是
if (count(tree[node]) == 1)
tree[node * 2] = tree[node * 2 + 1] = tree[node];
#include <cstdio>
#include <algorithm>
using std::swap;
const int maxL = 100000 + 5;
int L, T, O, tree[maxL * 3] = {0};
int count ...
典型的线段树区间更新、区间查询题目,代码基本上是自己根据理解写出来的
注:之前的版本写的不好,现在的是修改后的
#include <cstdio>
#include <cstring>
#include <algorithm>
using std::min;
using std::max;
typedef long long LL;
const int size = 100000 + 5;
int A, N, Q;
LL B[size];
struct tree_t {
tree_t() : below(0), cover( ...
这个题有多种做法
因为区间没有包含与被包含的,所以可以按照从左到右的顺序依次处理
处理到某个区间[i, j],可以通过确保[1, j]之间的元素都进入某个容器一次,且之后[1, i)之间的元素都出去某个容器一次,使得容器中存的是[i, j]之间的元素
然后要求这个容器能够高效地回答里面存的第k大的元素是多少,这步可以用各种平衡树或者树状数组+二分实现,我写的是线段树
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 100005;
int tree[m ...
终于写好无向图找割点了,笔记一下
割点的充分必要条件是
1. 对于dfs搜索树的根,有至少两个子树
2. 对于非dfs树的根,有至少一个子树
p.s.其实这两个条件是一样的,因为对于非根节点,有一条边连到父节点,所以把它看成是树根的时候,就有至少两个子树了
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <stack>
using namespace std;
vector<vector<i ...
文件上传
文件上传大小限制要通过php.ini中的几个选项来设置
似乎文件名中有英文和中文混合的就会出现乱码,暂时还没找到解决方案
p.s. AjaXplorer是一个灰常好用的文件管理器
Apache和Tomcat整合
\Apache2.2.11\conf\httpd.conf里启用
引用LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
然后在最后加入引用ProxyPass /wiki !
ProxyPass /ftp !
ProxyPas ...
- 2009-11-17 16:00
- 浏览 1039
- 评论(0)