Friday, June 20, 2008

On writing

Yale N. Patt

I remember a quote, attributed to Thornton Jenkins, the original Headmaster of the public high school I attended. I guess they felt calling the Principal a Headmaster would in some way compensate for everything that was wrong with the place. "What a man (today we would say man or woman) knows or what a man thinks is lost if he can not express it through oratory or writing."

Although I usually focus on how computers work and what we can do to make them work more effectively in the future, I recognize the importance of writing to getting our ideas across. Unfortunately, too many of us were taught too many bad "rules" along the way that need to be unlearned. In that light, and as a start, I offer the following:

  • Technical writing is for the benefit of the reader, not the writer. As a writer, it is worth taking the time to focus first on what your readers will bring to the table when they try to read what you write. If you keep your readers always in mind while you are writing, they will have a better chance of understanding what you have to say.
  • Short sentences are better than long.
  • Small words are better than big. The only 5 syllable word I use is "delicatessen."
  • The verb is the most important word in the sentence.
  • There are plenty of good, usable, legitimate verbs already out there. It is not not necessary to stick "ize" at the end of any random noun and invent a new one.
  • Active is better than passive.
  • It is okay to end a sentence with a preposition. Better that than an awkward sentence. Better still to rework the sentence so it does not come out awkward and does not end with a preposition.
  • It is okay to use the same word again in the same paragraph. A thesaurus can be put to better use propping up the small leg of a four-legged table than providing a word that means almost the same thing as the word you really want to use for the second time in that paragraph.
  • It is not okay to make spelling mistakes. A pocket dictionary next to your desk is an absolute must. If the word is not in the pocket dictionary, you probably shouldn't be using it in the first place. Spellcheck will not ketch awl mistakes.

My Ten Commandments for Good Teaching

Yale N. Patt

1. Know the material:

The purpose of teaching is for students to learn. To help a student who is having trouble understanding the material, you need to know (a) where the student is having a problem, and (b) how to explain it differently the second time. Both require that you know deeply the material you are teaching. It is not good enough to be "one page ahead" of the class, or to have memorized the material well enough to write it on the blackboard without making any mistakes.

2. Want to teach:

When you walk into a classroom, you should want to be there. Very little is as infectious to the student as an instructor who is genuinely happy to be there. The students can tell the difference. If the instructor is excited about the course, the student is likely to be also.

3. Genuinely respect your students and show it:

You are in the classroom for the benefit of the students, not vice-versa. Your ability to help them understand concepts that they currently do not understand is enhanced enormously if you connect with them. No one wants to be treated like a dummy or talked down to. Connecting means giving them credit for having a brain, willing to use it and caring enough to do what it takes to get it. AND, conveying that -- not verbally, but through your body language. That means respecting them.

4. Set the bar high; students will measure up:

Good students are there to learn and they know it won't happen automatically. My experience is that if you set the bar high, and do NOT waste the students' time with tedious work that serves no learning purpose, they will work as hard as they can to measure up to it. The myth that students want an easy course is just that, a myth. Some of them may complain and moan at the moment over some very tough homework. But at the end of the course, I generally am thanked profusely for setting the bar high. "Thank you, I never thought I could learn so much in one semester" is a comment I often get at the end of the course.

5. Emphasize understanding; de-emphasize memorization:

Memorizing is not understanding. Unfortunately, many students have gotten by for a very long time on the basis of a sharp memory, and have never had to really think. Memorization may work for the moment, but after graduation when they are faced with new challenges, it is their ability to think and to understand that will carry the day, not their ability to memorize. I have seen too many examples of students who can memorize almost anything, yet cannot think through a simple extension of what they have memorized. I suggest they will not be prepared for what lies ahead after graduation, in work or in life.

6. Take responsibility for what is covered:

Too many instructors have been lulled into this new pedagogical notion that the students should decide what gets taught in the classroom. Not in my classroom. I have been around longer, have seen techniques come and go, and because of that, I believe I know better than they what is important for them to know to be successful after they leave my course. Ergo, I decide what gets covered. I am very concerned about this fashionable notion of letting the students decide. Many students want instant gratification -- a technique they can use today, whether or not it will be useful downstream. It is up to instructors to take charge of what goes on in their classrooms.

7. Don't even try to cover the material:

