網頁

2014年12月23日 星期二

Google API

錯誤訊息
{"responseData": null, "responseDetails": "Suspected Terms of Service Abuse. Please see http://code.google.com/apis/errors", "responseStatus": 403}

到此申請帳號
https://developers.google.com/custom-search/v1/using_rest?hl=zh-TW


https://script.google.com/macros/s/AKfycbwwz9O_uKzZtpd3RPkuZLbQkueQUsDYHaEFhmi7PNXvzv_UrFo/exec?id=1Gt9Fe1WbNBSe1pMzqF50Lv1HBAnq7C_Hwh0lfTWVumM

"http://translate.google.com.tw/translate_tts?" +
      "ie=UTF-8&q=" + text + "&tl=" + lang + "&total=1&idx=0" +
      //"ie=UTF-8&q=" + escape(text) + "&tl=" + lang + "&total=1&idx=0" +
      "&textlen=" + text.length;

2014年12月18日 星期四

耳機線控

網路上的程式真的可以用,只是在 Service 和 Activity 間
都要多多 registerMediaButtonEventReceiver
以免 KeyEvent 被電話或預設的音樂程式接走了

尤其下列這種模擬的 KeyEvent,只能在模擬機器上使用,真機上容易觸發電話和預設的音樂程式
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MEDIA_PREVIOUS);
intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
sendBroadcast(intent);

2014年12月1日 星期一

關於民主

郭台銘說:民主不能當飯吃

陳為廷表示「民主或許不能當飯吃,但是民主可以讓你有尊嚴地吃飯」

朱學恒:
的確,民主不能讓你刀槍不入,民主不能讓你以寡擊眾,民主也不能讓你享盡榮華富貴
但是,我們來到這個世界上不是只為了吃飯
民主可以讓你有尊嚴,民主可以讓你不用卑躬屈膝,民主可以讓你勇敢,民主可以讓你自傲,民主讓你可以推倒高牆


2014年11月28日 星期五

ScreenOff 一鍵鎖屏

在 Activity 中
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
pm.goToSleep(SystemClock.uptimeMillis());
在 AndroidManifest.xml 中
<uses-permission android:name="android.permission.DEVICE_POWER"/>
失敗


在 Activity 中
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "GoToSleep");
wl.acquire();
wl.release();
在 AndroidManifest.xml 中
<uses-permission android:name="android.permission.DEVICE_POWER"/>
失敗


在 Activity 中
WindowManager.LayoutParams params = getWindow().getAttributes();
params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;
params.screenBrightness = 0;
getWindow().setAttributes(params);
成功 但只是螢幕切暗


在 Activity 中
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mPowerManager = (PowerManager)getSystemService(POWER_SERVICE);
mWindowManager = (WindowManager)getSystemService(WINDOW_SERVICE);
mWindowManager.getDefaultDisplay();
mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass().getName());
在 protected void onResume() 中
mWakeLock.acquire();
在 protected void onPause() 中
mWakeLock.release();
在 AndroidManifest.xml 中
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.HARDWARE_TEST" />
失敗


2014年11月27日 星期四

控制 Eclipse 的虛擬機器

可以直接使用鍵盤輸入資料
需要用Shift才可鍵入的字元需要加按Alt

Home -> Home
Esc -> Back
F2 -> Menu
F3 -> 撥號鍵
F4 -> 掛斷鍵
F5 -> 搜尋鍵
F8 -> 網路開關
Ctrl+F11 -> 旋轉螢幕

adb shell input keyevent 26

0 -> "KEYCODE_UNKNOWN"
1 -> "KEYCODE_MENU" 
2 -> "KEYCODE_SOFT_RIGHT" 
3 -> "KEYCODE_HOME" 
4 -> "KEYCODE_BACK" 
5 -> "KEYCODE_CALL" 
6 -> "KEYCODE_ENDCALL" 
7 -> "KEYCODE_0" 
8 -> "KEYCODE_1" 
9 -> "KEYCODE_2" 
10 -> "KEYCODE_3" 
11 -> "KEYCODE_4" 
12 -> "KEYCODE_5" 
13 -> "KEYCODE_6" 
14 -> "KEYCODE_7" 
15 -> "KEYCODE_8" 
16 -> "KEYCODE_9" 
17 -> "KEYCODE_STAR" 
18 -> "KEYCODE_POUND" 
19 -> "KEYCODE_DPAD_UP" 
20 -> "KEYCODE_DPAD_DOWN" 
21 -> "KEYCODE_DPAD_LEFT" 
22 -> "KEYCODE_DPAD_RIGHT" 
23 -> "KEYCODE_DPAD_CENTER" 
24 -> "KEYCODE_VOLUME_UP" 
25 -> "KEYCODE_VOLUME_DOWN" 
26 -> "KEYCODE_POWER" 
27 -> "KEYCODE_CAMERA" 
28 -> "KEYCODE_CLEAR" 
29 -> "KEYCODE_A" 
30 -> "KEYCODE_B" 
31 -> "KEYCODE_C" 
32 -> "KEYCODE_D" 
33 -> "KEYCODE_E" 
34 -> "KEYCODE_F" 
35 -> "KEYCODE_G" 
36 -> "KEYCODE_H" 
37 -> "KEYCODE_I" 
38 -> "KEYCODE_J"
39 -> "KEYCODE_K" 
40 -> "KEYCODE_L" 
41 -> "KEYCODE_M" 
42 -> "KEYCODE_N" 
43 -> "KEYCODE_O" 
44 -> "KEYCODE_P" 
45 -> "KEYCODE_Q" 
46 -> "KEYCODE_R" 
47 -> "KEYCODE_S" 
48 -> "KEYCODE_T" 
49 -> "KEYCODE_U" 
50 -> "KEYCODE_V" 
51 -> "KEYCODE_W" 
52 -> "KEYCODE_X" 
53 -> "KEYCODE_Y" 
54 -> "KEYCODE_Z" 
55 -> "KEYCODE_COMMA" 
56 -> "KEYCODE_PERIOD" 
57 -> "KEYCODE_ALT_LEFT" 
58 -> "KEYCODE_ALT_RIGHT" 
59 -> "KEYCODE_SHIFT_LEFT" 
60 -> "KEYCODE_SHIFT_RIGHT" 
61 -> "KEYCODE_TAB" 
62 -> "KEYCODE_SPACE" 
63 -> "KEYCODE_SYM" 
64 -> "KEYCODE_EXPLORER" 
65 -> "KEYCODE_ENVELOPE" 
66 -> "KEYCODE_ENTER" 
67 -> "KEYCODE_DEL" 
68 -> "KEYCODE_GRAVE" 
69 -> "KEYCODE_MINUS" 
70 -> "KEYCODE_EQUALS" 
71 -> "KEYCODE_LEFT_BRACKET" 
72 -> "KEYCODE_RIGHT_BRACKET" 
73 -> "KEYCODE_BACKSLASH" 
74 -> "KEYCODE_SEMICOLON" 
75 -> "KEYCODE_APOSTROPHE" 
76 -> "KEYCODE_SLASH" 
77 -> "KEYCODE_AT" 
78 -> "KEYCODE_NUM" 
79 -> "KEYCODE_HEADSETHOOK" 
80 -> "KEYCODE_FOCUS" 
81 -> "KEYCODE_PLUS" 
82 -> "KEYCODE_MENU" 
83 -> "KEYCODE_NOTIFICATION" 
84 -> "KEYCODE_SEARCH" 
85 -> "TAG_LAST_KEYCODE"

