Wednesday 10 July 2013

Is there such a thing as being too smart for your own good?

Are society and organizations designed to work best for the mediocre? Are there any studies that correlate increasing IQ with better "life results", or do chances of "success"  worsen with increasing IQ (say beyond 130 or so)?

I have just finished high school. How do I build my profile to get into Harvard for an MBA, around 10 years from today?

HBS doesn't care about you. They care about building their brand. They want future leaders. The best way to get in is to dominate whatever field it is that you're passionate about. 

Barring that, they play the prestige game. It's a signaling mechanism for future success. HBS sources elite candidates with sterling resumes as part of their class, and they want to put yet another brand name on their resume. Their brand name. That way they can claim you as one of their successes. So your goal for the next 5-6 years should be to work for the right prestigious companies to convey that signal to them.

Friday 28 June 2013

Chapter 16



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions


1. What are the three primary uses of symbolic logic in 


formal logic ?
to express propositions, to express the relationships between propositions, and to
describe how new propositions can be inferred from other propositions that
are assumed to be true.

Chapter 15



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions


1. Define functional form, simple list, bound variable and referential transparency.
Functional form : one that either takes one or more functions as parameters or yields a function as its result. 
Simple list : A list that does not include sublist.
Bound variable : A bound variable is a variable which never changes in the expression after being bound to an actual parameter value at the time evaluation of the lambda expressions begin. 
Referential transparency : A state where execution of function always produces the same result when given the same parameters.

Thursday 27 June 2013

Chapter 14



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. Define exception, exception handler, raising an exception, disabling an exception, continuation, finalization, and built-in exception.

Exception : any unusual event, erroneous or not, that is detectable by either hardware or software and that may require special processing.

Exception handler : a code unit which processes an exception.

Raising an exception : When a event associated with an exception occurs

Disabling an exception : Ignoring a certain hardware-detectable exceptions.

Continuation : Control transfer to somewhere in the program outside of the handler code or program might terminate .

Finalization : ability to complete some computation regardless of how subprogram execution terminates.

Built-in exception : Exception that is not made by the user, but rather comes as default.

Chapter 13



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What are the three possible levels of concurrency in programs ?
Instruction level, Statement level, and Unit level

Chapter 12



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. Name two functional languages that support object-oriented programming.

C++ and Objective-c

Chapter 11



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What are the two kinds of abstractions in programming       languages ?
Process Abstraction and Data Abstraction

Chapter 10



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions


2. Which of the caller or callee saves execution status 

information?
Status information can be saved by either caller or callee.

Chapter 9



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What are the three characteristics of subprogram?


  • Each subprogram has single entry point 
  • The calling program unit is suspended during the execution of the called subprogram, which implies that there is only one subprogram in execution at any given time. 
  • Control always returns to the caller when the subprogram execution terminates

Chapter 8



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What is the definition of control structure ?

Linguistic mechanisms that selecting among alternative control flow paths and causing repeated execution of statements or sequence statements.

Friday 17 May 2013

6 Steps to Better Practice Guitar












You have a good ear and a passion for music. You have a good guitar, and maybe good amp and a collection of effects worthy of your talents. And you have a vision, a well of great musical ideas you’re going to share with the world.

Monday 8 April 2013

Chapter 7



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. Define operator precedence and operator associativity.

Operator precedence is a rule used to clarify which procedures should be performed first in a given mathematical expression.
Operator associativity is a property that determines how operators of the same precedence are grouped in the absence of parentheses

Chapter 6



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What is a descriptor ?
Collection of the attributes of a variable

Chapter 5



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. What are the design issues for names ?
Case sensitivity, special keywords, and reserved word of particular language.

Chapter 4



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1.What are three reasons why syntax analyzers are based on 
grammars ?

-BNF descriptions of the syntax of programs are clear and concise, both for humans and for software systems that use them.
- BNF description can be used as the direct basis for the syntax analyzer.
- Implementations based on BNF are relatively easy to maintain because of their modularity

3. Define lexeme and token.
Lexeme is logical grouping that consists of collection of characters collected by lexical analyzer.   Token is internal code for categories of the lexeme

4. What are the primary tasks of a lexical analyzer ?
It serves as front end of a syntax analyzer.

