摘要: char ** intToString (int *a,int lenth){ char ** s = (char **)malloc(lenth*sizeof(int)); for(i<lenth...){ s[i] = (char*)malloc(sizeof(char)*10);//假设每个数不超过10位 sprintf(s[i],"%d",a[i]); } return s;} 阅读全文
posted @ 2014-04-10 15:10 Blue-Dream 阅读(251) 评论(0) 推荐(0)
摘要: import java.io.BufferedReader;import java.io.InputStreamReader;public class Main {public static String res = "";static int findchar(String s,char a){ //s中a出现的位置for(int i=0;i<s.length();i++){ if(a==s.charAt(i)) return i; } return -1; }static void cal_tree(String sa,String sb){ if(sb.leng 阅读全文
posted @ 2014-04-10 14:43 Blue-Dream 阅读(185) 评论(0) 推荐(0)
摘要: int main(void) { char str[] = "now # is the time for all # good men to come to the # aid of their country"; char delims[] = "#"; char *result = NULL;result = strtok( str, delims ); while( result != NULL ) { printf( "%s\n", result ); result = strtok( NULL, delims ); }sys 阅读全文
posted @ 2014-03-05 20:07 Blue-Dream 阅读(234) 评论(0) 推荐(0)
摘要: 单选对话框弹出 final String[] items=new String[list.size()];Iterator iterator=list.iterator();int i=0;while (iterator.hasNext()) {items[i++]=iterator.next();}AlertDialog.Builder aleBuilder=new AlertDialog.Builder(MainActivity.this);aleBuilder.setTitle("选择Appid").setSingleChoiceItems(items, -1, ne 阅读全文
posted @ 2013-08-14 09:52 Blue-Dream 阅读(234) 评论(0) 推荐(0)
摘要: 单元测试1: 2:public String read(String filename)在自己的类中写被测试的方法,如:fileservice类的service方法3:建立测试类public class Test extends AndroidTestCase {private static final String TAG="Test";public void testRead() throws Throwable{FileService service=new FileService(this.getContext());String result=service.re 阅读全文
posted @ 2013-07-31 17:25 Blue-Dream 阅读(258) 评论(0) 推荐(0)
摘要: HttpClient进行网络通信----------------------------------1:get方式String httpUrl = "http://59.64.158.106:8080/test/xxx.jsp"; //HttpGet对象 HttpGet httpGet = new HttpGet(httpUrl); try{ //取得HttpClient对象 HttpClient httpClient = new DefaultHttpClient(); //请求HttpClient,取得HttpResponse HttpResponse httpResp 阅读全文
posted @ 2013-07-31 17:22 Blue-Dream 阅读(227) 评论(0) 推荐(0)