2014年11月19日 星期三

How to add drawable resource

1. 建立 res/drawable folder
2. File/New/Android XML File
3. Resource Type: Drawable
4. 輸入 File
5. 選擇 Root Element

How to add PreferenceActivity

1. 建立 res/xml folder
2. File/New/Android XML File
3. Resource Type: Preference
4. 輸入 File
5. 選擇 Root Element

2014年11月18日 星期二

2014年11月13日 星期四

Android clickMenuItem

不要使用 menu 的 android:onClick="clickMenuItem"
不論你用 public void clickMenuItem(MenuItem item)
或者 public boolean clickMenuItem(MenuItem item)
都會產生 android.view.InflateException: Couldn't resolve menu item onClick handler clickMenuItem in class android.view.ContextThemeWrapper 錯誤

使用精靈產生的 public boolean onOptionsItemSelected(MenuItem item) 即可





Android Layout

LinearLayout
android:orientation="vertical|horizontal":垂直或水平
android:layout_weight="比例":寬或高所佔整個Layout的比例


RelativeLayout
android:layout_位置="@id/元件名稱":位置可以是 above, below, toLeftOf, toRightOf
android:layout_align對齊="@id/元件名稱":對齊可以是 top, bottom, left, right
android:layout_alignParent對齊="true|false":對齊可以是 top, bottom, left, right
android:layout_center對齊="true|false":對齊可以是 horizontal, vertical, inParent


TableLayout 會包含數個 TableRow,元件置於 TableRow 中,預設元件的寬度是 wrap_content 的效果



2014年11月10日 星期一

Run Android App

1. 程式寫好後,選 Run/Run Configurations...
2. 選擇 Target 頁簽,點選 Always prompt to pick device
3. 點選 Run
4. 出現 Android Device Chooser
5. 選擇 模擬器 按 OK

1. Run As/Android Application

利用 DDMS 測試程式
1. 連接手機到電腦
2. 手機進入USB偵測模式
3. 進入 Eclipse
4. 選擇 Window/Open Perspective/DDMS
5. 此時可看到手機

1. 進入 命令提示字元
2. cd C:\eclipse4_64\android-sdk-windows\tools
3 emulator.exe -avd avdname -memory 512 -partition-size 512
4 cd C:\eclipse4_64\android-sdk-windows\platform-tools
5 adb root
6 adb remount
7 以下選一執行,安裝路徑不一樣
7.a adb push D:\EclipseAndroid\Study\GoToSleep\GoToSleep.apk /system/app/GoToSleep.apk
7.b adb install D:\EclipseAndroid\Study\GoToSleep\GoToSleep.apk
8.a adb shell
8.b ls /data/data or /data/app 查詢 package 名稱
8.c exit
9 adb uninstall com.example.gotosleep

Eclipse 之 DDMS 使用 Android 萬用驅動程式

1. 手機進入 USB 偵錯模式
2. 電腦 控制台/裝置管理員 出現驚嘆號,表示沒有驅動的手機
3. 用右鍵點選手機 內容 切換 詳細資料 頁
4. 屬性 選擇 硬體識別碼
5. 複製 值 如下 USB\VID\0BB4&PID_0DFB&MI_01
6. 開啟 Eclipse 選擇 Window/Android SDK Manager
7. 確認在最底下 Extras/Google USB Driver 有安裝
8. 用記事本開啟 C:\eclipse4_64\android-sdk-windows\extras\google\usb_driver\android_winusb.inf
9. [Google.NTx86] 表示32位元作業系統,[Google.NTamd64]表示64位元作業系統
10. 選擇適當的作業系統位置,新增如下兩行
; Device Name
%CompositeAdbInterface% = USB_Install, USB\VID\0BB4&PID_0DFB&MI_0111. 介面有下列三種,請測試看看
%SingleAdbInterface%
%CompositeAdbInterface%
%SingleBootLoaderInterface%
12. 回到裝置管理員,安裝驅動動程式,驅動程式位置
C:\eclipse4_64\android-sdk-windows\extras\google\usb_driver

Win8 64bits 停用驅動程式強制簽章

1. Win+C/變更電腦設定
2. 更新與復原/復原
3. 選擇 進階啟動 之 立即重新啟動
4. 選擇 疑難排解/進階選項/啟動設定/重新啟動
5. 使用數字鍵或功能鍵 選擇 停用驅動程式強制簽章

開發人員選項

一般在設定已經找不到這個選項,因為預設隱藏起來了。
1. 進入 設定/關於/軟體資訊/更多
2. 在建置號碼 上面點七下
3. 重新進入 設定,此時就可以找到 開發人員選項

以上是開啟 開發人員選項的方法,但是怎麼隱藏呢?
1. 進入 設定/應用程式
2. 切換到 全部 分頁
3. 找到 設定 這個程式
4. 點選 清除資料

2014年11月5日 星期三

2014年10月29日 星期三

2014年10月28日 星期二

2014年10月27日 星期一

在VisualStudio中混合了.cpp和.c 出現C1853錯誤

開啟 .c 檔的 Property Page,進入C/C++內的 Precompiled Headers
在 Create/Use Precompiled Header 中選擇 Not Using Precompiled Headers

2014年10月23日 星期四

史記 伯夷列傳

子曰「道不同不相為謀」,亦各從其志也。故曰「富貴如可求,雖執鞭之士,吾亦為之。如不可求,從吾所好」。

「君子疾沒世而名不稱焉。」

2014年10月16日 星期四

DirectShow 演變

1. DirectShow -> Windows SDK

2. 安裝 Windows SDK for Windows 8.1

3. 安裝 Windows 8.1 desktop samples 但是找不到 DirectShow Base Classes
下載 WIndows SDK for Windows 7,可以找到下列三個 DVD iso
GRMSDK_EN_DVD.iso x86
GRMSDKIAI_EN_DVD.iso ia64
GRMSDKX_EN_DVD.iso amd64
可以安裝 x86和amd64的 Setup\WinSDKSamples\WinSDKSamples_xxx.si
C:\Program Files (x86)\Microsoft SDKs\WIndows\v7.1\Samples\Multimedia\directshow\baseclasses
C:\Program Files\Microsoft SDKs\WIndows\v7.1\Samples\Multimedia\directshow\baseclasses

4. error C2374: 'WMMEDIATYPE_Video' namedguid.h
修改 C:\Program Files\Microsoft SDKs\WIndows\v7.1A\Include\wmsdkidl.h

5. C:\Program Files (x86)\Windows Kits\8.1\bin\xxx\graphedt.exe

2014年10月15日 星期三

語言學習站 IE11 也可以

<audio> 在 IE 真的不好用
還是舊的 <bgSound>
雖然 IE8 上的 ajax.responseText 一直是 undefined
但是 IE11 上成功了。

2014年10月8日 星期三

瀏覽器種類判斷


