2011年3月11日 星期五

同時使用git與subversion開發project

接續此篇 -

同時使用subversion與git開發project


B人員使用git開發


A人員使用subversion開發

B人員修改1.txt 並commit to git repository


sync to subversion


A人員使用subversion log功能就可以看出差異



透過Facebook分享

同時使用subversion與git開發project

A人員使用subversion開發
B人員使用git開發

接續此篇

A人員修改1.txt並上傳subversion

此時B人員如何將差異的部份整進local端呢

先確認local端資料

使用git log

git svn log

發現內容上並無差異
代表local的subversion repository比subversion server端來的舊
  • 更新subversion repository
  • Check log

有新的資料
  • Get latest data from subversion
  • 確認資料via git log


Reference:

透過Facebook分享

將原本git維護的專案上傳到subversion server

你需要使用git-svn

 sudo apt-get install git-svn

正在用git開發維護某個project


此時
需要使用subversionr進行維護
先使用git svn init
指定subversion 目錄位置


建立subversion server目錄



接下來將維護的檔案上傳subversion server

  • git repository update from subversion
git svn fetch
Server端目錄不存在會有下列error

  • Subversion update from git repository
  • Check上傳資料


完成


Reference:



透過Facebook分享

使用svn command 建立基本folder - trunk, branches, tags

Subversion線上書建議你要建立這三個目錄 - trunk, branches, and tags

以下節錄書的內容
we suggest that each project root contain a trunk subdirectory for the main development line, a branches subdirectory in which specific branches (or collections of branches) will be created, and a tags subdirectory in which specific tags (or collections of tags) will be created.


需要安裝subversion
sudo apt-get install subversion


方法

  • 建立目錄
mkdir subversioncommand
cd subversioncommand
  • 建立三個標準子目錄
mkdir trunk
mkdir branches
mkdir tags
  • import to subversion server
cd ..
svn import ./subversioncommand/ http://Subversion-Path/subversioncommand

最後使用svn list來看server端的目錄結構

svn list http://Subversion-Path/subversioncommand

branches/
tags/
trunk/




透過Facebook分享

[Android]無法將ID編號超過32的衛星資訊通知回上層

感謝Danny網友詢問有關Android GPS的問題發現以下問題

Android GPS底層Driver在parse GPGSV

會需要將資訊填入GpsSvStatus

/** Represents SV status. */
typedef struct {
        /** Number of SVs currently visible. */
        int         num_svs;

        /** Contains an array of SV information. */
        GpsSvInfo   sv_list[GPS_MAX_SVS];

        /** Represents a bit mask indicating which SVs
         * have ephemeris data.
         */
        uint32_t    ephemeris_mask;

        /** Represents a bit mask indicating which SVs
         * have almanac data.
         */
        uint32_t    almanac_mask;

        /**
         * Represents a bit mask indicating which SVs
         * were used for computing the most recent position fix.
         */
        uint32_t    used_in_fix_mask;
} GpsSvStatus;

可是目前定義的長度只有32bit (uint32_t)

所以當你衛星ID超過32而且是fix的狀態

Android AP會無法得知

會造成某種程度定位資訊上的差異


透過Facebook分享

2011年3月10日 星期四

android-sdk_r3-windows 存在無法取得https://dl-ssl.google.com/android/repository/repository.xml

選擇https

會顯示下列error
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: Connection timed out: connect


選擇http
會顯示下列error

XML verification failed for http://dl-ssl.google.com/android/repository/repository.xml.
Error: cvc-elt.1: Cannot find the declaration of element 'sdk:sdk-repository'.
Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Unknown


使用android-sdk_r10-window可以解決上述問題
而且不用選擇http

透過Facebook分享

[git] 只commit某些檔案進git repository

使用git做source control
使用git commit會發現一次把所有修改過的檔案都加到git repository中

如果只是想要加入某些真的有意義的檔案該怎麼辦呢

使用git add -p來挑選要commit的檔案

他會一次show一個有修改過的檔案
並show出修改內容差異
再問你要不要Stage this hunk
選擇y就是要


nelsonchung@robot:~/temp/gitsubversiontest$ git status
# On branch master
# Changed but not updated:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working directory)
#
#       modified:   1.txt
#       modified:   2.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
nelsonchung@robot:~/temp/gitsubversiontest$ git add -p
diff --git a/1.txt b/1.txt
index bb4b503..8103efd 100644
--- a/1.txt
+++ b/1.txt
@@ -1,2 +1,3 @@
 1.text
 2.txt
+3.txt
Stage this hunk [y,n,q,a,d,/,e,?]? y

最後再做git commit就可以嚕

透過Facebook分享

square讓刷卡付費變得簡單

以iPhone為主的示範影片
http://v.youku.com/v_show/id_XMTUzMjA1NjAw.html

真的讓刷卡付費好簡單喔

iPhone, Android都可以用

Android平台上可以從此處下載軟體
http://www.androidzoom.com/android_applications/finance/square_gusg.html

透過Facebook分享

網樂通也可以改機

http://www.ptt.cc/bbs/Modchip/M.1297780925.A.A92.html

透過Facebook分享

