Translate

2010年10月29日 星期五

弘光 - 99-1 網路程式設計 - 課堂測驗


生 日 秘 數 計 算

1. 提供Edit與按鈕,讓使用者能輸入出生日期,如  1982/06/02
2.偵測其輸出格式是否錯誤,若錯誤則顯示錯誤於label
3. 計算生日數字,算法請參考 http://hkluck.com/kn/a04-02.php 
例 如 : 出 生 年 月 日 是 一 九 七 四 年 十 月 二 十 日 。生 命 秘 數 就 是 : 1974/10/23( 將 所 有 數 字 加 起 來 )1+9+7+4+1+0+2+3=27 2+7=9 9 就 是 您 的 生 命 秘 數 。 ( 如果是1 0 : 再相加為 1  , 如果是2 0 : 再相加為 2 )
  • 請使用 Method 撰寫計算生日數字副程式,並回傳生日數字 (int)
  • 使用字串操作
  • 於Edit上顯示數字
4. 將生日數字所屬的意含依計算出來的號碼顯示在Edit上 
  • 每個號碼顯示內容請參考 http://hkluck.com/kn/a04-02.php 
  • 僅取每個號碼的一小段即可,勿超過255字元(含空格)
  • 如1號:這 是 個 熱 愛 生 命 , 喜 歡 開 創 新 奇 事 物 的 表 徵 。 數 字 1 代 表 的 正 面 特 質 : 領 袖 氣 質 , 創 意 , 勇 氣 , 能 量 , 慷 慨 大 方 , 勤 奮 , 獨 立 自 主 , 險 性 , 熱 情 和 直 覺 性 。 你 通 常 會 設 立 一 個 偉 大 的 計 畫




製作步驟提示:

  • 建立物件  Edit , label , button
  • 取出輸入的出生年月日 (符合格式 "yyyy/mm/dd" , ex: 1988/03/05)
  • 出生年月日送入一個 Method進行年月日拆解並重組轉為字串,如 "19880305"
  • 將拆解完的年月日送入計算生日數字的Method
  • 設定一迴圈 ( for , while皆可),反覆將數字逐一相加
    • 使用字串處理函式將數字逐一相加
    • 回傳return結果
  • 將祕數顯示於Edit
  • 使用if 或swich case 方式將祕數對應結果顯示於edit

弘光 - 99-1 網路程式設計 - C#回顧練習4

Method 建立與使用



  • 建立原則與方式
  • 引數串列
    • 實引數 ( Actual Argument ) : 傳值呼叫
    • 需引數 ( Dummy Argument ) : ref : 參考、傳址呼叫 
  • 多載 (Overloading)
  • 練習1:
    • 潤年計算
      • 技巧:
      • try{} - catch{}   : 例外偵測
      • Exception obj  :  例外物件
      • Exception.Message  :  例外內容
      • System,Drawing.Color  : 給予系統顏色
  • 練習2 : 
    • 計算方程式 :   f = 3X^2 +  4Y + 5
      • 透過void方取出輸入值
      • 透過方法計算方程式結果 F
      • 透過void方法顯示結果
  • 練習3 :
  • 練習4:
    • 次方函式  mypower()
    • 單一引數為平方
    • 兩個引數,其第二個為次方項




ArrayList Class



  • 可以動態增減的好東西
  • Implements the IList interface using an array whose size is dynamically increased as required.
  • Properties and Methods :  Doc

2010年10月27日 星期三

99-1朝陽資工 - 手持式裝置程式設計 - Layout

常用Layout包裝方式  ( layout_width, layout_height)

  • fill_parent
  • wrap_content

Layout Type
  • Linear Layout
    • orientation 
      • vertical
      • horizontal
  • Table Layout
    • stretchColumns  :  值2為 3*3大小
    • shrinkColumns : 指定當填滿時,哪一格要往下挪字
    • collapseColumns : 隱藏指定列
    • 使用 TableRow 規劃每一行
    • 延伸閱讀:http://ppt.cc/1ROY
    • Exercise
      • 使用collapseColumns 讓按鈕消失
      • TableLayout object
        • setColumnCollapsed()  可以控制 collapseColumns 
  • Relative Layout
    • layout_toRightOf
    • layout_below
    • layout_toLeftOf
  • Absolute Layout
    • layout_y , layout_x
      • px (pixels)像素
      • dip (device independent pixels)設備獨立像素
        • Android Applications for Multiple Screen Sizes
          http://diigo.com/0ddsi
        • Supporting Multiple Screens | Android Developers http://diigo.com/0ddsg
  • Frame Layout
    • 最簡單的Layout模式
    • layout_gravity指定位址


99-1中台資管 - 行銷資訊系統 - SWOT分析

99-1中台資管 - 行銷資訊系統 - SWOT分析

請各小組在你們的網站上加入基於你們設計的商業構想之:

  • 商業內容
  • 創新之處
  • SWOT分析
    • 優勢(Strengths)
    • 劣勢(Weaknesses)
    • 競爭市場上的機會(Opportunities)
    • 威脅(Threats)
  • 參考文章:Link


