Skip to main content

Posts

Showing posts from 2016

【筆記】Git指令

Working Directory git stash save:當改code改到一半還不想commit,卻又要跳到別的工作狀態或分支的情況下,可以先將目前狀況儲藏(stash)下來 git stash apply:把最後一次的stash狀態還原出來用,使用後記得還要另外手動刪除 git stash drop:刪除最後一次的stash git stash list:查看stash清單 git add <file_name> Staging Area git rm --cached <file_name>:把檔案從stage撤下 git commit git commit -m <message>:commit並加上訊息,如git commit -m "add xxx file" git reset HEAD^: 想修改已commit的檔案,使用該指令取消最後一次commit (soft),把檔案拿回來繼續編輯 git reset HEAD^ --hard: 想修改已commit的檔案,使用該指令取消最後一次commit (hard) Repository git commit --amend:修改最後一次commit內容,如果之前有git add,那些檔案也會併入該次commit,而 不會新增提交次數 git commit --amend -m <message>:修改最後一次commit,如果之前有git add,那些檔案也會併入該次commit,-m後面加上要寫的message git log -p <file_name> : 查看單一檔案的歷史紀錄,每次commit與前一版本新增\刪除的部分 git blame <file_name> : 查看檔案每一行文字最近更動的提交編號 git checkout <file_name> : 讓檔案或目錄回到最近一次commit的狀態 git checkout .:讓當前目錄回到最近一次commit的狀態 分支 git branch:檢視分支 git branch -v:檢視各分支

【Android App】Android 6.0 藍芽搜尋無法獲得任何結果

Q: Android 6.0 (API level 23) BT、BLE搜尋無法獲得任何結果? A: Android 6.0下,使用BT、BLE硬體裝置時需加入ACCESS_FINE_LOCATION或ACCESS_COARSE_LOCATION權限,另外在進行BLE掃描的時候,要提示使用者將GPS開啟。 參考: https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id http://stackoverflow.com/questions/33043582/bluetooth-low-energy-startscan-on-android-6-0-does-not-find-devices 這封郵件來自 Evernote。Evernote 是您專屬的工作空間, 免費下載 Evernote

【有聲書】Aladdin and The Wonderful Lamp

Aladdin and The Wonderful Lamp  From The Arabian Night's Entertainment Vocabulary brass:黃銅 rub :摩擦、搓揉 grant :(通常指官方)同意,准予,授予 bathhouse :澡堂 bride :(準)新娘 bridegroom :(準)新郎 servant :(尤指舊時的)傭人,僕人/公務員、公僕 Chapter 1 The Evil Magician A long time ago, there lived a lazy boy named Aladdin. He would play with his friends all day long. Aladdin's mother was upset about her son. She would cry and pray. She wanted her son to change his behavior. However, Aladdin never changed. One day, a man came to Aladdin and asked, "Are you Mustapha's son?" "I am," answered Aladdin. "But he died long ago." The stranger kissed Aladdin when he heard this. He said, "I am your uncle. I thought you might look like my brother. Go home, and tell your mother that I am coming." Aladdin ran home and told his mother. "Yes, your father had a brother," his mother said. "But I thought he was

【CSS筆記】Position屬性

學習CSS Position各項屬性的筆記以及可以簡單操作的練習網頁。 top, bottom, left and right 已設定position屬性的物件,才可以使用left: 100px;, top: 200px;等語法來設定搭配的數值 position: static; 預設的position屬性為static,不做特別的排列,僅將物件以程式碼中的順序列出 Try it yourself-Position Static position: relative; 讓物件移動到相對於預設位置的地方,此處top, bottom, left and right設定的是相對於預設位置的margin量 Try it yourself - Position Relative position: absolute; 讓物件為在相對於最近新增且已定位 (Positioned) 之物件的位置,已定位物件是指已 設定除static外之position屬性的物件 Try it yourself - Position Absolute position: fixed; fix to the relative position to the browser window,物件會待在相對於瀏覽器畫面中的某固定位置如右下角(bottom:0; right:0;),此時網頁不管捲動到哪,該物件都會保持在右下角的位置 Try it yourself - Position Fixed 控制物件上/下層,使用z-index 兩個已定位(Positioned)物件,可以使用z-index來設定誰在上層誰在下層,z-index數值越大的越上層,背景圖片可以使用負值確保位在最底層 Try it yourself - z-index 延伸閱讀: http://www.w3schools.com/css/css_positioning.asp

【JAXA TKSC筑波宇宙中心參訪說明書】

