码迷,mamicode.com
首页 > 其他好文
Mybatis使用之分页
摘要: 使用Mybatis分页主要有两种方式、一种是将分页参数传递到配置文件中、在写sql的时候就做分页。另一种是使用Mybatis的拦截器拦截需要分页的sql语句、重新组装成具有分页功能的sql语句。...
分类:其他好文   时间:2015-05-27 15:50:41    阅读次数:352
如果两段内存重叠,用memcpy函数可能会导致行为未定义
如果两段内存重叠,用memcpy函数可能会导致行为未定义,改进: void* memmove(void* str1,const void* str2,size_t n) { char* pStr1= (char*) str1; const char* pStr2=(const char*)str2; if (pStr1 < pStr2 ) { for(size_t i=0;i!=...
分类:其他好文   时间:2015-05-27 15:50:20    阅读次数:119
Zend Studio 12.0.2打开文件夹项目
1)【文件】=》【新建】=》【PHP Project from Existing Directory】 2)输入项目名称,选择文件位置。 3)完成。...
分类:其他好文   时间:2015-05-27 15:49:23    阅读次数:142
Pascal's Triangle II
题目描述: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. 思路分析:依次计算每一行的值,把它们存在同一个数组里。 代码: class Solution { public: vector ...
分类:其他好文   时间:2015-05-27 15:47:51    阅读次数:93
string 转 LPCWSTR
virtual BOOL TextOut( int x, int y, LPCTSTR lpszString, int nCount ); BOOL TextOut( int x, int y, const CString& str ); WM_LBUTTONDOWN: {                              hd...
分类:其他好文   时间:2015-05-27 15:48:02    阅读次数:134
使用CodeFirst实现动态建库
在项目ITOO3.0中,有一个技术点是动态建库建表。简单的解释一下,就用一个用来来注册我们高校云平台系统的时候,我们会动态的为他创建一整套ITOO的后台数据库。好了,项目背景理清楚了,下面是具体的实现过程。     一、业务分析     以我们平时注册今目标为例,我们在注册今目标的过程中,具体步骤是这样的:...
分类:其他好文   时间:2015-05-27 15:48:20    阅读次数:132
librtmp 时间戳超过 0xffffff时,FMS掉连接
最近在IPCamer 上做rtmp 推流,遇到很多问题,究其因,对协议本身不熟悉。 遇到问题,当使用librtmp,发送实时码流时,4.66小时后即会掉连接。网上有帖子讲解是什么原因造成的, 但始终没找到一个代码,实现。今天把解决方法贴出来,以留备忘,若有不妥之处,请及时与本人联系。谢谢! 更改rtmp.c文件 RTMP_SendPacket 此函数...
分类:其他好文   时间:2015-05-27 15:46:41    阅读次数:191
北大ACM1328——Radar Installation~~贪心
题目的大概意思是:给你N个坐标,雷达的半径为d,求至少安装多少个雷达才能将所有点覆盖。雷达都在 x 轴上,不能全部覆盖的就输出 -1. 思路大概是,先算出雷达覆盖每一个点的横坐标的范围。然后再来贪心求解有几个。 下面的是AC的代码: #include #include #include using namespace std; class data { public: double...
分类:其他好文   时间:2015-05-27 15:48:26    阅读次数:127
[LeetCode] Jump Game
Jump Game   Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that positi...
分类:其他好文   时间:2015-05-27 15:47:44    阅读次数:139
xml布局自定义SurfaceView模板
package com.dream.apm; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; ...
分类:其他好文   时间:2015-05-27 15:46:16    阅读次数:218
ListView
public class MainActivity extends ActionBarActivity { private ListView lv; private ArrayAdapter arr_adapter; private String [] contents = nul...
分类:其他好文   时间:2015-05-27 15:44:06    阅读次数:188
uva 10246
题意:图中有C个点,R条边,每个点有个权值,每条边也有距离值,求A到B点的最短距离+经过的点的最大值的和最小#include#include#include#include#include#include#include#include#include#include#include#include...
分类:其他好文   时间:2015-05-27 15:43:08    阅读次数:126
龙书11_chapter_6 二:HillsDemo解析
书中HillsDemo 关键是类的结构,GeometryGenerator的组成和应用;MeshData的构成,来存储Mesh的vertex和index数据;class GeometryGenerator{public: struct Vertex { Vertex(){}...
分类:其他好文   时间:2015-05-27 15:43:08    阅读次数:102
bzoj 1047 单调队列
做4次单调队列优化DP。 1 /************************************************************** 2 Problem: 1047 3 User: idy002 4 Language: C++ 5 Result...
分类:其他好文   时间:2015-05-27 15:44:15    阅读次数:144
bzoj2794
这题我得到一个经验,bool型的dp一定要想办法把bool去掉来表示更多的东西(1933也是这个道理)暴力大家都会,这里有两个限制条件一个限制条件我们可以排序不断加入,另一个呢我们可以用f[i]表示c[]的和等于i时,最小的b[]最大是多少然后转移判断就很容易解决了 1 var sum,a,b,c:...
分类:其他好文   时间:2015-05-27 15:42:54    阅读次数:98
bzoj4025
首先我们要知道,怎么去维护一个是否是二分图二分图的充要条件:点数>=2且无奇环重点就是不存在奇环,怎么做呢考虑随便维护一个图的生成树,不难发现,如果一条边加入后,形成奇环的话就不是二分图否则的话,我们可以无视这条边,因为如果之后再新加入一条边和这条边形成了一个奇环那么新加入的边一定和原来生成树上的边...
分类:其他好文   时间:2015-05-27 15:42:33    阅读次数:242
ng-switch 指令
Secrect Won't show you my Secrects! / {{crumb.name}} {{crumb.name}} {{crumb.name}} ...
分类:其他好文   时间:2015-05-27 15:41:11    阅读次数:96
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!