Monday, December 13, 2010

Microsoft Windows

Three interesting note about Microsoft Windows:

1. You can't create a folder named "con".
Try it!

2. Write the following text into notepad:

"bush hid the facts"

save the file and re-open and see the magic.

3. Open Microsoft word and type

=rand(200, 99)

and press enter and see the magic.

4 comments:

  1. MAGIC #1: Reason : CON is a reserved KEYWORD in DOS

    1. Create a new text file
    2. Try renaming it to con.txt
    3. You will get a pop up stating that it’s a reserved keyword.
    4. Since the Folders are different from files you don’t get a pop up that’s it.

    Proof:
    It is in fact perfectly true that you cannot create a folder named "CON", nor can you rename an existing folder to "CON". However, there is no mystery surrounding this restriction whatsoever. The "team" at Microsoft, and a great many others besides, know perfectly well why you cannot name a folder "CON". "CON" and a number of other character strings are in fact reserved names that go back to the days of DOS and cannot be used to name folders or files. Other reserved names are:
    • PRN
    • AUX
    • NUL
    • LPT1
    • COM1
    • Potential drive letter - A: to Z:
    • A number of others
    If you try to name a folder using one of these reserved names, the name will automatically revert to the default, generally "New Folder". Moreover, if you try to use a reserved name to name a file such as a Notepad or Microsoft Word document you will generally receive an error message similar to the following:


    Depending on exactly how you save the file, you may instead receive a warning message advising that a file with that name already exists. However, even if you choose "Yes" to overwrite the existing file, you will still not be allowed to save the file.

    It should be noted that, by entering the right sequence of commands via the command prompt, it is usually possible to circumvent the restriction in Winodows and create a folder using a reserved name. However, this may cause other problems and is not advisable, especially for more inexperienced users.

    While there is no mystery about this issue, it might have saved user confusion if Windows displayed an explanatory error message when attempting to create a folder with a reserved name as well.

    ReplyDelete
  2. MAGIC #2: Agreed this is bug but it doesn’t mean no one can explain

    Here is the answer it is caused because of misinterpreted UTF-16LE encoding

    Proof:
    Bush hid the facts is a common name for a bug present in the function IsTextUnicode of Microsoft Windows, which causes a file of text encoded in Windows-1252 or similar encoding to be interpreted as if it were UTF-16LE, resulting in mojibake. When "Bush hid the facts" is put in a new Notepad document and saved, closed, and reopened, the words "畢桳栠摩琠敨映捡獴" appear instead.
    While "Bush hid the facts" is the sentence most commonly presented on the Internet to induce the error, the bug can be triggered by many sentences with characters and spaces in a particular order so that the bytes match the UTF-16LE encoding of valid (if nonsensical) Chinese Unicode characters. Other popular strings are "this app can break", “acre vai pra globo”, and "aaaa aaa aaa aaaaa".
    The bug occurs when the string is passed to the Win32 charset detection function IsTextUnicode with no other characters. IsTextUnicode sees what it thinks is valid UTF-16LE Chinese and returns true, and the application then incorrectly interprets the text as UTF-16LE.
    Many text editors and tools exhibit this behavior because they use IsTextUnicode as well.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. MAGIC #4:
    Reason :
    This is a test function used by Microsoft to test all its compatible
    Microsoft office functionalities in the office word.

    Proof:
    Visit http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B212251

    How to insert sample text in Microsoft Office Word 2007 or in Microsoft Office Word 2010
    To insert sample text in Word 2007 or Word 2010, use one of the following methods.
    Method 1: Use rand()
    To insert localized sample text in Word 2007 or Word 2010, type =rand() in the document where you want the text to appear, and then press ENTER.

    The sample text that is inserted for the English version of Word 2007 or Word 2010 resembles the following text:
    On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look.¶

    You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also format text directly by using the other controls on the Home tab. Most controls offer a choice of using the look from the current theme or using a format that you specify directly.¶

    To change the overall look of your document, choose new Theme elements on the Page Layout tab. To change the looks available in the Quick Style gallery, use the Change Current Quick Style Set command. Both the Themes gallery and the Quick Styles gallery provide reset commands so that you can always restore the look of your document to the original contained in your current template.¶
    Note This text includes a paragraph symbol (¶) that is displayed when sample text is inserted.

    You can control how many paragraphs and lines appear by adding numbers inside the parentheses of the rand() function. The =rand() function has the following syntax:
    =rand(p,l)

    Note In this function, p is the number of paragraphs, and l is the number of lines that you want to appear in each paragraph.
    The following are some examples that show how the parameters work:

    * =rand(1) inserts one paragraph with three lines of text in the paragraph.
    * =rand(10,10) inserts 10 paragraphs with 10 lines of text in each paragraph.

    The parameters are optional. If you omit the parameters, the default number of paragraphs is three, and the default number of lines per paragraph is also three.

    ReplyDelete