6. What is a state transition diagram ?
State diagram is a directed graph whose nodes are labeled with state names.

8. What are the two distinct goals of syntax analysis ?
First, syntax analyzer must check the input program to determine whether it is syntactically correct. The second goal is to produce a complete parse tree, or at least trace the structure of the complete parse tree, for syntactically correct input.

7. Who developed the Speedcoding system for the IBM 701 ?
The language was developed by John Backus in 1953 for the IBM.

9. Describe the differences between top-down and bottom-up parsers.
A top down parser builds from root downward to leaves, while bottom up parser builds from the leaves upward to the root

17. Describe the pairwise disjointness test.
It is a test of non-left recursive grammar that indicates whether left recursion can be done. It requires the ability to compute a set based on the RHSs of a given nonterminal symbol in a grammar.

18. What is left factoring ?
Left factoring is the action taken when a grammar leads backtracking while marking parsing/syntax tree.

Tuesday 26 March 2013

Chapter 3



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. Define syntax and semantics.

Syntax is form of a programming language’s expressions, statements, and program units.

Semantics is meaning of expressions, statements and program units.

2.Who are language descriptions for ?
Language descriptions is for programming language implementors

 4. Describe the operation of a general language recognizer.
The general operation of language recognizers is it will scan whether inputted string is inside certain language. If it is, it will accept the string.

5. What is the difference between a sentence and a sentential form ?
Sentence is strings of a language while sentential form is strings in the derivation

7. What three extensions are common to most EBNFs ?
optional part of RHS is delimited by brackets, the enclosed part can be repeated indefinitely or left out left altogether.

8. Distinguish between static and dynamic semantics.

Static semantics is only indirectly related to the meaning of programs during execution.

Dynamic semantics is not universally accepted in notation.

9. What purpose do predicates serve in an attribute grammar ?

Predicates function as boolean expression on the union of the attribute set and a set of literal attribute values

10. What is the difference between a synthesized and an inherited attribute ?
Synthesized attributes are used to pass semantic information up a parse tree while inherited attributes pass smenatic information down and accross a tree.

11. How is the order of evaluation attributes determined for the trees of a given attribute grammar?
The parse tree is evaluated based on its underlying BNF grammar, wit a possibility of having empty set of attributes values attached to each node.

12. What is the primary use of attribute grammars ?
Attribute grammars are used to describe more of the structure of a programming language than can be described with a context-free grammar.

Monday 11 March 2013

Chapter 2


Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. In what year was Plankalkul designed ? in what year was that design published ?
Plankalkul is a computer language designed for engineering purporses by Konrad Zuse between 1943 and 1945. 
It was the first high-level non-von Neumann  programming language to be designed for a computer. Also, notes survive with scribblings about such a plan calculation dating back to 1941.  It was published in year 1972.

2. Mention an interesting feature of Zuse’s programs.
It includes assignment statements, subroutines, conditional statements, iteration, floating point arithmetic, arrays, hierarchical record structures, assertions, exception handling, and other advanced features such as goal-directed execution.

3. What does Plankalkul mean ?
Plan Calculus (Plankalkul word is from Germany).

4. Speedcoding was invented to overcome two significant shortcomings of the computer hardware of the early 1950s. What were they ?
Speedcoding is a floating point three-address system which greatly simplifies programming, and checking out a program. Speedcoding provides convenient input-output operations, built-in checking, easy loading and printing. Therefore, Speedcoding reduces programming and testing expenses considerably. These expenses are often a large part of the cost of operating a computing installation. Thus Speedcoding is economical as well as convenient to use.

6. What hardware capability that first appeared in the IBM 704 computer strongly affected the evolution of programming languages ? Explain why.
The hardware has both indexing and floating-point instructions. It affects strongly because floating-point operations were simulated in software, and this operation is very time-consuming and the interpretation and the simulation of indexing were insignificant.

7. Who developed the Speedcoding system for the IBM 701 ?
The language was developed by John Backus in 1953 for the IBM.

10. What was the most significant feature added to Fortran 1 to get Fortran II ?
It added independent compilation of subroutines. Without it, any change in a program required the entire program to be recompiled.

11. What control flow statements were added to Fortran IV to get Fortran 77 ?
if-else

