好好學習.天天向上

嶺南大學社區學院 資訊科技、數學及科學組

Archive for October, 2007

Your Future in Supply Chain Management

without comments

Dear ABS (SCML) students,

You are cordially invited to attend a talk organized by the representatives from the Hong Kong Chartered Institute of Purchasing & Supply (HKCIPS). The details are as follows:

Topic: Your Future in Supply Chain Management
Read the rest of this entry »

Written by kychoi

October 31st, 2007 at 5:23 pm

Posted in 公佈

ISM001 Test Papers Ready for Pickup

without comments

Dear ISM001 students,

Thank you for coming to the test last Friday. The questions and answers are now posted here: question paper, answer sheets, answers.

The papers have been marked. Please get it back from me at your convenience. Otherwise I will return the papers to you on Friday. Thank you.

Written by 張真人

October 30th, 2007 at 3:20 pm

Posted in ISM001

How to do evil in Java

without comments

Our Java programmer Cham Hin Cheung found a way to write to file in a Java program:

http://www.pastebin.ca/753851

The simple program asks for a class name of an existing Java program and generates a DOS batch program that could compile and run the Java program. This is the first ever attempt in this course to compile and run one program from another.

The following link is also interesting:

Execute system commands in a Java Program

By using the Runtime.getRuntime() technique in the example, one can write a Java program that executes or even generates any other external program in the DOS environment. This includes modifying and replicating itself, which mean, in a sense, a computer virus.

Warning: Writing a computer virus is a very good training in computer programming. However, you can be prosecuted by law if you “share” the computer virus with others and cause some damage. If you want to write your own computer virus in Java, keep it in a safe place and make sure that it does not affect others. Come to me if you do not know how to do so.

Powered by ScribeFire.

Written by 張真人

October 30th, 2007 at 6:41 am

Posted in ISM001

How to create an exe from Java?

without comments

Some of our junior Java programmers in ISM001 asked me how to compile their Java programs into native code (i.e. .exe files on Windows) so that they do not need the Java interpreter to run.

But why do we want to do this in the first place? For me, the main reason is performance — A Java program in native code usually runs faster than Java bytecode (e.g. the .class files we have been using). Others may want to show off their Java programs to their friends who do not have Java installed.

An article by Hank Shiffman explains the pros and cons of compiling Java into native code:

Boosting Java Performance: Native Code & JIT Compilers

Feeling too complicated? The following page is easier to understand. It also contains a list of Java native compilers:

Java native compilers

An even longer list is here:

Free Java Compilers, Assemblers, Java Development Kits

Among the many choices, my favorite is gcj, the open source, cross-platform GNU compiler for the Java programming language. The following link contains more information:

Compiling Java with GCJ

In brief, to compile the program MyJavaProg.java, just type the following:

gcj -c -g -O MyJavaProg.java
gcj --main=MyJavaProg -o MyJavaProg MyJavaProg.o

which can be simplified as:

gcj -g -O --main=MyJavaProg -o MyJavaProg MyJavaProg.java

Remarks: Sad enough, gcj does not (yet) support printf and a few other new features since javac 1.5. As a work around, do not use printf for the moment if you want to use gcj.

For those who successfully compile your Java program into native code, please share your experience in the comments.

Powered by ScribeFire.

Written by 張真人

October 29th, 2007 at 9:52 pm

Posted in ISM001

BUSA01 Test 2 Sample Questions with Answers

without comments

This is taken from the Test 2 paper of last year. Note however that the paper in this year will only be similar to the past paper in the format, but not in the contents.

Questions [pdf]

Answers [pdf]

Written by 張真人

October 29th, 2007 at 1:54 pm

Posted in BUSA01

如何用 Google 學英文

without comments

如何用 Google 學英文(by using Phrase search)

Written by waiyeehk

October 27th, 2007 at 8:13 pm

Posted in BUS010

Tagged with , ,

BUSA01 Test 1 Answers and Results

without comments

Refer to the following document: BUSA01-test1-answers.pdf and BUSA01Test1Results.pdf

Answers for the make-up papers are marked on the answer sheet. Your instructor will return the papers to you next week.

Those with unsatisfactory scores please ask your instructor for assistance as soon as possible.

Powered by ScribeFire.

Written by 張真人

October 26th, 2007 at 10:32 am

Posted in BUSA01, 公佈

Make up class for BUS010 Section 4

without comments

Make up class for BUS010 Section 4 is confirmed: 

Date: 27/10/2007 (Sat)

Time: 3:30pm to 5pm

Venue: NAB 101

Topic: Module 5 + 6

Written by waiyeehk

October 24th, 2007 at 10:24 pm

Posted in BUS010

Reminder: ISM001 Test

without comments

Date: 26 October 2007 (THIS Friday)

Time: 15:30-17:30

Venue: NAB-206

Coverage and format:

Refer to Test and Examination Information.

Any class in the morning?

The class in the morning is canceled. I will be in an important meeting with some “big brothers” from another planet, so see you all in the afternoon.

How to survive the test:

Practise

Powered by ScribeFire.

Written by 張真人

October 24th, 2007 at 12:40 pm

Posted in ISM001, 公佈

Web2.0… The Machine is Us/ing Us

without comments

Web 2.0 正在改變世界:


(使用 RSS 的讀者可直接到 YouTube 觀看。)

Powered by ScribeFire.

Written by 張真人

October 23rd, 2007 at 9:41 pm

Close
E-mail It