现在位置: 首页 > pinewood发表的所有文章
  • 05月
  • 12日
综合 ⁄ 共 511字 评论关闭
转载自: http://blog.csdn.net/jackyrongvip/article/details/4607653 最近在spring mvc中遇到了如何实现页面跳转的问题.比如在页面A中的提交按钮用户提交后,需要重定向到另外一个新的页面,并且有可能要把一些参数带过去.  这其实在实现中有两个方法 1 在controller中实现redirect,可以使用sendRedirect()方法,然后返回 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { ........ response.sendRedirect("photohouxuandetail.do?pid="+pid); return null......
阅读全文
  • 10月
  • 05日
综合 ⁄ 共 2181字 评论关闭
公共头文件doc_anonymous_condition_shared_data.h: #include <boost/interprocess/sync/interprocess_mutex.hpp> #include <boost/interprocess/sync/interprocess_condition.hpp> struct trace_queue { enum { LineSize = 100 }; trace_queue() : message_in(false) { } // boost::interprocess::interprocess_mutex mutex; boost::interprocess::interprocess_condition cond_empty; boost::interprocess::interprocess_condition cond_full; // char items[LineSize]; bool message_in; }; 写进程......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 812字 评论关闭
下面的例子中,先取得编辑框本身的字体,然后改变其大小(需要注意的是,这种方法下,编辑框本身的字体如果不是TrueType型的话,字体大小的变化不是“连续”的,某些大小值的设定有可能不起作用):         CYourDlg中增加成员变量CFont       m_font;   //这个绝对不能使临时变量         BOOL       CYourDlg::OnInitDialog()           {     CDialog::OnInitDialog();         //  TODO:       Add       extra       initialization       here     CWnd       *pEdit       =       GetDlgItem(IDC_EDIT1);     CFont       ......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 909字 评论关闭
    这道题要求求解给定方阵的幂,我重载了一个幂运算符,发现C++的运算符很强大很好用!     这道题的URL:http://acm.hdu.edu.cn/showproblem.php?pid=1575;     我的AC代码。 #include<iostream> #include<string.h> #include<stdio.h> using namespace std; struct Matrix { int d[10][10]; static int size; Matrix() { memset(d, 0, sizeof(d)); } void makeUnit() { for(int i=0; i<size; i++) d[i][i] = 1; } friend Matrix operator *(Matrix a, Matrix b) { Matrix m; //结......
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 3981字 评论关闭
  什么是自定义标签? 1,用户自定义的Java语言元素, 实质是运行一个或者两个接口的JavaBean; 2,可以非常紧密地和JSP的表示逻辑联系在一起,又具有和普通JavaBean相同的业务逻辑处理能力; 3,当一个JSP页面转变为servlet时,其间的用户自定义标签转化为操作一个称为标签hander的对象; 4,可操作默认对象,处理表单数据,访问数据库以及其它企业服务; 自定义标签库的特点 1,通过调用页面传递参数实现定制; 2,访问所有对JSP页面可能的对象; 3,修改调用页面生成的响应; 4,自定义标签间可相互通信; 5,在同一个JSP页面中通过标签......
阅读全文
  • 05月
  • 18日
综合 ⁄ 共 2828字 评论关闭
/* 电梯调度算法: 微软有6部电梯,每层都有人上下,电梯在每层都停。 每次电梯从一层往上走时,只允许电梯停在其中的某一层。所有的乘客都从一楼上电梯,到达某层后,电梯停下来, 所有乘客再从这里爬楼梯到自己的目的层。在一楼的时候,每个乘客选择自己的目的层,电梯则自动计算出应停在 的楼层。 电梯停在那一层,能够保证这次乘坐电梯的所有乘客爬楼梯的层数之和最少。 分析:本质是优化问题。如何寻找抽象模型。树?图? 影响结果的两个因素:乘客数目及需要停的目的楼层。我们可以从统计到达各层的乘客数目分析; ......
阅读全文
  • 02月
  • 15日
综合 ⁄ 共 481字 评论关闭
binsearch::[Int]->Int->Bool binsearch [x] y | x == y = True | otherwise = False binsearch xs y = if y == xs !! ( (length xs ) `div` 2 ) then True else if y < xs !! ( (length xs ) `div` 2 ) then binsearch (take ( (length xs ) `div` 2) xs) y else binsearch ( drop ( (length xs ) `div` 2) xs) y   上面的方法不能给出目标所在的索引,所以改写了一下 binsearch::[Int]->Int->Int->Int->Int binsearch xs a b y = if y < xs !! a then -1 else......
阅读全文
  • 02月
  • 11日
综合 ⁄ 共 7281字 评论关闭
建一个表格,用js 数组将数据填充,并且能有查看功能! id name style 查看       button         第一次学习js,第一版代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>    <script>    //显示数组        function arrayFunction(num) {            var ArrList = new Array();            ArrList[0] = { id: "001", name: "张三", style: "待阅",......
阅读全文
  • 02月
  • 08日
综合 ⁄ 共 359字 评论关闭
// 获得当前PPT活动文档名字及路径 CComQIPtr <MSPPT::_Application> spApp(g_Application); CComPtr <MSPPT::_Presentation> spPre; spApp->get_ActivePresentation(&spPre); if ( spPre != NULL )  {  CComBSTR bstrName;   spPre->get_FullName(&bstrName);  g_strPath = bstrName.m_str;  MessageBox(NULL, g_strPath, _T("当前文档名字及路径"), MB_OK);  }  该段代码不要放在OnConnection中。     更多技术文章请参看施昌权的个人网站: http://www.joyvc.cn    
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 1977字 评论关闭
数位DP的DFS写法。。。。 Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4630    Accepted Submission(s): 1614 Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence includes the sub-sequence "49", the power of the blast would add one point.Now the counter-terrorist kno......
阅读全文
  • 01月
  • 14日
综合 ⁄ 共 927字 评论关闭
题目类型  搜索题 题目意思 找一个只由数字0或1构成的数字 要求这个数字可以被 n 整除( 1 <= n <= 200) 解题方法 BFS     且要知道 (a + b) % n == ( (a%n) + (b%n) ) % n 我们可以从左到右构造目标数字 目标数字肯定是以 1 开头的 接下来可以是 0 也可以是 1 我们可以用BFS来枚举 我们开一个标记数组 vis[i], vis[i] == true 表示 我们已经枚举过一个数 这个数 mod n 等于 i, 可以用一个map<int,LL>M 来保存这个枚举的数 即 M[i] 因为如果 某个数 x % n == y 的话 再遇到 % n == y的数的话 这个数和 x 是......
阅读全文
  • 12月
  • 10日
综合 ⁄ 共 2116字 评论关闭
文章目录 Mapping data to Lucene Displaying search results Things to look out for If you have multiple tables to search A common use-case for Lucene is performing a full-text search on one or more database tables. Although MySQL comes with a full-text search functionality, it quickly breaks down for all but the simplest kind of queries and when there is a need for field boosting, customizing relevance ranking, etc. Mapping data to Luce......
阅读全文