Categories
爪机爪机

[转载] 美国V版HTC Droid DNA支持电信3G上网的破解方法(改Radio)

本文转载自:
http://droiddna.diypda.com/thread-942842-1-1.html
==========================================
美国V版HTC Droid DNA原生并不支持电信3G上网,未经破解或刷了官ROM的原生基带后,电信卡信号上有个小三角,不能3G,需要对基带进行破解。具体方法:
1、从手机上提取radio.img

  • adb shell
  • su
  • 回手机上点授权,出现 # 后输入:
  • dd if=/dev/block/mmcblk0p16 of=/sdcard/radio.img
  • 操作完成后,radio.img会提取到sdcard卡上,提到电脑上进行下一步修改。
  • 手机继续连接电脑,DOS窗口保留着,等下一步还会用。

2、修改radio.img:

  • 用UltraEdit工具打开radio.img
  • 搜索:  257fffff306f257f
  • 替换:  257fffff5a6f257f
  • 鼠标移下一行后,继续:
  • 搜索:  257fffff5a6f257f
  • 替换:  257fffff306f257f
  • 保存后,将radio.img复制到sdcard卡替换原来提取的

、重刷radio.img:上述操作完后,回DOS窗口输入

  • dd if=/mnt/sdcard/radio.img of=/dev/block/mmcblk0p16
  • 如之前己关掉DOS窗口,需重新打开DOS窗口先执行:
  • adb shell
  • su
  • 回手机上点授权,出现 # 后再输入第一条命令

 
如果还是不能上网,用QPST改SIMPLE IP以及[email protected]和vnet.mobi
 

Categories
爪机爪机

HTC 修改Settings.apk使*#*#4636#*#* ##778#之类的指令可用

用不来的原因是Settings.apk里面一个Flag变成False了,就不允许你通过拨号盘输入这些特殊指令。
smalicomandroidsettingsframeworkflagfeature
这个目录底下有个HtcTestFeatureFlags.smali
里面有个函数叫
.method public static final supportDialingSecretCode(Landroid/content/Context;)Z
是管这个事情的
把整个函数直接返回True就行了
 

.method public static final supportDialingSecretCode(Landroid/content/Context;)Z
    .locals 1
    .parameter "context"
    .prologue
    .line 57
    const/4 v0, 0x1
    return v0
.end method
Categories
爪机爪机

HTC CDMA手机3G跳1X的解决办法

  • 问题描述:

在有3G信号的地方,手机也会时不时跳到1X网络。
 

  • 可能原因:

主要出现在拥有4G网络支持的机子上,初步感觉是会寻找4G基站然后跳到了1X,可以通过修改网络制式的方法解决问题。
 

  • 解决方案:

就是修改当前的网络模式,把CDMA/LTE中的LTE去掉。
可行方案:

  1. *#*#4636#*#*,里面有手机测试,把网络改成CDMA auto(PRL)
  2. 如果固件屏蔽了这个东西,下载个调出相关程序的软件设置
  3. 如果手机重启后会恢复原来的设置,可以尝试修改文件
/system/build.prop

里面找到

ro.telephony.default_network=xxx

之类的,比如我原来的是=10的,就是CDMA/EvDo/LTE AUTO
改成

ro.telephony.default_network=4

这个就是 CDMA auto(prl)了
切记区分CDMA only/CDMA auto(prl)/EvDo only,最前面那个只有1X网络,中间的是自动选,后面的那个是只有EvDo(数据)的

Categories
生活琐碎

期末周

期末考就要来了,复习进度上课,痛苦的是网络的外教课还得上一周,希望能有所收获吧。
暑期估计都要在杭州过了,因为浙大那边实验室确认收人了,刚好也好久没回家了。
至于其他学校只能先搁置了,暑假好好表现吧,权衡各方面来说也许呆在杭州前景也挺好。
目前最要紧的事情是把期末考搞定,这个应该是大学生涯最后3门考试周的考试了…要画上圆满的句号。

Categories
生活琐碎

有缘无分?

交大电院那边面试时间刚好跟SRTP答辩冲突,考虑到诸多因素,初步决定还是不去了,虽然南京离上海很近,可是要去的话估计还是得今晚出发什么的。之前软院那边的夏令营因为可能和浙大那边实习冲突,所以也拒绝了,复旦那边嘛估计也差不多状况。就感觉一下子放弃了好多机会,孤注一掷的感觉,不知道最后落得个什么下场。。。
幸好9月份还有正式的推免复试,之前另外了解到一些情况,也向学长打听了点东西,总归这条路不是想象中那么轻松就能走通的。
现在只能指望浙大那边有人要我了?感觉特别被动…

