Donnerstag, 11. September 2008

Pygame programming

You can use pygme to write Games.

When you go to 7-11 ot OK shop, we see on-line games written on Windows.

Why there aren't open source games? Anyone think of writing on-line games with python, pygame and the python twisted framework?

Anyone want to implement this project?


University and IVE game design courses won't teach you. They need to fit the industry with the proprietry software.

EeePc as NDS

Asus 's EeePc is a paradigm shift to the PC market.
The Linux O/S can have a market share which is legitmately dominated by Microsoft Windows.

Also, with its portability and affordable price about HK$4700, it can be a portable multimedia device.

It can also be a game console same as NDS but the former is a PC.

Skype + EeePC = Mobile phone

Mittwoch, 10. September 2008

EE5805 Java Programming (2)

EE5805 Java Programming and Applications
http://www.ee.cityu.edu.hk/

The Tutorial notes of EE5805 or EE3206 Java Programming and Application is shown as follows:

EE3206 or EE5805: Tutorial 2 – Developing Java Applications with NetBeans


1. Read the online training below and follow the steps to familiarize yourself with
the NetBeans development tools.

Before generating Javadoc, do add some Javadoc style comments for the acrostic method (e.g. @param, @return, @see, etc.) and see the Javadoc output.

Introduction to Developing General Java Applications

http://www.netbeans.org/kb/60/java/javase-intro.html


2. Create a project “JTutor02”. Write a Java class “Circle” and complete its method of the following header.

Test the class by writing a main method to show the area of circles with radii ranging from 10 to 100, with increment of 10.

static double circleArea(double radius);


3. Computer programs commonly need to process numerical data and characters.
Each character has a unique Unicode between 0 and FFFF in hexadecimal (65535
in decimal).

To generate a random character is to generate a random integer
between 0 and 65535.

Now write a class to generate random characters. A template, as shown in Code 1, is provided for you. You have to write a driver to
test your class.


4. Using the RandomCharacter class, write another program to generate 100
lowercase letters randomly and assign to an array of characters. Count the
occurrence of each letter and display to the screen.

Code 1 – Template of RandomCharacter.java

// RandomCharacter.java: Generate random characters

public class RandomCharacter {

/** Generate a random character between ch1 and ch2 */

public static char getRandomCharacter(char ch1, char ch2)
{
// write your code here
}

/** Generate a random lowercase letter */
public static char getRandomLowerCaseLetter()
{
// write your code here
}

/** Generate a random uppercase letter */
public static char getRandomUpperCaseLetter()
{
// write your code here
}

/** Generate a random digit character */
public static char getRandomDigitCharacter()
{
// write your code here
}

/** Generate a random character */
public static char getRandomCharacter()
{
// write your code here
}
}

- END -
http://www.cityu.edu.hk/arro/catalogue/course_EE.htm

EE5805 Java Programming (1)

EE5805 Java Programming and Applications
http://www.ee.cityu.edu.hk/

The Tutorial notes of EE5805 or EE3206 is shown as follows:

EE3206 or EE5805 Tutorial 1 – Java Programming Environments

The programming exercises in this course require the following software to be installedon your system:

JDK 6 (or latest stable version), http://java.sun.com/javase/downloads/index.jsp

NetBeans 6.1 (or latest stable version), http://www.netbeans.org/


1. Read the online training below and follow the steps to create your first “Hello World”program.

NetBeans IDE Java Quick Start Tutorial
http://www.netbeans.org/kb/60/java/quickstart.html


2. To compile and run your program using the command-line tools of JDK:

1). Choose [Run…] from the Start Menu of your Windows. Type in “cmd” and
then click [OK] to open a DOS command prompt.
2). Enter “path” to display your current path setting.
3). Add the path, if necessary, of the JDK compiler (javac.exe) by typing “set
path=%path%;BIN_PATH” where BIN_PATH is the location of the
compiler (usually as C:\Program Files\Java\jdkx.y.z\bin).

4). Go to the source directory of your project folder by entering “cd SRC_PATH”
where SRC_PATH is the actual path in your system.
5). Type “javac HelloWorldApp.java” to compile your program source.
Type “dir” and see if the class file is correctly generated.
6). Run the class file by entering “java HelloWorldApp”.


