摘要: 扩展schema,定义自己的bean属性。。不错!主要:1,定义META-INF下.xsd文件,这里是people.xsd;定义spring.handlers;定义spring.schemas2,定义namaspace解析类,这里是StudentNamespaceHandler3,定义beanDefinition,这里是StudentBeanDefinitionParser4,当然还有相关的javabean定义,这里是Student.java详细代码:people.xsd ... 阅读全文
posted @ 2013-08-14 19:46 pangbangb 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 1,MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.缘由:应该是之前强制停止redis快照导致解决方案:config set stop-writes-on-bgsave-error no 阅读全文
posted @ 2013-08-14 19:44 pangbangb 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 关于Qt操作文件夹、文件的知识用途较多,比如遍历下一层乃至所有子孙文件、文件夹,获取它们的一些信息(大小、类型、最后更改时间等)。当然,也可以进行级联删除。 首先看简单的: 一、Qt遍历文件夹下一层的文件: 方式1: void ImageTree::addFolderImages(QString path) { //判断路径是否存在 QDir dir(path); if(!dir.exists()) { return; } ... 阅读全文
posted @ 2013-08-14 19:42 pangbangb 阅读(10367) 评论(0) 推荐(0) 编辑
摘要: 原文地址: 5 More HTML5 APIs You Didn’t Know Existed演示地址: 全屏API Demo 原文日期: 2012年11月08日 翻译日期: 2013年08月13日HTML5 已经给我们提供了许多好用的JavaScript以及HTML API.其中一些是我们期待了许多年的,而另外一些是为移动和桌面开发者准备的。不管这些API出于什么目的而推出,只要能帮我们更好地完成工作就是“好猫”。 前几天我发表了一篇名为: 5个你不知道的HTML5的接口的博文,希望能帮您更好地开发web应用。今天我将为您介绍另外5个少为人知的HTML5 API—— 希望您能发现他们... 阅读全文
posted @ 2013-08-14 19:40 pangbangb 阅读(469) 评论(0) 推荐(0) 编辑
摘要: 点击打开poj 2926思路: n维空间计算最远的曼哈顿距离 分析: 1 题目给定n个5维的点,要求最远的曼哈顿距离 2 求最远曼哈顿距离,对于一个n维的空间,其中两点的曼哈顿距离为:|x1-x2|+|y1-y2|+... , 两点的坐标分别为(x1,y1……)和(x2,y2,……)3 考虑二维的情况对于二维空间的两个点(x1,y1)和 (x2,y2),那么曼哈顿距离为|x1-x2|+|y1-y2|那么我们去掉绝对值之后就有四种情况(x1-x2)+(y1-y2) , -(x1-x2)+(y1-y2) ,(x1-x2)-(y1-y2) ,-(x1-x2)-(y1-y2)那么我们把相同点的放在一起 阅读全文
posted @ 2013-08-14 19:37 pangbangb 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=3414 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22009#problem/J Pots Time Limit:1000MSMemory Limit:65536K Total Submissions:8253Accepted:3499Special Judge DescriptionYou are given two pots, having the volume ofAandBli... 阅读全文
posted @ 2013-08-14 19:35 pangbangb 阅读(588) 评论(1) 推荐(0) 编辑
摘要: Wa的版本。。。/*DPdp[i][j]:前i个取某些个且cost不超过j得到的最大价值*/#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const int maxn = 105;const int maxm = 10005;const int 阅读全文
posted @ 2013-08-14 19:33 pangbangb 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 在某些应用场合下,我们可能需要在启动A进程启动时关闭进程B。MFC下该如何做呢?以下是我项目中用到的代码:int KillProcess(DWORD Pid){ //打开进程得到进程句柄 HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS,FALSE,Pid); if(hProcess==NULL) { printf("OpenProcess error\n"); return 0; } //结束进程 if (TerminateProcess(hProcess,0)) { printf("结束进程成功\n"); 阅读全文
posted @ 2013-08-14 19:31 pangbangb 阅读(1729) 评论(0) 推荐(0) 编辑
摘要: ----------------------------------------------------------- #!/bin/bash set -e command 1 command 2 ... exit 0 ---------------------------------------------------------- Every script you write should include set -e at the top. This tells bash that it should exit the script if any statement returns a. 阅读全文
posted @ 2013-08-14 19:28 pangbangb 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 建议先学会用康托展开:http://blog.csdn.net/u010372095/article/details/9904497 Problem Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into 阅读全文
posted @ 2013-08-14 19:26 pangbangb 阅读(291) 评论(0) 推荐(0) 编辑
摘要: TCP(Transmission Control Protocol) TCP(又叫传输控制协议),是一种面向连接的、可靠的、基于字节流的传输层通信协议。TCP连接包括三个状态:连接创建、数据传送和连接终止。三次握手: 1.第一次握手:客户端通过向服务端发送一个SYN来创建一个主动打开,作为三次握手的一部分。简单的说,就是客户端询问服务端,我可以向你发送数据么? 2.第二次握手:服务端应当为一个合法的SYN回送一个SYN/ACK。简单的说就是,服务端回复客户端说,你可以发,你什么时候发? 3.第三次握手:客户端在发送一个ACK。就是客户端告诉服务端,我现在就发,你接着吧。这样就完成了三次握... 阅读全文
posted @ 2013-08-14 19:24 pangbangb 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is apolynomial like this:(a0*x^(2^0)+1) * (a1* x^(2^1)+1)*.......*(an-1* x^(2^(n-1))+1). Then Alice ask Bob Q questions. In theexpansion of the Polynomial, Given an integer P, please tell the coefficient of the.. 阅读全文
posted @ 2013-08-14 19:21 pangbangb 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 翻译整理自:http://guides.rubyonrails.org/v3.2.13/association_basics.html想吐槽一句,http://guides.ruby-china.org/ 翻译地太慢了!!!csdn 复制过来格式都有误啊,改格式改了好几遍了。烦心。。。。什么时候能支持markdown呢-。- Rails支持以下6种关联类型: belongs_to has_one has_many has_many :through has_one :through has_and_belongs_to_many 1. belongs_to :在两个model间建立一... 阅读全文
posted @ 2013-08-14 19:19 pangbangb 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 排序算法系列学习,主要描述冒泡排序,选择排序,直接插入排序,希尔排序,堆排序,归并排序,快速排序等排序进行分析。文章规划:一。通过自己对排序算法本身的理解,对每个方法写个小测试程序。具体思路分析不展开描述。二。通过《大话数据结构》一书的截图,详细分析该算法。在此,推荐下程杰老师的《大话数据结构》一书,当然不是打广告,只是以一名读者的身份来客观的看待这本书,确实是通俗易懂,值得一看。ps:一个较为详细的学习链接 http://blog.csdn.net/guo_hongjun1611/article/details/7632047 五。堆排序一。个人理解 学习堆排序,要了解以下两方面内容... 阅读全文
posted @ 2013-08-14 19:17 pangbangb 阅读(410) 评论(0) 推荐(1) 编辑
摘要: Jenkins强大的功能主要靠其丰富的plugin体现,之前的一篇博客《Jenkins安装plugin》中介绍了如何找到并安装需要的plugin。虽然目前已经有大量非常优秀的plugin可供使用,但是有时候仍需要自己开发一些满足项目特殊要求的plugin。下面通过一个简单实例,介绍Jenkins的plugin的整个开发过程。1. 环境准备 1) 安装工具: Maven 3; JDK 6.0或以上版本,Eclipse SDK 4.2 2) 环境变量:PATH中添加mvn.bat路径;JAVA_HOME中添加SDK路径 3) 修改maven安装目录下conf文件夹中的se... 阅读全文
posted @ 2013-08-14 19:15 pangbangb 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immediately. Yet, the beast set a maze. Only if the prince find out the maze’s exit can he save the princess. Now, here comes the . 阅读全文
posted @ 2013-08-14 19:12 pangbangb 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 一、存储过程定义:它是一组为了完成特定功能的SQL语句集,经过编译和优化后存储在数据库中,用户通过指定存储过程的名字并给出参数(如果这个存储过程带有参数的话)来执行,实现对表的增删改查。(一)优点:1、灵活性:增强了SQL语言的功能和灵活性。可以用流控制语句编写,可以完成复杂的判断和较复杂的运算。2、安全性: (1)保证数据的安全性。通过存储过程可以使没有权限的用户在控制之下间接地存取数据库而不必拥有直接操作基础表的权限,从而保证数据的安全。 (2)数据库完整性。通过存储过程可以使相关的动作在一起发生,从而可以维护数据库的完整性。同时也可以避免对数据库操作出现错误,因为它是预编译的。 (3.. 阅读全文
posted @ 2013-08-14 19:10 pangbangb 阅读(399) 评论(0) 推荐(0) 编辑
摘要: MySql安装由于需要用mySql数据库今天就把它安上了,每次安装软件,数据库总是够我们折腾的,有时出现错误甚至比重装系统还要让人头疼。今天在安的过程中就不出了很多错误,在重启与重装的反复捣鼓中终于安上了,安完之后才感觉原来是这样,以后卸载软件或者重装应该应该怎么样做。遇到的小问题第一个错误是 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax 。根据问题描述应该是连接服务器过程中输入的字符串语法有些问题 阅读全文
posted @ 2013-08-14 19:08 pangbangb 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 首先我学习了struts 1.x与struts 2的区别: 1.struts 1.x的控制器类必须从Action类继承。2.struts 2的控制器类可以是一个普通的类,也可以是ActionSupport类的子类。 3.struts 1.x使用一个名为ActionServlet的Servlet类来处理客户端请求。 4.struts 2.x使用一个名为FilterDispatcher的过滤器类来处理客户端请求。 struts 2 的工作流程: 1.判断客户端请求是否以action结尾,如果不是以.action结尾,直接交由Servlet引擎来处理,否则继续下面的步骤。 2.调用一... 阅读全文
posted @ 2013-08-14 19:06 pangbangb 阅读(135) 评论(0) 推荐(0) 编辑
摘要: /// /// rename PPT /// private static void renamePPT() { //add references Microsoft.Office.Interop.PowerPoint //using PowerPoint = Microsoft.Office.Interop.PowerPoint; string pptPath = @"R:\LiChao\Temp\test\CCB_F4I;09_Field Work ... 阅读全文
posted @ 2013-08-14 19:04 pangbangb 阅读(955) 评论(0) 推荐(0) 编辑