Time of Update: 2018-12-04
1.音訊seekTo最終是在AudioPlayer類中實現的,AudioPlayer::seekTo函數status_t AudioPlayer::seekTo(int64_t time_us) { Mutex::Autolock autoLock(mLock); mSeeking = true;// 設定seek標誌為true mReachedEOS = false;// 可以seek,說明還未到檔案末尾,則結束標識設定為false mSeekTimeUs =
Time of Update: 2018-12-04
以前在模擬器上接螢幕,都是Alt + PrintScreen, 放在畫圖或者ps裡面,再截模數擬器圖片。至少要經過三步才可以,而且畫圖工具儲存的圖片還不清晰。今天看DDMS的用法,Devices裡面有個直接捕捉螢幕(Screen Caption)的功能,超級方便。以模擬器為例,可以把當前模擬器的螢幕拷貝下來放在一個快顯視窗裡,直接點擊Save就可以儲存為png格式的圖片,很清晰。操作如:首先要開啟DDMS視窗,在Window-> Show View -> Other...
Time of Update: 2018-12-04
附註:這篇文章是之前在個人網站寫的,現在轉過來了。今天很榮幸參加了去朝陽區亮馬橋日本國駐華大使館(以下簡稱日使館)參加Yukai Engineering活動,由於文筆很差,不能說是感想,只能說是記錄下一些所見所聞和一些思考。以下以一種簡單瑣碎的形式進行展示。1.溫柔,再次見到了日本人的寒暄和說話辦事,給人的感覺還是一如既往的文明有禮貌
Time of Update: 2018-12-04
// 判斷一個整數的二進位位中有多少個1void totalOne(int x){int count = 0;while(x){x = x & ( x - 1 );count++;}printf("count = %d/n", count);}迴圈: x = x & ( x - 1 ); count++; 直到x為0為止。該方法的時間複雜度是O(m)在此,不妨把x的二進位位表示為
Time of Update: 2018-12-04
我就以這兩款CPU做個比較▼↓CPU比較:華為U8500高通MSM7225 600MHZ CPU和高通MSM 7201A 528MHz CPU 比較再分析CPU:7201是7200A去掉了H264的寫入程式碼7225是7201繼續去掉TV-OUT,USB-HOST等小玩意,大幅度削弱顯示能力效能方面MSM7201強於msm7225 而採用了 MSM7200A 是可以錄製 VGA 30fp MPEG-4 和 VGA 15fps H.264 的視頻的;也能硬解 H.264 VGA
Time of Update: 2018-12-04
使用map實現單詞轉換的程式從map中尋找單詞時必須使用find函數,不能使用下表,因為在map中使用下標訪問不存在的元素將導致在map容器中添加一個新的元素,新元素的key即要尋找的內容。/****************************************************************************** Open file******************************************************************
Time of Update: 2018-12-04
// 遞迴實現字串反轉char *reverse(char *str){if( !str ){return NULL;} int len = strlen(str); if( len > 1 ) { char ctemp =str[0]; str[0] = str[len-1]; str[len-1] = '/0';// 最後一個字元在下次遞迴時不再處理 reverse(str+1); // 遞迴調用
Time of Update: 2018-12-04
在做cms系統時我們經常會用到上一條,下一條或者是上一篇,下一篇,這是我們都會簡單的使用這裡暫訂資料表為news 欄位名為id 當前urlid參數值為currentId如果按照一般的想法,下面是提取上一篇的資訊的sql語句select * from news where id=currentId-1;下面是提取下一篇資訊的sql語句select * from news where
Time of Update: 2018-12-04
關鍵字volatile有什麼含意?並給出三個不同的例子。 一個定義為volatile的變數是說這變數可能會被意想不到地改變,這樣,編譯器就不會去假設這個變數的值了。精確地說就是,最佳化器在用到這個變數時必須每次都小心地重新讀取這個變數的值,而不是使用儲存在寄存器裡的備份。下面是volatile變數的幾個例子: 1). 平行裝置的硬體寄存器(如:狀態寄存器) 2). 一個中斷服務子程式中會訪問到的非自動變數(Non-automatic variables)3). 多線程應用中被幾個任務共用的變數
Time of Update: 2018-12-04
/* * 冒泡排序 */void BubbleSort(int arr[], int n){int temp;for (int i = 0; i < n - 1; i++){for (int j = i + 1; j < n; j++){if (arr[i] > arr[j]){temp = arr[i];arr[i] = arr[j];arr[j] = temp;}}}}/* * 選擇排序 */void ChooseSort(int arr[], int n){int
Time of Update: 2018-12-04
即輸入鏈表1->2->3->4->5,反轉後為5->4->3->2->1。#include "stdafx.h"#include <stdio.h>#include <malloc.h>typedef struct _linka {int data;_linka* next;}linka;// Reverse linkvoid Reverse(linka*& head) {if(head
Time of Update: 2018-12-04
1.先安裝虛擬光碟機Daemon tools lite,不能使用PowerISO,此工具安裝Ubuntu失敗。2.啟動虛擬光碟機Daemon,預設在工作列裡啟動的,載入Ubuntu的iso檔案3.在我的電腦裡,點擊載入了Ubuntu的虛擬光碟機,開啟後選擇在windows
Time of Update: 2018-12-04
public class JavaTest {static boolean fun(char c) {System.out.print(c);return true;}/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubint i = 0;for (fun('A'); fun('B') && i < 2; fun('C'))
Time of Update: 2018-12-04
1. What is important to you in a job? Challenge, the feeling of accomplishment, and knowing that you have made a contribution. 2. Why do you want to work for this organization? Its reputation, the opportunities it offers, and the working conditions.
Time of Update: 2018-12-04
Another date problem, which results from computing dates into the year 2038 and beyond in 32-bit operating systems. Unix and other C applications represent time as the number of seconds from January 1, 1970. The 32-bit variable (time_t) that stores
Time of Update: 2018-12-04
內嵌函式的執行過程與帶參數宏定義很相似,但參數的處理不同。帶參數的宏定義並不對參數進行運算,而是直接替換;內嵌函式首先是函數,這就意味著函數的很多性質都適用於內嵌函式,即內嵌函式先把參數運算式進行運算求值,然後把運算式的值傳遞給形式參數。 內嵌函式與帶參數宏定義的另一個區別是,內嵌函式的參數類型和傳回值類型在聲明中都有明確的指定;而帶參數宏定義的參數沒有類型的概念,只有在宏展開以後,才由編譯器檢查文法,這就存在很多的安全隱患。 使用內嵌函式時,應注意以下問題:
Time of Update: 2018-12-04
typedef struct st_test{int id;char *pName;char class[10];}Student;void fn(Student *pStud) {pStud->id = 10;pStud->pName = "Tom Simith";strcpy(pStud->class, "Class 1");printf("sizeof(pStud) = %d /n", sizeof(pStud));// sizeof(pStud) = 4printf("
Time of Update: 2018-12-04
文章目錄 hasNextnext 使用Collection類的Iterator,可以方便的遍曆Vector, ArrayList, LinkedList等集合元素,避免通過get()方法遍曆時,針對每一種對象單獨進行編碼。樣本:Collection coll = new Vector(); //LinkedList();
Time of Update: 2018-12-04
// service內部類,監聽撥打電話中,如果有電話呼入,則暫停播放,通話結束,繼續播放 public static class PhoneStatReceiver extends BroadcastReceiver { private static boolean bPlayingFlg = false; @Override public void onReceive(Context context, Intent intent) {
Time of Update: 2018-12-04
/* * 窩頭類 */class WoTou {int Id;WoTou(int Id) {this.Id = Id;}public String toString() {return "WoTou " + Id;}}/* * 放窩頭的筐,最多放6個窩頭 */class SyncStack {int index = 0;WoTou[] arrWT = new WoTou[6];// 把窩頭放在筐裡public synchronized void Push(WoTou wt) {while