Programming Methodology 2008

HOMEWORK FROM Aj Veera

Must submit to progmethcp@gmail.com by 3 October


Syllabus
Lab GUI 01 (for everyone)
Homework 01 (for everyone)

Lab GUI 02
Homework02

LabGUI03
Homework03

LabGUI04
Today, the lab is rather a revision, so, ask questions if you need help! You must make sure you understand every lab up to this point.

LabGUI05
All about playing with arrays today.

LabGUI06


Lab JUnit  คนที่เรียน sec อ วีระ ให้ทำแล็บของ อ วีระ เอง แยกกันนะ แล็บนี้ ค่อยมาทำ ตอนเริ่มเรียน sec อ เชษฐ หรือ อ วิษณุ
เอกสารต่างๆ
Testing slides
JUnit Setup in Eclipse
JUnit Testing Example and Grade.java (ทำไปแค่นิดเดียว)

ตัวแล็บ
The lab question แล็บนี้ใช้ภาษาไทย ในการทำส่งนั้น ให้ใช้ encoding ภาษาไทย เป็น UTF8 นะ ให้ถามพี่ๆหรือเพื่อนๆเรื่องการเซ็ต encoding

6 August 2008
Lab Object Oriented: Simple  คนที่เรียน กับ อ วีระ ก็ทำแล็บ อ วีระนะ   แล็บนี้ต้องทำต่อจาก แล็บ JUnit     ถ้ายังไม่ได้ทำ JUnit  ต้องไปทำซะก่อน

MIDTERM SCORE


13 August 2008
คนที่เรียนมากับ อ วีระเมื่อสองครั้งก่อน แล้วคราวนี้เรียนกับ อ เชษฐ ให้ส่งแล็บ JUnit นะ
คนที่เรียน กับ อ วีระ อาทิตย์นี้ ก็ทำแล็บ อ  วีระ ไป
ส่วนที่เหลือ ทำแล็บ Screensaver อันนี้



20 August 2008
คนที่เรียน กับ อ วีระ อาทิตย์นี้ ก็ทำแล็บ อ  วีระ ไป  อย่าลืม เวลาส่งงานต้องใส่เลข id มาด้วยทุกครั้ง
คนที่เรียนกับ อ เชษฐ อาทิตย์นี้ ให้เอาแล็บ Lab Object Oriented: Simple มาทำต่อ โดยเขียน javadoc ของตัวแปร และ เมธอดทุกเมธอด ส่งภายในเที่ยงคืนวันนี้ เหมือนเดิม ส่งมาที่ progmethcp@gmail.com โดยในเมล์ subject ต้องเขียนเป็น studentID_DOC_secNumber และไฟล์ต้องมีชื่อว่า studentID_DOC_secNumber.jar  ต้องให้แน่ใจว่า ตัวเว็บเพจถูกเซฟมาในจาร์ไฟล์ด้วยนะ

ึคนที่เรึยนกับ อ วิษณุ ให้ทำแล็บ Lab Object Oriented: Simple



27 August 2008
คนที่เรียน กับ อ วีระ อาทิตย์นี้ ก็ทำแล็บ อ  วีระ ไป  อย่าลืม เวลาส่งงานต้องใส่เลข id มาด้วยทุกครั้ง
คนที่เรียนกับ อ เชษฐ อาทิตย์นี้ ให้เอาแล็บ Lab Object Oriented: Simple มาทำต่อ โดยเขียน javadoc ของตัวแปร และ เมธอดทุกเมธอด ส่งภายในเที่ยงคืนวันนี้ เหมือนเดิม ส่งมาที่ progmethcp@gmail.com โดยในเมล์ subject ต้องเขียนเป็น studentID_DOC_secNumber และไฟล์ต้องมีชื่อว่า studentID_DOC_secNumber.jar  ต้องให้แน่ใจว่า ตัวเว็บเพจถูกเซฟมาในจาร์ไฟล์ด้วยนะ

ึคนที่เรึยนกับ อ วิษณุ ให้ทำแล็บ Screensaver อันนี้

ตัวอย่าง polymorphism


3 Sep 2008
คำสั่งเหมือนกับ ของวันที่ 27 August


10 Sep 2008
โจทย์ทบทวน พยายามทำเวลาเหมือนทำข้อสอบจริงนะ  ไม่ต้องส่ง






Project
present วันที่ 9 และ 10 ตุลาคม ตั้งแต่เช้าถึงเย็น  เดี๋ยวจะมีตารางให้แต่ละกลุ่มเซ็นจองเวลาหน้าห้อง อ วิษณุ

