2014年6月10日 星期二

[Mac] "Mac pro蓋上蓋後,不乖乖睡覺"




自己做個記錄&給跟我有一樣問題的人。好險,我以為mac它壞了。
(而且我沒有買阿婆ㄎㄟ兒..)

打開 Terminal 之後輸入:pmset -g assertions
然後就會跑出下面這些資訊:




如果有東西阻礙你的電腦睡覺在Assertion status system-wide中 PreventSystemSleep或是 PreventUserIdleSystemSleep這兩則的數值就會是1

而下面就會有個 Listed by owning process: 的訊息 再依照上面顯示的訊息關閉你電腦上面相應的設定就可以了
像我的就是:

DenySystemSleep named: "com.apple.InternetSharing"



資料來源
http://blog.funnyq.com/2012/01/mac-can-not-sleep/
另外附上MAC 官方manual pagehttps://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/pmset.1.html

2014年3月7日 星期五

Ten days about how I learn to sketch.

well, I am just not good in drawing.
This book helps a lot in learning some basic sketching concept.















2013年11月4日 星期一

Using OpenCV on Xcode

The install process should be as follow.

1. Install MacPorts through pkg file  
http://www.diigo.com/annotated/99033418ec79c564a75a4c33609c9de2

ps. 若出現 port : command not foundsudo vi /etc/pathsAdd 2 following lines: (先按i開啟編輯模式)
/opt/local/bin
/opt/local/sbin  (輸入  :wq   存檔並離開)
Reboot your terminal

2. Install OpenCV throught 'Terminal' 
sudo port install opencv
3. Add library to your Xcode project which shown as belowBy default OpenCV is installed to /opt/local/ according to MacPorts conventions. The opencv_xxxx utilities are located in /opt/local/bin/, the dynamic libraries in /opt/local/lib/ and the header files in /opt/local/include/opencv/.

也就是說因為XCODE他的預設路徑在var底下,你可以把opt底下的東西拷貝到var底下,或者像我一樣到Xcode的 project檔案Build TAB底下去設定header 跟 libraries 的路徑。
OpenCV所需要的library加入用Xcode
開啓一個new command project
點選上方工具列 Project -> New Group 來創立一個新的Group 
在這裡我們稱他OpenCV Frameworks
左方輕點選剛剛創立出來的OpenCV Frameworks
點選上方工具列 Project -> Add to Project按下"/" 輸入/opt/local/lib 選擇下面三個檔案加入
  • libopencv_core.2.2.0.dylib
  • libopencv_highgui.2.2.0.dylib
  • libopencv_imgproc.2.2.0.dylib
4. Use #include <cv.h> #include <highgui.h> in the top of your program.