2016年6月7日 星期二

LuCI 編碼錯誤問題


在這篇網誌中,要小心 htm 的部分不可以使用 DOS 字元,需要使用 UNIX 字元才行,否則可能會出現 unfinished string near 的錯誤訊息。

在 Source Insight 直接編輯時,如果設定不對會變成 DOS 字元,此時可用 notepad++ 進行格式上的轉換。

2016年5月23日 星期一

Hidden ActionBar (Status Bar) on Android.

這幾天一直搞不定 status bar 的問題,網路上搜尋到的資料大多都是會造成 actionbar crash,後來尋找到這一篇 stackoverflow 文章,

http://stackoverflow.com/questions/28144657/android-error-attempt-to-invoke-virtual-method-void-android-app-actionbar-on

如果你有機會使用繼承到 AppCompatActivity Class,可能需要將 getAction() 換成 getSupportActionBar()。

否則可能出現 actionbar null 的問題

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference

另外要隱藏 ActionBar 可以從 https://developer.android.com/training/system-ui/status.html 搭配所對應的 Activity Class 過濾出要使用 getAction() or getSupportActionBar()。

2016年5月22日 星期日

Android 出現 net::ERR_CACHE_MISS 問題

在開發 Android 的過程中,如果有遇到 net::ERR_CACHE_MISS 的訊息,特別是用到 chrome (webview) 時出現,有可能是在 Permission 沒有進行 Internet 的權限宣告。

此時到 AndroidManifest.xml 進行宣告即可。


2016年4月21日 星期四

YouCompleteMe(YCM) Error

前陣子在使用 YCM,他算是 vim 可以擴充的一個套件,但在安裝 Plugin 之後,卻出現了下列的訊息:

2016年4月18日 星期一

python 2.7.11 使用 matplotlib 出現了不相容的問題

在使用 python 2.7.11 搭配 matplotlib 套件時,出現了下列的錯誤訊息

Homebrew on MAC El Capitan issue



在 El Capitan 版本使用 homebrew 時出現了下面錯誤的訊息



解法步驟如下:
  1. cd /usr/local
  2. git reset --hard FETCH_HEAD
  3. git checkout Library
  4. sudo brew update
之後應該就能夠正常使用了


2016年3月29日 星期二

NAT 種類

最近在研究關於 NAT 的內容,所以分享一下 NAT 好了。

NAT 大家比較熟悉的應該是用在家用分享器上,在一個 WAN IP 可以 Mapping 到多個 LAN 裝置,其中 Mapping 的方式有很多種,例如我們舉幾個維基裡所提到的種類,這也是大多數的人會探討的幾個。

  • Full cone NAT 
  • Address-Restricted cone NAT 
  • Port-Restricted cone NAT 
  • Symmetric NAT