POJ 3449 Geometric Shapes --计算几何,线段相交
题意: 给一些多边形或线段,输出与每一个多边形或线段的有哪一些多边形或线段。
解法: 想法不难,直接暴力将所有的图形处理成线段,然后暴力枚举,相交就加入其vector就行了。主要是代码有点麻烦,一步一步来吧。
还有收集了一个线段旋转的函数。
给定正方形对角求其他两点用到了线段旋转。
Vector Rotate(Point P,Vector A,double rad){ //以P为基准点把向量A旋转rad
return Vector(P.x+A.x*cos(rad)-A.y*sin(rad),P.y+A.x*sin(rad)+A.y*cos(rad));
}
从POJ Discuss上面搞了一点数据下来:
【input】 Z line (,) (,)
A square (,) (,)
R polygon (,) (-,-) (,-) (,) (-,-)
V line (,) (-,)
P line (-,-) (-,)
S rectangle (,-) (,-) (,-)
B triangle (-,) (,) (,)
T line (-,) (-,)
L triangle (-,) (-,) (,)
M rectangle (-,) (,-) (,-)
N line (-,) (-,)
O square (,-) (,)
C line (-,) (,)
Q square (-,-) (-,)
-
D line (-,-) (-,)
K line (,) (-,)
H square (-,-) (-,)
C rectangle (-,-) (,) (-,-)
M line (,) (-,)
W rectangle (,) (-,-) (,)
T square (,-) (,)
Z rectangle (,-) (,-) (,-)
E line (,) (-,-)
A rectangle (-,-) (-,) (-,)
F rectangle (,-) (,-) (,-)
G line (,) (,)
I triangle (,-) (,) (-,)
Q line (-,) (,)
N line (,-) (-,)
-
Q polygon (,) (-,) (,) (,) (,-) (-,-) (-,)
A rectangle (-,-) (-,-) (-,)
K triangle (-,) (,-) (-,-)
J square (,) (,-)
X square (-,-) (,)
S line (,-) (,)
E rectangle (-,-) (-,-) (-,)
O triangle (-,-) (,-) (,)
F rectangle (,-) (,-) (,-)
-
W square (,-) (,)
X polygon (,) (-,-) (,)
T square (-,-) (-,)
K square (,-) (,)
E rectangle (,) (,) (,)
Y square (-,-) (-,)
V polygon (-,) (,) (,) (,) (,) (,-) (-,-) (-,) (-,-) (,)
Z polygon (-,) (-,) (-,) (,-) (,) (,) (,-) (,)
B polygon (,-) (,) (,) (,) (,) (,) (-,) (-,-) (,-) (-,) (-,)
A rectangle (-,-) (,) (-,-)
U rectangle (,-) (-,-) (,)
H triangle (-,) (,-) (,)
C square (-,) (,)
D rectangle (,) (,-) (,)
F square (-,) (,-)
G rectangle (-,) (,-) (,-)
Q triangle (-,) (-,) (,-)
S square (-,-) (,)
R line (,-) (,-)
I square (,) (,-)
J line (,) (,)
L triangle (-,-) (,) (,-)
M rectangle (-,-) (,-) (,-)
-
Q polygon (-,) (,) (-,) (-,) (-,-) (,-) (,-) (,) (,) (,) (,) (-,)
X line (-,) (,)
K square (,-) (,-)
Y polygon (,-) (,) (-,-) (,)
Z polygon (,-) (,-) (,-) (,-) (,-) (-,-) (-,-) (,) (-,-) (,-) (,) (,-) (,)
C polygon (,) (-,) (,) (-,-) (,-) (,-) (,) (,) (,)
F polygon (,) (,) (-,) (,) (,) (-,) (,)
A square (,-) (,)
U polygon (,) (,) (,) (-,) (,) (,) (-,) (-,) (,) (-,) (-,-)
G rectangle (,) (-,) (,)
D polygon (,-) (-,) (,) (,) (,) (,-) (,) (,-) (,)
-
P polygon (-,) (,) (,) (,) (,-) (-,-) (-,-) (-,-) (,-) (-,-) (,)
O triangle (,) (,) (,)
G rectangle (,) (-,-) (,)
M square (-,-) (-,)
K line (-,) (-,-)
E triangle (,) (,-) (,)
X square (,-) (,)
-
E square (-,-) (-,)
X polygon (,-) (-,-) (-,-) (,-) (-,)
O rectangle (-,) (-,) (,-)
M square (,-) (-,-)
I polygon (,) (,-) (,-) (,) (,) (-,) (,) (-,) (-,) (-,) (,) (-,-)
C square (-,-) (-,)
D line (,-) (-,)
N polygon (,) (,) (,) (,) (-,) (,-) (-,-) (-,-) (-,-) (-,) (,) (,)
P line (,-) (-,-)
Y triangle (,-) (,) (-,-)
-
U polygon (,) (,) (,) (,-) (,-) (-,) (-,-) (-,) (-,) (,) (-,)
O square (-,) (,-)
B triangle (,-) (-,-) (,)
H line (,-) (-,)
E rectangle (-,-) (,-) (,-)
Q rectangle (-,-) (-,-) (,-)
P rectangle (-,-) (-,-) (-,)
-
O square (,-) (-,)
I square (-,) (,-)
X polygon (,-) (-,) (-,-) (-,-)
U square (-,) (,)
Z triangle (-,-) (,) (-,)
Y rectangle (,-) (,-) (,-)
-
G triangle (,-) (,) (,-)
C square (,) (-,)
O rectangle (,-) (,-) (,-)
J rectangle (-,-) (-,) (-,)
K polygon (-,) (,-) (,-) (,-) (,) (,) (,) (,-) (,-) (,-) (-,-)
H square (-,-) (,)
Z triangle (,) (-,) (,-)
D rectangle (,-) (-,) (-,)
R rectangle (-,) (,) (-,-)
W triangle (,) (,) (,-)
A triangle (,-) (,-) (,)
U square (-,-) (-,-)
L square (,) (,-)
T square (,) (,-)
X rectangle (,-) (,) (-,-)
M triangle (,) (,) (,)
B line (,) (,)
F rectangle (,) (,-) (,-)
I polygon (-,-) (-,-) (-,-) (,-) (,) (,)
N triangle (,) (,) (,)
Y square (,) (-,-)
P polygon (,) (-,) (-,-) (,-) (-,-) (,) (-,) (,)
Q square (,) (,-)
E square (,-) (,)
S square (,) (-,-)
V triangle (-,) (,) (,)
-
. 【output】
A intersects with Z
B intersects with L, N, O, P, Q, R, T, and V
C intersects with N, O, P, Q, and R
L intersects with B, P, Q, R, T, and Z
M intersects with O, R, and S
N intersects with B and C
O intersects with B, C, M, P, Q, R, S, and V
P intersects with B, C, L, O, Q, R, and V
Q intersects with B, C, L, O, P, R, and V
R intersects with B, C, L, M, O, P, Q, and V
S intersects with M and O
T intersects with B and L
V intersects with B, O, P, Q, R, and Z
Z intersects with A, L, and V A intersects with C, D, E, T, and W
C intersects with A, H, I, and T
D intersects with A and E
E intersects with A, D, G, H, I, K, M, N, Q, and T
F intersects with H, I, T, and Z
G intersects with E, K, and Q
H intersects with C, E, F, I, K, N, Q, T, W, and Z
I intersects with C, E, F, H, K, N, T, W, and Z
K intersects with E, G, H, I, N, T, and W
M intersects with E, N, and Q
N intersects with E, H, I, K, M, Q, T, and W
Q intersects with E, G, H, M, and N
T intersects with A, C, E, F, H, I, K, N, W, and Z
W intersects with A, H, I, K, N, and T
Z intersects with F, H, I, and T A intersects with K, O, and X
E intersects with O and X
F has no intersections
J intersects with K, O, Q, and X
K intersects with A, J, O, Q, and X
O intersects with A, E, J, K, Q, and X
Q intersects with J, K, O, S, and X
S intersects with Q
X intersects with A, E, J, K, O, and Q A intersects with B, F, G, L, M, Q, S, V, W, Y, and Z
B intersects with A, C, D, F, G, H, I, J, K, L, M, Q, S, T, U, V, W, X, Y, and Z
C intersects with B, D, E, F, H, I, J, L, S, T, U, V, W, X, and Z
D intersects with B, C, E, F, G, H, I, J, L, S, U, W, X, and Z
E intersects with C, D, F, I, L, U, and X
F intersects with A, B, C, D, E, G, H, L, M, Q, U, V, W, X, Y, and Z
G intersects with A, B, D, F, H, L, M, U, V, X, and Z
H intersects with B, C, D, F, G, I, J, L, M, S, T, U, V, W, X, and Z
I intersects with B, C, D, E, H, J, K, L, S, U, V, W, X, and Z
J intersects with B, C, D, H, I, U, V, W, X, and Z
K intersects with B, I, V, W, and Z
L intersects with A, B, C, D, E, F, G, H, I, M, Q, U, V, W, X, Y, and Z
M intersects with A, B, F, G, H, L, Q, S, U, V, W, and X
Q intersects with A, B, F, L, M, S, T, U, V, W, X, and Y
R intersects with V
S intersects with A, B, C, D, H, I, M, Q, T, U, V, W, X, Y, and Z
T intersects with B, C, H, Q, S, V, W, Y, and Z
U intersects with B, C, D, E, F, G, H, I, J, L, M, Q, S, V, W, X, and Z
V intersects with A, B, C, F, G, H, I, J, K, L, M, Q, R, S, T, U, W, X, Y, and Z
W intersects with A, B, C, D, F, H, I, J, K, L, M, Q, S, T, U, V, X, Y, and Z
X intersects with B, C, D, E, F, G, H, I, J, L, M, Q, S, U, V, W, and Z
Y intersects with A, B, F, L, Q, S, T, V, W, and Z
Z intersects with A, B, C, D, F, G, H, I, J, K, L, S, T, U, V, W, X, and Y A intersects with C, D, F, G, K, Q, U, Y, and Z
C intersects with A, D, F, G, K, Q, U, X, Y, and Z
D intersects with A, C, F, G, K, Q, U, X, Y, and Z
F intersects with A, C, D, G, Q, U, X, Y, and Z
G intersects with A, C, D, F, Q, U, X, Y, and Z
K intersects with A, C, D, Q, Y, and Z
Q intersects with A, C, D, F, G, K, U, X, Y, and Z
U intersects with A, C, D, F, G, Q, X, Y, and Z
X intersects with C, D, F, G, Q, U, Y, and Z
Y intersects with A, C, D, F, G, K, Q, U, X, and Z
Z intersects with A, C, D, F, G, K, Q, U, X, and Y E intersects with O, P, and X
G intersects with M, P, and X
K intersects with M and P
M intersects with G, K, P, and X
O intersects with E, P, and X
P intersects with E, G, K, M, O, and X
X intersects with E, G, M, O, and P C intersects with E, I, M, N, X, and Y
D intersects with I, N, X, and Y
E intersects with C, I, M, N, O, X, and Y
I intersects with C, D, E, M, N, O, X, and Y
M intersects with C, E, I, N, O, X, and Y
N intersects with C, D, E, I, M, P, X, and Y
O intersects with E, I, M, X, and Y
P intersects with N
X intersects with C, D, E, I, M, N, O, and Y
Y intersects with C, D, E, I, M, N, O, and X B intersects with E, H, O, P, Q, and U
E intersects with B, H, O, P, Q, and U
H intersects with B, E, O, P, Q, and U
O intersects with B, E, H, P, Q, and U
P intersects with B, E, H, O, Q, and U
Q intersects with B, E, H, O, P, and U
U intersects with B, E, H, O, P, and Q I intersects with O, X, and Z
O intersects with I, X, and Z
U has no intersections
X intersects with I, O, and Z
Y has no intersections
Z intersects with I, O, and X A intersects with C, E, H, I, K, L, N, P, Q, S, T, and W
B intersects with H, K, N, P, T, V, W, and Z
C intersects with A, E, F, G, H, I, J, K, L, M, N, P, Q, R, S, V, W, X, Y, and Z
D intersects with I, J, K, L, P, R, T, X, and Z
E intersects with A, C, F, H, I, K, L, N, P, Q, S, T, W, and Z
F intersects with C, E, G, H, I, K, L, O, P, Q, S, T, X, Y, and Z
G intersects with C, F, H, I, K, L, N, P, Q, S, T, V, Y, and Z
H intersects with A, B, C, E, F, G, I, K, L, N, P, Q, R, S, T, U, W, Y, and Z
I intersects with A, C, D, E, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, Y, and Z
J intersects with C, D, I, K, L, P, R, T, and X
K intersects with A, B, C, D, E, F, G, H, I, J, L, M, N, O, P, Q, R, S, T, W, X, Y, and Z
L intersects with A, C, D, E, F, G, H, I, J, K, M, P, Q, R, S, T, V, W, X, Y, and Z
M intersects with C, I, K, L, N, S, T, V, and W
N intersects with A, B, C, E, G, H, I, K, M, P, Q, S, T, V, W, Y, and Z
O intersects with F, K, P, R, and T
P intersects with A, B, C, D, E, F, G, H, I, J, K, L, N, O, Q, R, S, T, U, V, W, X, Y, and Z
Q intersects with A, C, E, F, G, H, I, K, L, N, P, S, T, W, Y, and Z
R intersects with C, D, H, I, J, K, L, O, P, S, T, X, and Y
S intersects with A, C, E, F, G, H, I, K, L, M, N, P, Q, R, V, W, and Y
T intersects with A, B, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, V, W, X, Y, and Z
U intersects with H and P
V intersects with B, C, G, I, L, M, N, P, S, T, W, Y, and Z
W intersects with A, B, C, E, H, I, K, L, M, N, P, Q, S, T, and V
X intersects with C, D, F, J, K, L, P, R, T, and Z
Y intersects with C, F, G, H, I, K, L, N, P, Q, R, S, T, V, and Z
Z intersects with B, C, D, E, F, G, H, I, K, L, N, P, Q, T, V, X, and Y
---------------------------------------------------------------------
代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#define pi acos(-1.0)
#define eps 1e-8
using namespace std; struct Point{
double x,y;
Point(double x=, double y=):x(x),y(y) {}
void input() { scanf("%lf%lf",&x,&y); }
};
typedef Point Vector;
struct Line{
Point p;
Vector v;
double ang;
Line(){}
Line(Point p, Vector v):p(p),v(v) { ang = atan2(v.y,v.x); }
Point point(double t) { return Point(p.x + t*v.x, p.y + t*v.y); }
bool operator < (const Line &L)const { return ang < L.ang; }
};
int dcmp(double x) {
if(x < -eps) return -;
if(x > eps) return ;
return ;
}
template <class T> T sqr(T x) { return x * x;}
Vector operator + (Vector A, Vector B) { return Vector(A.x + B.x, A.y + B.y); }
Vector operator - (Vector A, Vector B) { return Vector(A.x - B.x, A.y - B.y); }
Vector operator * (Vector A, double p) { return Vector(A.x*p, A.y*p); }
Vector operator / (Vector A, double p) { return Vector(A.x/p, A.y/p); }
bool operator < (const Point& a, const Point& b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
bool operator >= (const Point& a, const Point& b) { return a.x >= b.x && a.y >= b.y; }
bool operator <= (const Point& a, const Point& b) { return a.x <= b.x && a.y <= b.y; }
bool operator == (const Point& a, const Point& b) { return dcmp(a.x-b.x) == && dcmp(a.y-b.y) == ; }
double Dot(Vector A, Vector B) { return A.x*B.x + A.y*B.y; }
double Length(Vector A) { return sqrt(Dot(A, A)); }
double Angle(Vector A, Vector B) { return acos(Dot(A, B) / Length(A) / Length(B)); }
double Cross(Vector A, Vector B) { return A.x*B.y - A.y*B.x; }
Vector VectorUnit(Vector x){ return x / Length(x);}
Vector Normal(Vector x) { return Point(-x.y, x.x) / Length(x);}
double angle(Vector v) { return atan2(v.y, v.x); } bool SegmentIntersection(Point A,Point B,Point C,Point D) {
return max(A.x,B.x) >= min(C.x,D.x) &&
max(C.x,D.x) >= min(A.x,B.x) &&
max(A.y,B.y) >= min(C.y,D.y) &&
max(C.y,D.y) >= min(A.y,B.y) &&
dcmp(Cross(C-A,B-A)*Cross(D-A,B-A)) <= &&
dcmp(Cross(A-C,D-C)*Cross(B-C,D-C)) <= ;
}
Vector Rotate(Point P,Vector A,double rad){ //以P为基准点把向量A旋转rad
return Vector(P.x+A.x*cos(rad)-A.y*sin(rad),P.y+A.x*sin(rad)+A.y*cos(rad));
} struct node {
char id;
int cnt;
Line line[];
vector<char> inter;
}poly[];
int cmp(node ka,node kb) { return ka.id < kb.id; } int main()
{
char ss[],shape[];
int tot = ,i,j,e,k;
while(scanf("%s",ss)!=EOF)
{
if(ss[] == '.') break;
if(ss[] != '-') {
poly[++tot].id = ss[];
scanf("%s",shape);
if(shape[] == 't') { //triangle
poly[tot].cnt = ;
Point P[];
for(i=;i<;i++) scanf(" (%lf,%lf)",&P[i].x,&P[i].y);
for(i=;i<;i++) poly[tot].line[i] = Line(P[i],P[(i+)%]-P[i]);
}
else if(shape[] == 's') { //square
poly[tot].cnt = ;
Point A,B,C,D;
scanf(" (%lf,%lf)",&A.x,&A.y);
scanf(" (%lf,%lf)",&C.x,&C.y);
B = Rotate(A,C-A,pi*0.25); B = A + (B-A)/sqrt(2.0);
D = C + (A-B);
poly[tot].line[] = Line(A,B-A), poly[tot].line[] = Line(B,C-B);
poly[tot].line[] = Line(C,D-C), poly[tot].line[] = Line(D,A-D);
}
else if(shape[] == 'r') { //rectangle
poly[tot].cnt = ;
Point A,B,C,D;
scanf(" (%lf,%lf)",&A.x,&A.y);
scanf(" (%lf,%lf)",&B.x,&B.y);
scanf(" (%lf,%lf)",&C.x,&C.y);
D = A + (C-B);
poly[tot].line[] = Line(A,B-A), poly[tot].line[] = Line(B,C-B);
poly[tot].line[] = Line(C,D-C), poly[tot].line[] = Line(D,A-D);
}
else if(shape[] == 'l') { //line
poly[tot].cnt = ;
Point A,B;
scanf(" (%lf,%lf)",&A.x,&A.y);
scanf(" (%lf,%lf)",&B.x,&B.y);
poly[tot].line[] = Line(A,B-A);
}
else if(shape[] == 'p') { //polygon
scanf("%d",&poly[tot].cnt);
Point P[];
for(i=;i<poly[tot].cnt;i++) {
scanf(" (%lf,%lf)",&P[i].x,&P[i].y);
if(i >= ) poly[tot].line[i-] = Line(P[i-],P[i]-P[i-]);
}
poly[tot].line[i-] = Line(P[i-],P[]-P[i-]);
}
}
else //processing...
{
for(i=;i<=tot;i++) //处理第i个多边形
{
poly[i].inter.clear();
for(e=;e<poly[i].cnt;e++) //枚举每条边
{
for(j=;j<=tot;j++) //枚举别的多边形
{
if(i == j) continue;
for(k=;k<poly[j].cnt;k++) //枚举别的多边形的每条边
{
Point A = poly[i].line[e].p, B = poly[i].line[e].p+poly[i].line[e].v;
Point C = poly[j].line[k].p, D = poly[j].line[k].p+poly[j].line[k].v;
if(SegmentIntersection(A,B,C,D))
{
poly[i].inter.push_back(poly[j].id);
break;
}
}
}
}
sort(poly[i].inter.begin(),poly[i].inter.end());
poly[i].inter.erase(unique(poly[i].inter.begin(),poly[i].inter.end()),poly[i].inter.end());
}
sort(poly+,poly+tot+,cmp);
for(i=;i<=tot;i++) {
printf("%c",poly[i].id);
int sz = poly[i].inter.size();
if(sz == )
puts(" has no intersections");
else {
printf(" intersects with ");
if(sz == )
printf("%c\n",poly[i].inter[]);
else if(sz == )
printf("%c and %c\n",poly[i].inter[],poly[i].inter[]);
else {
for(j=;j<sz-;j++) printf("%c, ",poly[i].inter[j]);
printf("and %c\n",poly[i].inter[j]);
}
}
}
puts("");
tot = ;
}
}
return ;
}
POJ 3449 Geometric Shapes --计算几何,线段相交的更多相关文章
- POJ 3449 Geometric Shapes 判断多边形相交
题意不难理解,给出多个多边形,输出多边形间的相交情况(嵌套不算相交),思路也很容易想到.枚举每一个图形再枚举每一条边 恶心在输入输出,不过还好有sscanf(),不懂可以查看cplusplus网站 根 ...
- POJ 3449 Geometric Shapes(判断几个不同图形的相交,线段相交判断)
Geometric Shapes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1243 Accepted: 524 D ...
- 简单几何(线段相交)+模拟 POJ 3449 Geometric Shapes
题目传送门 题意:给了若干个图形,问每个图形与哪些图形相交 分析:题目说白了就是处理出每个图形的线段,然后判断是否相交.但是读入输出巨恶心,就是个模拟题加上线段相交的判断,我第一次WA不知道输出要按字 ...
- POJ 3449 Geometric Shapes (求正方形的另外两点)
Geometric Shapes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1470 Accepted: 622 D ...
- POJ 3449 Geometric Shapes
判断两个多边形是否相交,只需判断边是否有相交. 编码量有点大,不过思路挺简单的. #include<cstdio> #include<cstring> #include< ...
- POJ 1066 Treasure Hunt (线段相交)
题意:给你一个100*100的正方形,再给你n条线(墙),保证线段一定在正方形内且端点在正方形边界(外墙),最后给你一个正方形内的点(保证不再墙上) 告诉你墙之间(包括外墙)围成了一些小房间,在小房间 ...
- POJ 2653 Pick-up sticks (线段相交)
题意:给你n条线段依次放到二维平面上,问最后有哪些没与前面的线段相交,即它是顶上的线段 题解:数据弱,正向纯模拟可过 但是有一个陷阱:如果我们从后面向前枚举,找与前面哪些相交,再删除前面那些相交的线段 ...
- POJ 2653 Pick-up sticks【线段相交】
题意:n根木棍随意摆放在一个平面上,问放在最上面的木棍是哪些. 思路:线段相交,因为题目说最多有1000根在最上面.所以从后往前处理,直到木棍没了或者最上面的木棍的总数大于1000. #include ...
- POJ 1410 Intersection --几何,线段相交
题意: 给一条线段,和一个矩形,问线段是否与矩形相交或在矩形内. 解法: 判断是否在矩形内,如果不在,判断与四条边是否相交即可.这题让我发现自己的线段相交函数有错误的地方,原来我写的线段相交函数就是单 ...
随机推荐
- 为什么URL中的中文需要Encode两次?
在URL中传参的时候常常需要传入中文,这个时候就需要对中文参数进行编码,即URLEncode.但是,常常是Encode两次,而不是一次,为什么呢? 首先要知道,tomcat会自动解码一次: 这样的话, ...
- go语言 类型:数组
在go语言中数组array是一组特定长度的有序的元素集合. go的数组类型由两部分组成——类型和长度,二者缺一不可.数组本来就是一块存储相同类型元素的连续内存空间,因此决定一个数组的类型,必然需要决定 ...
- Oracle中用随机数更新字段----将一张表的数据插入另一张表----环境设置
DECLARE CURSOR recordCursor IS SELECT longitude,latitude FROM WR_WIUST_B_SEC FOR UPDATE; recordRow r ...
- WAF指纹识别和XSS过滤器绕过技巧
[译文] -- “Modern Web Application Firewalls Fingerprinting and Bypassing XSS Filters” 0x1 前言 之前在乌云drop ...
- Laravel 5 性能优化技巧
说明 性能一直是 Laravel 框架为人诟病的一个点,所以调优 Laravel 程序算是一个必学的技能. 接下来分享一些开发的最佳实践,还有调优技巧,大家有别的建议也欢迎留言讨论. 这里是简单的列表 ...
- Android项目编译和使用C语言动态库(so库)
编译SO库 1.新建工程,建立jni目录用于放置c语言相关文件 2.编写Android.mk文件 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) ...
- iOS9 HTTP 通信报错解决方案
UIWebView *myview = [[UIWebView alloc] initWithFrame:CGRectMake(, , [UIScreen mainScreen].bounds.siz ...
- WPF 命令基础
1命令的组成 命令源:就是谁发送的命令. 命令目标:就是这个命令发送给谁,谁接受的命令. 命令:就是命令的内容. 命令关联:就是把命令和外围的逻辑关联起来,主要用来判断命令是否可以执行和执行完以后干点 ...
- cocoapods卸载与安装的各种坑
在mac上安装cocoapods,一路的坑啊,无数报错啊有木有! 本以为安装很简单,mac下都自带ruby,使用ruby的gem命令即可下载安装: $ sudo gem install cocoapo ...
- js 浮点运算出现的精度丢失问题
var myf='6.202555'; myf=Number(myf).toFixed(2);//使用方法 Number.prototype.toFixed = function(scale) { v ...