0%

XcodeGhost S: A New Breed Hits the US
November 03, 2015 | By Yong Kang , Zhaofeng Chen, Raymond Wei | Threat Research, Botnets
apple logo grey

Just over a month ago, iOS users were warned of the threat to their devices by the XcodeGhost malware. Apple quickly reacted, taking down infected apps from the App Store and releasing new security features to stop malicious activities. Through continuous monitoring of our customers’ networks, FireEye researchers have found that, despite the quick response, the threat of XcodeGhost has maintained persistence and been modified.

Read more »

作者:JohnGossman (MVVM 模式的创始人)

对于我们什么时候和为什么要使用 M-V-VM 与其它模式我思考了很多。

Read more »

工作中发现的一些问题

在一些公司中,为了测试的方便,经常会使用他们的企业证书去部署应用到测试设备上面。这样看似没什么问题,但是这里隐藏了一个安全问题。就是代码中的方法名和字符串经过反汇编都会一览无余地显示出来。

Read more »

作者:Prateek Gianchandani

译者:吴发伟

原文网址

版权声明:自由转载-非商用-保持署名

本文我们将看看应用在本地存储数据有哪些方法以及这些不同方法的安全性。
我们将会在一个demo上这些这些测试,你可以从我的github账号上下载这个例子程序。对于CoreData的例子,你可以从下载例子程序。本例有一个不同点就是我们将会在模拟器上运行这些应用,而不是在设备上运行。这样做的目的是为了证明在前面文章中的操作都可以通过Xcode来把这些应用运行在模拟器上。当然,你也可以把这应用安装到设备上。

Read more »

HDOJ1007 Quoit Design

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double INF = 1e20;
const int N = 100005;

struct Point
{
double x;
double y;
}point[N];
int n;
int tmpt[N];

bool cmpxy(const Point& a, const Point& b)
{
if(a.x != b.x)
return a.x < b.x;
return a.y < b.y;
}

bool cmpy(const int& a, const int& b)
{
return point[a].y < point[b].y;
}

double min(double a, double b)
{
return a < b ? a : b;
}

double dis(int i, int j)
{
return sqrt((point[i].x-point[j].x)*(point[i].x-point[j].x)
+ (point[i].y-point[j].y)*(point[i].y-point[j].y));
}

double Closest_Pair(int left, int right)
{
double d = INF;
if(left==right)
return d;
if(left + 1 == right)
return dis(left, right);
int mid = (left+right)>>1;
double d1 = Closest_Pair(left,mid);
double d2 = Closest_Pair(mid+1,right);
d = min(d1,d2);
int i,j,k=0;
//分离出宽度为d的区间
for(i = left; i <= right; i++)
{
if(fabs(point[mid].x-point[i].x) <= d)
tmpt[k++] = i;
}
sort(tmpt,tmpt+k,cmpy);
//线性扫描
for(i = 0; i < k; i++)
{
for(j = i+1; j < k && point[tmpt[j]].y-point[tmpt[i]].y<d; j++)
{
double d3 = dis(tmpt[i],tmpt[j]);
if(d > d3)
d = d3;
}
}
return d;
}

int main(){

freopen("/Users/RichardLu/Code/C++/Algorithm/largeNumberSort/largeNumberSort/largeNumberSort/testcase.in", "r", stdin);
freopen("/Users/RichardLu/Code/C++/Algorithm/largeNumberSort/largeNumberSort/largeNumberSort/testcase.out", "w", stdout);

while(true)
{
scanf("%d",&n);
if(n==0)
break;
for(int i = 0; i < n; i++)
scanf("%lf %lf",&point[i].x,&point[i].y);
sort(point,point+n,cmpxy);
printf("%.2lf\n",Closest_Pair(0,n-1)/2);
}
fclose(stdin);
fclose(stdout);

return 0;
}

ACMCoder2009 数列求和

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;



int main(){

freopen("testcase.in", "r", stdin);
freopen("testcase.out", "w", stdout);
double n,m;
while (cin>>n>>m&&n>=0&&m>=0) {
m-=1;
double sum = n;
while (m--) {
n = sqrt((double)n);
sum += n;
}
cout<<setiosflags(ios::fixed)<<setprecision(2)<<(double)sum<<endl;
}
fclose(stdin);
fclose(stdout);

return 0;
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
using namespace std;
int main(){

freopen("testcase.in", "r", stdin);
freopen("testcase.out", "w", stdout);



fclose(stdin);
fclose(stdout);

return 0;
}

HDOJ1002 A + B Problem II

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// main.cpp
// largeNumberSort
//
// Created by Richard on 9/9/15.
// Copyright (c) 2015 luxin. All rights reserved.
//


#include <string>
#include <iostream>

#define MAX_NUM 2000
using namespace std;

int add1[MAX_NUM],add2[MAX_NUM],res[MAX_NUM],tmp;
char tmp1[MAX_NUM],tmp2[MAX_NUM];
int N;

int main() {
cin>>N;
int count = 0;
tmp = 0;
while (count < N) {

memset(add1,0,sizeof(add1));
memset(add2,0,sizeof(add2));
memset(res,0,sizeof(res));
memset(tmp1,0,sizeof(tmp1));
memset(tmp2,0,sizeof(tmp2));

cin>>tmp1>>tmp2;

int len1 = static_cast<int>(strlen(tmp1));
int len2 = static_cast<int>(strlen(tmp2));

for (int i = len1-1,k = 0; i >= 0; --i,++k) {
add1[k] = tmp1[i] - '0';

}

for (int i = len2-1,k = 0; i >= 0; --i,++k) {
add2[k] = tmp2[i] - '0';

}

if (len1 >= len2) {
for (int i = 0; i <= len1; ++i) {
res[i] = (add1[i] + add2[i] + tmp) % 10;
tmp = (add1[i] + add2[i] + tmp) / 10;
}

}else if (len1 < len2) {
for (int i = 0; i <= len2; ++i) {
res[i] = (add1[i] + add2[i] + tmp) % 10;
tmp = (add1[i] + add2[i] + tmp) / 10;
}
}

int len = 0;
if (len1 >= len2) len = len1;
else len = len2;
//TODO: priint it
cout<<"Case "<<(count+1)<<":\n"<<tmp1<<" + "<<tmp2<<" = ";
if (res[len] != 0) cout<<res[len];
for (int i = len-1; i >= 0; --i) {
cout<<res[i];
}
cout<<"\n";
if (count != N-1) {
cout<<"\n";
}
count++;
}

}

ACMCoder2010 水仙花数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <map>
#include <string>
#include <math.h>

using namespace std;



int main(){

freopen("testcase.in", "r", stdin);
freopen("testcase.out", "w", stdout);

int a,b;
while (cin>>a>>b) {
bool flag = false;
for (int i = a; i <= b; ++i) {

int temp = i,result=0;
while (temp) {
result+=pow(temp%10, 3);
temp = temp / 10;
}
if (result == i) {
if (!flag) {
cout<<result;
}else{
cout<<" "<<result;
}
flag = true;
}
}
if (!flag) {
cout<<"no"<<endl;
}else
cout<<endl;
}


fclose(stdin);
fclose(stdout);

return 0;
}