$(function () {
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
// gecko for IE11
(s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] :
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

if (Sys.ie) $('span').text('IE: ' + Sys.ie);
if (Sys.firefox) $('span').text('Firefox: ' + Sys.firefox);
if (Sys.chrome) $('span').text('Chrome: ' + Sys.chrome);
if (Sys.opera) $('span').text('Opera: ' + Sys.opera);
if (Sys.safari) $('span').text('Safari: ' + Sys.safari);
});

2014年10月2日 星期四

網頁升級

replaceNode -> replaceChild

removeNode -> removeChild

event.srcElement -> event.target

<bgSound>還可以在 IE 上運作,Chrome 則要用 <audio>

iframe.style.pixelWidth -> iframe.style.width

<center> -> <div style="text-align:center;"> 和 <table style="margin:auto;">

document.all.name -> document.getElementsByName('name')[0]

if (event.keyCode == 13) {
  event.keyCode = 9; // 失效了
}
直接尋找下一個元件 focus()

table 內會自動加入無效的 space & enter

Grid.jsFixHeader // 失效了
不要在 TR 內設 style.position = "relative"
改在每個 TH 內設定, style.top 也是如此

showModalDialog() // 失效了

rtMethod.value = "parent.window.jsMethodRt";



2014年9月29日 星期一

微軟的網頁 Behaviors 和 HTC檔,已經被淘汰了

慘慘慘...

Eclipse 搬家

因為 Omondo 之 EclipseUML 不能在 Eclipse 4.4 中執行
直接搬舊的版本到新電腦

1.按 Menu/Window/Preferences
2.選 Server/Runtime Environments
3.選擇 Apache Tomcat v6.0
4.按 Edit...
5.按 Browse...
6.重新選擇 Tomcat installation directory

1.按 Menu/Project/Properties
2.選 Java Build Path
3.選 Libraries 頁簽
4.移除 Apache Tomcat v6.0, 並重新安裝
5.移除 JRE System Library, 並重新安裝

執行時出現 "The archive: C:/Program Files/Apache Software Foundation/Tomcat 6.0/bin/bootstrap.jar..." 錯誤
1.按 Menu/Run/Run Configurations...
2.選 Apache Tomcat/Tomcat v6.0 Server at localhost
3.選 Classpath
4.刪除 User Entries 之錯誤的 bootstrap.jar

執行時出現 "Could not load the Tomcat server configuration..." 錯誤
按 Detail 顯示 "resource is out of sync with the filesystem"
1.按 Menu/Window/Preferences
2.選 General/Workspace
3.勾選 Refresh automatically
4.按 OK
5.重新取消勾選 Refresh automatically

網址:
http://localhost:8080/DigiChance/LightLog/index.html
http://localhost:8080/Kennel/ym/util/Program.xml

因為要與 64bits Java 共存
新增 exlipse.bat, 指定 32bits Java 所在
PATH=C:\Program Files (x86)\Java\jre7\bin;%PATH%
start c:\eclipse3_32\eclipse.exe


2014年9月25日 星期四

MySQL 的替代者 MariaDB

MySQL 有閉源的風險,用 MariaDB 取代

安裝時在 Custom Setup 時可以設定資料庫位置
MariaDB Server/Database instance

執行 HeidiSQL
按 Menu/文件/加載SQL文件
選擇 sql 檔 和 UTF-8編碼

Linux 下搬移資料位置
1.Stop MariaDB using the following command:
 service mariadb stop
2.Copy the existing data directory using the following command:
 sudo cp -R -p /oldpath /newpath
3.edit the MariaDB configuration file /etc/my.cnf.d/server.cnf(my.ini)
4.Restart MariaDB with the command:
 service mariadb start


使用命令安裝,指定資料位置
msiexec /i path-to-package.msi [PROPERTY_1=VALUE_1 ... PROPERTY_N=VALUE_N] /qn
INSTALLDIR:%ProgramFiles%\MariaDB<version>\
DATADIR:INSTALLDIR\data

2014年9月24日 星期三

Export apk from Eclipse

1.在專案上按右鍵 > Android Tools > Export Signed Application Package...
2.預設專案名稱,不要動
3.選擇 Create new keystore(因為之前尚未建立)
4.記住 password,等一下要用
5.輸入 Alias, Password, Validity(使用年限), First and Last Name 等
6.選擇apk的位置

JSP in Eclipse

1.進 Eclipse
2.選擇 Help/Install New Software
3.選擇Indigo - http://download.eclipse.org/release/indigo
4.勾選 Pending...
5.勾選 Web, XML, Java EE and OSGi Enterprise Develepment
6.安裝 Tomcat
7.再進Eclipse
8.選擇 Windows/Preference
9.選擇 Server/Runtime Environments
10.選擇 Add...
11.選擇 Tomcat 版本
12.填入 Tomcat 安裝路徑
13.按 Finish


2014年9月23日 星期二

Android in Eclipse

1.下載並安裝 Java SE 7
2.至 http://developer.android.com/sdk 下載 SDK Tools Only 並解壓縮
3.下載並安裝 Eclipse Standard 4.4, 使用 zip
4.執行 eclipse
5.按功能表 Help/Install New Software
6.按 Add, Name 輸入 ADT Plugin, Location 輸入 http://dl-ssl.google.com/android/eclipse
7.勾選 Developer Tools, 按 Next
8.選擇 I accept the terms of the license agreements, 按 Finish
9.按 OK, 再按 Yes, 重新啟動 Eclipse
10.重新啟動 Eclipse 後按 Open Preferences, 再按 Proceed
11.按 Browse 選擇步驟2的解壓縮目錄
12.按OK, 按Close, 按Close
13.按Cancel
14.按功能表 Window/Android SDK Manager
15.安裝所需的 Packages
16.按功能表 Window/Android Virtual Device Manager
17.按 New 建立 Android 模擬裝置

以上參考 準備 Android 開發環境

設定環境變數 ANDROID_SDK_HOME=D:\Users\mark
改變 Android Virtual Device Manager 位置


2014年9月11日 星期四

MSB8031 錯誤

Visual Studio 2013 編譯時出現 MSB8031 錯誤
是因為微軟移除了 Visual Studio 2013 MFC 的 Multibyte 支援
可下載 Multibyte MFC Library for Visual Studio 2013 解決

2014年9月2日 星期二

Build OpenCV v2

使用 Python 2.7, 不要用 Python 3.4, 雖然只是無法Build OpenCV documents
Python有32和64位元, 要分別安裝
Python的debug版本, 要下載 Python 的 source, 用 VS2013 開啟 PCbuild/pcbuild.sln
可以建立出32位元 PCbuild/python27_d.dll並且拷貝至 Python27/libs 下
64位元會置於 PCbuild/amd64/python27_d.dll 下