Categories
不学无术

1032. Sharing (25)

时间限制

100 ms
内存限制
32000 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example, “loading” and “being” are stored as showed in Figure 1.

Figure 1
You are supposed to find the starting position of the common suffix (e.g. the position of “i” in Figure 1).
Input Specification:
Each input file contains one test case. For each case, the first line contains two addresses of nodes and a positive N (<= 105), where the two addresses are the addresses of the first nodes of the two words, and N is the total number of nodes. The address of a node is a 5-digit positive integer, and NULL is represented by -1.
Then N lines follow, each describes a node in the format:
Address Data Next
where Address is the position of the node, Data is the letter contained by this node which is an English letter chosen from {a-z, A-Z}, andNext is the position of the next node.
Output Specification:
For each case, simply output the 5-digit starting position of the common suffix. If the two words have no common suffix, output “-1” instead.
Sample Input 1:

11111 22222 9
67890 i 00002
00010 a 12345
00003 g -1
12345 D 67890
00002 n 00003
22222 B 23456
11111 L 00001
23456 e 67890
00001 o 00010

Sample Output 1:

67890

Sample Input 2:

00001 00002 4
00001 a 10001
10001 s -1
00002 a 10002
10002 t -1

Sample Output 2:

-1

 

====================================
没啥技术含量的题,记得早些年数据结构期中考考过,当时觉得好难
其实如果标记下走过哪里的话就好简单
没啥好说的,注意输出格式,比如1要变成00001
===================================

