sub_mb_pred( mb_type ) { for( mbPartIdx = 0; mbPartIdx 0 | | mb_field_decoding_flag ) && mb_type != P_8x8ref0 && sub_mb_type[ mbPartIdx ] != B_Direct_8x8 && SubMbPredMode( sub_mb_type[ mbPartIdx ] ) != Pred_L1 ) ref_idx_l0[ mbPartIdx ] for( mbPartIdx = 0; mbPartIdx 0 | | mb_f Read More
posted @ 2013-07-25 18:07
javawebsoa
Views(329)
Comments(0)
Diggs(0)
比如我们已经知道f1=1,f2=1,fn=a*fn-2+b*fn-1。用普通方法求fn就是一个循环。从3循环到n,时间复杂度为O(n)。下面用另一种方法求fn的值。设矩阵 A = B =则A*B= *=A*A*B = A*(A*B) = *=A*A*….*B=A(n-2) *B = 式(1)如何求一个数a的b次幂a^b(使用快速幂算法,时间复杂度为lgn)。假设b=6,用二制表示就是2^2*1+2^1*1+2^0*0 (6的二进制为110)则a^b=a^(2^2+2^1)=a^(2^2)*a^(2^1) 注:A^(x+y)=A^x*A^y求a^b的C伪代码result=1;while(b!=. Read More
posted @ 2013-07-25 18:05
javawebsoa
Views(285)
Comments(0)
Diggs(0)
1:publicclassArrayAdapterActivityextendsListActivity{ @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //列表项的数据 String[]strs={"1","2","3","4","5"}; ArrayAdapteradapter=newArrayAdapter(this,android.R.layout.s Read More
posted @ 2013-07-25 18:03
javawebsoa
Views(356)
Comments(0)
Diggs(0)
好吧,我们今天来聊聊SoundPool这东西。据说这个东西是冰激凌(Android4.0)里才引入的一个新东西。按照官方的意思大多数情况下是给游戏开发用的,比如一个游戏10关,它能在游戏开始前一次加载所有10关的背景音乐,这其中也包括了解码操作,当真正要播放时候就直接把音频数据写设配了,大家自己琢磨下到底有什么好处,我自己确实没觉得特别大的好处。扯淡完了就开始说正题了。老规矩,开撸之前比如得有个洞吧,就是入口,你们懂得。这里我就以拍照音的播放来做切入点一步步分析它是怎么工作的。(当然你自己也可以搜一下SoundPool来找入口点。但话说这玩样儿确实被google造了出来,但是用的却很少。)这里 Read More
posted @ 2013-07-25 18:00
javawebsoa
Views(1731)
Comments(0)
Diggs(0)
#include #include #include #include #include #include using namespace std;const int maxn=1005;const double eps=1e-6;const double inf=0xffffffff;struct node{ double x,y,h;}no[maxn];int n; bool visited[maxn]; double weight[maxn][maxn],c[maxn][maxn],d[maxn][maxn];double up,down;double dis(node &a,n Read More
posted @ 2013-07-25 17:59
javawebsoa
Views(222)
Comments(0)
Diggs(0)
找了一些资料,然后我是用到了MySQL字符串处理中的两个函数concat()和left()1、【CONCAT(str1,str2,...) 返回来自于参数连结的字符串。如果任何参数是 NULL, 返回 NULL。可以有超过2个的参数。一个数字参数被变换为等价的字符串形式。 [示例] select CONCAT('My', 'S', 'QL'); -> 'MySQL' select CONCAT('My', NULL, 'QL'); -> NULLselect CONCAT(14.3); Read More
posted @ 2013-07-25 17:57
javawebsoa
Views(1835)
Comments(0)
Diggs(0)
一、概念 这是android的Manifest文件,可以看到根节点是application,这就是我们要说的类。Application和Actovotu,Service一样是android框架的一个系统组件,当android程序启动时系统会创建一个 application对象,用来存储系统的一些信息。通常我们是不需要指定一个Application的,这时系统会自动帮我们创建,如果需要创建自己 的Application,也很简单创建一个... Read More
posted @ 2013-07-25 17:55
javawebsoa
Views(729)
Comments(0)
Diggs(0)
第一种是实现上下文管理器协议,即魔法方法__enter__和__exit__。class Foo: def __enter__(self): print 'in' def __exit__(self, type, value, trace): print 'out'定义了之后,就可以这样来使用 with Foo(): print 'do something'输出: in do something out 第二种是使用contextlib模块 from contextlib import contextmanager@contextma... Read More
posted @ 2013-07-25 17:53
javawebsoa
Views(184)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号