因為 Intel IPP 會 Build 進 OpenCV 的 library
所以在安裝 Intel IPP 之前,可先建立一版沒有 Intel Ipp 的 OpenCV Library

  1. Microsoft Visual Studio
  2. Download CMake: www.cmake.org
    ... and install it.
    選 Do not add Cmake to system PATH
  3. Download msysgit and install it.
    msysgit 已經改成 git for windows
    Download TortoiseGit: http://code.google.com/p/tortoisegit/
    ... and install it.
    Note: After this you may need to restart your system.
  4. 建立目錄 C:/OpenCV
    Clone the repository to C:\OpenCV from https://github.com/Itseez/opencv.git
    1. Download Python: https://www.python.org/downloads/ and install it.
      若是使用 Python34 版本,會在建立文件時出錯,為了確認這一點,花了不少時間。
      下載x86(32位元)和amd64(64位元)版本,分別安裝於不同目錄。
      安裝 Setuptools
      下載 ez_setup.py 置於 C:\Python27_32 下
      執行 C:\Python27_32>python ez_setup.py
    2. Start up a command window and navigate to your Python install Scripts folder.
      Install Sphinx via the command:
      C:\Python27_32\Scripts\easy_inatall.exe sphinx
    3. Download and install Numpy: http://sourceforge.net/projects/numpy/files/NumPy/1.8.2/
      注意相對 Python 的版本, 只能下載到32位元, 所以一定會找 Python 32位元版
    4. Download and install Miktex: http://miktex.org/.
      At the fourth step make sure you select for the "Install missing packages" the Yes option.
    5. Download the Intel TBB library: https://www.threadingbuildingblocks.org/, 選擇 Windows 版本
      Extract it.
      Create a dep directory in your OpenCV folder.
      And copy the extracted files here.
    6. Do the same with the eigen files: eigen.tuxfamily.org
    7. And again with the OpenEXR source files: http://www.openexr.com/
      這個好像不用裝。
    8. For OpenNI first download and install the binaries:
      http://www.openni.org/downloadfiles/opennimodules
      Then the PrimeSensor moudle (OpenNI Compliant Hardware Binaries).
      我沒有這個東西。
    9. 從 https://developer.nvida.com/cuda-downloads 下載 CUDA Toolkit
      它有分成Notebook, Desktop, 32/64 等四個版本,請選一個
    10. Qt - You first need to download the source files: http://qt-project.org/
      Then extract them to a final path (should be a short one).
      When finished start up a Visual Studio Command Prompt (2013) from the start menu.
      Navigate to your Qt folder.
      Now enter the command: configure.exe -release -no-webkit -no-phonon -no-phorion -backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-itcg
      Answer to the license agreement.
      Then wait as it could easily take up to a half hour to finish.
      Once finished just enter the nmake command.
      Building the library will take a lot longer then the previous step...
      QT5 64bit 參考如下:
      add C:\Python27_64 to PATH
      開啟 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x64 Native Tools Command Prompt
      set QMAKESPEC=C:\OpenCV\dep\qt5_64\qtbase\mkspecs\win32-msvc2013
      configure.bat -debug-and-release -platform win32-msvc2013 -nomake examples
      nmake
      若是失敗要重來,就整個目錄刪除比較快。
      add C:\OpenCV\dep\qt5_64 to QTDIR
      add C:\OpenCV\dep\qt5_64\qtbase\bin to PATH
      QT5 32bit 參考如下:
      add C:\Python27_32 to PATH
      開啟 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x86 Native Tools Command Prompt
      set QMAKESPEC=C:\OpenCV\dep\qt5_32\qtbase\mkspecs\win32-msvc2013
      configure.bat -debug-and-release -platform win32-msvc2013 -nomake examples
      nmake
      若是失敗要重來,就整個目錄刪除比較快。
      add C:\OpenCV\dep\qt5_32 to QTDIR
      add C:\OpenCV\dep\qt5_32\qtbase\bin to PATH
  5. Now we can build the OpenCV library.
    First start the CMake Gui from the start menu.
    Then select where your source files are and where your want your build files to be.
    Choose the compiler (IDE) you use.
    Note: They are different compiler for 32 and 64 bit.
    CMake will try to search for as many libraries as possible.
    For the ones he cannot find a NOTFOUND constant is set.
    You need to specify these manually.
    Under the WITH group you can select which 3th party libraries to use for the build.
    Under the BUILD group you can specify which extra OpenCV parts to build.
    Set all not found constant to the correct path.
    In ENABLE group enable the solution folders in order to make an organized Visual Studio solution.
    Look arund the items and set any further not found constants.
    Then press the configure button to test them.
    This will bring up some new not found constants. specify them manually.
    Then press again the configure for validation.
    Repeat this procedure until all the entries are accepted.
    Then press the Generate to make the solution and project files.
    Now in the build directory you have the OpenCV solution. Open it.
    Then Build the ALL_BUILD project.
    Do it for both the Debug and Release configuration.
    Depanding on just how much of OpenCV you are building this can take quite long...
    If you haven't yet you might need to add the Intel TBB bin folders content to the system path. Again use the Path Editor.
    To test if your build works start up the generated exe files from your build directory.
    For example contours.exe...
    To collect the built binary files into a single folder built the install project.
    In the install folder you will have all the files of OpenCV that you will use inside your projects.
    That's it. You are done!
    以下步驟紀錄:
    Visual Studio 12 ==> VS2013 x86
    Visual Studio 12 Win64 ==> VS2013 x64
    勾選 Grouped 和 Advanced
    SPHINX_BUILD=C:/Python27/Scripts/sphinx-build.exe
    EIGEN_INCLUDE_PATH=C:/OpenCV/dep/eigen
    選 WITH_QT
    QT_QMAKE_EXECUTABLE=C:/OpenCV/dep/qt5_64/qtbase/qmake/qmake.exe
    Qt5OpenGL_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5OpenGL
    Qt5Concurrent_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Concurrent
    Qt5Core_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Core
    Qt5Gui_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Gui
    Qt5Test_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Gui
    Qt5Widgets_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Widgets
    選 WITH_TBB, 不選 BUILD_TBB
    TBB_INCLUDE_DIRS=C:/OpenCV/dep/tbb42_20140122oss/include
    TBB_LIB_DIR=C:/OpenCV/dep/tbb42_20140122oss/lib/ia32/vc12
    TBB_STDDEF_PATH=C:/OpenCV/dep/tbb42_20140122oss/include/tbb/tbb_stddef.h
    選 WITH_IPP, WITH_IPP_A
    IPP_A_INCLUDE_DIR=C:/Program Files (x86)/Intel/IPP Preview 2014 February/ipp/include
    IPP_A_LIBRARIES=C:/Program Files (x86)/Intel/IPP Preview 2014 February/ipp/lib/intel64/ipp_async_preview.lib
    PYTHON_INCLUDE_DIR=C:/Python27/include
    PYTHON_LIBRARY=C:/Python27/libs/python27.lib
    PYTHON_LIBRARY_RELEASE=C:/Python27/libs/python27.lib
  6. 用 VisualStudio2013 開啟 C:\OpenCV\Builds\OpenCV.sln
    Build Debug 會有一個失敗,因為缺少 python27_d.lib
    Build Release
    Build documentation/docs or documentation/html_docs 單獨的
    Build CMakeTargets/INSTALL 單獨的
  7. 設定下列環境變數以便 VisualStudio2013專案 使用
    TBB_DIR_32=C:\OpenCv\dep\tbb43_20140724oss\bin\ia32\vc12
    TBB_DIR_32_ui=C:\OpenCv\dep\tbb43_20140724oss\bin\ia32\vc12_ui
    TBB_DIR_64=C:\OpenCv\dep\tbb43_20140724oss\bin\intel64\vc12
    TBB_DIR_64_ui=C:\OpenCv\dep\tbb43_20140724oss\bin\intel64\vc12_ui
    OPENCV_BIN_32=C:\OpenCv\build_32\install\x86\vc12\bin
    OPENCV_BIN_32_IPP=C:\OpenCv\build_32_ipp\install\x86\vc12\bin
    OPENCV_BIN_64=C:\OpenCv\build_64\install\x64\vc12\bin
    OPENCV_BIN_64_IPP=C:\OpenCv\build_64_ipp\install\x64\vc12\bin
    OPENCV_INC_32=C:\OpenCv\build_32\install\include
    OPENCV_INC_32_IPP=C:\OpenCv\build_32_ipp\install\include
    OPENCV_INC_64=C:\OpenCv\build_64\install\include
    OPENCV_INC_64_IPP=C:\OpenCv\build_64_ipp\install\include
    OPENCV_LIB_32=C:\OpenCv\build_32\install\x86\vc12\lib
    OPENCV_LIB_32_IPP=C:\OpenCv\build_32_ipp\install\x86\vc12\lib
    OPENCV_LIB_64=C:\OpenCv\build_64\install\x64\vc12\lib
    OPENCV_LIB_64_IPP=C:\OpenCv\build_64_ipp\install\x64\vc12\lib
    刪除Path內的C:\OpenCV\dep\qt5_64\qtbase\bin, 另外新增下列兩環境變數
    QT5_32=C:\OpenCV\dep\qt5_32\qtbase\bin
    QT5_64=C:\OpenCV\dep\qt5_64\qtbase\bin
    32/64位元,且有無IPP一樣 Debug Additional Dependencies
    opencv_calib3d300d.lib
    opencv_core300d.lib
    opencv_features2d300d.lib
    opencv_flann300d.lib
    opencv_highgui300d.lib
    opencv_imgcodecs300d.lib
    opencv_imgproc300d.lib
    opencv_ml300d.lib
    opencv_objdetect300d.lib
    opencv_photo300d.lib
    opencv_shape300d.lib
    opencv_stitching300d.lib
    opencv_superres300d.lib
    opencv_ts300d.lib
    opencv_video300d.lib
    opencv_videoio300d.lib
    opencv_videostab300d.lib
    32/64位元,且有無IPP一樣 Release Additional Dependencies
    opencv_calib3d300.lib
    opencv_core300.lib
    opencv_features2d300.lib
    opencv_flann300.lib
    opencv_highgui300.lib
    opencv_imgcodecs300.lib
    opencv_imgproc300.lib
    opencv_ml300.lib
    opencv_objdetect300.lib
    opencv_photo300.lib
    opencv_shape300.lib
    opencv_stitching300.lib
    opencv_superres300.lib
    opencv_ts300.lib
    opencv_video300.lib
    opencv_videoio300.lib
    opencv_videostab300.lib

