现在位置: 首页 > Accoubyexorce发表的所有文章
  • 11月
  • 05日
数据库 ⁄ 共 20887字 评论关闭
周海汉/文 2013.8.22 环境 hive 版本hive-0.11.0 sqoop 版本 sqoop-1.4.4.bin__hadoop-1.0.0 从hive导到mysql mysql 表: mysql> desc cps_activation; +————+————-+——+—–+———+—————-+ | Field | Type | Null | Key | Default | Extra | +————+————-+——+—–+———+—————-+ | id | int(11) | NO | PRI | NULL | auto_increment | | day | date | NO | MUL | NULL | | | pkgname | varchar(50) | YES | | NULL | | | cid | varchar(50) | YES | | NULL | | | pid | varchar(50) | YES | | NULL | | | activation | int(11)......
阅读全文
  • 09月
  • 13日
综合 ⁄ 共 5079字 评论关闭
当用户点击或搜索引擎向网站服务器发出浏览请求时,服务器将返回Http Header Http头信息状态码,常见几种如下: 1、Http/1.1 200 OK 访问正常   表示成功访问,为网站可正常访问时的状态。 2、Http/1.1 301 Moved Permanently 301重定向永久重定向   对搜索引擎相对友好的跳转方式,当网站更换域名时可将原域名作301永久重定向到新域名,原域名权重可传递到新域名,也常有将不含www的域名301跳转到含www的,如xxx.com通过301跳转到www.xxx.com  3、Http/1.1 302 Found 为临时重定向   易被搜索引擎判为作弊,比如asp程序的re......
阅读全文
  • 08月
  • 22日
综合 ⁄ 共 2954字 评论关闭
我们现在编写一个简单的闹铃程序,允许用户输入一个时间,在这个时间过后闹钟显示到达时间的文本消息。 #include "errors.h" #include <stdio.h> int main(int argc, char **argv) { int seconds; char line[128]; char message[128]; while (1) { printf("Alarm> "); if (fgets(line, sizeof(line), stdin) == NULL) exit(0); if (strlen(line) <= 1) continue; if (sscanf(line, "%d %64[^\n]", &seconds, message) < 2) { fprintf(stderr, "Bad command\n"); } else { sleep......
阅读全文
  • 06月
  • 10日
数据库 ⁄ 共 11380字 评论关闭
JBoss JBPM 实践系列(一)--- 安装配置(Tomcat 6.0 + MySQL 5.1)          jBPM,全称是Java Business Process Management,是一种基于J2EE的轻量级工作流管理系统。jBPM是公开源代码项目,遵循Apache License。jBPM在2004年10月18日,发布了2.0版本,并在同一天加入了JBoss,成为了JBoss企业中间件平台的一个组成部分,它 的名称也改成JBoss jBPM。          jBPM有两大特色,使他成为市场的一大两点。其中最大的特色就是它的业务逻辑定义没有采用目前的一些规范,如WfMC&acute;s XPDL, BPML, ebXML, BPEL4WS等,而是它自......
阅读全文
  • 04月
  • 14日
综合 ⁄ 共 1148字 评论关闭
转自:http://hi.baidu.com/aekdycoin/item/a4407c37850e5b9db80c03a6 先看对数的性质,loga(b^c)=c*loga(b),loga(b*c)=loga(b)+loga(c); 假设给出一个数10234432,那么log10(10234432)=log10(1.0234432*10^7)=log10(1.0234432)+7; log10(1.0234432)就是log10(10234432)的小数部分. log10(1.0234432)=0.010063744 10^0.010063744=1.023443198 那么要取几位就很明显了吧~ 先取对数(对10取),然后得到结果的小数部分bit,pow(10.0,bit)以后如果答案还是<1000那么就一直乘10。 注意偶先处理了0~20项是为了方便处理~ 这题要利用到......
阅读全文
  • 12月
  • 19日
算法 ⁄ 共 713字 评论关闭
      A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive elements of the sequence, the sum of which is greater than or equal to S. 尺取法 设置两个指针s,t。 维护一个区间的信息,然后根据指针的移动,更新区间信息。 时间复杂度 O(n). 同类型练习题: poj 3320  Jessica's Reading Problem #include<cstdio> #......
阅读全文
  • 05月
  • 24日
综合 ⁄ 共 530字 评论关闭
    产生问题的代码: function sendNewList2Server(clientType, clientVer, ulDom){ var lis = $(ulDom).children(); var domains = ""; for(var i=0; i<lis.length; ++i){ if(i == 0) { domains = lis[i].attr("id"); } else { domains = domains + "_" + lis[i].attr("id"); } } }     这段代码的目的是遍历一个ul元素下的li元素,并将所有的li的id拼接起来。lis是一个JQuery对象,当我当时遍历ul的时候,想当然的用了下标操作符,而下标操作是js的语法。然后程序运行到去下标操作的时候,代码报错。 请......
阅读全文
  • 05月
  • 11日
综合 ⁄ 共 23418字 评论关闭
本示例介绍在Android平台下通过HTTP协议实现断点续传下载。 我们编写的是Andorid的HTTP协议多线程断点下载应用程序。直接使用单线程下载HTTP文件对我们来说是一件非常简单的事。那么,多线程断点需要什么功能? 1.多线程下载, 2.支持断点。   使用多线程的好处:使用多线程下载会提升文件下载的速度。那么多线程下载文件的过程是:    (1)首先获得下载文件的长度,然后设置本地文件的长度。      HttpURLConnection.getContentLength();//获取下载文件的长度     RandomAccessFile file = new RandomAccessFile("QQWubiSetup.......
阅读全文
  • 05月
  • 07日
综合 ⁄ 共 3989字 评论关闭
HTTP响应代码 1xx - 信息提示 这些状态代码表示临时的响应。客户端在收到常规响应之前,应准备接收一个或多个 1xx 响应。  · 100 - Continue 初始的请求已经接受,客户应当继续发送请求的其余部分。[1.1] · 101 - Switching Protocols 服务器将遵从客户的请求转换到另外一种协议。[1.1] 2xx - 成功 这类状态代码表明服务器成功地接受了客户端请求。 · 200 - OK 一切正常,对GET和POST请求的应答文档跟在后面。  · 201 - Created 服务器已经创建了文档,Location头给出了它的URL。  · 202 - Accepted 已经接受请求,但处理尚未完成......
阅读全文
  • 04月
  • 26日
综合 ⁄ 共 620字 评论关闭
import java.math.BigInteger; import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scanner=new Scanner(System.in); int t=scanner.nextInt(); int time; while(t--!=0) { time=1; BigInteger bigInteger1=BigInteger.ZERO; int x=scanner.nextInt(); int y=scanner.nextInt(); for(;time<=x;time++) { BigInteger bigInteger3=BigInteger.va......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 1523字 评论关闭
题目: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. You may not alter the values in the nodes, only nodes itself may be changed. Only constant memory is allowed. For example, Given this linked list: 1->2->3->4->5 For k = 2, you should return: 2->1->4->3->5 For k = 3, you should return: 3->2->1->4-......
阅读全文
  • 03月
  • 22日
综合 ⁄ 共 2955字 评论关闭
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 可以在num上设置默认值0,确保表中num列没有null值,然后这样查询: select id from t where num=0 3.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 4.应尽量避免在 where 子句中使用 or 来连接条件,否则将导致引擎放弃使用索引而进行全表扫描......
阅读全文