忍者ブログ
私筆記
カテゴリー
* [心路歷程] 綜合百匯(4) * [心路歷程] 文章轉錄(2) * [程式設計] C.C++(0) * [程式設計] JAVA(2) * [網頁設計] Sever(0) * [網頁設計] HTML(1) * [網頁設計] PHP(0) * [網頁設計] SQL(0) * [網頁設計] AJAX(0) * [軟硬兼施] 應用軟體(0) * [心路歷程]攝紀路(14)
  カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  最新記事
  アーカイブ
  カテゴリー
  研究紀錄
  RSS
收藏本站Add to Technorati Favorites
今天瀏覽人次
昨天瀏覽人次
總計瀏覽人次
  最新コメント
  最新トラックバック
      バーコード
      ブログ内検索
    2024/05/03 (Fri)
    ×

    [PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

    2008/11/07 (Fri)
    /**********************************************************************
    *    DS第一次作業  by  496530002 資管二 郭建廷                              *           
    *                                                                                                                   *
    ***********************************************************************/
    /*載入JAVA預設函式庫*/
    import java.io.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import java.util.Arrays;
    import java.util.ArrayList;
    import java.util.LinkedList;
    import java.util.Collections;
    import java.util.List;
    import java.lang.String;
    import java.lang.Integer;
    import java.util.Scanner;
    import java.util.InputMismatchException;

    public class dshw1/*主要class宣告*/{
        /*建立Linklist物件*/
        static LinkedList<String> list = new LinkedList<String>();
        static LinkedList<String> list2 = new LinkedList<String>();
        static LinkedList<String> list3 = new LinkedList<String>();
        /*建立Scanner物件*/
        static Scanner keyboard = new Scanner(System.in);
        /*主程式main宣告*/
        public static void main(String[]args)throws IOException{
            /*宣告資料讀取流,載入檔案*/
            BufferedReader br1 = new BufferedReader(new FileReader("Name.dat"));
            BufferedReader br3 = new BufferedReader(new FileReader("Name.dat"));
            BufferedReader br2 = new BufferedReader(new FileReader("Skill.dat"));
            String[]a1; String[]a2;        //宣告字串儲存用字串陣列
            String Name=br1.readLine();        //宣告字串變數儲存讀入字串
            String Skill=br2.readLine();
            String count1=br3.readLine();
            /*設定計數器偵測檔案行數調整陣列大小*/
            int count=0;    //宣告計數器
            while(count1!=null){         //設定迴圈讀取檔案、計數   
                count1 = br3.readLine();
                count++;
            }
            /*設定以變數設定大小之陣列*/
            int i=0;
            a1=new String [count+1];
            a2=new String [count+1];
            /*利用迴圈把資料儲存起來*/
            while(Name!=null){            
                a1[i]=Name;            //設定陣列儲存資料   
                a2[i]=Skill;
                Name = br1.readLine();        //以行為單位儲存到字串陣列中
                Skill = br2.readLine();
                list.add(a1[i]);        //將陣列中之字串之料一筆筆加入List物件中
                list2.add(a2[i]);
                i++;
            }
            System.out.println("");        //換行
            System.out.println("");
            /*程式主要功能選項*/
            int sel=0;
            try {
                    System.out.println("Select 1<第一題> or 2<第二題> or 3<第三題> or <第四、五題>");
                    sel=keyboard.nextInt();
                } catch(InputMismatchException e) {
                    System.out.printf("Not a correctly number.\n");
                    keyboard.nextLine();
                    System.out.printf("Try again\n\n");
                }
            switch(sel){
                case 1:linearlistprint(a1,a2,i);
                    break;
                case 2:sllnext(count);
                    break;   
                case 3:binso(a1,a2,i);
                    break;
                case 4:doublink(i);
                    break;
            }
        }
        /*第一題,將linearlist印出來*/
        public static String linearlistprint(String[]a1,String[]a2,int i)throws IOException{   
            /*印出*/
            System.out.println("");
            System.out.println("Array");
            for(int j=0;j<i;j++){
                System.out.print(a2[j]+"        ");
            }       
            System.out.println("");       
            for(int j=0;j<i;j++){
                System.out.print(a1[j]+"   ");
            }
            System.out.println("\n\nList");
            System.out.println(list2+"\n"+list);   
            return "";    //傳變數回主程式
        }
        /*第二題,SingleLinkList*/
        public static int sllnext(int i)throws IOException{
            System.out.println("");    //換行
            System.out.println("");
            System.out.println("");
            int cou=0;int con=cou+1;int xxx=1;int sto;       
            System.out.println("\n\nNode "+con+"\n"+list.get(cou)+"\n"+list2.get(cou)+"\n\n");
            System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
            sto = keyboard.nextInt();
            cou++;con++;
            while(cou<=i-1&&sto!=3){
                System.out.println("\n\nNode "+con+"\n"+list.get(cou)+"\n"+list2.get(cou)+"\n\n");
                System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
                sto = keyboard.nextInt();       
                if(sto==1){
                    cou++;
                    con++;
                }
                else if(sto==3){
                    System.exit(0);
                }
                else
                    cou=cou+0;
            }
            return 0;
        }
        /*第三題,Binsorting*/
        public static String binso(String[]a1,String[]a2,int r)throws IOException{
           
            int i=list.size();
            int[]bins=new int[i];    //宣告變數
            for(int j=0;j<i;j++){
                bins[j]=Integer.parseInt(a2[j]);
            }
            String t,t2,t3;int xll;
            boolean flag = true;
            for(int h = 0; h < i+1 && flag; h++) {
                //flag = false;
                for(int j = 0; j+1 < i; j++) {
                    if((Integer.parseInt(list2.get(j+1)) < (Integer.parseInt(list2.get(j))))){             
                        t = list2.get(j+1);
                        t2= list.get(j+1);
                        list2.remove(j+1);
                        list.remove(j+1);
                        list2.add(j+1,list2.get(j));
                        list.add(j+1,list.get(j));
                        list.remove(j);
                        list2.remove(j);
                        list2.add(j,t);
                        list.add(j,t2);
                    }
                    if((Integer.parseInt(list2.get(j+1)) == (Integer.parseInt(list2.get(j))))){
                        if(((list.get(j+1)).compareTo(list.get(j)))<0){
                            t3=list.get(j+1);
                            list.remove(j+1);
                            list.add(j+1,list.get(j));
                            list.remove(j);
                            list.add(j,t3);
                        }
                    }
                }
            }
            /*印出list*/
            System.out.println(list2);
            System.out.println(list);
           
            int cou=0;int con=cou+1;int xxx=1;int sto=0;
            System.out.println("\n\nNode "+con+"\n"+list.get(cou)+"\n"+list2.get(cou)+"\n\n");
           
           
            try {
                    System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
                    sto = keyboard.nextInt();
                } catch(InputMismatchException e) {   
                    System.out.printf("Not a correctly number.\n");
                    keyboard.nextLine();
                    System.out.printf("Try again\n\n");
                }
           
            cou++;con++;
            while(cou<=i-1&&sto!=3){
                System.out.println("\n\nNode "+con+"\n"+list.get(cou)+"\n"+list2.get(cou)+"\n\n");
                System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
                sto = keyboard.nextInt();       
                if(sto==1){
                    cou++;
                    con++;
                }
                else if(sto==3){
                    System.exit(0);
                }
                else
                    cou=cou+0;
            }
            return "";
        }
        /*第四、五題,DoublyLinkList*/
        public static String doublink(int r)throws IOException{
            /*設定選項*/
            int arc=0;
            try {
                    System.out.println("Select 1<AddNode> or 2<RemoveNode> or 3<Continue>");
                    arc = keyboard.nextInt();
                } catch(InputMismatchException e) {
                   
                    System.out.printf("Not a correctly number.\n");
                    keyboard.nextLine();
                    System.out.printf("Try again\n\n");
                }
            int sizeup=((list.size())+1);int rd;        //設定變數等於list大小
            while(arc!=3){
               
                //選項敘述
                switch(arc){
                    case 1:System.out.println("Add Name:");        //新增Node功能
                           String adn=keyboard.next();
                           System.out.println("Add Skill:");
                           String ads=keyboard.next();
                           list.add(adn);
                           list2.add(ads);
                           System.out.println(list);
                           break;
                    case 2:System.out.println(list2+"\n"+list);        //刪除node功能
                           System.out.println("Remove Which Node?");
                           rd=keyboard.nextInt();                     
                           System.out.println("Remove"+list.get(rd)+""+list2.get(rd)+"!!");
                           list.remove(rd);
                           list2.remove(rd);
                           System.out.println(list+"\n"+list2);
                           break;               
                    default:
                }
                try {
                    System.out.println("Select 1<AddNode> or 2<RemoveNode> or 3<Continue>");
                    arc = keyboard.nextInt();
                } catch(InputMismatchException e) {
                    System.out.printf("Not a correctly number.\n");
                    keyboard.nextLine();
                    System.out.printf("Try again\n\n");
                }
            }       
            int i=list.size();        //設定迴圈範圍
            System.out.println("");    //換行
            System.out.println("");
            System.out.println("");
            int cou=0;int con=cou+1;int xxx=1;int sto;        //變數宣告
            System.out.println("\n\nFirstNode \n"+list.getFirst()+"\n"+list2.getFirst()+"\n\n");        //印出結果
            System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
            sto = keyboard.nextInt();
            cou++;con++;
            while(sto!=3){
                while(cou<=i-2&&sto!=3){
                    System.out.println("\n\nNode "+con+"\n"+list.get(cou)+"\n"+list2.get(cou)+"\n\n");
                    System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
                    sto = keyboard.nextInt();       
                    if(sto==1){
                        cou++;
                        con++;
                    }
                    else if(sto==3){
                        System.exit(0);
                    }
                    else
                        cou=cou+0;
                }
               
                System.out.println("\n\nLastNode \n"+list.getLast()+"\n"+list2.getLast()+"\n\n");
                System.out.println("Select 1<Prev> or 2<Stop> or 3<exit>");
                sto = keyboard.nextInt();
                while(cou>1&&sto!=3){
                    System.out.println("\n\nNode "+(con-1)+"\n"+list.get(cou-1)+"\n"+list2.get(cou-1)+"\n\n");
                    System.out.println("Select 1<Prev> or 2<Stop> or 3<exit>");
                    sto = keyboard.nextInt();       
                    if(sto==1){
                        cou--;
                        con--;
                    }
                    else if(sto==3){
                        System.exit(0);
                    }
                    else
                        cou=cou+0;
                }   
                System.out.println("\n\nFirstNode "+(con-1)+"\n"+list.get(cou-1)+"\n"+list2.get(cou-1)+"\n\n");
                System.out.println("Select 1<Next> or 2<Stop> or 3<exit>");
                sto = keyboard.nextInt();
            }       
            return "";    //傳變數回主程式
        }       
    }
    PR
    2008/03/27 (Thu)
    生產者      中間投入          工資        折舊       產品市價
    農夫          500(進口肥料)(M)          50         1000(小麥)
    麵粉廠       1000(小麥)      500       200       2400(麵粉)
    麵包店       2400(麵粉)      600       100       3500(麵包)(C)

    計算GDP
    (1)支出面法
    無國外要素所得淨額時
    GDP=GNP=C + I + G + X - M=3500 - 500 = 3000

    (2)附加價值法
    (1000 - 500) + (2400 - 1000) + (3500 - 2400) =3000

    (3)要素所得法(假設政府不課稅)
    NI=W + R + i + π(Pi)
    GDP=NI + D(折舊) =W + π(Pi) + D = (500 + 600) + (1000 - 500 - 50) + (2400 - 200 - 1000 - 500) + (3500 - 2400 - 100 - 600)  = 3000
    ---------------------------------------------------------------------------
    2008/03/05 (Wed)
      剛剛看完經濟部技術處出版的「WEB 2.0」一書,在此記下一些我覺得比較重要的東西。

    Web2.0核心概念 U.S.E.R
    Unconstraint - 讓使用者更自由

    Service - 已服務當作主導

    Externality - 藉由使用者互相提供的資訊產生正面外部性並吸引更多使用者

    Reward -  獲利

    Web2.0 所使用到的重要技術
    AJAX (Asynchronous JavaScript and XML) - 由三種技術組合使用而成使網頁更加快速、瀏覽更方便。

    RSS/ATOM - 新聞訂閱功能

    Mashup - 結合各種網頁服務所形成的網路服

    Ruby on Rails -  一種類似Perl的動態式程式語

    LAMP (Linux + Apache + MySql + PHP)  - 指的是由上述軟體所構成的網站實體環境

    CSS - 用來決定文字顏色 字體 以及網頁排版的檔案,可以與XHTML'XML一起使用

    XML (Extensible Markup Language) - 可自定義HTML標籤之程式語言

    P2P (Peer to Peer) - 點對點傳輸,Web2.0 強調透過P2P來增加使用者對網站的依存度。

    Flash - 由Macromedia(被Adobe吃掉了)研發的多媒體軟體,可以讓網頁藉著與多媒體的整合顯得更加豐富

    Web2.0五種網頁服務型態
    混搭服務 Mashup

    網路軟體 Webware

    共享平台 Social Media

    社群服務 Social Network Service, SNS

    播客服務 Podcast


    Web2.0 商業模式
    CIA 
    Cross Service
    -  網站內容由第三方提供 

    Inherence -  網站內容由網站業者提供

    Aggregator -  網站內容由使用者提供

    網站的七大獲利來源
    商務(Commerce)

    會員(Membership)

    廣告(Advertisment
    )

    行動(Mobile)

    拍賣(Auction)

    內容(Content)

    虛擬物品(Avatar)

    Web2.0 公司的核心優勢
    優良的程式設計師

    優良的系統維護工程師

    優良的網頁開發設計師

    優良的社群經營管理師

    優良的總機接待人員

    Web2.0 行銷
    4P -  Production + Price +  Promotion + Place

    4C - Consumer + Cost + Convenience + Communication

    4V -  Versatility + Value + Variation + Vibration
    2008/02/26 (Tue)
      今天開了這個地方,為了紀錄一些東西,也可以算是一個新的想法。會選擇這個空間是因為,從看到別人的介紹到現在已經使用了大約一年多,在各方面都覺得很棒,雖然之前好像有看到說會新增廣告(?)。當然另外一個很實際的理由就是"習慣是種毒藥",沒錯,這裡也是一種毒藥,而且我已經無可救藥了。

      主要的內容大概會著重在我目前已經稍微學習過、正在學習、以及雖然尚未接觸但是想要學習的內容。內容會很雜也很淺顯(因為是正在摸索當中),但是我相信一步一腳印的記錄下來,對學習絕對是有正面影響的。

      想要的東西其實很渺小,但是對於我而言卻是最令我感到興趣並且有動力往前的。

      注視著夜空中那深不可見的遠方。
    忍者ブログ [PR]

    * ILLUSTRATION BY nyao *