2014年9月1日 星期一

系統映像備份

1. Windows 8 提供 系統映像備份
2. 備份目錄:F:\WindowsImageBackup\電腦名稱\Backup 日期時間
3. 第二次備份時會依據電腦名稱備份,但會不預期的合併備份時間
4. 每次備份完成皆對電腦名稱改名
5. 還原時需將電腦名稱改回去

2014年8月27日 星期三

2014年8月25日 星期一

查詢 Windows 備份資料

Wbadmin get versions
Wbadmin get versions -backupTarget:F:
Vssadmin list shadows /for=C:

字串分行

CString str1 = "12345\
67890";
CString str2 = "12345"
                       "67890";

2014年8月19日 星期二

E540 優化

1.開啟硬碟的內容,取消 允許為這個磁碟機中的檔案內容建立索引
2.控制台/系統及安全性/最佳化磁碟機 取消最佳化
3.系統內容/進階/效能/進階/虛擬記憶體/變更 取消 自動管理所有磁碟的分頁大小 選擇 沒有分頁檔
4.用系統管理員執行 powercfg -h off 關閉系統休眠
5.用系統管理員執行 msconfig,開機/選無 GUI 開機

a. 傳統硬碟開機 23s
b. SSD 開機 19s
c. 優化後開機 15s




依據說明設定SSD Cache分割,再安裝 ExpressCache
最後用系統管理員執行 eccmd.exe -info 確認 ExpressCache 正常執行


此時 SanDisk SSD U110 16GB 已經不見了
eccmd.exe -exclude c --排除 C:\ 做 Cache
eccmd.exe -format --清空 SSD Cache
eccmd.exe -clearexclusions --取消Cache排除




刪除不明分割區

Windows內建的Diskpart命令
1.系統管理員身分執行「命令提示字元」,視窗開啟後輸入「diskpart」
2.「list disk」指令查看所有硬碟資訊
3.「select disk 1」(數字部分輸入磁碟編號)切換到該磁碟
4.使用「list partition」或「detail disk」指令來查看該磁碟所有分割區資訊
5.當獵殺目標鎖定之後,只要輸入很簡單的「clean」指令,該顆硬碟上所有分割區就能在瞬間全數刪除
6.「exit」來結束Diskpart程式

2014年8月12日 星期二

Chrome & ramdisk

網路上發現的東西,下次試試看

Google Chrome v26.0 之後的 『--disk-cache-dir=』失效,另解
1. 關閉 Google Chrome,請開啟工作管理元檢查
2. 命令提示字元 右鍵 「以系統管理員身份執行」

rmdir "C:\Users\{帳號}\AppData\Local\Google\Chrome\User Data\Default\Cache"
mkdir "{要指向的位置}"
mklink /d "C:\Users\{帳號}\AppData\Local\Google\Chrome\User Data\Default\Cache" "{要指向的位置}"


範例:
del "C:\Users\user1\AppData\Local\Google\Chrome\User Data\Default\Cache"
mkdir "R:\TEMP\Google Chrome"
mklink /d "C:\Users\user1\AppData\Local\Google\Chrome\User Data\Default\Cache" "R:\TEMP\Google Chrome"

2014年8月11日 星期一

ftp client passive mode 的防火牆設定

在一般的想法中,ftp client 並不需要在防火牆上做任何的設定
但是遇到下列錯誤
指令: PASV
錯誤: 已從伺服器離線: ECONNABORTED - Connection aborted
錯誤: 無法取得目錄列表

一種不負責的解決方法就是關閉防火牆

經過長時間的搜尋,發現自從 Window 7 開始,StatefulFtp 會檢查網路連線
當它發現 PASV就中斷你的連線
所以關閉它,ftp就可正常運作了。
netsh advfirewall set global StatefulFtp disable
當然你也可以啟動它
netsh advfirewall set global StatefulFtp enable

2014年8月8日 星期五

兒當兵太累 戴勝益助脫苦海

在父親節的時候,看到這篇新聞,心情眞差

兒當兵太累 戴勝益助脫苦海

既然無法讓小孩當有錢人,就讓他習慣窮人的生活

2014年8月6日 星期三

FTP 協定

通常 IP分享器會認得 FTP 的 PORT 命令
並且改寫內部IP為外部IP
但部分 IP分享器要求命令的結尾一定要用 \r\n 不能只有 \n

