by Gian-Carlo Rota
Lesson One: You can and will work at a desk for seven hours straight, routinely. For several years, I have been teaching 18.30, differential equation, the largest mathematics course at MIT, with more than 300 students. The lectures have been good training in dealing with mass behavior. Every sentence must be perfectly enunciated, preferably twice. Examples on the board must be relevant, if not downright fascinating. Every 15 minutes or so, the lecturer is expected to come up with an interesting aside, joke, historical anecdote, or unusual application of the concept at hand. When a lecturer fails to conform to these inexorable requirements, the students will signify their displeasure by picking by their books and leaving the classroom.
$5 + 10 CHF = $10 if rate is 2:1
$5 * 2 - $10
Make "amount" private
Dollar side effects?
Money rounding?
equals()
hashCode()
Equal null
Equal object
5 CHF * 2 - 10 CHF
Dollar/Franc duplication
Common equals
Common times
Compare Francs with Dollars
Currency?
$5 + 10 CHF = $10 if rate is 2:1
$5 * 2 - $10
Make "amount" private
Dollar side effects?
Money rounding?
equals()
hashCode()
Equal null
Equal object
5 CHF * 2 - 10 CHF
Dollar/Franc duplication
Common equals
Common times
Compare Francs with Dollars
$5 + 10 CHF = $10 if rate is 2:1
$5 * 2 - $10
Make "amount" private
Dollar side effects?
Money rounding?
equals()
hashCode()
Equal null
Equal object
5 CHF * 2 - 10 CHF
Dollar/Franc duplication
Common equals
Common times
public void testMultiplication {
Dollar five = new Dollar(5);
assertEquals(new Dollar(10), five.times(2));
assertEquals(new Dollar(15), five.times(3));
}
$5 + 10 CHF = $10 if rate is 2:1
$5 * 2 - $10
Make "amount" private
Dollar side effects?
Money rounding?
equals()
hashCode()
Equal null
Equal object
public void testMultiplication {
Dollar five = new Dollar(5);
assertEquals(new Dollar(10), five.times(2));
assertEquals(new Dollar(15), five.times(3));
}
$5 + 10 CHF = $10 if rate is 2:1
$5 * 2 - $10
Make "amount" private
Dollar side effects?
Money rounding?
equals()
hashCode()
public void testEquality() {
assertTrue(new Dollar(5).equals(new Dollar(5)));
}
The goal is clean code that works - Ron Jeffries
So we want to test multiplication and make sure that the "times()" method returns the right amount when passed a multiplier.
public void testMultiplication() {
Dollar five = new Dollar(5);
Dollar product = five.times(2);
assertEquals(10, product.amount);
product = five.times(3);
assertEquals(15, product.amount);
}
So, in order to use Emacs more comfortably, it's a good idea to switch the Ctrl and Cap Locks key. What I don't understand is why people don't map the Alt key to the Ctrl key. Personally, I find the Alt key more annoying than the Ctrl key.
Update: I found a better combination at Bob Roger's website. He recommends that you get rid of the Caps Locks at together and retain the use of the both left "Windows Flag" key and the "Menu" key. However, unlike Bob's layout which doesn't use the "Caps Locks" key, my layout uses the Caps_Lock key as the Control key, keeps the Ctrl Key as the Control keys, switches the Super_L, Alt_L keys and makes the Menu into another Alt_R key.
After upgrading to Windows XP SP2, Partition Magic stopped working and would display Error #11019. It's been over a year and a half since I first encountered this message and I didn't bother searching for a solution. I expected Symantecs to release a new version that would simply make this problem go away.
Well, after a year and a half, I decide to try Partition Magic again and I'm still getting the same error message. The only response on Symantec's Support website is from 2004 and it says that it's a known problem with no solution. Bull!