Search   Feed   Browse   Add
Feed items 1 - 4 of 4 for April 2005

Bad Recursion Revisited - April 28, 2005

We have internal email lists for questions about programming languages. Here's one that came across recently that I thought illustrated a good point about language design. An interview candidate gave the following awful implementation of the factorial function. (Recall that factorial is notated "n!", and is defined as the product of all the integers from 1 to n. 0! is defined as 1. So 4! = 4 x 3 x 2 x 1 = 24.) If you note that n! = n x ((n-1)!) then a recursive solution comes to mind. When...
http://blogs.msdn.com/ericlippert/archive/2005/04/28/bad-recursion-revisited.aspx

How Do Script Engines Implement Object Identity - April 26, 2005

I've talked a few times in this blog about the semantics of the equality operators in various languages. (Such as here, and here.) Recently a reader asked me how JScript implements object identity. That is, given two objects, how do we know if they are "the same object" or not For the remainder of this discussion I'm going to assume that we've got two non-null objects that we're comparing for identity. The details of how objects are compared to strings, numbers, etc, will have to wait for...
http://blogs.msdn.com/ericlippert/archive/2005/04/26/412199.aspx

Binary Files and the File System Object Do Not Mix - April 20, 2005

OK, back to scripting today. But before I get back to scripting issues, one brief correction. An attentive reader noted that "The Well-Tempered Clavier" was in fact designed to sound good on a "well tempered" instrument, not an "equally tempered" instrument. The difference is that a "well" temperament is designed so that every key sounds good, but is allowed to have some badly-out-of-tune intervals that must be avoided. (Traditionally these are called "wolf intervals".) There was considerable..
http://blogs.msdn.com/ericlippert/archive/2005/04/20/binary-files-and-the-file-system-obje...

VBScript Quiz Answers, Parts Eleven and Twelve - April 5, 2005

11) X and Y are both Booleans.  Which of the following always assigns True  Why (a) Z = Not X Or Y = X Imp Y(b) Z = X Imp Y = Not X Or Y(c) Z = X Eqv Y = Not X XOr Y(d) Z = Not X XOr Y = X Eqv Y  (a) assigns False if X and Y are both False.  The others assign True no matter what X and Y are. However, these are not as straightforward as you might think. Imp is the "logical implication" operator. X Imp Y means "If X is True then Y is True". It is always True unless X is True..
http://blogs.msdn.com/ericlippert/archive/2005/04/05/vbscript-quiz-answers-parts-eleven-an...
Available Archives
- March (3 items)
- April (4 items)
- June (1 item)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact