- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 斐波那契数列(经典递归和动态规划)
斐波那契数列,指的是这样一个数列:1、1、2、3、5、8、13、21、…也就是除了第一个和第二个数以外,每一项都等于前两项之和。使用经典递归的做法如下:public int fib1(int a){ if(a == 1 || a == 0){ return 1; } return fib1(a-1) + fib1(a-2);}但是使用经典递归的方
2014-03-26 17:57:22 635
原创 异或(^)的作用
//求出其中无法成对的数 int[] array = {1, 2, 5, 2, 5, 1, 4}; int single = array[0]; for(int i = 1; i < array.length; i++) { single ^= array[i]; System.out.pri
2013-12-27 14:33:39 475
原创 FCKEditor学习笔记
1.下载FCKEditor压缩包,解压到项目根目录中。2.导入FCKEditor所需要的js可css文件 3.创建FCKEditor文本框。方法一: 使用CKEDITOR.appendTo(“”,config,html) ,可以在指定的DOM对象中创建fckeditor文本框。其中的属性 html 为初始化的时候fckeditor中的值,如果为html
2013-12-25 15:18:14 524
原创 easyUI 中用来判断表单时否通过验证
第一种方法: $("#order_form").form('validate') order_form代表一个表单;第二种方法: if(easyValidateForm('userForm')) userForm代表一个表单;
2013-11-21 11:29:16 1097
原创 java md5
使用java进行MD5加密:ublic class Demo1 { private static char[] md5Str = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; private static String str = null; private
2013-10-22 16:29:12 450
原创 统计某字符串内出现次数最多的字符
String string = "a网定位于我的建设门户、我的工作社区,倾听用户的声音,关注用户的需求是天工生存与发展的根基,网上会员大都是通过口碑相传得知a网,并成为天a的忠实用户";char[] content = string.toCharArray();Map map = new HashMap();for (int i = 0; i < content.length; i++) {if
2013-10-17 11:43:29 543
原创 检测手机上所安装的app
List myApps = new ArrayList(); PackageManager packageManager = getPackageManager(); Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); mAllApps
2013-10-17 11:40:30 625
转载 ViewPager + PagerTabStrip
首先上布局文件:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical
2013-09-11 23:09:56 624
转载 ActivityManager
ActivityManager 获取方法ActivityManagermActivityManager(ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); 常用的静态内部类如下(下面具体介绍): ActivityManager.MemoryInfo: 系统可
2013-09-06 19:07:48 482
原创 小知识,随时更新
一跳转activity就弹出输入法 : 在activity的属性中加入android:windowSoftInputMode="stateVisible" 不行就再加一个焦点
2013-09-03 12:45:55 468
原创 TextView单击链接弹出Activity 和 SpannableString的用法(一部分转载,代码自己编写)
SpannableStringTextView是用来显示文本的,有时需要给TextView中的个别字设置为超链接,或者设置个别字的颜色、字体等,那就需要用到Spannable对象,可以借助Spannable对象实现以上设置myTextView = (TextView) this.findViewById(R.id.myTextView); //创建一
2013-07-30 10:58:34 584
转载 Tab的学习和使用
TabHost 那么我们要用到的Tab载体是TabHost,需要从TabActivity.getTabHost获取。 现在看看TabHost类,它有3个内嵌类:1个类TabHost.TabSpec,2个接口TabHost.TabContentFactory和TabHost.OnTabChangeListener。后面会介绍这些类和接口。 TabHost类的一些函数:
2013-07-29 22:24:48 486
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人