This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、#service mysqld start | |
提示:mysqld未被识别的服务 | |
原因:没有安装mysql-server | |
解决方法:安装mysql-server | |
yum安装:#yum -y install mysql-server | |
安装mysql所需rpm软件包: | |
mysql-5.1.61-1.el6_2.1.i686.rpm | |
mysql-server-5.1.61-1.el6_2.1.i686.rpm | |
mysql-libs-5.1.61-1.el6_2.1.i686.rpm | |
2、#mysql -u root -p passwd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15道使用频率极高的基础算法题: | |
1、合并排序,将两个已经排序的数组合并成一个数组,其中一个数组能容下两个数组的所有元素; | |
2、合并两个已经排序的单链表; | |
3、倒序打印一个单链表; | |
4、给定一个单链表的头指针和一个指定节点的指针,在O(1)时间删除该节点; | |
5、找到链表倒数第K个节点; | |
6、反转单链表; | |
7、通过两个栈实现一个队列; | |
8、二分查找; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一、导出数据库用mysqldump命令(注意mysql的安装路径,即此命令的路径): | |
1、导出数据和表结构: | |
mysqldump -u用户名 -p密码 数据库名 > 数据库名.sql | |
#/usr/local/mysql/bin/ mysqldump -uroot -p abc > abc.sql | |
敲回车后会提示输入密码 | |
2、只导出表结构 | |
mysqldump -u用户名 -p密码 -d 数据库名 > 数据库名.sql | |
#/usr/local/mysql/bin/ mysqldump -uroot -p -d abc > abc.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
解决办法: | |
1、 查看 SELinux 的状态: sestatus -b | grep ftp | |
2、 在出现的结果中可以看到 ftp_home_dir off | |
tftpd_disable_trans off | |
之类。我们现在只要把其中之一设置为on就可以啦。 | |
3、 setsebool -P ftpd_disable_trans on 或者 setsebool -P ftp_home_dir on | |
4、 重启vsftpd: service vsftpd restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 连接ftp服务器 | |
格式:ftp [hostname| ip-address] | |
a)ftp ftp.drivehq.com | |
b)服务器询问你用户名和口令,输入后即可。 | |
2. 下载文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <io.h> | |
const char *to_search="C:\\WINDOWS\\*.exe"; //欲查找的文件,支持通配符 | |
int main() | |
{ | |
long handle; //用于查找的句柄 | |
struct _finddata_t fileinfo; //文件信息的结构体 | |
handle=_findfirst(to_search,&fileinfo); //第一次查找 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
首先来理解一下chunk,它是MMSeg分词算法中一个关键的概念。Chunk中包含依据上下文分出的一组词和相关的属性,包括长度 (Length)、平均长度(Average Length)、标准差的平方(Variance)和自由语素度(Degree Of Morphemic Freedom)。下面列出了这4个属性: | |
属性 含义 | |
长度(Length) chuck中各个词的长度之和 | |
平均长度(Average Length) 长度(Length)/词数 | |
标准差的平方(Variance) | |
标准差是方差开方后的结果(即方差的算术平方根) | |
假设这组数据的平均值是m | |
方差公式s^2=1/n[(x1-m)^2+(x2-m)^2+...+(xn-m)^2] | |
自由语素度(Degree Of Morphemic Freedom) 各单字词词频的对数之和 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongodb依赖js库,slackware下可以从slackbuilds.org用sbopkg安装上即可 | |
mongodb依赖boost库,slackware安装的开发工具库中已经包含 | |
mongodb使用scons构建工具,故需要安装scons,slackware下也可以从slackbuilds.org安装 | |
把mongodb安装在$HOME/usr/mongo: | |
$ mkdir -p ~/usr/mongo | |
$ tar xvf mongodb-src-r1.8.2.tar.gz | |
$ scons --prefix=$HOME/usr/mongo --full install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、下载数据并保存 | |
char url[1024] = "http://xxxxxx"; | |
FILE *fp = fopen("xxxxx", "w"); | |
CURL* curl_obj; | |
curl_obj = curl_easy_init(); | |
//设置URL | |
curl_easy_setopt(curl_api::_curl_obj, CURLOPT_URL, url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <fstream> | |
#include <sstream> | |
#include <ext/hash_map> | |
using namespace __gnu_cxx; | |
using namespace std; | |
class CDictionary { | |
public: |
NewerOlder