交通-搭乘JR快速巴士 > 前往巴士站 *巴士站在東京車站八重洲南口(Yaesu South Exit) *東京車站的東邊是八重洲的出口,西邊是丸之內 >購票 *巴士站末端(往數字大的方向走去)會有自動售票機 *自動售票機購票流程(片道,かたみち,是指單程票的意思): http://www.jrbuskanto.co.jp/ticket_info/img/ticket02.pdf *票價:單程1,180,三枚3,200,可以先買單程,回程時直接在車上付款,如果是雙人同行的話,買三枚+一枚可以省一點費用: http://time.jrbuskanto.co.jp.t.wn.hp.transer.com/bk040720_bk040722.html#fate_01 *車票樣貌: >搭乘 *2號巴士站上車,搭乘往「筑波大學」或者往「つくばセンター」(下行)方向,在「並木一丁目」下車 *高速巴士時刻表: http://time.jrbuskanto.co.jp.t.wn.hp.transer.com/bk040720_bk040722.html *下車後,走一小段路就到了 JAXA 筑波宇宙中心(TKSC) >公開參觀區域 - Space Dome & Planet Cube *免費參觀 *10人以上團體要預約 *營業時間:10:00~17:00 *開館/休館期間: http://fanfun.jaxa.jp/visit/tsukuba/open.html#visit_open *Space Dome by Google街景: https://goo.gl/maps/bfFqG6vs3L72 >付費導覽(需事先預約) *費用500日圓 *導覽時間70分鐘 *主要參觀內容與地點: **筑波宇宙中心介紹影片 **ISS KIBO控制中心by google map室內環景: https://goo.gl/maps/QRAwgP7MbAA2 **太空人訓練所by google map室內環景: https://goo.gl/maps/vhMsFxsXP3q *導覽預約網址: http://fanfun.jaxa.jp/visit/tsukuba/tour.html#v

【WP】Role Model

劉安婷 (Anting Liu) By watching her TED talk in 2013, I knew her story. She is the founder of Teach for Taiwan which is a nonprofit organization that aims to help children in rural areas have a proper education. 1.  Focus and go all-out for her dream After she told her parents that she decided to get into a university in the U.S.A., her parents set two conditions. First, she had to get an excellent score in GSAT in Taiwan. Second, she needed to get a scholarship to reduce the tuition fees in the university in the U.S.A. During the time she had been working on for that goal, she taught herself English and only slept 4 or 5 hours a day. In the end, she made it and got a full amount scholarship from Princeton University. 2. Willing(adj.) to help people During her days at Princeton, she devoted herself to volunteering in different parts of the world, including Haiti, Ghana(迦納) and Cambodia(柬埔寨) 3.  Willing to solve problems, make actions Although she had a job

ScanSettings.Builder().setReportDelay()會有硬體不支援的狀況發生

Q: ScanSettings.Builder(),在Nexus 7上可以設定ScanMode,但是一將setReportDelay填入非0值,就ScanCallback就會吐onScanFailed,errorCode是4( SCAN_FAILED_FEATURE_UNSUPPORTED )。 A: 由於是新的API,所以可能會發生硬體不支援的狀況。可以使用下列程式碼做檢測: if  ( bluetoothAdapter .isOffloadedScanBatchingSupported())     Log. d ( TAG ,  "Scan Batching is Supported" ); else     Log. d ( TAG ,  "Scan Batching is NOT Supported" ); 如果出現Scan Batching is NOT Supported表示該裝置不支援這個功能,填入非0值就會出現錯誤。 P.S 可以使用isOffloadedFilteringSupported檢查是否支援應用filter。 bluetoothAdapter . isOffloadedFilteringSupported (); 參考: http://stackoverflow.com/questions/35266845/how-to-fix-android-ble-scan-failed-feature-unsupported-on-nexus-5 這封郵件來自 Evernote。Evernote 是您專屬的工作空間, 免費下載 Evernote

【新知練習】 Android XmlPullParser-Basic

由於Android系統內挾帶大量xml檔案,所以便想研究一下XmlPullParser的作用跟用法,本文主要參考網路、Android開發者網頁,並製作讀取政府開放資料(空氣品質資料)的範例。

【實用技巧】 用7-zip合併mp3檔案

網路上有人分享怎麼用7-zip合併mp3檔案,但是合併後的檔案並沒有真的把mp3合併起來,原來是步驟二的設定有改,這邊做個筆記給以後的自己或其他人參考囉。 步驟一 :選取要合併的mp3檔案們->點選右鍵->7-Zip->加入壓縮檔 步驟二:設定各項參數。檔案名稱一定要是「xxx.mp3」,壓縮檔格式要設定為「7z」,壓縮層級選擇「封存」。接著按下確定就完成了。

在Eclipse中正常顯示Android原始碼的方法

因為在Eclipse內想查看Andorid原生類別/方法原始碼的時候,卻只能看到下面這個畫面,所以紀錄一下該怎麼新增跟建立連結,以便多多觀摩Android的精隨XD。