12. Which version of Fortran was the first to have any sort of dynamic variables ?
Fortran 90

Tuesday 5 March 2013

Chapter 1



Concept of Programming Languages by Robert W. Sebesta Answer

Review Questions

1. Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language ?
Having some background in language design will help a programmer to learn about new programming language easily and make the programmer be able to select the most suitable language for particular project .

2. How can knowledge of programming language characteristics benefit the whole computing community ?
By knowing the fundamentals of a programming language, a programmer will know what happen in computer underneath the hood and making the programmer  to have an ability to understand any new programming language. This will give an insight on what functionality of certain languages works well and what doesn’t work well.

3. What programming language has dominated scientific computing over the past 50 years ?
FORTRAN is the language used in past 50 years for scientific applications.

4. What programming language has dominated business applications over the past 50 years ?
COBOL is the language used in past 50 years for business applications.

5. What programming language has dominated artificial intelligence over the past 50 years ?
LISP

6. In what language is most of UNIX written ?
C programming language.

7. What is the disadvantage of having too many features in a language ?
It will reduce the software development itself, since the programmers will not have a full control to the language.

8. How can user-defined operator overloading harm the readibility of a program ?
User-defined operator overloading can harm the readability in case that user doesn’t realize the difference in operands and a possible confusion between functions of an operator.

9. What is one example of a lack of orthogonality in the design of C ?
For example of the lack of orthogonality in C is that C has 2 types of structured data types, they are array and struct.

10. What language used orthogonality as a primary design criterion ?
ALGOL 68.

11. What primitive control statement is used to build more complicated control statements in languages that lack them ?
GO TO is used to build more complicated control statements such as the FOR loop statement.

12. What construct of a programming language provides process abstraction ?
The use of a subprogram to implement a sort algorithm that is required several times in a program. Without the subprogram, the algorithm would need to be copy-pasted at all places it need to be and thus making the code longer and harder to understand and read.

13. What does it mean for a program to be reliable ?
A program is said reliable if and only if it performs its normal function specified under all conditions including good memory management that means there will be no memory leak.

14. Why is type checking the parameters of a subprogram important ?
Because parameters of a subprogram is like a command-line arguments that means if the paremeter is wrong, it will make the program error or not run properly. Also it is possible for a subprogram to receive a type of variable that is different from what is expected that can make an error too.

15. What is aliasing ?
Aliasing is having two or more distinct name to access the same memory cell. It is considered dangerous feature. For example, assigning two pointers with different name into one variable. In some languages, aliasing is used to overcome deficiencies in the language’s data abstraction facilities.

Monday 28 January 2013

Zen of Doing

"Move and the way will open."
- Zen and The Art of Happiness

You know that you should exercise, and eat lots of veggies and less fried, salty and sweet foods.
But knowing something and actually doing it are two very different things.

You know you should stop procrastinating. You know you should watch less TV or go to social sites (or news sites, or your email program) less often. You know you should be writing, or learning that language you’ve always wanted to learn, or practicing guitar, or decluttering your house. Knowing isn’t the problem. It’s the doing that gets us every time.

Wednesday 16 January 2013

Chapter 15


Discovering Computers 2011 : Living in a Digital World Answer

True/False

1.   True
2.   False
3.   True 
4.   True
5.   True
6.   False
7.   True
8.   True
9.   True
10. True

Chapter 14


Discovering Computers 2011 : Living in a Digital World Answer

True/False

1.   True
2.   False
3.   False
4.   True
5.   False
6.   False
7.   True
8.   True
9.   True
10. True

Chapter 13


Discovering Computers 2011 : Living in a Digital World Answer

True/False

1.   True
2.   True
3.   True
4.   True
5.   True
6.   False
7.   False
8.   True
9.   False
10. False

Chapter 12


Discovering Computers 2011 : Living in a Digital World Answer

True/False


1. False
2. True 
3. False 
4. False 
5. False 
6. True
7. False
8. False
9. True
10.True
11.False


Chapter 11


Discovering Computers 2011 : Living in a Digital World Answer

True/False


1.  True 
2.  True 
3.  False 
4.  True 
5.  False 
6.  True 
7.  True
8.  True
9.  False
10.False
11.True
12.False