#include 
#include 
#include  // std::setfill, std::setw
using namespace std;
#define END_OF_NODE -1
#define MAX_NODE_QTY 100000
struct Node
{
	char letter;
	int nextPtr;
	bool visited;
	Node()
	{
		nextPtr = END_OF_NODE;
		visited = false;
	}
};
Node nodes[MAX_NODE_QTY];
int main()
{
	int root_A_ptr, root_B_ptr;
	int N;
	scanf("%d %d %d", &root_A_ptr, &root_B_ptr, &N);
	//Read node infomation
	for(int i=0; i

测试点 结果 用时(ms) 内存(kB) 得分/满分
0 答案正确 0 1650 10/10
1 答案正确 0 1770 1/1
2 答案正确 0 1900 8/8
3 答案正确 0 1630 1/1
4 答案正确 0 1780 2/2
5 答案正确 30 1900 3/3

Categories
免费VρN发布

免费联通WiFi账号/密码

手头有一堆联通WiFi的账号,如果有需要的请回复你的邮箱地址索要。
有些省市的不支持多人同时登录,有些可以,有些可能临时无法使用,免费的嘛反正~你懂的
总有一个能用的

Categories
不学无术

1007. Maximum Subsequence Sum (25)

时间限制

400 ms
内存限制
32000 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, given sequence { -2, 11, -4, 13, -5, -2 }, its maximum subsequence is { 11, -4, 13 } with the largest sum being 20.
Now you are supposed to find the largest sum, together with the first and the last numbers of the maximum subsequence.
Input Specification:
Each input file contains one test case. Each case occupies two lines. The first line contains a positive integer K (<= 10000). The second line contains K numbers, separated by a space.
Output Specification:
For each test case, output in one line the largest sum, together with the first and the last numbers of the maximum subsequence. The numbers must be separated by one space, but there must be no extra space at the end of a line. In case that the maximum subsequence is not unique, output the one with the smallest indices i and j (as shown by the sample case). If all the K numbers are negative, then its maximum sum is defined to be 0, and you are supposed to output the first and the last numbers of the whole sequence.
Sample Input:

10
-10 1 2 3 4 -5 -23 3 7 -21

Sample Output:

10 1 4

==============================================
这是一个经典问题,可以利用《编程珠玑》第8章<算法设计技术>里面的扫描算法
算法不写了,书上一模一样的原题,伪代码如下:

maxsofar = 0
maxendinghere = 0
for i = [0,n)
    /* invariant: maxendinghere and maxsofar
       are accurate for x[0..i-1] */
    maxendinghere = max(maxendinghere + x[i], 0)
    maxsofar = max(maxendinghere, maxsofar)

只不过这里输出的时候要输出首末位置的数字,所以加了一些变量。
什么时候会改变首末位置呢:
1. maxEndingHere == 0的时候,表示如果后面还会有更好的结果的话,肯定开始的位置是从这个点之后的一个数字开始的。此时要记录可能会产生gap,留给后续处理
2.当到达vStartIndex,别忘了记下<可能的>新的起点
3.当后面那一坨真的比原来的值还大时,如果存在gap,那要用新的起点替换掉旧的,然后吧gap开关关上,一个新的开始
4.当算出来总数maxEndingHere比maxSofar大时,别忘了记下当前位置的数值作为末尾数值
另外要注意,如果全是负值怎么处理,特别注意这样的输入,不能以maxSofar是否>0判断

3
-1 0 -1

代码中startIndex与endIndex是不必要存储的。
=============================================

#include 
#include  //max
using namespace std;
int main()
{
	int N;
	scanf("%d", &N);
	long maxSofar = 0;
	long maxEndingHere = 0;
	int startVal = 0;
	int startIndex = -1;  //
	int vStartIndex = 0;//
	int vStartVal = 0;
	int endIndex = -1;//
	int endVal = 0;
	bool hasGap = true;
	bool allNegative = true;
	//int *savedVals = new int[N];
	int totalStartVal;
	int totalEndVal;
	for(int i=0; i= 0 && allNegative)
			allNegative = false;
		if(i==0)
			totalStartVal = inputVal;
		else if(i == N-1)
			totalEndVal = inputVal;
		//savedVals[i] = inputVal;
		maxEndingHere = max( maxEndingHere + inputVal, (long)0);
		if(maxEndingHere == 0)
		{
			hasGap = true;
			vStartIndex = i+1;
		}
		if(i == vStartIndex)
			vStartVal = inputVal;
		if( maxEndingHere > maxSofar)
		{
			maxSofar = maxEndingHere;
			endIndex = i;
			endVal = inputVal;
			if(hasGap)
			{
				startIndex = vStartIndex;
				startVal = vStartVal;
				hasGap = false;
			}
		}
	}
	if(!allNegative)
		printf("%ld %d %d", maxSofar, startVal, endVal);
	else
		printf("%ld %d %d", maxSofar, totalStartVal, totalEndVal);
	return 0;
}

测试点 结果 用时(ms) 内存(kB) 得分/满分
0 答案正确 0 750 2/2
1 答案正确 0 790 1/1
2 答案正确 0 790 3/3
3 答案正确 0 790 4/4
4 答案正确 0 790 4/4
5 答案正确 0 790 3/3
6 答案正确 0 790 3/3
7 答案正确 0 750 5/5

Categories
不学无术

1027. Colors in Mars (20)

1027. Colors in Mars (20)

时间限制
400 ms
内存限制
32000 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The only difference is that they use radix 13 (0-9 and A-C) instead of 16. Now given a color in three decimal numbers (each between 0 and 168), you are supposed to output their Mars RGB values.
Input
Each input file contains one test case which occupies a line containing the three decimal color values.
 
Output
For each test case you should output the Mars RGB value in the following format: first output “#”, then followed by a 6-digit number where all the English characters must be upper-cased. If a single color is only 1-digit long, you must print a “0” to the left.
Sample Input

15 43 71

Sample Output

#123456

 

===============================
没啥技术含量。
===============================

#include 
#include 
using namespace std;
string GetRGBVal(int val)
{
	char ret[3];
	ret[2] = '';
	int count = 1;
	while( count >= 0)
	{
		if(val == 0)
			ret[count] = '0';
		int temp = val % 13;
		if(temp >9)
		{
			temp -= 10;
			temp += 0x41;
		}
		else
			temp += 0x30;
		val /= 13;
		ret[count--] = (char)temp;
	}
	return string(ret);
}
int main()
{
	int rgb[3];
	cin >> rgb[0] >> rgb[1] >> rgb[2];
	cout << "#";
	for(int i=0; i<3; i++)
	{
		cout << GetRGBVal(rgb[i]);
	}
	return 0;
}
Categories
生活琐碎

SJTU软院面试

没啥特别的感觉
老师还不错,边上还有个妹纸…不过貌似是打杂的
别的没什么咯