2010年1月20日 星期三

雲端運算 ! 介紹影片

2009年12月22日 星期二

[轉載] C# RowDataBound事件




RowDataBound事件基本上就是迴圈發生的, 我在其中寫foreach根本是多餘的


請看 ..............



2009年12月13日 星期日

[閱讀]行銷,就是讓消費者替你說好話



熱迷行銷,讓顧客自動為你宣傳!

名人代言風潮的下一個浪潮將是熱迷代言──
與顧客搏感情留住顧客、提升忠誠度,
以難忘的體驗,讓消費者吃好道相報,
口耳相傳力量大,讓顧客瘋你的產品,
不只買你的東西,還樂於替你的產品代言。

2009年12月12日 星期六

Xbox 360 新體感




XBOX太帥了,如果可以製作出感應這麼精良的sensor 那玩"七龍珠"一定很爽

2009年12月9日 星期三

[C++] 井字遊戲程式碼

這個程式用到三維空間陣列概念 用提示命令字元視窗模擬

寫得不是很精簡拉XD

Class TicTacToe{
   public:
       TicTacToe();
       void Make();
   private:
       void judge();
       int winner,i,j,count,linesum,side,choice;
       int **game;
       char ***display; //三維陣列
   };
TicTacToe::TicTacToe(){
            cout<<"----井字遊戲----"<<endl;
            count=0;
            for(i=0;i<5;i++){
             for(j=0;j<5;j++){
               if(i==1||i==3) cout<<"-";
               if(j==1||j==3){
                if(i!=1&&i!=3) cout<<" |";
                      }
                      }
                      cout<<endl;
                      }
            for(i=1;i<=9;i++){
             cout<<i<<"  ";
             if(i%3==0) cout<<endl;
                    }
             cout<<endl;
            linesum=0;
            side=1;
            winner=0;
            game=new int*[3]; //初始化二維陣列
            for(i=0;i<3;i++) game[i]=new int[3];
            for(i=0;i<3;i++){
             for(j=0;j<3;j++) game[i][j]=0;}
             display=new char**[3];
              for(i=0;i<3;i++) display[i]=new char*[3];
              for(i=0;i<3;i++){
               for(j=0;j<3;j++) display[i][j]=new char[1];}
            for(i=0;i<3;i++){
            for(j=0;j<3;j++) strcpy(display[i][j],"-");}
}
void TicTacToe::Make(){
            cout<<"開始PK!!!!!"<<endl<<endl;
            while(winner==0){
               if(side==1){
                    cout<<"Player1.....*"<<endl;
                    cin>>choice;
                    choice--;
               while(game[choice/3][choice%3]!=0){
                  cout<<"已經劃過!!!";
                  cin>>choice;
                  choice--;
               }
               strcpy(display[choice/3][choice%3],"*");
               game[choice/3][choice%3]=1;
               side=2;
               cout<<"Round : "<<count+1<<endl<<endl;
               count++;
               for(i=0;i<3;i++){
               for(j=0;j<3;j++){
                  cout<<display[i][j];
                  }
                  cout<<endl;
                  }
                  cout<<endl;
                  judge();
               }
         else if(side==2){
                  cout<<"Player2.....O"<<endl;
                  cin>>choice;
                  choice--;
               while(game[choice/3][choice%3]!=0){
                 cout<<"已經劃過!!!";
                 cin>>choice;
                 choice--;
               }
               strcpy(display[choice/3][choice%3],"O");
               game[choice/3][choice%3]=4;
               side=1;//丟選擇權
               count++;
               cout<<"Round : "<<count<<endl<<endl;
               for(i=0;i<3;i++){
               for(j=0;j<3;j++){
                  cout<<display[i][j];
                  }
                  cout<<endl;
                  }
                  cout<<endl;
               }
               judge();
               if(count==9) winner=1;
         }
               cout<<"平手"<<endl;
                system("pause");
}
void TicTacToe::judge(){
            for(i=0;i<3;i++){
             for(j=0;j<3;j++){
             linesum=linesum+game[i][j];
                     }
             if(linesum==3){cout<<"PLATER 1 WIN!!!"<<endl;
             system("pause");}
             if(linesum==12){cout<<"PLATER 2 WIN!!!"<<endl;
             system("pause");}
             linesum=0;
                     }
             for(i=0;i<3;i++){
             for(j=0;j<3;j++){
             linesum=linesum+game[j][i];
                     }
             if(linesum==3){cout<<"PLATER 1 WIN!!!"<<endl;
             system("pause");}
             if(linesum==12){cout<<"PLATER 2 WIN!!!"<<endl;
             system("pause");}
             linesum=0;
                     }
             if(game[0][0]+game[1][1]+game[2][2]==3){
                                 cout<<"PLATER 1 WIN!!!"<<endl;
                                 system("pause");}
             if(game[0][0]+game[1][1]+game[2][2]==12){
                                 cout<<"PLATER 2 WIN!!!"<<endl;
                                 system("pause");}
             if(game[2][0]+game[1][1]+game[0][2]==3){
                                 cout<<"PLATER 1 WIN!!!"<<endl;
                                 system("pause");}
             if(game[2][0]+game[1][1]+game[0][2]==12){
                                 cout<<"PLATER 2 WIN!!!"<<endl;
                                 system("pause");}
             }
        main(){
             TicTacToe t;
             t.Make();
             system("pause");
}

2009年12月6日 星期日

IEEE 802.11 & IEEE 802.11e


Wireless LAN: WiFi (IEEE 802.11)

1.IEEE 802.11:
定義了媒體存取控制層(MAC層)和物理層。物理層定義了工作在2.4GHz的ISM頻段上的兩種展頻作調頻方式和一種紅外傳輸的方式,總數據傳輸速率設計為2Mbit/s。兩個設備之間的通信可以設備到設備(ad hoc)的方式進行,也可以在基站(Base Station, BS)或者訪問點(Access Point,AP)的協調下進行。為了在不同的通訊環境下取得良好的通訊質量,採用 CSMA/CA (Carrier Sense Multi Access/Collision Avoidance)硬體溝通方式。

2009年9月27日 星期日

生活開始轉變

升上研究所了

真得蠻不習慣

感覺壓力會莫名其妙從生活中空隙滲入