[Question]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
使用分词类库,分词类库请参见:http://www.xunsearch.com/scws/
如何使用PHP实现全文检索功能?
很多人可能马上可以想出几种方案,比如:文件检索法、采用SQL的like语句等方法,但这些方法效率都相当的低。
这里介绍一种比较高效的PHP全文检索实现方法,这就是采用MYSQL的FULLTEXT字段类型。但是MYSQL的FULLTEXT字段对中文的支持不是很好,本...
分类:
数据库 时间:
2014-05-07 05:00:43
阅读次数:
513
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722
思路:数位dp,dp[i][j]表示到第i位,数字和%10为j,然后进行dp,注意完全匹配的情况是要+1,而其他情况是从0 到 9 都要考虑
代码:
#include
#include
#include
#include
using namespace std;
int t;
l...
分类:
其他好文 时间:
2014-05-07 04:55:37
阅读次数:
314
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._
object Solution {
def solution(A: Array[Int]): Int = {
// write your code in Scala 2.10
// sort
scala.uti...
分类:
其他好文 时间:
2014-05-07 04:20:38
阅读次数:
352
一维数组指针,int *prt=new int[10],*ptr和ptr[0]是一样的吗...
分类:
其他好文 时间:
2014-05-07 03:50:33
阅读次数:
276
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
You are given a target value to search. If found in the array retur...
分类:
其他好文 时间:
2014-05-06 19:03:11
阅读次数:
365
测试mysql_query与mysql_unbuffered_query的时间差问题的时候,做了一个简单的PHP连接mysql数据库的测试代码,文件编码是utf8,在chrome浏览器中,当把chrome浏览器的编码更改为utf8的情况下,刷新页面,获取的时间戳是不会改变的,在nginx服务器和代码之间找了很久也没发现问题..
分类:
其他好文 时间:
2014-05-06 17:28:09
阅读次数:
373
自PHP-5.3.3起,PHP-FPM加入到了PHP核心,编译时加上--enable-fpm即可提供支持。PHP-FPM以守护进程在后台运行,Nginx响应请求后,自行处理静态请求,PHP请求则经过fastcgi_pass交由PHP-FPM处理,处理完毕后返回。Nginx和PHP-FPM的组合,是一种稳定、高效的PHP运行方式,效率要..
分类:
其他好文 时间:
2014-05-06 17:17:15
阅读次数:
579
Count the string
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4212 Accepted Submission(s): 1962
Problem Description
It is wel...
分类:
其他好文 时间:
2014-05-06 15:27:24
阅读次数:
306
CodeIgniter(以下简称"CI")是一款国外优秀的PHP轻量级MVC框架,它支持PHP4和PHP5,是开发中小型可拓展性需求高的Web应用程序的利器。目前你所见到的这个博客程序,正是采用CI进行的编写。
秉承MVC架构的思想,CI中的所有控制器都需要经过单点入口文件index.php(默认)来加载调用。也就是说,在默认情况下,所有CI开发项目的URL都形如以下这种形式:
htt...
分类:
数据库 时间:
2014-05-06 15:21:57
阅读次数:
744