sprintf_s(buf, FTP_BUFFER_LEN, "PORT %s,%d,%d\n", hostIp, hPort, lPort);

sprintf_s(buf, FTP_BUFFER_LEN, "PORT %s,%d,%d\r\n", hostIp, hPort, lPort);

溫度檢測軟體

HWMonitor => 選擇zip不用安裝
GUP-Z => 執行時選No不要安裝
NVIDIA Inspector

2014年8月5日 星期二

std vector 的消滅

早期使用方式:
for (vector<Vector4*>::iterator it = mPt.begin(); it != mPt.end();) {
Vector4 *pVt = *it;
delete pVt;
it = mPt.erase(it);
}

在大量數據時會很慢,更新為下列方式:
while (!mPt.empty()) {
Vector4 *pVt = mPt.back();
delete pVt;
mPt.pop_back();
}

2014年6月26日 星期四

E540 送修紀錄

E540 的第一印象還算不錯
但是偶而會發生藍底白字當機
有一次紀錄到內容是(KERNEL_DATA_INPAGE_ERROR)
懷疑是安裝軟體的問題
但是經過反覆的安裝和回復,強烈懷疑硬體
聯絡 Lenovo,2014/5/8第一次送修,維修人員說是換主機板
約三到四天後送回
隔天卻發現右邊 USB 硬碟不能使用
2014/5/13第二次送修,這一次維修很快就送回,但是忘了問是否又換主機板

Nvidia Geforce GT 740M 壓力測試出現警告
此時使用一陣子,但一值擔心

之後打電話詢問
Lenovo 建議送修
2014/6/11 第三次送修
2014/6/17送回,再次檢測
Nvidia Geforce GT 740M 壓力測試出現警告
Windows 紀錄/系統/事件識別碼 153
2014/6/17 第四次送修
2014/6/27 終於收到機器,說是硬碟的系統有問題導致顯卡測試錯誤,換了主機板和硬碟,所以硬碟清空了,只有原廠的系統。
開機設定完成,執行 Windows Update後,再次檢測
!@#$%^&*() 還是一樣嘛!
2014/6/27 第五次台北之旅...送修

等等等等...

2014/08/05終於回來了
維修結果:
1.開機檢測使用System Update更新系統及驅動測試SLC顯示卡壓力測試正常,因客戶表示會自行到官方網站下載新版驅動更新,依照客戶所敘述的方式至官方下載新版驅動更新測試SLC壓力測試會出現警告狀態,依照Lenovo公司回覆的驅動版本更新狀況依舊,等待公司與總公司確認中 2.客戶要求先行取回測試使用

也就是目前無解, Lenovo E540 不能買啊!


SanDiskSSD U110 16G
2006/6/21
6.3.9600.16384

WDC WD10JPVX-08JC3T5

Intel(R) HD Graphics 4600
Intel Croporation
2013/12/20
10.18.10.3379
Microsoft Windows Hardware Compatibility Publisher

NVIDIA GeForce GT 740M
NVIDIA
2913/10/28
9.18.13.2762
Microsoft WIndows Hardware Compatibility Publisher

2014/09/18
終於接到電話,硬體沒問題,是檢測軟體的問題。

DeadLock

一般說來 MultiThread 的 DeadLock,只要依序取得資源,是不會鎖死的。

但是遇到有畫面的 Thread 就複雜了,如下

1.工作Thread取得資源
2.畫面Thread等待資源
3.工作Thread 使用 畫面->SendMessage
4.鎖死...永遠的等待

2014年6月17日 星期二

英文學習站 忽然死了

經過查證

發出 request
https://googledrive.com/host/0B7u4moMmo8nDMDJuTmxSMGptUmc?ti=%u9673%u5E73%u82F1%u6587%u4E94%u4E0B_Unit1&id=1bXGGbmey3BTWtvZDdHLVwFHgEUNERXtzHSEucaBt6cs
回覆: status 301
轉成
https://079d23e82a287d32341893c3a6d0d7c6f9632316.googledrive.com/host/0B7u4moMmo8nDMDJuTmxSMGptUmc
此時掉了 query string

建立 EnglishClass.html,將課程列表放入
將 Google Drive 的目錄 share,在 share folder 內可以直接使用檔名

2014年6月4日 星期三

語錄

不怕神一樣的對手,就怕豬一樣的隊友
反服貿 -> 自己國家自己救
北捷運隨機殺人事件 -> 自己的性命自己救
會考 -> 自己的小孩自己教
電腦 -> 自己的電腦自己修 ---> 我不是神啊!

給你福利你當福氣
給你方便你當隨便
給你輕鬆你當放鬆
給你臉你不要臉

PMP
PMPMP

雙面刀鬼

人生四鐵:一起同過窗,一起扛過槍,一起嫖過娼,一起分過贓。

That which does not kill us makes us stronger.
打沒死就變大尾

孟子 ‧ 公孫丑章句
齊人有言曰:『雖有智慧,不如乘勢;雖有鎡基,不如待時。』



2014年6月3日 星期二

OpenCV 開發

執行時會出現 Cannot find or open the PDB file 錯誤
開啟 Tools -> Options -> Debugging -> symbols 並且勾選 "Microsoft Symbol Servers"
程式執行一遍,這次速度會很慢,因為要下載 .pdb 檔
此時再取消 Microsoft Symbol Servers
程式再執行一遍,若是還有找不到 PDB 檔,則輸入在 Specify excluded modules

執行時出現 無法找到程序輸入點 InitializeCriticalSectionEx (在動態連結程式庫 KERNEL32.dll)。錯誤
是因為Intel TBB在XP上產生的錯


2014年5月29日 星期四

ThinkPad E540 技巧

完整關機->Shift+關機
開機時按 F1->進入BIOS
開機時按 F12->開機選擇->此時有 Lenovo Diagnostics
Fn+Esc 選擇 Fn 功能
查詢 S/N -> 開啟命令提示字元 輸入 wmic bios get serialnumber
「Win」+「R」快速鍵,於「開啟」欄位輸入「services.msc」
「Win」+「X」快速鍵,於畫面左下角開啟命令選單
Ctrl+Alt+F12 -> Intel HD 圖形控制台
藍芽開關->Win+C->變更電腦設定->網路->飛航模式->Bluetooth
「Win」+「Shift」+「<-」快速鍵,雙螢幕切換位置




2014年5月23日 星期五

