Thursday, April 18, 2013

Fix Bold and Italic Font Problem in Windows

I searched on Internet to find a working solution. I found a few solutions but none of them worked for me. At last I was able to fix this problem myself.

Here some method for you to fix the bold-italic font problem in Windows :

Method 1 : Apply Default Theme from Desktop Properties

If you are facing this bold-italic font problem, first of all you should try to re-apply default theme using Desktop Properties.

  1. Right-click on Desktop and select Personalize option. Windows XP users will have Properties option instead of Personalize.
  2. Now apply default Windows theme.
This process will restore all customized font and color settings made by you in Windows theme like changing font type, font size, font color, etc.

If it doesn't fix the font problem, try the next one mentioned below.

Method 2 : Reset Default Fonts Settings

In this step, we'll try to reset fonts settings in Windows.
  1. Type fonts in RUN or start menu search box and press Enter. It'll open Fonts folder. Alternatively you can open the same folder using Control Panel window.
  2. Now click on Font settings link present in left sidebar of Fonts window.
  3. Now click on Restore default fonts settings button as shown there.
  4. That's it. Restart your system and it should fix the problem.
If it doesn't help, try the next method.

Method 3 : Restore Default Registry Settings

Sometimes a few settings related to fonts in Windows Registry become corrupted which might also cause this weird bold-italic font issue. You can restore these Registry settings using following steps :
  1. Download following ZIP file, extract it and run the extracted REG file. It'll ask for confirmation, accept it : Download Registry Script
  2. Restart your system and it should fix the problem.
Method 4 : Reinstall Missing Fonts in Windows

If none of the above mentioned methods worked for you, this final method will definitely help you. In this ultimate method, we'll reinstall a few most common and widely used fonts like Arial, Times New Roman, Courier New, Tahoma, Verdana, Trebuchet MS, MS Sans Serif and Segoe UI in Windows.

Actually sometimes a required font gets deleted accidentally by a software program or an update. When Windows doesn't find that font, it starts showing the text using another variation of that font or the default font set in Registry.

For example, Windows Vista and Windows 7 use "Segoe UI" font and if "Segoe UI Regular" font is deleted, Windows starts showing the text using "Segoe UI Bold Italic" font which is a separate font in Windows.

That's the main reason behind this annoying font problem. What we can do to fix the problem? We can try to reinstall common fonts in Windows which will provide the missing font to Windows and it'll start showing things normally.
  1. Download following ZIP file, extract it and you'll get a folder containing a few .ttf files which are actually font files. Download Missing Windows Fonts
  2. Now select all .ttf font files, right-click on any file and select Install option. Alternatively, you can open Fonts folder using the same step 1 mentioned in Method 2 and then drag-n-drop the downloaded .ttf font files in Fonts folder.
  3. Windows will show a confirmation dialog box telling you "The font is already installed. Do you want to replace it?" Click on Yes button.
  4. That's it. Once you copy all the fonts in Fonts folder, restart Windows and it'll 100% fix the annoying bold-italic font problem.

Monday, April 8, 2013

Answers of Concepts of Programming Languages 10th - Chapter 5


Martin - 1601213690

02 PBT


Review Questions

1. What are the design issues for names?
    * Case sensitive and special words of language reserved words or keywords

4. What is an alias?
    * Alias is more than one variable name can be used to access the same memory location.

5. Which category of C++ reference variables is always aliases?
    * Looping variables.

6. What is the l-value of a variable? What is the r-value?
    * l-value is short of "left hand side value"
    * r-value is short of "right hand side value"

7. Define binding and binding time.
    * A binding in a program is an association of an attribute with a program component such as an identifier or a symbol. For example the data type of the value of a variable is an attribute that is associated with the variable name.
    * The binding time for an attribute is the time at which the binding occurs. For example, in C the binding time for a variable type is when the program is compiled, but the value of the variable is not bound until the program executes.

9. Define static binding and dynamic binding.
    * Static binding, the compiler can resolve the binding at the compile time. All the instance method calls are always resolved at runtime, but all the static method calls are resolved at compile time itself and hence we have static binding for static method calls.
    * Dynamic binding refers to the case where compiler is not able to resolve the call and the binding is done at runtime only.

10. What are the advantages and disadvantages of implicit declarations?
    * Advantage : flexibility ( generic code )
    * Disadvantage : Inefficient, because all attributes are dynamic. Loss of error detection.

11. What are the advantages and disadvantages of dynamic type binding?
    * Advantages : flexibility ( generic program units )
    * Disadvantages : high cost ( dynamic type checking and interpretation ), type error detection by the compiler is difficult.



Problem Set

1. Which of the following identifier forms is most readable? Support your decision.
    * sum_of_sales, because it's easier to see the spaces between words and easier to read.

2. Some programming languages are typeless. What are the obvious advantages and disadvantages of having no types in a language.
    * Advantages : allow users to write sloppy programs faster.
    * Disadvantages : cannot control the data and variables, compiler cannot detect any mistakes.