3. Under the project folder, the IDE tool created a JAR (Java Archive) file in the
“dist” subdirectory. The JAR file is in a ZIP-compatible format.

To explore the content of a JAR, you may use any ZIP programs (e.g. WinZip) to extract it or use the command-line tool (jar.exe) with this command “jar xfv yourjarfile.jar”.

Write down what you find inside the JAR file.


4. For each of the following code fragments, decide whether it can be compiled. If yes,determine the value of x after the execution of the code. If no, explain why.

a) byte x = 0;
x++;
b) byte x = 127;
c) byte x = 128;

d) char x = '0';
x = x + 1;
e) char x = '0' + 1;
f) char y = '0';
char x = y + 1;

g) final char y = '0';
char x = y + 1;
h) int x = 3f * 4;
i) int x = (int) 3f * 4;
j) int x = (int) 3f * 4f;
k) int x = 'f' * 4;

l) float x = 1.0;
m) float x;
x = 1.0;
n) double x;
x = 1f;

5. For each of the following code fragments, decide whether it can be compiled.
If yes,determine the output display of the execution of the code. If no, explain why.

a) int x = 1, y = 2, z = 3;
if (x > y) if (z > y)
System.out.println(“y is the smallest”);
else
System.out.println(“y is not the smallest”);

b.) boolean t = true, f = false;
if (t && f)
System.out.println(“t && f”);
if (t && !f)
System.out.println(“t && !f”);
if (t || f)
System.out.println(“t || f”);
if (!!t & !f)
System.out.println(“!!t & !f”);


c.) int x = 0, y = 0, z = 0;
switch (x) {
case 0:
y = 1;
z = 2;
break;
case 1:
y = 2;
break;
z = 1;
default:
}
System.out.println(y);
System.out.println(z);


d.) for (int i=0; i<10; i++)
for (int j=0; j<10; j++)
if (j == 5)
break;
System.out.print(i * j + “ ”);

e.) for (int i=0; i<10; i++) {
for (int j=0; j<10; j++) {
if (j == 5)
continue;
System.out.print(i * j + “ ”);
}
}

f.) for (int i=0; i<10; i++) {
for (int j=0; j<10; j++) {
if (i == 5)
break;
System.out.print(i * j + “ ”);
}
}

g.) for (int i=0; i<10; i++) {
for (int j=0; j<10; j++) {
if (i == 5)
continue;
System.out.print(i * j + ' ');
}
}


6. Create a project “JTutor01”. Write a class “PrintPyramid” that prompts the user toenter an integer ranging from 1 to 15 and displays a digit-pyramid.

For example, if the input integer is 12, the output is shown below.


- END -

芒果酥皮拿破崙: Mango Mille-feuille

美味DIY - 芒果酥皮拿破崙Mango Mille-feuille

http://www.rthk.org.hk/elearning/dessert/cake_mangomf.htm

Other Desserts

http://www.rthk.org.hk/elearning/dessert/cake.htm

(Flash)

Dienstag, 9. September 2008

EE5808 Engineering Techniques for Computer Graphics

For EE5808 Engineering Techniques for Computer Graphics, the required textbook is:

Hearn and Baker (2004). Computer Graphics with OpenGL. PH.

To do list:

1. Use VC++2005 to do OpenGL programming (with GLUT)
2. PPT presentations in tutorial
3. Create a character (Individual project)
4. Animate the characterin a story (Group Proj)
5. Usual assignments/ exercises

For the opensource alternative, you may use wx-Dev C++. It claims it is compatible with VC++2005.

There are 6 parts:

1. Database Traversal
2. Modelling Transform
3. Viewing Transform
4. Lighting
5. Rasterization
6. Display

Reference:

http://www.cgvisual.com/links/html/CGVlinks_hk1.htm

各位有志投身cg業的畢業生找到工作未??

Freitag, 5. September 2008

Fitting the Industry

We learn tools to fit the Industry. Tools that are proprietry are stable for the Industry.

Expect the expected?

Python/Ruby cannnot fit the Industry. Then why there are people still using it?

6.1261: In logic process and result are equivalent. (Hence the absence of surprise.)

CHANGE CHANGE CHANGE

Expect the unexpected in using oss tools.

The concept of generativity is embeded in oss tools which can give you a new way of thinking.