請以網站方式製作,並將連結貼於本文回覆。
請小組長分配同學討論後撰寫!

2010年10月21日 星期四

99-1朝陽資工 - 手持式裝置程式設計 - Code (20101021)

99-1朝陽資工 - 手持式裝置程式設計 -  Code (20101021)



同學玩玩看吧:
            
        Button btn_inputname = (Button)findViewById( R.id.Button01 );    
        btn_inputname.setOnClickListener(      
         new View.OnClickListener() {
        
         public void onClick(View v) {
        
         EditText editText = (EditText)findViewById(R.id.EditText01);
         CharSequence text = editText.getText();
         name_in = text.toString() ;
        
        
         }

});

2010年10月18日 星期一

99-1中台資管 - 行銷資訊系統 - 小組行銷網站(系統)

99-1中台資管 - 行銷資訊系統 - 小組行銷網站(系統)


請各組建立小組專用的行銷資訊系統,
並將網址貼於本文章回覆中。

網站內容 2010/10/18

  • 網站名稱
  • 小組成員
  • 目標產業介紹
  • 目標行銷內容
  • 初步功能設定

2010年10月14日 星期四

99-1朝陽資工 - 手持式裝置程式設計 - Intent

Android - Intent

An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an ActivitybroadcastIntent to send it to any interested BroadcastReceiver components, andstartService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.
An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed. The primary pieces of information in an intent are:
  • action -- The general action to be performed, such as ACTION_VIEWACTION_EDITACTION_MAIN, etc.
  • data -- The data to operate on, such as a person record in the contacts database, expressed as a Uri.


Chat 小程式:
  • 新增專案
  • 新增class
  • 新增XML於layout
  • 新增變數於values
  • 修改AndroidManifest.xml
    • 新增Application Nodes
    • 增加Activity
  • 修改新增class
  • 撰寫程式

2010年10月13日 星期三

99-1朝陽資工 - 手持式裝置程式設計 - Activity

Android:  Activity - Lifecycle


Simple Flowchart : [ link ]


Three loops

  • The entire lifetime of an activity happens between the first call to onCreate(Bundle) through to a single final call to onDestroy(). An activity will do all setup of "global" state in onCreate(), and release all remaining resources in onDestroy(). For example, if it has a thread running in the background to download data from the network, it may create that thread in onCreate() and then stop the thread in onDestroy().
  • The visible lifetime of an activity happens between a call to onStart() until a corresponding call to onStop(). During this time the user can see the activity on-screen, though it may not be in the foreground and interacting with the user. Between these two methods you can maintain resources that are needed to show the activity to the user. For example, you can register a BroadcastReceiver in onStart() to monitor for changes that impact your UI, and unregister it in onStop() when the user an no longer see what you are displaying. The onStart() and onStop() methods can be called multiple times, as the activity becomes visible and hidden to the user.
  • The foreground lifetime of an activity happens between a call to onResume() until a corresponding call to onPause(). During this time the activity is in front of all other activities and interacting with the user. An activity can frequently go between the resumed and paused states -- for example when the device goes to sleep, when an activity result is delivered, when a new intent is delivered -- so the code in these methods should be fairly lightweight.

Lifecycle DEMO :
http://blip.tv/file/958450/

Example: LifecycleExample

  • Toast Class
    • A toast is a view containing a quick little message for the user. The toast class helps you create and show those. When the view is shown to the user, appears as a floating view over the application. It will never receive focus. The user will probably be in the middle of typing something else. The idea is to be as unobtrusive as possible, while still showing the user the information you want them to see. Two examples are the volume control, and the brief message saying that your settings have been saved.
    • Detail : [ Link ]


  • Activity Class : 
    • An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View). While activities are often presented to the user as full-screen windows, they can also be used in other ways: as floating windows (via a theme with windowIsFloating set) or embedded inside of another activity (using ActivityGroup). 
    • Detail : [ Link ]
    • Activity | Android Developers http://diigo.com/0d5sd
    • Starting Activities and Getting Results :  http://diigo.com/0d5v6



2010年10月11日 星期一

99-1中台資管 - 行銷資訊系統 - 網路行銷工具

網路行銷工具

99-1中台行銷 - 資訊科技與應用 - 報告用檔案

99-1中台行銷- 資訊科技與應用 - 報告用檔案


請同學將你們報告的檔案上傳並貼到本文章的回覆中。

謝謝。

報告組別與題目請見:  [ SHEET ]

99-1中台國企 - 資訊科技與應用 - 報告用檔案

99-1中台國企 - 資訊科技與應用 - 報告用檔案


請同學將你們報告的檔案上傳並貼到本文章的回覆中。

謝謝。

報告組別與題目請見:  [ SHEET ]

2010年10月9日 星期六

99-1中台資管 - 行銷資訊系統 - Google v.s. 行銷