Build OpenCV

  1. Microsoft Visual Studio
  2. Download CMake: www.cmake.org
    ... and install it.
    選 Do not add Cmake to system PATH
  3. Download msysgit and install it.
    msysgit 已經改成 git for windows
    Download TortoiseGit: http://code.google.com/p/tortoisegit/
    ... and install it.
    Note: After this you may need to restart your system.
  4. 建立目錄 C:/OpenCV
    Clone the repository to C:\OpenCV from https://github.com/Itseez/opencv.git
    1. Download Python: https://www.python.org/downloads/ and install it.
      若是使用 Python34 版本,會在建立文件時出錯,為了確認這一點,花了不少時間。
      下載x86(32位元)和amd64(64位元)版本,分別安裝於不同目錄。
      安裝 Setuptools
      下載 ez_setup.py 置於 C:\Python27_32 下
      執行 C:\Python27_32>python ez_setup.py
    2. Start up a command window and navigate to your Python install Scripts folder.
      Install Sphinx via the command:
      C:\Python27_32\Scripts\easy_inatall.exe sphinx
    3. Download and install Numpy: http://sourceforge.net/projects/numpy/files/NumPy/1.8.1/
      注意相對 Python 的版本
    4. Download and install Miktex: http://miktex.org/.
      At the fourth step make sure you select for the "Install missing packages" the Yes option.
    5. Download the Intel TBB library: https://www.threadingbuildingblocks.org/, 選擇 Windows 版本
      Extract it.
      Create a dep directory in your OpenCV folder.
      And copy the extracted files here.
    6. Do the same with the eigen files: eigen.tuxfamily.org
    7. And again with the OpenEXR source files: http://www.openexr.com/
      這個好像不用裝。
    8. For OpenNI first download and install the binaries:
      http://www.openni.org/downloadfiles/opennimodules
      Then the PrimeSensor moudle (OpenNI Compliant Hardware Binaries).
      我沒有這個東西。
    9. To use CUDA you need to install the latest CUDA Toolkit...
      and the Cuda Tools SDK.
      CUDA 並不支援 VS2013
    10. Qt - You first need to download the source files: http://qt-project.org/
      Then extract them to a final path (should be a short one).
      When finished start up a Visual Studio Command Prompt (2010) from the start menu.
      Navigate to your Qt folder.
      Now enter the command: configure.exe -release -no-webkit -no-phonon -no-phorion -backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-itcg
      Answer to the license agreement.
      Then wait as it could easily take up to a half hour to finish.
      Once finished just enter the nmake command.
      Building the library will take a lot longer then the previous step...
      QT5 64bit 參考如下:
      add C:\Python27_64 to PATH
      開啟 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x64 Native Tools Command Prompt
      set QMAKESPEC=C:\OpenCV\dep\qt5_64\qtbase\mkspecs\win32-msvc2013
      configure.bat -debug-and-release -platform win32-msvc2013 -nomake examples
      nmake
      若是失敗要重來,就整個目錄刪除比較快。
      add C:\OpenCV\dep\qt5_64 to QTDIR
      add C:\OpenCV\dep\qt5_64\qtbase\bin to PATH
      QT5 32bit 參考如下:
      add C:\Python27_32 to PATH
      開啟 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x86 Native Tools Command Prompt
      set QMAKESPEC=C:\OpenCV\dep\qt5_32\qtbase\mkspecs\win32-msvc2013
      configure.bat -debug-and-release -platform win32-msvc2013 -nomake examples
      nmake
      若是失敗要重來,就整個目錄刪除比較快。
      add C:\OpenCV\dep\qt5_32 to QTDIR
      add C:\OpenCV\dep\qt5_32\qtbase\bin to PATH
  5. Now we can build the OpenCV library.
    First start the CMake Gui from the start menu.
    Then select where your source files are and where your want your build files to be.
    Choose the compiler (IDE) you use.
    Note: They are different compiler for 32 and 64 bit.
    CMake will try to search for as many libraries as possible.
    For the ones he cannot find a NOTFOUND constant is set.
    You need to specify these manually.
    Under the WITH group you can select which 3th party libraries to use for the build.
    Under the BUILD group you can specify which extra OpenCV parts to build.
    Set all not found constant to the correct path.
    In ENABLE group enable the solution folders in order to make an organized Visual Studio solution.
    Look arund the items and set any further not found constants.
    Then press the configure button to test them.
    This will bring up some new not found constants. specify them manually.
    Then press again the configure for validation.
    Repeat this procedure until all the entries are accepted.
    Then press the Generate to make the solution and project files.
    Now in the build directory you have the OpenCV solution. Open it.
    Then Build the ALL_BUILD project.
    Do it for both the Debug and Release configuration.
    Depanding on just how much of OpenCV you are building this can take quite long...
    If you haven't yet you might need to add the Intel TBB bin folders content to the system path. Again use the Path Editor.
    To test if your build works start up the generated exe files from your build directory.
    For example contours.exe...
    To collect the built binary files into a single folder built the install project.
    In the install folder you will have all the files of OpenCV that you will use inside your projects.
    That's it. You are done!
    以下步驟紀錄:
    Visual Studio 12 ==> VS2013 x86
    Visual Studio 12 Win64 ==> VS2013 x64
    勾選 Grouped 和 Advanced
    SPHINX_BUILD=C:/Python27/Scripts/sphinx-build.exe
    EIGEN_INCLUDE_PATH=C:/OpenCV/dep/eigen
    選 WITH_QT
    QT_QMAKE_EXECUTABLE=C:/OpenCV/dep/qt5_64/qtbase/qmake/qmake.exe
    Qt5OpenGL_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5OpenGL
    Qt5Concurrent_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Concurrent
    Qt5Core_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Core
    Qt5Gui_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Gui
    Qt5Test_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Gui
    Qt5Widgets_DIR=C:/OpenCV/dep/qt5_64/qtbase/lib/cmake/Qt5Widgets
    選 WITH_TBB, 不選 BUILD_TBB
    TBB_INCLUDE_DIRS=C:/OpenCV/dep/tbb42_20140122oss/include
    TBB_LIB_DIR=C:/OpenCV/dep/tbb42_20140122oss/lib/ia32/vc12
    TBB_STDDEF_PATH=C:/OpenCV/dep/tbb42_20140122oss/include/tbb/tbb_stddef.h
    選 WITH_IPP, WITH_IPP_A
    IPP_A_INCLUDE_DIR=C:/Program Files (x86)/Intel/IPP Preview 2014 February/ipp/include
    IPP_A_LIBRARIES=C:/Program Files (x86)/Intel/IPP Preview 2014 February/ipp/lib/intel64/ipp_async_preview.lib
    PYTHON_INCLUDE_DIR=C:/Python27/include
    PYTHON_LIBRARY=C:/Python27/libs/python27.lib
    PYTHON_LIBRARY_RELEASE=C:/Python27/libs/python27.lib
  6. 用 VisualStudio2013 開啟 C:\OpenCV\Builds\OpenCV.sln
    Build Debug 會有一個失敗,因為缺少 python27_d.lib
    Build Release
    Build documentation/docs or documentation/html_docs 單獨的
    Build CMakeTargets/INSTALL 單獨的

2014年5月22日 星期四

備份與還原

備份

  1. 放入要備份的硬碟
  2. 按 Win+C
  3. 按 設定
  4. 按 控制台
  5. 按 檔案歷程紀錄,此時要等系統抓取硬碟
  6. 選左下方的 系統映像備份
  7. 選擇 硬碟,按下一步
  8. 按 開始備份,此時要等...
  9. 有遇過備份失敗,如下訊息,找不到解答,最後執行 硬牒右鍵/內容/工具/檢查錯誤,之後再備份一次。
  10. 完成後可在硬碟上發現 WindowImageBackup 目錄
備份失敗
Windows 備份無法在存放位置上建立陰影複製。(0x80780034)

其它資訊:
陰影複製提供者發生錯誤。如需詳細資訊,請檢查系統和應用程式事件紀錄檔。(0x80042306)

備份失敗
錯誤碼:0x81000036
設定 SoftPerfect RAMdisks 安裝為可移除磁碟

