urlListShot

需先在/sdcard/下放入一份UrlList.txt。

檔案裡面儲存你要自動瀏覽的網址,注意最後一行還要再斷行才可以

例如:

程式開啟Browser後瀏覽網址,接著往下滑動並截圖,最後退出Browser回到Home Screen。

   1: #!/bin/bash
   2: #================================================
   3: #               Initial Setup
   4: #================================================
   5: ScreencapPath="/sdcard/AutoSwipe/"
   6: filename="/sdcard/UrlList.txt"
   7:  
   8: mkdir $ScreencapPath
   9: #================================================
  10: i=1
  11: count=1
  12: while [ 1 ]
  13: do
  14:     cat $filename | while read line
  15:     do
  16:         am start -n com.android.browser/.BrowserActivity
  17:         sleep 3
  18:         
  19:         #Search Key
  20:         input keyevent 84
  21:         sleep 1
  22:         
  23:         #Input URL        
  24:         line=${line:0:(${#line}-1)}
  25:         echo "$i-->$line"    
  26:         input text $line
  27:         
  28:         #Enter Key
  29:         input keyevent 66
  30:         sleep 10
  31:         
  32:         #Swipe down
  33:         input swipe 100 600 100 100
  34:         sleep 1
  35:         
  36:         #Take a shot
  37:         dateTime=$(date +"%F_%H-%M-%S")
  38:         screencap -p "$ScreencapPath${i}_$dateTime.png"
  39:         
  40:         #Back to home screen
  41:         input keyevent 3
  42:         sleep 1
  43:         
  44:         i=$((${i}+1))        
  45:     done
  46:     count=$((${count}+1))
  47:     echo "count:$count"
  48: done

toyangel 發表在 痞客邦 留言(0) 人氣()

簡單記錄一下,有空再來整理 ! 

Android 輸入 *#*#4636#*#* 可以進入通用測試模式,裡面有很多資訊,包括手機資訊、電池資訊、使用情形統計資料及WiFi information

iPhone 輸入 *3001#12345#* 可以進入 Field Test 模式,左上角的訊號強度會變成數字,越大表示訊號越好。

toyangel 發表在 痞客邦 留言(0) 人氣()

暫時記一下,有空再來整理

While googling around, I've stumbled upon an interesting project - Android Market API. This project is clearly a result of some Android reverse engineering work, still it's hosted on Google Code site. Funny, isn't it? Oh, by the way - the Android Market protocol uses Google's Protocol Buffers with HTTP as a transport layer.

Anyway, to play with the API you need a Google account (obviously), but also a sort of device identifier referred to as "Android ID". Funny enough, this is not the Android ID which can be obtained usingandroid.provider.Settings.Secure class etc., the right ID can be obtained by "dialing" *#*#8255#*#* - look forDevice ID, remove `android-` prefix.

But is there a way to retrieve this ID programmatically? It required a bit of hacking to reveal, but here's the recipe:

1

toyangel 發表在 痞客邦 留言(0) 人氣()

在Ubuntu下設定Adnroid ADB環境變數:

Step1. gedit /etc/profile

加入

export PATH="$PATH:[sdk放置路徑]/android-sdk-linux_86/platform-tools/"

export PATH="$PATH:[sdk放置路徑]/android-sdk-linux_86/tools/"

toyangel 發表在 痞客邦 留言(0) 人氣()

因為工作上需要以VM執行Ubuntu,每次都要切換root權限好麻煩。

所以乾脆就把ubuntu設定成一開機就以root身分登入,雖然這種習慣不好,不過畢竟只是在VM上做開發,想說就算了沒關係!

環境:Ubuntu 11, 64 bit

Step1: sudo -i ,切換到root

Step2: 修改root password

toyangel 發表在 痞客邦 留言(0) 人氣()

在網路上找到的,真的是還滿方便的!

用SQL Server內建的複製資料庫太麻煩了

基本上,只要貼上下面的語法再改一下DB name就好了

   1: -----------------------------------------------------------
   2: -- 基本上只需要設定 @Source_DB 和 @Target_DB 就可以了    --
   3: -----------------------------------------------------------
   4:  
   5: -- 宣告來源資料庫的名稱
   6: DECLARE @Source_DB nvarchar(256);
   7: -- 宣告來源資料庫的「資料邏輯名稱」
   8: DECLARE @Source_DB_LogicalName_Dat nvarchar(256);
   9: -- 宣告來源資料庫的「紀錄邏輯名稱」
  10: DECLARE @Source_DB_LogicalName_Log nvarchar(256);
  11:  
  12: -- 宣告目的地的資料庫的名稱
  13: DECLARE @Target_DB nvarchar(256);
  14:  
  15: -- 取得資料庫本機的 DATA 資料目錄
  16: DECLARE @data_path nvarchar(256);
  17: DECLARE @data_file_mdf nvarchar(256);
  18: DECLARE @data_file_ldf nvarchar(256);
  19: SET @data_path = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1)
  20:                   FROM master.sys.master_files
  21:                   WHERE database_id = 1 AND file_id = 1);
  22:  
  23: -- 取得資料庫本機的 Backup 資料目錄
  24: DECLARE @backup_path nvarchar(256);
  25: DECLARE @backup_file nvarchar(256);
  26: SET @backup_path = (SELECT SUBSTRING(SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1), 1, CHARINDEX(N'\DATA\', LOWER(physical_name)) - 1) + '\Backup\'
  27:                   FROM master.sys.master_files
  28:                   WHERE database_id = 1 AND file_id = 1);
  29: ----------------
  30: -- 參數設定區 --
  31: ----------------
  32: SET @Source_DB = 'AdventureWorks';
  33: SET @Source_DB_LogicalName_Dat = @Source_DB
  34: SET @Source_DB_LogicalName_Log = @Source_DB + '_log';
  35: SET @Target_DB = 'AdventureWorks_Buckup';
  36:  
  37: SET @backup_file = @backup_path + @Source_DB + '.bak';
  38:  
  39: SET @data_file_mdf = @data_path + @Target_DB + '.mdf';
  40: SET @data_file_ldf = @data_path + @Target_DB + '_log.ldf';
  41:  
  42: -- 先將 @Source_DB 資料庫備份至 Backup 資料夾
  43: BACKUP DATABASE @Source_DB 
  44:    TO DISK=@backup_file;
  45:  
  46: -- 最後將傳回的資料記錄檔還原到 @Target_DB 資料庫
  47: RESTORE DATABASE @Target_DB
  48:    FROM DISK=@backup_file 
  49:    WITH MOVE @Source_DB_LogicalName_Dat TO @data_file_mdf,
  50:    MOVE @Source_DB_LogicalName_Log TO @data_file_ldf;
  51: GO

by the way, 這個能在文章中嵌入程式碼的plugin叫做 Code Snippet

toyangel 發表在 痞客邦 留言(0) 人氣()

vsCode

環境

OS:XP SP3

DB:SQL Server 2005

IDE:Visual Studio 2010

目的:

toyangel 發表在 痞客邦 留言(0) 人氣()

logj4_1

Eclipse也有lo4j的plug-in可以用,但我是第一次學習所以還是自己手動設定產生log檔比較好。

首先先到log4j官網下載最新版程式http://logging.apache.org/log4j/1.2/download.html

下載回來之後放到自己指定的資料夾下即可

在 Eclipse 新增一個 Java Project,輸入檔名後選next,我們要在這邊加入 Log4j 的 JAR 檔。選 Libraries → Add External JARs

選剛剛放到C槽下 Log4j 檔案裡的 JAR 檔

toyangel 發表在 痞客邦 留言(3) 人氣()

Eclipse 上跑 Tomcat 時遇到的問題,錯誤訊息如下:

'Starting Tomcat v6.0 Server at localhost' has encountered a problem.

Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use.

The server may already be running in another process, or a system process may be using the port.

To start this server you will need to stop the other process or change the port number(s).

toyangel 發表在 痞客邦 留言(1) 人氣()

01.png

考試準備:
這個網路上有很多人分享準備過程,我自己也是買了本猛虎回來K,再配合原廠教材花了兩個月的時間準備。
考試的內容範圍參考以原廠公布為主 Oracle Certification Program
再來是兩個不錯的部落格,分享考試心得和準備過程,當然還有更多就靠自己找了!
Payton's Arena

toyangel 發表在 痞客邦 留言(5) 人氣()

1. 必須先存在一個.txt的文字檔。此以檔名 load.txt 為例。

  (檔案格式須存為 UTF-8 格式,可由 notepad++ 實現)
2. 開啟 flash 新檔,以 Action Script 2 為例。
3. 使用文字工具,選用動態文字,並給與實體名稱:LoadText
4. 新增圖層,並給予動作:

toyangel 發表在 痞客邦 留言(0) 人氣()

方法一.

  將要移除超連結的地方一次框起來,按 Ctrl+Shift+F9 就可以了

註:如有表格只限同一表格內的全部超連結

方法二.

  寫一隻程式

toyangel 發表在 痞客邦 留言(1) 人氣()

1 2 3
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。