2015年12月24日 星期四

[Project-web]Front end web final project

這是一堂網頁設計的期末專題
雖然老師進度緩慢,但是我從零到有,並偷懶從bootstrap開始學起,從中真的學到非常多的東西,像是html 相關標籤語言,利用css來達成美化和版面配置,最後一些滑動點擊事件處理利用jQuery,很開心完成自己從以前就想學習怎麼實作的想法,感謝自己有勇氣修這堂課.

This is my web design courses final project.
In this part we are going to show the front end part.Although teacher taught in a slow way, I learn how to use bootstrap by making my web!!
From zero to 100%.It's really a fantastic thing!!!!


2015年11月26日 星期四

[Android] EditText close the default pop-out keyboard 關閉鍵盤自動跳出

Method: 
在AndroidMainfest.xml中把windowSoftInputMode把屬性設成
adjustUnspecified|stateHidden

Go to Mainfest.xml choose your activity and type android:windowSoftInputMode="adjustUnspecified|stateHidden"

< activity android:name=" .Main " 
android:label="@string/app_name" 
android:windowSoftInputMode="adjustUnspecified|stateHidden" > 
< intent-filter> 
< action android:name="android.intent.action.MAIN" /> 
< category android:name="android.intent.category.LAUNCHER" /> 
< /intent-filter> 
< /activity>  

2015年11月17日 星期二

[OpenCV C++]Load Image 圖片開啟

cvLoadImage()

載入圖片的意思 IplImage* cvLoadImage("檔案名稱",參數); 參數的部份可以參考命名規則的說明,回傳的訊息是IplImage資料結構,它的參數分類有 #define CV_LOAD_IMAGE_UNCHANGED -1 原圖影像 #define CV_LOAD_IMAGE_GRAYSCALE 0 灰階 #define CV_LOAD_IMAGE_COLOR 1 彩色 #define CV_LOAD_IMAGE_ANYDEPTH 2 任何彩度 #define CV_LOAD_IMAGE_ANYCOLOR 4 任何彩色

cvNamedWindow()

cvNamedWindow("視窗名稱",參數);
而它的參數實質上只有一個
AUTOSIZE可以讓圖片便成原圖大小,也就是圖形維度不做調整,但是圖片太大很容易造成困擾
如果要微調就要用到cvResizeWindow()這個函式
但是,cvNamedWindow()不能設成1(CV_WINDOW_AUTOSIZE),務必將參數設為0或其他非1的數字.

#include < opencv2/core/core.hpp >
#include < opencv2/highgui/highgui.hpp >
#include < iostream >
using namespace cv;
using namespace std;
int main()
{
    IplImage *InImage;

 InImage = cvLoadImage("C:/Users/Public/Pictures/Sample Pictures/789.jpg",CV_LOAD_IMAGE_GRAYSCALE);
    
 CvSize Size1 = cvGetSize(InImage);

    //建立視窗(視窗名稱,參數)
 cvNamedWindow("InImage",CV_WINDOW_AUTOSIZE);
 
    //顯示影像(視窗名稱,影像檔案)
    cvShowImage("InImage",InImage);
  
    cvWaitKey(0); //按下任意按鍵可將圖片關閉
 cvReleaseImage(&InImage); //釋放來源影像佔用的記憶體
    cvDestroyWindow( "InImage" ); //銷毀視窗「src」
    return 0;

  
}

2015年10月29日 星期四

[Eclispe]加上自動提示(Intellisense)程式碼

When u build an new environment!!! Don't forget to set Eclipse Intellisense. it will help u a lot haha!!

打一打沒有提示字真得好難,這次來分享自動提示

Solution:
Windows -> Preferences -> Java -> Editor -> Content Assist
Auto activation triggers for Java keyin                    abcdefghijklmnopqrstuvwxyz(,


[Eclipse] console font size

Sometime i will forget how to resize my console font size in my eclipse!!

Solution
window -> preferences-> general -> appearance -> colors and fonts ->debug -> console font 


【Android】Redering Problems Missing Styles

After i update my Android Studio , my XML always show  Rendering Problems Missing Style
今天在升級版的Android Studio後,在建立新應用程式後,都會出現下列的問題畫面:


Solution:

【File】→【Invalidate Caches / Restart...】:

[Android] java.io.FileNotFoundException AND android.os.NetworkOnMainThreadException!!

1.Android 4.0 has a new Exception in NetWork part.So if you request it.
You will get a android.os.NetworkOnMainThreadException!!

Android4.0在網路的部份多了一個新的Exception,
叫做android.os.NetworkOnMainThreadException
意思就是說:網路的活動跑在主要執行緒上了,很貼心的告訴你,這樣子你的APP可能會因為網路的活動等待回應太久,而被系統強制關閉(收到ANR)。

Solution:(put it in main )
StrictMode
    .setThreadPolicy(new StrictMode.ThreadPolicy.Builder()  
    .detectDiskReads()  
    .detectDiskWrites()  
    .detectNetwork()   // or .detectAll() for all detectable problems  
    .penaltyLog()  
    .build());  



2.Android 4.0 hope developer use post to request ,But if will occur
Java.io.FileNotFoundException

4.0中設置httpCon.setDoOutput(true),将導致請求以post方式提交
然後就會出現 java.io.FileNotFoundException

Soluation:
Delete-->httpCon.setDoOutput(true);