還原
  1. 放入原先備份的硬碟
  2. 按 Win+C
  3. 設定
  4. 右下方之 變更電腦設定
  5. 更新與復原
  6. 復原
  7. 進階啟動 之 立即重新啟動
  8. 重新開機後 選 疑難排解
  9. 進階選項
  10. 系統映像修復
  11. 選擇帳戶
  12. 輸入密碼
  13. 可選擇 使用最新可用的系統映像,或 選取系統映像
  14. 選擇 選取系統映像 按下一步
  15. 選取硬碟 按下一步
  16. 此時會列出所有備份的時間點
  17. 選擇後 按下一步
  18. ....
原廠還原
  1. 按 Win+C
  2. 設定
  3. 右下方之 變更電腦設定
  4. 更新與復原
  5. 復原
  6. 移除所有項目並重新安裝 WIndows
  7. 下一步
  8. 選擇磁碟機
  9. 只移除我的檔案

mingrenn@outlook.com


ThinkPad E540 安裝紀錄

0. 右下角出現 未正確設定安全開機 執行完 Windows Update 即會消失
0. ExpressCache
0. 移除 Norton Internet Security,Windows 會自動啟動 Windows Defender
0. 移除 LenovoEMC
0. Lenovo System Update
0.a ThinkVantage Active Protection System
0.b ThinkPad Video Features
0.c Intel(R) HD Graphics Driver
0.d Synaptics UltraNav Driver
0.e ThinkPad Hotkey Features Integration Package Setup
0.f Conexant CX20751 Aduio Driver

1. GnuWin32 OpenSSL-0.9.8h
1. Daemon Tools Lite => 使用 PowerDVD CreateWindows檔案總管 替代
1. EOS Utility
1. SoftPerfect RAM Disk
1. OpenOffice
1. LuCam Capture
1. 7-Zip File Manager
1. UltraEdit-32 => 在本機上無法執行,那就換一台機器吧!
1. UltraVNC
1. VLC media player
1. FileZilla => 這裡面有廣告軟體 ADWARE/InstallCore.Gen7
1. TortoiseSVN
1. Youtube Downloader HD => 小心偷渡軟體
1. Visual Studio 2005
1. Visual Studio 2008
1. Visual Studio 2013
1. HTC Sync Manager
1. Chrome => 參考 chrome & ramdisk 文章
1. Adobe Reader

1. Altera Quartus II 9.1sp2 => 安裝 USB-Blaster 驅動 "C:\altera\91sp2\quartus\drivers\usb-blaster"
1. MicroChip MPLAB IDE => 安裝 ICD 3驅動 "C:\Program Files (x86)\Microchip\MPLAB IDE\Drivers64 "
1. Activate or Trial PRO mode

1. Wireshark
1. WinCap

2. WebNavi => 使用管理員執行32位元之IE,進入Signalway安裝WebNaviSetup.exe
2. CMake 2.8.12.2
2. Git for Windows(Git 1.9.4)
2. TortoiseGit
2. Install for OpenCV...
2. Python 2.7.8
2. Python 2.7.8 amd64
2. numpy 1.8.2
2. MikTeX 2.9
2. CUDA Tools SDK 6.5.14 notebook 64
2. Intel IPP Preview 2014

3. Visual Studio InstallShield
3. Multibyte MFC Library for Visual Studio 2013
3. Java EE 7 Web Profile SDK 32&64 bits
3. MariaDB 10.0
3. Tomcat 6
3. Eclipse ->參考 Eclipse 搬家JSP in Eclipse
3. Android -> 參考 Android in Eclipse
3. DirectShow -> 參考 DirectShow 演變
3. DR3_TMConfigurator

4.Eclipse4.4 加入 Web, XML, Java EE and OSGi Enterprise Development

5. VMware Player VMware-player-12.0.1-3160714.exe
5. Arduino arduino-1.6.6-windows.exe
5. HI-TECH C PRO for the PIC18 MCU Family V9.80PL0

2014年5月20日 星期二

2014年5月14日 星期三

英文學習站 使用方式

  1. 用滑鼠點 英文字 會發音。
  2. 用滑鼠快點兩下 英文或中文字 會隱藏或顯示 英文或中文字。
  3. 點選第一列標頭的 中文 或 英文,會隱藏或顯示整欄的 英文或中文。
  4. 點選表格上方隻重排,會重新排列表格。
  5. 再輸入欄位填入英文後按 enter,會發出輸入之音,並檢查輸入英文是否正確。
正式發布 英文學習站

設計過程遇到一大堆的窟窿
本想解決一個,就發佈一篇網誌
但那是不可能的

除了可能根本無法完成 英文學習站 計畫
(當然也可將網誌視為失敗紀錄)
在解決問題的過程中,一關接著一關
整個腦袋想著各種的可能
實在是分不出精神來做這事
目前只能寫寫回憶錄了


  • Google 發音 時靈時不靈,尤其在 Google 的 blogger,後來發現 Google Drive 內的網頁也會,本機的網頁比較不會。直覺的反應就是 Cache,所以在 chrome 的 紀錄/清除瀏覽資料 中勾選 快取圖片和檔案,解決了時靈時不靈的狀況,變成本機正常,Google 內的都不正常。
  • 懷疑是 google 的 blogger 內的某一些 script 導致錯誤,所以將網頁移往 Google Drive。但還是一樣。
  • 利用 chrom 內 網頁中按滑鼠右鍵,選擇 檢查元素,切換 Network 頁簽,檢查網路傳輸的差異,發現不能發音是 Status canceled,利用 chrome://net-internals ,選擇 Events,發現 正不正常 的差異是,HTTP 協議 Header 中 Referer,本機正常 沒有 Referer,Google 內的網頁不正常 都有 Referer,推測是 Google 發現 Referer 來自 Google 本身,所以回覆了404 not found。
  • 本以為 ajax.setRequestHeader("Referer", ""); 能消除 Referer,發現安全性問題使得不能作用,隨後安裝 chrome 的擴充功能 Referer Control,就成功了,但是 IE 怎麼辦?之後又發現 https:// 到 http:// 也有安全性問題,不會傳送 Referer,所以將 https://translate.google.com.tw/translate_tts 改成 http://translate.google.com.tw/translate_tts 就完成了。
  • 雖然 chrome 成功,IE 居然不行,虧我還是從微軟的網站上找到的資料。試試看把 audio 藏在 iframe 吧!
  • 雖然 iframe 把 Referer 移除,但是裡面的 audio 移除了一半,不知為何 IE 連送三次 Request,第三次才移除 Refere_r,但還是不說話。
  • 網路上有人猜測,只要有 Referer,translate_tts 就不動作,害我還懷疑是 google 的 blogger 內的某一些 script 導致錯誤,大動干戈。
  • 最後放棄了,把 IE 獨立出來。
另一個問題是 Google Drive 內的網頁問題,因為一時懶惰,沒有看清說明,直接使用 share 的網址,如下 https://drive.google.com/file/d/0B7u4moMmo8nDOERrYlFDRm9NaUU 一直不成功,直到最後才發現要改成 https://googledrive.com/host/0B7u4moMmo8nDOERrYlFDRm9NaUU。