原创 Android開發常用命令總結
大日誌分割 split -b xm 文件名 7z 文件解壓 7z e 文件名 adb 命令 查看cpu : adb shell busybox top 查看內存: adb shell dumpsys meminfo 進程名(xxx
原创 Android開發筆記:RecyclerView(一)先學會使用
對RecyclerView一直處於一種朦朧的理解狀態,最近項目經常使用RecyclerView,本系列主要從淺入深的總結自己對RecyclerView的理解 前言 面對一個新控件,首先要學會使用,然後再逐步學習其原理,Rec
原创 hdu圖論題目
=============================以下是最小生成樹+並查集====================================== 【HDU】 1213 How Many Tables 基礎並查集★ 1
原创 最大子序列和
求最大子序列的和是一道經典的動態規劃題目:給一個數組,求出數組中和最大的子序列,輸出最大的和,有些題目還需要輸出子序列的開始和結束位置: 題目參考: LeetCode :https://leetcode.com/problems/max
原创 《談話的力量》
一、通過提問促進交談 1,多提開放式問題,怎麼樣、爲什麼、以何種方式。 2,提問題保持願意傾聽的態度。 3,儘量保持雙重視角,換位思考。 4,不要預設答案提問題,例如:以一定很宅吧?說說你平時都做什麼。 二、表達誠實的稱讚
原创 Leetcode495 Teemo Attacting
// C++In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition.
原创 Leetcode 142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify t
原创 Leetcode :Intersection of Two Arrays 兩個數組的交集
LeetCode349. Intersection of Two Arrays Given two arrays, write a function to compute their intersection. Example: G
原创 LeetCode 84. Largest Rectangle in Histogram 單調棧應用
單調棧即棧內元素必須單調增或者單調減,假設有數組arr[2,1,5,6,2,3],求數組中每個數字左右兩邊離他最近的比他小的數, 2: 左邊—無 右邊—1 1: 左邊—無 右邊—無 5: 左邊—1
原创 LeetCode200. Number of Islands 基礎dfs
題目:https://leetcode.com/problems/number-of-islands/description/ dfs尋找聯通區域個數,使用遞歸會超時,要用棧模擬遞歸,代碼如下: class Solution { pub
原创 字典樹的應用:求數組中異或最大的兩個數
求數組中異或最大的兩個數,題目參考 LeetCode:https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/description/ hdoj :http
原创 LeetCode 648. Replace Words 字典樹練習
In English, we have a concept called root, which can be followed by some other words to form another longer word - le
原创 Android將camera獲取到的YuvData在jni中轉化爲Mat
Android中可以通過camera獲取圖像,並實時處理,不同的手機camera支持的的圖像格式不同,可以採用getCameraPreviewFormat來得到preview支持的圖像編碼格式,Android默認使用NV21(yuv420
原创 Android 通過jni返回Mat數據類型
Android 開發過程中爲了實現代碼的高效性,通常要調用本地c++代碼,JNI是java語言提供的和c/c++相互溝通的機制,在使用opencv做圖像處理時,通常要調用c/c++代碼進行相關操作,將處理後的結果返回java進行顯示或者其
原创 Android 一鍵退出應用
最近的項目中需要點擊按鈕一鍵退出系統,方法總結如下: 1.通過發送一條特殊的廣播,每個Activity在收到廣播之後調用finish方法關閉自己即可 2.在application中通過一個Activity類型的list記錄應用中已經打開的