iOS有时候需要判断是否touch到某个图的区域中。也就是touch到的这个点是否在某个图的区域范围内。解决问题的办法很多, 这里简单介绍一种。我们可以通过CGPath创建一个区域,区域是由路径做两点间线段并闭合成的区域,然后就可以用CGPath相关函数CGPathContainsPoint判断点是否在区域里了。比如这里创建了一个简单的矩形。它的frame为(4, 4, 10, 10)。 四个顶点...
分类:
移动开发 时间:
2014-09-01 17:44:03
阅读次数:
208
Struts2 在项目中用到的核心是拦截器interceptor,OGNL(Object Graph navigation Language)对象图导航语言(用来操作ValueStack里面的数据),Value Stack和ActionContext。strut2是基于WebWork,WebWork...
分类:
其他好文 时间:
2014-09-01 13:49:53
阅读次数:
492
package leetcode;import java.util.Stack;/** * Created by smallstrong on 14-8-31. *///For example,// Given s = "the sky is blue",// retur...
分类:
其他好文 时间:
2014-08-31 14:26:01
阅读次数:
173
首先摘录如下URL对pagemap的描述。
https://www.kernel.org/doc/Documentation/vm/pagemap.txt
* /proc/pid/pagemap. This file lets a userspace process find out which
physical frame each virtual page is map...
分类:
系统相关 时间:
2014-08-31 09:14:51
阅读次数:
805
WordPress 的 rich text采用js,先让selenium切换到iframe中driver.switchTo().frame("content_ifr");然后执行JSWebElement editor = driver.findElement(By.tagName("body"));...
分类:
其他好文 时间:
2014-08-31 00:25:30
阅读次数:
374
??
1.stack,size(),empty(),pop()函数
#include
#include
using
namespace
std;
//通过push()方法入栈
//通过size()方法求栈中元素的个数
//通过empty()方法判断栈是否为空
//通过pop()求栈中最顶端的元素
void
main...
分类:
其他好文 时间:
2014-08-30 23:08:10
阅读次数:
252
思路:这题棋盘DP或者搜索,或者暴力都可以,因为棋盘比较小。
这里用的双向dfs。
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define mem(a,b) me...
分类:
其他好文 时间:
2014-08-30 21:45:50
阅读次数:
340
这是《Lua程序设计》中的例子,做个简单记录。
#include
#include
#include
static void stackDump(lua_State *L){
int i;
int top = lua_gettop(L);
for(i = 1; i <= top; i++){
int t = lua_type(L, i);
...
二分二分二分。。记录二分的点。1600多MS,应该 可以再优化#include #include #include #include using namespace std;int stack[150],sp;int n,M;struct Matrax { int m[35][35];};Matra...
分类:
其他好文 时间:
2014-08-30 17:36:09
阅读次数:
172