- 博客(76)
- 资源 (3)
- 收藏
- 关注
原创 LeetCode String to Integer(atoi)
public class Solution { public int atoi(String str) { if (str == null || str.length() < 1) return 0; str = str.trim(); char sign = '+'; int i = 0;
2014-04-29 19:36:14 538
原创 LeetCode Longest Palindromic Substring(最长回文子串)
public class Solution { public String longestPalindrome(String s) { int len = s.length(); if (len <= 1) return s; boolean[][] table = new boolean[len][len];
2014-04-29 19:20:02 632
原创 UVa229 - Scanner(枚举技巧)
Scanner A body scanner works by scanning a succession of horizontal slices through the body; the slices are imaged one at a time. The image slices can be reassembled to form a three dime
2014-04-28 21:47:16 861
原创 UVa219 - Department of Redundancy Department(DFS)
Department of Redundancy Department When designing tables for a relational database, a functional dependency (FD) is used to express the relationship between the different fields. A func
2014-04-22 17:17:59 683
原创 Bitmap的使用(二)
开启图片抓拍,同时设置存储文件名:imageFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "a.jpg";Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);i.putExtra(android.
2014-04-21 22:53:53 676
原创 Bitmap的使用(一)
BitmapFactory.decodeResource(Resources, int id)package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.graphics.BitmapFactory;import android.graphics
2014-04-21 21:32:50 639
原创 UVa11968 - In The Airport
R — In The AirportTime Limit: 1 secMemory Limit: 32 MBIt’s a Wednesday night and Bob is sitting at the airport and waiting for an airplain to Lithuania. The challenge he is facing is to c
2014-04-19 22:17:38 690
原创 UVa11413 - Fill the Containers(最大值最小化问题)
Problem C : Fill the ContainersTime Limit: 1 secA conveyor belt has a number of vessels of different capacities each filled to brim with milk. The milk from conveyor belt is to be filled i
2014-04-19 20:49:38 1692
原创 UVa11549 - Calculator Conundrum (Floyd判圈法)
Problem CCALCULATOR CONUNDRUMAlice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time waster.She enters a number k then repe
2014-04-19 19:30:48 759
原创 TextWatcher的使用
实现接口的三个方法public void afterTextChanged(Editable s)public void beforeTextChanged(CharSequence s, int start, int count, int after) { }public void onTextChanged(CharSequence s, int start, int before
2014-04-17 21:45:44 1108
原创 TextSwitcher的使用(一)
创建文本变化的动画效果package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.view.Gravity;import android.view.View;import android.view.animation.Animation;impo
2014-04-17 21:31:48 1199
原创 TabHost的使用(三):动态添加Tab
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.widget.TabHost;import android.widget.Button;import android.view.View;import android.widget.An
2014-04-17 21:20:52 1746
原创 TabHost的使用(二):实现TabHost.TabContentFactory接口
实现TabHost.TabContentFactory接口,要实现public View createTabContent(String text)
2014-04-17 21:01:45 1433
原创 TabHost的使用(一)
添加两个tab,一个放时钟,一个放按钮package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.widget.TabHost;public class MainActivity extends Activity { @Over
2014-04-17 20:52:10 654
原创 SurfaceHolder的使用
package com.example.androidtest;import android.app.Activity;import android.graphics.Canvas;import android.graphics.Paint;import android.os.Bundle;import android.util.Log;import android.view.Key
2014-04-16 22:39:06 3387
原创 Spinner的使用(一):与ArrayAdapter的配合使用
在处理Spinner的OnItemSelectedListener时,要重写接口的两个方法:public void onItemSelected(AdapterV
2014-04-16 22:23:29 871
原创 SlidingDrawer的使用(一)
在资源文件中布局SlidingDrawer,而SlidingDrawer中放置一个ImageView和一个AnalogClo
2014-04-16 22:10:39 586
原创 SeekBar的使用(二):控制Button的缩放,移动及旋转
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.widget.Button;import android.widget.SeekBar;import android.util.Log;public class MainActivit
2014-04-16 22:03:08 1208
原创 SeekBar的使用(一):实现OnSeekBarChangListener
实现OnSeekBarChangeListener,要实现该接口的三个方法public void on
2014-04-16 21:50:11 3218 1
原创 UVa941 - Permutations
A permutation of a string is the set of all possible ways to combine its characters. E.g., the permutation of "abc" is {"abc", "acb", "bac", "bca", "cab", "cba"}. The size of this set is the factorial
2014-04-16 21:01:51 703
原创 hdu1027 Ignatius and the Princess II(排列问题)
Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebub has to beat our hero first.
2014-04-15 23:41:24 1011
原创 ImageSwitcher的使用(一):与Gallery配合使用
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.content.Context;import android.content.res.TypedArray;import android.view.View;import android
2014-04-15 19:10:17 664
原创 GridView的使用(三):与SimpleCursorAdapter搭配使用
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.database.Cursor;import android.provider.Contacts.People;import android.widget.GridView;import
2014-04-14 21:58:18 990
原创 GridView的使用(二):与BaseAdapter搭配使用
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.
2014-04-14 21:40:08 1433
原创 GridView的使用(一):与ArrayAdapter搭配使用
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.
2014-04-14 21:26:04 2192
原创 Gallery的使用(二):显示抓拍的图片
package com.example.androidtest;import android.os.Bundle;import android.app.Activity;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import a
2014-04-13 11:33:59 627
原创 java中Collections的接口及类层次图
1、Collection和CollectionsCollection和Collections是两个不两只的概念
2014-04-12 22:03:17 1228
Ubuntu Linux实用学习教程.pdf
2009-09-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人