When one sits in the office in August and plans the syllabus for the Fall semester, optimism runs very high. The instructor often lays out the course outline, assuming that every student gets every point the first time, that every explanation is brilliant, and that no student needs to ask a question. Not too many classes into the semester reality sets in. The fact is that some days the explanations are bad. And, some days the students don't get it the first time. Ergo, if one insists on covering the material, the only one left standing at the end of the course is the instructor (maybe). I believe the following. First, there is always far more material than can be covered adequately in a semester. BUT, only a core body of material needs to be covered. So, in August when everything is coming out roses, sure -- assume the best. But, as the semester moves along, and reality sets in, do not be afraid to stop and cover again the same point a second or third time, bringing in different perspectives and examples to get it across. Answer questions, even if it means totally blowing the schedule. That is, do not even try to cover the material. Certainly, one has to cover the core body necessary to move on to the next semester. But that usually represents half the material, or so. Anything beyond that is a bonus, and has no place in the course if the student failed to learn the core material.

8. Encourage interruptions; don't be afraid to digress:

This is a consequence of the one just above. The point is that the reason for the course is for the student to learn. If the student is not learning, it it irrelevant how much material is being covered. Therefore encourage interruptions. It means the student is thinking. And, if the student is thinking, he/she has a chance of getting it. Digress when it seems useful. Digressions can add meaning to the understanding of a concept. Anecdotes from the instructor's experience can make the material more alive. It can provide just the twist that allows the student to get it.

9. Don't forget those three little words:

The three little words are "I don't know." The biggest thing about a classroom that makes learning work or not work is the connection between the instructor and the students. Many of the items above relate to establishing that connection. Nothing will destroy that connection as quickly as the instructor speaking nonsense. It only takes one student in the class to know that the instructor is bs-ing, and credibility has been lost for good. And, if the instructor loses credibility, he/she has nothing. Students will tune out. AND, it is okay to not know. The instructor can not be expected to know everything. That is the nature of humans. Never pretend to know. Just say, "I don"t know," move on, and if possible try to find out before the next class and answer the question then.

10. Reserved for future use:

Many have observed that this last one is not a commandment at all, and that therefore there are really only nine. Wrong! This tenth one is my way of saying you should make allowances for contingencies. Things will often not go as planned. Be prepared to adapt to dynamic situations, as they unfold.

Tuesday, December 04, 2007

Word Wrap in Eclipse
Eclipse without wordwrap function sometimes is a nuisance. Find a plugin to solve it.

In Eclipse, Help -> Software Updates -> Find and Install -> Search for new features to install -> New Remote Site -> Name: Wordwrap; URL:, then click OK -> click Finish.

In the right-click manu, choose Virtual Word Wrap. Done!

Thursday, August 23, 2007

A JAXB Problem
JAXBContext jc = JAXBContext.newInstance("edu.iu.cgl.gpir");
Unmarshaller u = jc.createUnmarshaller();
ResourceStatic rs = (ResourceStatic)u.unmarshal(new StreamSource(new StringReader(rslt)));

The above method works fine for GPIR while got an error for QBETS:
Exception in thread "main" java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to edu.ucsb.cs.nws.MachinesType

I debugged and found that the returned value of unmarshal() is JAXBElement, but don't know why it can't be cast to the type I expect.

Found the solution at

MachinesType machines = (MachinesType)((JAXBElement)u.unmarshal(new StreamSource(new StringReader(rslt)))).getValue();

It works.

Friday, July 20, 2007

JAXB 2.1 and JDK 6
I'm trying to use JAXB to generate corresponding Java class file from the xsd file.
When I ran, an error popped:
"Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/globalhome/yiligong/software/jaxb-ri-20070125/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See"

The solutions might be:
1. Use Java endorsed mechanism to override whats in Java platform. See for more details on Endorsed Standards Override Mechanism.
Simply copy jaxb-api.jar to /lib/endorsed.
3. Since I have no root privilege, I added "-Djava.endorsed.dirs=/globalhome/yiligong/software/jaxb-ri-20070125/lib" into the last line of, i.e. exec "$JAVA" $XJC_OPTS -Djava.endorsed.dirs=/globalhome/yiligong/software/jaxb-ri-20070125/lib -jar "$JAXB_HOME/lib/jaxb-xjc.jar" "$@".

A JAXB 2.1 tutorial:

Wednesday, July 04, 2007

Total Copy
I was trying to copy a .iso file (6.22G) from one one computer to another.

Found Total Copy online and it worked perfect.

Thursday, June 21, 2007

Thinkpad T60 Memory Installation

Wednesday, June 20, 2007

TeraGrid Related Stuff
Java-based GSI-SSH Term:

Single Sign-On on TeraGrid: