2015年9月23日 星期三

[Mac] 開啟內建apache

開啟 apache

sudo su

apachectl start


/Library/WebServer/Documents

http://localhost/

開啟php

cd /etc/apache2

vim httpd.conf

開啟

LoadModule php5_module libexec/apache2/libphp5.so

apachectl restart

[Tools] Sublime Text3


安裝 Package Control 套件

View --> Show Console



從下面網址 複製貼上
https://packagecontrol.io/installation#st3






2015年8月10日 星期一

[其他] Acer ASPIRE 4830TG enable VT-x

使用 android studio 模擬器 會要求你安裝


安裝到一半會發生錯誤 錯誤訊息顯示 VT-X 沒有啟動

查詢 intel CPU 資料發現 i5 2410M 有支援 VT-X

但是在Acer BIOS 被閹割掉 沒有選項可以開關 VT-X

詢問Goolge 大師, 必須要刷BIOS 去開啟

有網友破解 BIOS unlock menu

鼓起勇氣刷下去 開啟 VT-x 依舊無法使用

繼續爬文 發現 AVAST 擋掉了




關掉這個選項, android 模擬器 快樂使用中!!!

2015年7月29日 星期三

[Tools] Android Studio 快速鍵




功能
Windows
Mac
刪除整行
Ctrl + Y
Cmd + Delete
清除沒用import
Alt + Ctrl + O
Option + Control + O
跳到目前變數宣告位置
Ctrl + B  or Ctrl + 滑鼠左鍵
程式架構
Ctrl + F12
Cmd + F12
尋找
Ctrl + F
Cmd + F
繼承架構圖
Ctrl + H
跳到警告位置
F2
把程式碼變註解 //
Ctrl + /
Cmd + /
把程式碼變註解 /* */
Ctrl + Shift  + /
Cmd + Option + /
取代
Ctrl + R
Cmd + R
縮排
Ctrl + Alt + L
Cmd + Option + L
擴大縮小選取範圍
Ctrl + W/Ctrl + Shift + W
Option + Up/Down
定位到字首/
Ctrl + Left/Right
Cmd + Left/Right
大小寫轉換
Ctrl + Shift + U
Cmd + Shift + U
跳行
Ctrl + G
Cmd + L
最近開啟文件
Ctrl+E
最近編輯文件
Ctrl+Shift+E
search everywhere
double Shift
全部尋找
Ctrl+Shift+R
列出目前class function和變數
 Ctrl+O
回到上次修改處
Alt+←

到下一個修改處
Alt+→

Replace in path
Ctrl+Shift+R

Settings
Ctrl+Alt+S

Project Structure
Ctrl+Alt+Shift+S

快速加上If/For/While/try-catch
Ctrl+Alt+T
Command+option+T









2015年7月10日 星期五

[Apache ] win7 灌 Apache HTTP Server


下載網址
http://www.apachelounge.com/download/

Apache 2.4.12 Win64 httpd-2.4.12-win64-VC14.zip 9 Jul '15 13.284K

修改 Apache24\conf\httpd.conf

Start apache in a DOS box:
  >httpd.exe Install as a service:



爬文網友表示skype 會佔據 port 80
關閉 skype 重開 apache 即可





2015年7月2日 星期四

[ubuntu] Shell Script 筆記


function 使用方式
    function Sync() {
        echo "sync $1"
        p4 sync "@$1"
    }
    Sync

時間使用方式
    Date=$(date +%Y%m%d)
    Time=$(date +%H%M%S)


if else 使用方式
    if [ -d "$tar" ]
    then
        echo "$tar found."
    else
        mkdir "$tar"
    fi



[ string1 = string2 ] string1 and string2 are equal
[ string1 != string2 ] string1 and string2 are not equal
[ string1 \< string2 ] string1 is lexically less than string2(e.g. 'a' is less than 'b')
[ string1 \> string2 ] string1 is lexically greater than string2(e.g. 'b' is greater than 'a')
[ -e file ] file exists
[ -f file ] file is a file
[ -d file ] file is a directory
[ n1 -eq n2 ] true if integer n1 = integer n2
[ n1 -ne n2 ] true if integer n1 <> n2
[ n1 -gt n2 ] true if n1 > n2
[ n1 -ge n2 ] true if n1 >= n2
[ n1 -lt n2 ] true if n1 < n2
[ n1 -le n2 ] true if n1 <= n2

2015年6月25日 星期四

[android] 測量android 開機時間

android source code 有詳細說明
\dev\android\system\core\init\README.BOOTCHART


This version of init contains code to perform "bootcharting", i.e. generating log
files that can be later processed by the tools provided by www.bootchart.org.

To activate it, you need to define build 'init' with the INIT_BOOTCHART environment
variable defined to 'true', for example:
touch system/init/init.c
m INIT_BOOTCHART=true
On the emulator, use the new -bootchart <timeout> option to boot with bootcharting
activated for <timeout> seconds.

Otherwise, flash your device, and start it. Then create a file on the /data partition
with a command like the following:
adb shell 'echo $TIMEOUT > /data/bootchart-start'
Where the value of $TIMEOUT corresponds to the wanted bootcharted period in seconds;
for example, to bootchart for 2 minutes, do:
adb shell 'echo 120 > /data/bootchart-start'
Reboot your device, bootcharting will begin and stop after the period you gave.
You can also stop the bootcharting at any moment by doing the following:
adb shell 'echo 1 > /data/bootchart-stop'
Note that /data/bootchart-stop is deleted automatically by init at the end of the
bootcharting. This is not the case of /data/bootchart-start, so don't forget to delete it
when you're done collecting data:
adb shell rm /data/bootchart-start

The log files are placed in /data/bootchart/. you must run the script tools/grab-bootchart.sh
which will use ADB to retrieve them and create a bootchart.tgz file that can be used with
the bootchart parser/renderer, or even uploaded directly to the form located at:

  http://www.bootchart.org/download.html

NOTE: the bootchart.org webform doesn't seem to work at the moment, you can generate an
      image on your machine by doing the following:

         1/ download the sources from www.bootchart.org
         2/ unpack them
         3/ in the source directory, type 'ant' to build the bootchart program
         4/ type 'java -jar bootchart.jar /path/to/bootchart.tgz

technical note:

this implementation of bootcharting does use the 'bootchartd' script provided by
www.bootchart.org, but a C re-implementation that is directly compiled into our init
program.

===============
ubuntu 安裝方式
  • apt-get install bootchart



2015年6月18日 星期四

[資訊] IOT

IOT

物聯網(Internet of Things,縮寫IoT)是一個基於網際網路、傳統電信網等資訊承載體,讓所有能夠被獨立尋址的普通物理物件實作互聯互通的網路。[1]物聯網一般為無線網,而由於每個人周圍的裝置可以達到一千至五千個,所以物聯網可能要包含500兆至一千兆個物體。在物聯網上,每個人都可以應用電子標籤將真實的物體上網聯結,在物聯網上都可以查出它們的具體位置。通過物聯網可以用中心電腦對機器、裝置、人員進行集中管理、控制,也可以對家庭裝置、汽車進行遙控,以及搜尋位置、防止物品被盜等。
物聯網將現實世界數位化,應用範圍十分廣泛。物聯網的應用領域主要包括以下幾個方面:運輸和物流領域、健康醫療領域範圍、智慧環境(家庭、辦公、工廠)領域、個人和社會領域等,[2]具有十分廣闊的市場和應用前景。

資料來源:
https://zh.wikipedia.org/wiki/%E7%89%A9%E8%81%94%E7%BD%91

Paas
平台即服務(platform as a service,縮寫作PaaS)是一種雲端運算服務,提供運算平台與解決方案堆疊即服務。在雲端運算的典型層級中,平台即服務層介於軟體即服務與基礎設施即服務之間。
平台即服務提供使用者能將雲端基礎設施部署與建立至用戶端,或者藉此獲得使用程式語言、程式庫與服務。使用者不需要管理與控制雲端基礎設施,包含網路、伺服器、作業系統或儲存,但需要控制上層的應用程式部署與應用代管的環境。[1]
PaaS將軟體研發的平台做為一種服務,以軟體即服務(SaaS)的模式交付給使用者。因此,PaaS也是SaaS模式的一種應用。但是,PaaS的出現可以加快SaaS的發展,尤其是加快SaaS應用的開發速度。
平台即服務(PaaS)這是在軟體即服務(Software as a Service,簡稱SaaS)之後興起的一種新的軟體應用模式或者架構。是應用服務提供商(the Application Service Provider,簡稱ASP)的進一步發展。

資料來源:
https://zh.wikipedia.org/wiki/%E5%B9%B3%E5%8F%B0%E5%8D%B3%E6%9C%8D%E5%8A%A1

