HDU 5130 Signal Interference(计算几何 + 模板)
HDU 5130 Signal Interference(计算几何 + 模板)
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5130
Description
Two countries A-Land and B-Land are at war. The territory of A-Land is a simple polygon with no more than 500 vertices. For military use, A-Land constructed a radio tower (also written as A), and it's so powerful that the whole country was under its signal. To interfere A-Land's communication, B-Land decided to build another radio tower (also written as B). According to an accurate estimation, for any point P, if the euclidean distance between P and B is no more than k (0.2 ≤ k < 0.8) times of the distance between P and A, then point P is not able to receive clear signals from A, i.e. be interfered. Your task is to calculate the area in A-Land's territory that are under B-Land's interference.
Input
There are no more than 100 test cases in the input.
In each test case, firstly you are given a positive integer N indicating the amount of vertices on A-Land's territory, and an above mentioned real number k, which is rounded to 4 digits after the decimal point.
Then N lines follow. Each line contains two integers x and y (|x|, |y| ≤ 1000), indicating a vertex's coordinate on A's territory, in counterclockwise or clockwise order.
The last two lines of a test case give radio tower A and B's coordinates in the same form as vertexes' coordinates. You can assume that A is not equal to B.
Output
For each test case, firstly output the case number, then output your answer in one line following the format shown in sample. Please note that there is a blank after the ':'.
Your solution will be accepted if its absolute error or relative error is no more than 10-6.
This problem is special judged.
Sample Input
4 0.5000
-1 -1
1 -1
1 1
-1 1
0 0
-1 0
Sample Output
Case 1: 0.2729710441
题意:
给你n个点按照顺时针或者逆时针排序围成多边形,A,B点,让你计算从某点到B点的距离是到A距离的K倍,求这个图形和多边形的相交的面积。
题解:
求的点带入,化简就是一个圆,然后就是圆和多边形的面积交。套模板。
代码:
#include <bits/stdc++.h>
#define eps 1e-8
using namespace std;
struct Point{
double x,y;
Point(double x=0, double y=0):x(x),y(y) {}
void input() { scanf("%lf%lf",&x,&y); }
};
typedef Point Vector;
struct Circle{
Point c;
double r;
Circle(){}
Circle(Point c,double r):c(c),r(r) {}
Point point(double a) { return Point(c.x + cos(a)*r, c.y + sin(a)*r); }
void input() { scanf("%lf%lf%lf",&c.x,&c.y,&r); }
};
int dcmp(double x) {
if(x < -eps) return -1;
if(x > eps) return 1;
return 0;
}
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) == 0 && dcmp(a.y-b.y) == 0; }
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 OnSegment(Point P, Point A, Point B) {
return dcmp(Cross(A-P,B-P)) == 0 && dcmp(Dot(A-P,B-P)) < 0;
}
double DistanceToSeg(Point P, Point A, Point B)
{
if(A == B) return Length(P-A);
Vector v1 = B-A, v2 = P-A, v3 = P-B;
if(dcmp(Dot(v1, v2)) < 0) return Length(v2);
if(dcmp(Dot(v1, v3)) > 0) return Length(v3);
return fabs(Cross(v1, v2)) / Length(v1);
}
double DistanceToLine(Point P, Point A, Point B){
Vector v1 = B-A, v2 = P-A;
return fabs(Cross(v1,v2)) / Length(v1);
}
Point DisP(Point A, Point B){
return Length(B-A);
}
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)) <= 0 &&
dcmp(Cross(A-C,D-C)*Cross(B-C,D-C)) <= 0;
}
Point Zero = Point(0,0);
//sum_ans !!!!!!!fabs()
double TriAngleCircleInsection(Circle C, Point A, Point B)
{
Vector OA = A-C.c, OB = B-C.c;
Vector BA = A-B, BC = C.c-B;
Vector AB = B-A, AC = C.c-A;
double DOA = Length(OA), DOB = Length(OB),DAB = Length(AB), r = C.r;
if(dcmp(Cross(OA,OB)) == 0) return 0;
if(dcmp(DOA-C.r) < 0 && dcmp(DOB-C.r) < 0) return Cross(OA,OB)*0.5;
else if(DOB < r && DOA >= r) {
double x = (Dot(BA,BC) + sqrt(r*r*DAB*DAB-Cross(BA,BC)*Cross(BA,BC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return asin(TS*(1-x/DAB)*2/r/DOA)*r*r*0.5+TS*x/DAB;
}
else if(DOB >= r && DOA < r) {
double y = (Dot(AB,AC)+sqrt(r*r*DAB*DAB-Cross(AB,AC)*Cross(AB,AC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return asin(TS*(1-y/DAB)*2/r/DOB)*r*r*0.5+TS*y/DAB;
}
else if(fabs(Cross(OA,OB)) >= r*DAB || Dot(AB,AC) <= 0 || Dot(BA,BC) <= 0) {
if(Dot(OA,OB) < 0) {
if(Cross(OA,OB) < 0) return (-acos(-1.0)-asin(Cross(OA,OB)/DOA/DOB))*r*r*0.5;
else return ( acos(-1.0)-asin(Cross(OA,OB)/DOA/DOB))*r*r*0.5;
}
else return asin(Cross(OA,OB)/DOA/DOB)*r*r*0.5;
}
else {
double x = (Dot(BA,BC)+sqrt(r*r*DAB*DAB-Cross(BA,BC)*Cross(BA,BC)))/DAB;
double y = (Dot(AB,AC)+sqrt(r*r*DAB*DAB-Cross(AB,AC)*Cross(AB,AC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return (asin(TS*(1-x/DAB)*2/r/DOA)+asin(TS*(1-y/DAB)*2/r/DOB))*r*r*0.5 + TS*((x+y)/DAB-1);
}
}
Point s[600],A,B ;
int main()
{
int n ;
int _t = 0;
while (~scanf("%d",&n)){
double k ;
_t++ ;
scanf("%lf",&k) ;
for (int i = 1;i <= n; i++)
s[i].input();
A.input();B.input();
s[n+1] = s[1];
double D,E,F;
D = (2.0*k*k*A.x - 2.0*B.x)/(1.0-k*k) ;
E = (2.0*k*k*A.y - 2.0*B.y)/(1.0-k*k) ;
F = (B.x*B.x+B.y*B.y-k*k*(A.x*A.x+A.y*A.y))/(1.0-k*k) ;
Circle C = Circle(Point(D*(-0.5),E*(-0.5)),sqrt(D*D+E*E-4.0*F)*0.5) ;
double ans = 0.0;
for (int i = 1; i <= n; i++){
ans = ans + TriAngleCircleInsection(C,s[i],s[i+1]) ;
}
printf("Case %d: %.10lf\n",_t,fabs(ans)) ;
}
return 0;
}
HDU 5130 Signal Interference(计算几何 + 模板)的更多相关文章
- HDU 5130 Signal Interference --计算几何,多边形与圆的交面积
题意: 求所有满足PB <= k*PA 的P所在区域与多边形的交面积. 解法: 2014广州赛区的银牌题,当时竟然没发现是圆,然后就没做出来,然后就gg了. 圆的一般式方程: 设A(x1,y1) ...
- hdu 4667 Building Fence < 计算几何模板>
//大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string ...
- LA 7072 Signal Interference 计算几何 圆与多边形的交
题意: 给出一个\(n\)个点的简单多边形,和两个点\(A, B\)还有一个常数\(k(0.2 \leq k < 0.8)\). 点\(P\)满足\(\left | PB \right | \l ...
- HDU5130 Signal Interference
/* HDU5130 Signal Interference http://acm.hdu.edu.cn/showproblem.php?pid=5130 计算几何 圆与多边形面积交 * */ #in ...
- lrj计算几何模板
整理了一下大白书上的计算几何模板. #include <cstdio> #include <algorithm> #include <cmath> #include ...
- UVA 12304 - 2D Geometry 110 in 1! - [平面几何基础题大集合][计算几何模板]
题目链接:https://cn.vjudge.net/problem/UVA-12304 题意: 作为题目大合集,有以下一些要求: ①给出三角形三个点,求三角形外接圆,求外接圆的圆心和半径. ②给出三 ...
- HDU - 5130 :Signal Interference (多边形与圆的交)
pro:A的监视区域是一个多边形. 如果A的监视区的内满足到A的距离到不超过到B的距离的K倍的面积大小.K<1 sol:高中几何体经验告诉我们满足题意的区域是个圆,那么就是求圆与多边形的交. # ...
- hdu 5130(2014广州 圆与多边形相交模板)
题意:一个很多个点p构成的多边形,pb <= pa * k时p所占区域与多边形相交面积 设p(x,y), (x - xb)^2+(y - yb)^2 / (x - xa)^2+(y ...
- hdu 3060 Area2 (计算几何模板)
Problem Description 小白最近又被空军特招为飞行员,参与一项实战演习.演习的内容还是轰炸某个岛屿(这次的岛屿很大,很大很大很大,大到炸弹怎么扔都能完全在岛屿上引爆),看来小白确实是飞 ...
随机推荐
- GTK、KDE、Gnome、XWindows 图形界面
一.linux图形界面的实现只是linux下的应用程序实现图形界面(GUI)并不是linux的一部分,linux只是一个基于命令行的操作系统,linux和Xfree的关系就相当于当年的DOS和Wind ...
- 还原数据时出现的“FILESTREAM功能被禁用”问题
解决SQLSERVER在还原数据时出现的“FILESTREAM功能被禁用”问题 解决SQLSERVER在还原数据时出现的“FILESTREAM功能被禁用”问题 今天由于测试需要,在网上下载了Adven ...
- C# 与 C++强强联合--C#中的指针
C# 与 C++强强联合--C#中的指针 非常的不好意思,距离上次随笔C# 与 C++强强联合已经过去快1个月了.承诺大家的C#指针和A*算法迟迟未上.为表歉意献上美女一枚 哈哈.流口水了吧 话归正题 ...
- C#中WindowsForm常见控件的运用
C#中WindowsForm常见控件的运用 -- 1.button(曹操,贡天子以令不臣): 属性;text:我们经常可以看见将按钮命名为“登入”,在其属性面板里面编辑text即可:如下图: ...
- MS Sql Server 消除重复行 保留信息完整的一条 2011-11-26 13:19(QQ空间)
select company ,count(company) as coun into myls from mylist group by company having count(company)& ...
- Android实现通过手机找回密码
其实这篇文章有点标题党,代码没有几行,真不好意思,但是确实给出了解决方案,这个我觉得还是很重要的,代码写了几年之后其实比较注重的就是思路跟方法了. 背景:手机客户端有这么一个需求,用户忘记密码了,然后 ...
- 弃用个人博客站重返CSDN缘由
最近悄然关闭了自己的个人博客小站,重新返回了CSDN写博客.恰逢周末,闲暇尚有,敲击键盘记录一下. 其实最初关闭个人基于SAE的个人博客站是一周前开始的,想想自己的博客已经有两周年多的时间了,刚刚创建 ...
- 用indexOf获取字符窜某个字符的所有位置
indexOf方法可以传两个参数,第二个参数是传位置的参数,利用这点获取所有的位置.例如: var str = "hello world,welcome!"; var arr = ...
- npm scripts + webpack 实践经验(React、Nodejs)
最近用Webpack+npm scripts+Mongodb+Nodejs+React写了个后台项目,在用Webpack构建过程中遇到了许多坑,就写出来分享一下. 构建工具五花八门,想当年刚学会Gru ...
- oracle表空间表分区详解及oracle表分区查询使用方法(转+整理)
欢迎和大家交流技术相关问题: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://g ...
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5130
Description
Two countries A-Land and B-Land are at war. The territory of A-Land is a simple polygon with no more than 500 vertices. For military use, A-Land constructed a radio tower (also written as A), and it's so powerful that the whole country was under its signal. To interfere A-Land's communication, B-Land decided to build another radio tower (also written as B). According to an accurate estimation, for any point P, if the euclidean distance between P and B is no more than k (0.2 ≤ k < 0.8) times of the distance between P and A, then point P is not able to receive clear signals from A, i.e. be interfered. Your task is to calculate the area in A-Land's territory that are under B-Land's interference.
Input
There are no more than 100 test cases in the input.
In each test case, firstly you are given a positive integer N indicating the amount of vertices on A-Land's territory, and an above mentioned real number k, which is rounded to 4 digits after the decimal point.
Then N lines follow. Each line contains two integers x and y (|x|, |y| ≤ 1000), indicating a vertex's coordinate on A's territory, in counterclockwise or clockwise order.
The last two lines of a test case give radio tower A and B's coordinates in the same form as vertexes' coordinates. You can assume that A is not equal to B.
Output
For each test case, firstly output the case number, then output your answer in one line following the format shown in sample. Please note that there is a blank after the ':'.
Your solution will be accepted if its absolute error or relative error is no more than 10-6.
This problem is special judged.
Sample Input
4 0.5000
-1 -1
1 -1
1 1
-1 1
0 0
-1 0
Sample Output
Case 1: 0.2729710441
题意:
给你n个点按照顺时针或者逆时针排序围成多边形,A,B点,让你计算从某点到B点的距离是到A距离的K倍,求这个图形和多边形的相交的面积。
题解:
求的点带入,化简就是一个圆,然后就是圆和多边形的面积交。套模板。
代码:
#include <bits/stdc++.h>
#define eps 1e-8
using namespace std;
struct Point{
double x,y;
Point(double x=0, double y=0):x(x),y(y) {}
void input() { scanf("%lf%lf",&x,&y); }
};
typedef Point Vector;
struct Circle{
Point c;
double r;
Circle(){}
Circle(Point c,double r):c(c),r(r) {}
Point point(double a) { return Point(c.x + cos(a)*r, c.y + sin(a)*r); }
void input() { scanf("%lf%lf%lf",&c.x,&c.y,&r); }
};
int dcmp(double x) {
if(x < -eps) return -1;
if(x > eps) return 1;
return 0;
}
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) == 0 && dcmp(a.y-b.y) == 0; }
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 OnSegment(Point P, Point A, Point B) {
return dcmp(Cross(A-P,B-P)) == 0 && dcmp(Dot(A-P,B-P)) < 0;
}
double DistanceToSeg(Point P, Point A, Point B)
{
if(A == B) return Length(P-A);
Vector v1 = B-A, v2 = P-A, v3 = P-B;
if(dcmp(Dot(v1, v2)) < 0) return Length(v2);
if(dcmp(Dot(v1, v3)) > 0) return Length(v3);
return fabs(Cross(v1, v2)) / Length(v1);
}
double DistanceToLine(Point P, Point A, Point B){
Vector v1 = B-A, v2 = P-A;
return fabs(Cross(v1,v2)) / Length(v1);
}
Point DisP(Point A, Point B){
return Length(B-A);
}
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)) <= 0 &&
dcmp(Cross(A-C,D-C)*Cross(B-C,D-C)) <= 0;
}
Point Zero = Point(0,0);
//sum_ans !!!!!!!fabs()
double TriAngleCircleInsection(Circle C, Point A, Point B)
{
Vector OA = A-C.c, OB = B-C.c;
Vector BA = A-B, BC = C.c-B;
Vector AB = B-A, AC = C.c-A;
double DOA = Length(OA), DOB = Length(OB),DAB = Length(AB), r = C.r;
if(dcmp(Cross(OA,OB)) == 0) return 0;
if(dcmp(DOA-C.r) < 0 && dcmp(DOB-C.r) < 0) return Cross(OA,OB)*0.5;
else if(DOB < r && DOA >= r) {
double x = (Dot(BA,BC) + sqrt(r*r*DAB*DAB-Cross(BA,BC)*Cross(BA,BC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return asin(TS*(1-x/DAB)*2/r/DOA)*r*r*0.5+TS*x/DAB;
}
else if(DOB >= r && DOA < r) {
double y = (Dot(AB,AC)+sqrt(r*r*DAB*DAB-Cross(AB,AC)*Cross(AB,AC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return asin(TS*(1-y/DAB)*2/r/DOB)*r*r*0.5+TS*y/DAB;
}
else if(fabs(Cross(OA,OB)) >= r*DAB || Dot(AB,AC) <= 0 || Dot(BA,BC) <= 0) {
if(Dot(OA,OB) < 0) {
if(Cross(OA,OB) < 0) return (-acos(-1.0)-asin(Cross(OA,OB)/DOA/DOB))*r*r*0.5;
else return ( acos(-1.0)-asin(Cross(OA,OB)/DOA/DOB))*r*r*0.5;
}
else return asin(Cross(OA,OB)/DOA/DOB)*r*r*0.5;
}
else {
double x = (Dot(BA,BC)+sqrt(r*r*DAB*DAB-Cross(BA,BC)*Cross(BA,BC)))/DAB;
double y = (Dot(AB,AC)+sqrt(r*r*DAB*DAB-Cross(AB,AC)*Cross(AB,AC)))/DAB;
double TS = Cross(OA,OB)*0.5;
return (asin(TS*(1-x/DAB)*2/r/DOA)+asin(TS*(1-y/DAB)*2/r/DOB))*r*r*0.5 + TS*((x+y)/DAB-1);
}
}
Point s[600],A,B ;
int main()
{
int n ;
int _t = 0;
while (~scanf("%d",&n)){
double k ;
_t++ ;
scanf("%lf",&k) ;
for (int i = 1;i <= n; i++)
s[i].input();
A.input();B.input();
s[n+1] = s[1];
double D,E,F;
D = (2.0*k*k*A.x - 2.0*B.x)/(1.0-k*k) ;
E = (2.0*k*k*A.y - 2.0*B.y)/(1.0-k*k) ;
F = (B.x*B.x+B.y*B.y-k*k*(A.x*A.x+A.y*A.y))/(1.0-k*k) ;
Circle C = Circle(Point(D*(-0.5),E*(-0.5)),sqrt(D*D+E*E-4.0*F)*0.5) ;
double ans = 0.0;
for (int i = 1; i <= n; i++){
ans = ans + TriAngleCircleInsection(C,s[i],s[i+1]) ;
}
printf("Case %d: %.10lf\n",_t,fabs(ans)) ;
}
return 0;
}
题意: 求所有满足PB <= k*PA 的P所在区域与多边形的交面积. 解法: 2014广州赛区的银牌题,当时竟然没发现是圆,然后就没做出来,然后就gg了. 圆的一般式方程: 设A(x1,y1) ...
//大白p263 #include <cmath> #include <cstdio> #include <cstring> #include <string ...
题意: 给出一个\(n\)个点的简单多边形,和两个点\(A, B\)还有一个常数\(k(0.2 \leq k < 0.8)\). 点\(P\)满足\(\left | PB \right | \l ...
/* HDU5130 Signal Interference http://acm.hdu.edu.cn/showproblem.php?pid=5130 计算几何 圆与多边形面积交 * */ #in ...
整理了一下大白书上的计算几何模板. #include <cstdio> #include <algorithm> #include <cmath> #include ...
题目链接:https://cn.vjudge.net/problem/UVA-12304 题意: 作为题目大合集,有以下一些要求: ①给出三角形三个点,求三角形外接圆,求外接圆的圆心和半径. ②给出三 ...
pro:A的监视区域是一个多边形. 如果A的监视区的内满足到A的距离到不超过到B的距离的K倍的面积大小.K<1 sol:高中几何体经验告诉我们满足题意的区域是个圆,那么就是求圆与多边形的交. # ...
题意:一个很多个点p构成的多边形,pb <= pa * k时p所占区域与多边形相交面积 设p(x,y), (x - xb)^2+(y - yb)^2 / (x - xa)^2+(y ...
Problem Description 小白最近又被空军特招为飞行员,参与一项实战演习.演习的内容还是轰炸某个岛屿(这次的岛屿很大,很大很大很大,大到炸弹怎么扔都能完全在岛屿上引爆),看来小白确实是飞 ...
一.linux图形界面的实现只是linux下的应用程序实现图形界面(GUI)并不是linux的一部分,linux只是一个基于命令行的操作系统,linux和Xfree的关系就相当于当年的DOS和Wind ...
解决SQLSERVER在还原数据时出现的“FILESTREAM功能被禁用”问题 解决SQLSERVER在还原数据时出现的“FILESTREAM功能被禁用”问题 今天由于测试需要,在网上下载了Adven ...
C# 与 C++强强联合--C#中的指针 非常的不好意思,距离上次随笔C# 与 C++强强联合已经过去快1个月了.承诺大家的C#指针和A*算法迟迟未上.为表歉意献上美女一枚 哈哈.流口水了吧 话归正题 ...
C#中WindowsForm常见控件的运用 -- 1.button(曹操,贡天子以令不臣): 属性;text:我们经常可以看见将按钮命名为“登入”,在其属性面板里面编辑text即可:如下图: ...
select company ,count(company) as coun into myls from mylist group by company having count(company)& ...
其实这篇文章有点标题党,代码没有几行,真不好意思,但是确实给出了解决方案,这个我觉得还是很重要的,代码写了几年之后其实比较注重的就是思路跟方法了. 背景:手机客户端有这么一个需求,用户忘记密码了,然后 ...
最近悄然关闭了自己的个人博客小站,重新返回了CSDN写博客.恰逢周末,闲暇尚有,敲击键盘记录一下. 其实最初关闭个人基于SAE的个人博客站是一周前开始的,想想自己的博客已经有两周年多的时间了,刚刚创建 ...
indexOf方法可以传两个参数,第二个参数是传位置的参数,利用这点获取所有的位置.例如: var str = "hello world,welcome!"; var arr = ...
最近用Webpack+npm scripts+Mongodb+Nodejs+React写了个后台项目,在用Webpack构建过程中遇到了许多坑,就写出来分享一下. 构建工具五花八门,想当年刚学会Gru ...
欢迎和大家交流技术相关问题: 邮箱: jiangxinnju@163.com 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://g ...