ทำกลุ่มละสองคน
คะแนนเต็ม 100 ซึ่งจะถูกนำมาเป็นคะแนนจริง  20 คะแนน

project ต้องมี GUI และต้องมีสิ่งเหล่านี้

Thread  ที่แยกต่างหากจาก main ทำงานถูกต้อง -  20%
Javadoc ครบถ้วนในทุกส่วน จะให้เปิดให้ดูตอน present  - 20%
JUnit ของส่วนที่ใช้คำนวณ (ต้องมีการแยกเมธอดที่ใช้คำนวณให้เป็นสัดส่วน) -20%
สามารถ export jar ออกมาทำงานได้ถูกต้อง -10%
ความสวยงาม - 10%
ความคิดสร้างสรรค์ - 10%
คู่มือการใช้งานโปรแกรม - 10%

การตรวจจะใช้ พี่ๆตรวจตอนที่ present เลย  การให้คะแนนเป็นสิทธิขาดและถือว่าอยู่ในวิจารณญาณของพี่ๆ TA


FINAL

สอบ 17 กย นี้ เนื้อหาจะไม่เน้น GUI มาก จะไปเน้นที่ JUnit กับ Javadoc และเรื่องการเขียนโปรแกรมมากกว่า สอบ 13.00-16.00 ในห้องแล็บเหมือนเดิมนะ

เรื่องเก่าๆ สามารถเอามาออกปนได้ทุกเรื่อง แต่สัดส่วนคะแนนจะน้อยกว่าเรื่องที่เรียนหลังมิดเทอม







Midterm 2008
Here is the question sheet   (doc) (pdf

วิธีส่งมิดเทอม




Aj. Veera's lab will start after midtern ja. 
.....

GUI Programming

Coding Standard
  1. Debugging
  2. Coding Standard
  3. Test-Driven Development
  4. Exception Handling
  5. Code Management (Versioning)

Concurrent Programming

Week 1:

Lecture: Multithreaded Programming Concepts

Lab: Eclipse (เหมือนกับตอนเรียนอื่น)

Week 2:

Lecture: Programming with Java Threads

Lab: Java Threads

Week 3:

Lecture: Programming with Windows Threads

Lab: Intel Compiler

Week 4:

Lecture: Profiling and Performance Tuning

Lab: Intel VTune Performance Analyzer

Lecture notes will be given in class.


OLd labs from 2007 (for challenge :) )

Lab01 (6 June 2007)

Lab02 (13 June 2007) : The solution is here.

Lab03 (20 June 2007)   : The solution is here.

Lab04(27 June 2007) :    

Lab05 (4 July 2007) :     Here is the solution.

Lab06(11 July 2007):  Solution  (not now :P)

Lab07 (18 July 2007): Solution     


Lab08 Exception :
    question
    file


MIDTERM

Lab 09 GUI 

Lab 10 GUI 2

Lab THREAD


Final Lab (examination sample). No submission required, but you need to be able to do this in order to be able to do real exam questions.
  

Additional thread question. No submission required. But you need to know it in order to program more complex applications.

Slides 2007:

 

 

 


Make a JAR executable

In the manifest file of a JAR, it is possible to specify the class to be used when the JVM is lauched with the JAR as parameter. The class must have a main().

Try with this simple class

import java.awt.*;
import java.awt.event.*;

public class MyClass {
 public static void main(String[] args) {
    Frame f = new Frame();
    f.addWindowListener
          (new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                 System.exit(0);
                 }
              }
    );
    f.add(new Label("Hello world"));
    f.setSize(200,200);
    f.setVisible(true);
   }
}

Then create this manifest file (manifest.mft) with any text editor.

Manifest-Version: 1.0
Main-Class: MyClass
Classpath: .\MyJar.jar

Next, you include the manifest file in the JAR (MyJar.jar) with the MyClass class.

jar cvfm MyJar.jar manifest.mft *.class

Then you are able to start the MyClass.class by double-clicking on the MyJar.jar file (if the JRE is correctly installed) or by typing

java -jar MyJar.jar

If you need to pass parameters, use the -D switch before de -jar switch and use the getProperty() method to get the value.

On NT, you can also make JARs run from the command-line by setting the PATHEXT environment variable, for example

set PATHEXT=.EXE;.BAT;.CMD;.JAR

Then if you have the jar file MyJar.jar accessible via the PATH environment variable, typing "MyJar" on the DOS command line will invoke "java -jar MyJar.jar" .

 



Don't forget to make JAR file when asked to do.

JAAJAR..... err....