sl410

SL410 2842-FCV



PChome線上購物- SL410-Core 2 Duo+NO OS$17900

 - 9 個瀏覽次數 - 下午12:35
殺青最後8台↗加碼送無線基地台◢Lenovo ThinkPad SL410 2842-FCV寬螢幕小黑【Intel 64位元雙核心處理器T6570】【防潑水鍵盤】 勇~耐操! ...
shopping.pchome.com.tw › 24h 購物 › ThinkPad 聯想 - 頁庫存檔 - 類似內容

透過Facebook分享

2011年3月7日 星期一

[Android] 如何不重複啟動相同的Activity

繼先前的文章-

[Android] Activity執行(啟動)另一個Activity 之 life cycle分析




如果你不想產生重複的Activity
請使用將intent的flag設定成FLAG_ACTIVITY_REORDER_TO_FRONT



01-01 00:47:25.641: VERBOSE/1(11937): onCreate
01-01 00:47:25.641: VERBOSE/1(11937): onStart
01-01 00:47:25.641: VERBOSE/1(11937): onResume
01-01 00:47:25.771: INFO/ActivityManager(2155): Displayed activity application.nelson/.CheckAndroidLifeCycle: 4075 ms (total 4075 ms)
01-01 00:47:30.811: DEBUG/dalvikvm(11709): GC_EXPLICIT freed 137 objects / 10120 bytes in 31ms
01-01 00:47:35.811: DEBUG/dalvikvm(11723): GC_EXPLICIT freed 882 objects / 59784 bytes in 33ms
01-01 00:47:40.811: DEBUG/dalvikvm(2295): GC_EXPLICIT freed 657 objects / 37136 bytes in 36ms
01-01 00:48:03.782: INFO/ActivityManager(2155): Starting activity: Intent { flg=0x20000 cmp=application.nelson/.OtherActivity }
01-01 00:48:03.791: VERBOSE/1(11937): onPause
01-01 00:48:03.871: WARN/Resources(11937): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
01-01 00:48:03.871: VERBOSE/2(11937): onCreate
01-01 00:48:03.871: VERBOSE/2(11937): onStart
01-01 00:48:03.871: VERBOSE/2(11937): onResume
01-01 00:48:04.151: INFO/ActivityManager(2155): Displayed activity application.nelson/.OtherActivity: 350 ms (total 350 ms)
01-01 00:48:04.151: VERBOSE/1(11937): onStop
01-01 00:48:10.441: INFO/ActivityManager(2155): Starting activity: Intent { flg=0x20000 cmp=application.nelson/.CheckAndroidLifeCycle }
01-01 00:48:10.501: VERBOSE/2(11937): onPause
01-01 00:48:10.511: VERBOSE/1(11937): onStart
01-01 00:48:10.511: VERBOSE/1(11937): onResume
01-01 00:48:10.771: VERBOSE/2(11937): onStop


Source code download

Reference:
http://stackoverflow.com/questions/2232238/how-to-bring-an-activity-to-foreground-top-of-stack
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_REORDER_TO_FRONT
http://developer.android.com/reference/android/content/Context.html#startActivity(android.content.Intent)

透過Facebook分享

[Android] Activity執行(啟動)另一個Activity 之 life cycle分析

先前的文章-

[Android] Activity執行(啟動)另一個Activity


這樣子的啟動方式
是真的去new一個新的Activity

所以lifecycle順序會是
1(CheckAndroidLifeCycle)呼叫2(OtherActivity)


01-01 04:03:41.691: INFO/ActivityManager(2134): Starting activity: Intent { cmp=application.nelson/.OtherActivity }
01-01 04:03:41.701: VERBOSE/1(29115): onPause
01-01 04:03:41.721: WARN/Resources(29115): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
01-01 04:03:41.721: VERBOSE/2(29115): onCreate
01-01 04:03:41.721: VERBOSE/2(29115): onStart
01-01 04:03:41.721: VERBOSE/2(29115): onResume
01-01 04:03:42.001: INFO/ActivityManager(2134): Displayed activity application.nelson/.OtherActivity: 293 ms (total 293 ms)
01-01 04:03:42.001: VERBOSE/1(29115): onStop

2
01-01 04:03:44.261: VERBOSE/2(29115): onPause
01-01 04:03:44.261: INFO/ActivityManager(2134): Starting activity: Intent { cmp=application.nelson/.CheckAndroidLifeCycle }
01-01 04:03:44.281: WARN/Resources(29115): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
01-01 04:03:44.281: VERBOSE/1(29115): onCreate
01-01 04:03:44.281: VERBOSE/1(29115): onStart
01-01 04:03:44.281: VERBOSE/1(29115): onResume
01-01 04:03:44.541: INFO/ActivityManager(2134): Displayed activity application.nelson/.CheckAndroidLifeCycle: 272 ms (total 272 ms)
01-01 04:03:44.541: VERBOSE/2(29115): onStop


Source code download


有沒有方法是可以讓activity life cycle像下面圖片呢
onPause->onResume(不要有onCreate)

Reference:
http://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)
http://developer.android.com/reference/android/app/Activity.html


透過Facebook分享