IaaS
基礎設施即服務(Infrastructure as a Service,簡稱IaaS)是消費者使用處理、儲存、網路以及各種基礎運算資源,部署與執行作業系統或應用程式等各種軟體。客戶端無須購買伺服器、軟體等網路設備,即可任意部署和運行處理、存儲、網絡和其它基本的計算資源,不能控管或控制底層的基礎設施,但是可以控制作業系統、儲存裝置、已部署的應用程式,有時也可以有限度地控制特定的網路元件,像是主機端防火牆。[1][2]

資料來源:
https://zh.wikipedia.org/wiki/%E5%9F%BA%E7%A4%8E%E8%A8%AD%E6%96%BD%E5%8D%B3%E6%9C%8D%E5%8B%99


SaaS
軟體即服務(Software as a Service,簡稱SaaS,發音:sas或s?s[1])有時被作為「即需即用軟體」(即「一經要求,即可使用」)提及[2],它是一種軟體交付模式[3]。在這種交付模式中雲端集中式託管軟體及其相關的數據,軟體僅需透過網際網路,而不須透過安裝即可使用。用戶通常使用精簡客戶端經由一個網頁瀏覽器來訪問軟體即服務。
對於許多商業應用來說,軟體即服務已經成為一種常見的交付模式。這些商業應用包括會計系統[2]、協同軟體、客戶關係管理、管理信息系統、企業資源計劃、開票系統、人力資源管理、內容管理、以及服務台管理[4]。軟體即服務已經被吸納進所有領先的企業級軟體公司的戰略中[5]。這些公司的最大的賣點之一就是通過將硬體和軟體維護及支持外包給軟體即服務的提供者,來降低信息技術(Information Technology,簡稱IT)成本[6]。
根據一份高德納集團(Gartner Group,也稱顧能集團)的評估[7],軟體即服務的銷售在2010年達到了100億美元,並且曾被預計在2011年要達到121億美元,比2010年上升20.7%。高德納集團估計,到2015年,軟體即服務的收入將會超過它的2010年的收入的2倍以上,並且達到預計的213億美元。客戶關係管理系統持續成為軟體即服務的最大市場。在客戶關係管理市場中的軟體即服務曾被預測會從2010年的32億美元上升到2011年的38億美元[8]。
「軟體即服務」(SaaS)的術語被認為是雲計算的命名法的一部分,還有IaaS、PaaS、桌面即服務(DaaS)都被認為是雲計算的學術名稱[9]。

資料來源:
https://zh.wikipedia.org/wiki/%E8%BD%AF%E4%BB%B6%E5%8D%B3%E6%9C%8D%E5%8A%A1

2015年6月6日 星期六

[敗家] 2015_06_06 小米體重機

身為一個寫程式的宅宅, 總是喜歡一些可以連接手機的3C 產品

很久前就注意到了 小米體重計 換算台幣約500元

打死賣場一堆普通的體重計

等了很久~ 台灣沒上市

只好自己想辦法了~~

終於~~ 今天收到了

話不多說 開箱!!!

拿到的時候可以感覺到手有點沉 有一點重量


 拿紅米note 當比例尺.

好吧!套句潮溝說的話 窮酸宅 才用小米商品.

這我承認 小米商品便宜又有點賣點

每一樣都想買來玩看看


上面的鋼化玻璃蠻有質感的. 踩上去腳的觸感也不錯!



簡單的說明書





電池蓋蠻好開的 前提是用對方法



顯示部分蠻有質感的


綁定體重機
使用的軟體跟小米手環同一個
可是google play上面的小米手環沒有此功能
必須在google 搜尋 小米手環 app

選下面這個

小米运动-小米应用商店


安裝後就可以綁定了




綁定時 會透過BLE 更新體重計韌體















 雖然沒有體脂的功能, 但是已這個價位算是超值的商品

接著想辦法來弄台 小米血壓計玩玩


2015年5月29日 星期五

[旅遊] 2015_05_29 興大路阿勃勒


興大路!台中有名的阿勃勒景點

現場蠻多人在拍照了

感覺已經算花期已經到尾聲!

只好明年早點來~



黃黃的道路~~



偷拍這對老夫妻!感覺很溫馨~








偷拍攝友的阿愣 有點可愛!可惡!想買一隻~~








[旅遊] 2015_05_29 梅川東路阿勃勒

隱藏在中港路旁的小秘境, 沒有興大路那麼有名.

但是也是很漂亮!

感覺找一天下雨後隔天清晨 拍起來應該會很讚!