99-1中台資管 - 行銷資訊系統 - Google v.s. 行銷

在本次課程中,我們將介紹如何透過Google進行整體網路行銷策略,
內容可分為技術層次與行銷管理層次,相關重點如下:

技術層次

  • Google Sites (協作平台)
  • Google App Engine
  • Google Gadget
  • Google Docs
行銷管理層次
  • Google AdSense
  • Blogger
  • Google WAVE
  • Google Maps
  • Google Finance

以上,都,免費!
請同學趕緊去註冊帳號吧!

BP

2010年10月8日 星期五

弘光 - 99-1 網路程式設計 - 協作平台作業

弘光 - 99-1 網路程式設計 - 協作平台作業


請同學將你們建立的協作平台公告於本文回覆內!!!

Note:

  • 請建立Google帳號
  • 將所有成員建立為協作者
  • 公開讓網路使用者瀏覽
  • 選定主題與目標
  • 說明
    • 動機
    • 目的
    • 想要達到的效果

參考資料:

弘光 - 99-1 網路程式設計 - C#回顧練習2

身份證檢查程式 - C#回顧


學習重點
  • 副程式設計 
  • Array 陣列使用與操作
  • 字串、字元、ASCII 碼轉換

身份證認證公式

驗證規則 ( Source:戶證事務所) 
       身份證統一編號共計10 位,其中第一位為英文字母,後共有九個數字;
       而最後一位數字為檢查碼( Check Digit ) ,表示如下表:

       L1 D1 D2 D3 D4 D5 D6 D7 D8 D9 

L1: 英文字母, 代表出生地的縣/市代號
A=10 台北市 J=18 新竹縣 S=26 高雄縣
B=11 台中市 K=19 苗栗縣 T=27 屏東縣
C=12 基隆市 L=20 台中縣 U=28 花蓮縣
D=13 台南市 M=21 南投縣 V=29 台東縣
E=14 高雄市 N=22 彰化縣 * W=32 金門縣
F=15 台北縣 * O=35 新竹市 X=30 澎湖縣
G=16 宜蘭縣 P=23 雲林縣 Y=31 陽明山
H=17 桃園縣 Q=24 嘉義縣 * Z=33 連江縣
* I=34 嘉義市 R=25 台南縣

       D1: 性別,1=男, 2=女
       D2~D9: 檢查碼

       L1 對照表:
         字母A   B  C   D   E   F   G   H   J   K   L   M  N 
         代號10 11 12 13 14 15 16 17 18 19 20 21 22 
         -------------------------------------------
         字母P   Q   R   S   T   U   V   X   Y  W   Z    I   O
         代號23 24 25 26 27 28 29 30 31 32 33 34 35 

       令其十位數為X1 ,個位數為X2 ;( 如A=10:X1=1 , X2=0 )

       依其公式計算結果:
       Y= X1 + 9*X2 + 8*D1 + 7*D2 + 6*D3 + 5*D4 + 4*D5 + 3*D6 + 2*D7 + D8 + D9

       驗證
       假如Y能被10 整除,則表示該身份證號碼為正確,否則為錯誤。
即如以10 為模數,檢查號碼為( 10 - Y- D9 ) / 10 的餘數,
如餘數為0 時,則檢查碼為0 。



製作流程


○ 建立網站
○ 製作按鈕與Label、Edit元件
○ 建立全域一維陣列: NumberArray 大小為26 (public int[]NumberArray = new int[26]; )
○ 建立初使化程序 protected void initArray;

  • 進行NumberArray 初始化,其值以查表方式建立
    EX: 
    • NumberArray[0] = 10 ; //A
    • NumberArray[1] = 11 ; //B
    • 請查表
○ 建立輸入字串檢查函式驗證是否符合格式
   public boolean CheckErr( String 
idnum );
  • 判斷是否長度相同 (使用idnum.Length 找出字串長度)
  • 判斷第一字母是否為大寫英文 
    • 使用  Regex NumberPattern=new Regex("^[A-Z]")
    • if (!NumberPattern.IsMatch(idnum.Substring(0,1)) )
  • 判斷第二個字是否為1(男),2(女) : idnum.Substring(1,1)
  • 判段輸入是否為數字 (使用  if (int.TryParse( oneword , out num) == false)  判斷)

○ 建立身份證檢查函式   public Boolean CheckID(String IDstr)
  • 取出第一個字母對應到NumberArray 的值 
    • (以ASCII code 判斷做對照, 轉ASCII code方法: Convert.ToInt32( char ) )
  • 取出該字母於array的對應值
  • 取出X1, X2值
  • 套入公式 :Y= X1 + 9*X2 + 8*D1 + 7*D2 + 6*D3 + 5*D4 + 4*D5 + 3*D6 + 2*D7 + D8 + D9
  • 若可被10除盡表該身份證為對
○ 輸出結果




2010年10月7日 星期四

99-1朝陽資工 - 手持式裝置程式設計 - 範例

Example