"""说明:对于一个指定的序列,如果需要获得一个只包含该序列中不重复的序列时,使用以下算法:"""seq=['a','a','b','c','c','d']res=[]forelinseq:ifelnotinres:res.append(el)printres
分类:
编程语言 时间:
2015-01-15 20:07:06
阅读次数:
272
首先看一下效果图:
整个页面布局为:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:back...
分类:
移动开发 时间:
2015-01-15 18:14:37
阅读次数:
199
代码编写做好准备工作后,终于可以开始写我们的hello android了,在开始编写代码之前,我们先了解几个文件:res/layout/main.xml App主窗体布局文件,你的应用长什么样都在这边定义,有Design和Text两种模式res/values/strings.xml 可以理解为i18n文件,这个文件用来存放程序调用的各种字符串src/com/example/helloandroid...
分类:
移动开发 时间:
2015-01-15 16:12:34
阅读次数:
194
现在常见的广告栏效果,自动切换广告,也可手动滑动切换。
我用ViewPager实现的,废话不多说,上代码:
1、布局文件 layout_ad_pager.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width=...
分类:
移动开发 时间:
2015-01-15 16:03:05
阅读次数:
181
转载请注明出处:
Drawable Animation(Frame Animation):帧动画,连续播放和播放gif图片的效果是一样的。
可以使用xml构建Drawable Animation,也可以使用代码编写Drawable Animation动画
下面先介绍使用xml构建Drawable Animation动画
在res目录下新建anim目录
创建xml文件
例如:
drw...
分类:
移动开发 时间:
2015-01-15 14:22:51
阅读次数:
149
题目:EPI 13.12
我的代码与书上的代码略有不同,是从题目13.11 中得到的启发。方法是先把数组A排序,然后用一个变量cur记录当前已经遍历的区间的交集,cur初始化为A[0],从A[1]开始遍历数组,若当前遍历到的元素A[i] 与 cur有交集,则更新cur;若没有交集,则从cur中选一个点填入返回值res,然后cur=A[i]。
typedef int TimeType;...
分类:
编程语言 时间:
2015-01-15 14:21:58
阅读次数:
151
一:文本的颜色选择器:在res目录下面创建color文件夹,在color文件夹下面创建font_style_colors.xml文件在布局文件中使用字体颜色选择器二、关于Calener的比较calendar的compareto测试时出现了两个时间相等,但比较结果不是我断言的,经高人指点,这才明白,原...
分类:
移动开发 时间:
2015-01-15 10:35:52
阅读次数:
495
1 public int titleToNumber(String s) {2 if(s.length()==0) return 0;3 int res=0;4 for(int i=0;i<s.length();i++)5 {...
分类:
其他好文 时间:
2015-01-14 22:41:44
阅读次数:
243
public String convertToTitle(int n) { String res=""; while(n>26) { if(n%26==0) { res="Z"+r...
分类:
其他好文 时间:
2015-01-14 22:35:06
阅读次数:
227
1 import android.content.Context; 2 import android.content.res.TypedArray; 3 import android.graphics.Bitmap; 4 import android.graphics.BitmapShad...
分类:
其他好文 时间:
2015-01-14 19:57:30
阅读次数:
204