原创 python學習筆記——1_變量

# coding: UTF-8 #!/usr/bin/python # 測試浮點數 print 10E-4 # 測試 三引號 print ''' This is test. 'what's test?' 'python str

原创 python學習筆記——7_輸入輸出

#coding:UTF-8 #文件 開始 poem='''\ Programming is fun When the work is done if you wanna make your work also fun:

原创 python學習筆記——4_數據結構

#coding:UTF-8 #列表開始 #help(list) shopList=['apple','mango','carrot','banana'] print 'I have',len(shopList),'items to pu

原创 android 內存分析心得

常用的內存分析工具 mat ,可以檢測 內存泄露的地方,具體使用可以百度或谷歌,但是由於安卓版本的不同,圖片存儲位置不一樣(3.0以前是分配在native heap上,3.0以後是分配在VM heap上),而且mat檢測不到nativ

原创 python學習筆記——2_函數

# coding:UTF-8 #定義函數開始 def sayHello(): print 'hello world' sayHello() #結果:hello world #定義函數結束 #===============

原创 python學習筆記——8_異常

#coding:UTF-8 #try.. except 開始 ''' 我們把所有可能引發錯誤的語句放在try塊中,然後在except從句/塊中處理所有的錯誤和異常。 except從句可以專門處理單一的錯誤或異常,或者一組包括在圓括號內的

原创 sudo apt install build-essential

1.sudo apt install build-essential  build-essential : Depends: g++ (>= 4:7.2) but it is not going to be installed      

原创 python學習筆記—— 用的測試文件

poem.txt Programming is fun When the work is done if you wanna make your work also fun: use Python! test_modu

原创 android webView加載gif圖片並且居中顯示

開源的gifView在我使用的時候 內存不釋放,容易引起內存泄露,最後不得不使用webView gif圖片放到asset文件夾下邊, WebViewgf1=(WebView) findViewById(R.id.gif1); gf1.l

原创 java程序的151個建議(一)

建議12:避免用序列化類在構造函數中爲不變量賦值 public class Client implements Serializable{ private static final long serialVersionUID =

原创 java程序的151個建議(二)

public class Client { public static void main(String[] args) { int num1=127; int num2=255; int num3=580; int n

原创 Canvas: trying to use a recycled bitmap android.graphics.Bitmap

public static Bitmap compressBitmap(Bitmap bitmap, int width) { if (bitmap == null) { return null; } Bitmap ou

原创 Ubuntu下搭建android開發環境遇到的一些問題

Ubuntu root默認密碼 Ubuntu如果沒有創建root用戶,但是想切換到root用戶卻不知道密碼怎麼辦:Ubuntu的默認root密碼是隨

原创 ubuntu12.04安裝android源碼編譯環境

android源碼編譯官方教程地址:http://source.android.com/index.html android源碼 模塊 git 下載地址:https://android.googlesource.com/ 執行 $ su

原创 android 定位當前城市

private void getLocationByLocationManager() { LocationManager locationManager = (LocationManager)this