码迷,mamicode.com
首页 > 其他好文
handler looper和messageQueue
一、使用方法。 Looper用来处理消息循环,在创建过程中会初始化MessageQueue。 Handler在其它线程发消息给当前线程 MessageQueue用来存放消息   Looper对象在哪个线程创建,Handler的handleMessage方法就在哪个线程执行   在创建activity时,android系统本身会为activity创建Looper。 final Han...
分类:其他好文   时间:2014-08-13 22:37:07    阅读次数:368
uitableView 选择跳转后 再跳回来 颜色不变 问题
今天遇见过这个问题  以前都没这方面需求所以没有遇见    今天遇见了 网上查了 没有查到 好吧 只能说自己的问题  但是 还好kai哥到 一句话就解决了 ! 就是在- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath中反选回来 如下代码: - (vo...
分类:其他好文   时间:2014-08-13 22:36:27    阅读次数:202
UVA1555-- Garland(推导+二分)
题目链接 题意:有n个灯,给定第一盏灯A的高度,接下去每盏灯的高度按照公式计算,求使所有灯都不会落在地上(允许碰触)的B的最低高度。 思路:根据题目所给公式 Hi=(Hj+1+Hj?1)/2?1,转化为Hi+1=2?Hi?Hi?1+2,当我们已知H1时,我们就可以二分枚举H2,求出符合题意的最小的B #include #include #includ...
分类:其他好文   时间:2014-08-13 22:36:17    阅读次数:296
poj 2828 Buy Tickets
Buy Tickets Time Limit: 4000MS   Memory Limit: 65536K Total Submissions: 13277   Accepted: 6595 Description Railway tickets were difficult to buy around the Lunar New Y...
分类:其他好文   时间:2014-08-13 22:35:37    阅读次数:373
UVA - 12046 Great Numbers
Description Problem G - Great Numbers In this problem you have to count the number of great numbers of length n. Here a great number must have the following property: the number must be divis...
分类:其他好文   时间:2014-08-13 22:35:27    阅读次数:219
poj3268俩次SPFA。。。。。
俩次SPFA。。。。...
分类:其他好文   时间:2014-08-13 22:35:17    阅读次数:284
Yii 不完全解决方案
此文意在记录 Yii 开发过程中的小问题解决方案,不全面,不权威,不是教程。自己写过,觉得可以解决问题,以后也可能用上,就记记吧。...
分类:其他好文   时间:2014-08-13 22:35:07    阅读次数:358
xhEditor实现插入代码功能
如果大家经常使用CSDN或者其他技术博客,都会有插入程序代码或脚本功能...
分类:其他好文   时间:2014-08-13 22:34:57    阅读次数:277
HDU2680 Choose the best route 【Dijkstra】
Choose the best route Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7061    Accepted Submission(s): 2300 Problem Description One ...
分类:其他好文   时间:2014-08-13 22:34:27    阅读次数:312
poj 2406 Power Strings (KMP)
# include # include # include using namespace std; int len; char a[1000010]; int next[1000010]; void Getnext() { int i=0,j=-1; next[0]=-1; while(i<=len) { if(j==-1||a[j]==a[...
分类:其他好文   时间:2014-08-13 22:34:17    阅读次数:262
hdu 4937 Lucky Number ( 进制转换+枚举 )
题意: 有一个数n,问有多少个进制x(基数)使得n转换为x进制后的数字中只有3、4、5、6四个数。 算法: 对于只有一位数的情况,显然3、4、5、6都应该输出-1.   如果有2位数,假设这2位中高位为a,低位为b,进制为base,则 n = a * base + b,解一元一次方程即可。   如果有3位数,假设这3为从高到低分别为a、b、c,进制为base,则 ...
分类:其他好文   时间:2014-08-13 22:34:07    阅读次数:342
Scala基础
REPL     在Scala中的书籍中会提及REPL,REPL(Read-Eval-Print Loop);这被称为“读取-求值-打印”循环。     不带参数的Scala方法通常不使用圆括号,例如,StringOps类的API显示它有一个distinct方法,不带(),其作用是获取字符串中不重复的字符。调用如下: print("hello".distinct); Scaladoc ...
分类:其他好文   时间:2014-08-13 22:33:57    阅读次数:281
poj2752 Seek the Name, Seek the Fame(next数组的运用)
poj2752 Seek the Name, Seek the Fame(next数组的运用)...
分类:其他好文   时间:2014-08-13 22:33:37    阅读次数:320
leetcode--Reverse Words in a String
Problem Description: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". click to show clarification. Clarificat...
分类:其他好文   时间:2014-08-13 22:33:27    阅读次数:276
poj 2886 Who Gets the Most Candies?(线段树+约瑟夫环+反素数)
Who Gets the Most Candies? Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 9934   Accepted: 3050 Case Time Limit: 2000MS Description N children are s...
分类:其他好文   时间:2014-08-13 22:33:17    阅读次数:281
POJ2914 Minimum Cut 最小割集
题目大意是,给定N个顶点,M条边,两个顶点之间可能有多条边,求至少删除多少条边才能将该图分成两个子图。         最小割集,典型的算法Stoer-Wagner,就是那篇论文,这里也就不复制过来了,只是用Prim求最大生成树时,更新的“边”不是普通意义上的边,而是顶点到所有已划分集合中的所有点的边权值和,这里要特别注意~ 直接贴代码~ #include #include #includ...
分类:其他好文   时间:2014-08-13 22:33:07    阅读次数:287
QT程序移植成功
今天终于把QT移植好了,并且交叉编译了helloworld和Clock。     花了好长时间,其实归根结底是不了解交叉编译是什么。     一开始在电脑上安装了QT软件,可以打开新建工程做了个例程,在这个基础上用提供的ARM-LINUX交叉编译器编译程序,一直不能用,最后发现其实自己并没有好好看开发板的文档,有一个文档已经写出了怎样移植QT 。需要重新用ARM-LINUX交叉编译工具编译QT...
分类:其他好文   时间:2014-08-13 22:32:47    阅读次数:236
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!