4. Dynamic type binding is closely related to implicit heap-dynamic variables. Explain this relationship.
    * Both are related to the assignment and the statement.

5. Describe a situation when a history-sensitive variable in a subprogram is useful.
    * History sensitive variables may be useful in data manipulation subprograms, where some operation is performed on a variable, and the function exits, then the function is called again. This way, the function doesn't have to take the variable as a parameter, but only to return it.

Answers of Concepts of Programming Languages 10th - Chapter 3


Martin - 1601213690

02 PBT


Review Questions

1. Define syntax and semantics.
    * Syntax is the grammatical rules and structural patterns governing the ordered use of appropriate words and symbols for issuing commands, writing code, etc., in a particular software application or programming language.
    * Semantics provides the rules for interpreting the syntax which do not provide the meaning directly but constrains the possible interpretations of what is declared.

2. Who are language descriptions for?
    * Language descriptions are written for the potential users, who are the initial evaluates of the language.

3. Describe the operation of a general language generator.
    * A general language generator is a device that can be used to generate the sentences of the language. It generates unpredictable sentences which makes a generator seems to be a device of limited usefulness as language descriptor.

4. Describe the operation of a general language recognizer.
    * A general language recognizer is a recognition device capable of reading strings of characters from the alphabet. It would analyze the given string and it would either accept or reject the string based from the language given.

5. What is the difference between a sentence and a sentential form?
    * A sentence is a sentential form that has only terminal symbols.
    * A sentential form is every string of symbols in the derivation.

6. Define a left-recursive grammar rule.
    * Left recursion is a particular form of recursion that cannot be directly handled by the simple LL(1) parsing algorithm.

7. What three extensions are common to most EBNFs?
    * Optional parts are placed in brackets ([])
    * Put alternatives in parentheses and separate them with vertical bars (+|-)
    * Put repetitions ( 0 or more ) in braces ({})

8. Distinguish between static and dynamic semantics.

    * Static semantics is more on the legal forms of programs ( syntax rather semantics ) and is only indirectly related to the meaning of the programs during execution. Static semantics is so named because the analysis required to check these specifications can be done at compile time. In many cases, the semantic rules of language state its type constraints.
    * Dynamic semantics is describing the meaning of the programs. Programmers need to know precisely what statements of a language do. Compile writers determine the semantics of a language for which they are writing compilers from English descriptions.


10. What is the difference between a synthesized and an inherited attribute?
    * The synthesized attributes are the result of the attribute evaluation rules, and may also use the values of the inherited attributes.
    * The inherited attributes are passed down from parent nodes.

12. What is the primary use of attribute grammars?
    * An attribute grammar is a device used to describe more of the structure of a programming language than is possible with a context-free grammar. The primary purpose of an attribute grammar is it allows certain language rules to be described, such as type of compatibility.



Problem Set

1. The two mathematical models of language description are generation and recognition. Describe how each can define the syntax of a programming language.

3. Rewrite the BNF of Example 3.4 to give + precedence over * and force + to be right associative.
    * <assign> -> <id> = expr
       <id>       -> A | B | C
       <expr>   -> <expr> - <term>
       | <term>
       <term>   -> <term> / <factor>
       | <factor>
       <factor> -> (<expr>)
       | <id>

6. Using the grammar in example 3.2, show a parse tree and a leftmost derivation for each of the following statements :
    a.    =
         /   \
       a      *
             /   \
           *       a
         /   \
       b      +
             /   \
           c      a
    b.    =
         /   \
        b     *
             /   \
           +      c
          / \
        a    *
            /  \
          c     b
    c.    =
         /   \
        a     +
             /  \
            *    a
          /  \
        b     c

7. Using the grammar in Example 3.4, show a parse tree and a leftmost derivation for each of the following statements :
    a. A=(A+B)*C

<assign>-><id>=<expr>
<id>->A|B|C
<expr>-><id>+<expr>
|<term>
<term>-><term>*<factor>
|<factor>
<factor>->(<expr>)
|<id>

    b. A=B+C+A

<assign>-><id>=<expr>
<expr>-><expr>+<id>
|<term>
<term>-><term>*<factor>
|<factor>
<factor> -> (<expr>)
|<id>

    c. A=A*(B+C)

<assign>-><id>=<expr>
<expr>-><id>+<expr>
|<term>
<term>-><term>*<factor>
|<factor>
<factor>->(<expr>)
|<id>

    d. A=B*(C*(A+B))

<assign>-><id>=<expr>
<expr>-><id>*<expr>
|<term>
<term>-><term>+<factor>
|<factor>
<factor>-><id>*<id>
|<id>


13. Write a grammar for the language consisting of string that have n copies of letter a followed by the same number of copies of the letter b, where n>0. For example, the strings ab, aaaabbbb, and aaaaaaaabbbbbbbb are in the language but a, abb, ba, and aaabb are not.

18. What is a fully attributed parse tree?
    * The tree is said to be fully attributed if all the attribute in a parse tree have been computed.