Enter your Email Address:

Delivered by FeedBurner

To get posts delivered to your Email

16 August 2017

Wired to be Weird?

Journey of you and me

    Image result for mind
  1. Human mind is fresh when born
  2. Few days after you are born, the folks around you condition you (smile is an outcome of happiness, boy doesn't cry, so do not cry, a girl should not do this)
  3. Because of extreme conditioning, you build your faith
  4. You associate yourself with others of similar faith (things are fine till this)
  5. You tend to believe that the person who you associated with is "good" because of what you experience with him (which is ok, but things start to go bad). Instead of you liking a quality or a task, you tend to like that person
  6. Assume that the person exhibit some unusual behavior
  7. Since you like that person, you are actually discounting the unusual behavior (which is not good) and if you like that person to extreme, you actually justify his behavior
And therefore
  1. We are weird and as the result, we regress
  2. We regress and feel bad, understand our hardware (brain - how it is wired) and try to change our software (thinking/awareness). We grow (a nice possibility)

11 August 2017

Logic without Logic


Image result for ignorance
I came across an wonderful quote in a book on Discrete Mathematics. It applies to several things in life and our attitude in life. Here it goes 

Symbolic logic has been disowned by many logicians on the plea that its interest is mathematical and by many mathematicians on the plea that its interest is logical. - A N Whitefield

Inference: And as a result it is disowned by both.

Apply to Life: I have been in this is situation several times. For instance, when you study mathematics (or any complex subject that needs hard work to master) in school we hear teachers saying that you will understand it much deeper when you go to college. And after a couple of years when you are in college, your lecturer will say "you would learnt it in school" and just skim through it. 

We often get caught in the tiny window of ignorance due to negligence (when people treat you under qualified when you are young and over qualified when you are old and as a result you never get qualified). Break the window


06 June 2017

Internship for Students

Image result for internship
Writing this after a while. 

I was thinking of doing something like this for a very long time (many years probably) but took while. Dr. Sankaran's post is one of the reasons [Thank you Sir]

Hope you guys still remember OpenGyan. I am planning to do something similar but for folks who are really want to take programming to next level. The thinking is to come up with real world problems and TRY solving it and on the way you will learn some cool things. It will be like internship (of course with no stipend).

Program Structure:
  1. Identify folks who are interested to do this. Ideally someone with good (this is purely relative) programming skills and willing to put efforts to learn something new. Should be doing graduate or post-graduate course in a college (and interested in computers)
  2. Willingness to put 4-5 hours of efforts per week. I think this will be a big differentiation. 
  3. Willingness to work in latest technologies - cloud/containers/tools/http/REST (some of these are highly talked about in industry)
  4. Has Google hangout or similar tool for interaction
  5. Talking to geeks and learning from them (expands your learning)
  6. Planning to do for two teams each containing not more than two people. The members of team are co-located (either from same college or live near by each other or connected by Google hangout in the order of preference)
  7. Finally a demo of your work (a write-up on what you have done and learnt) and move on to next problem (if you are still interested)

What you will probably get (no guarantee):
  1. Problems that the world is trying to solve (tough part)
  2. How some of the problems are solved (easy part once tough part is found)
  3. Get hooked to problems (disciple)
  4. Apply what you learnt. If you have not learnt anything, learnt it first and apply it (consistency)
  5. Learn tools that professional use to debug/solve problems (smart work)
What you pay:
  • Your fee is through your commitment and valuing the folks' bandwidth
  • No exchange of money or favour to be involved

If you are interested - write to me GRABYOURFREEDOM AT GMAIL DOT COM
If you feel it will help someone that you know (or don't know) - Just Share.


05 March 2017

Programming Language Pragmatics [Chapter 1, Section 1.5] Check Your Understanding

This post has my answers for "Check Your Understanding" questions in section 1.5, Chapter 1 of the book Programming Language Pragmatics by Michael L. Scott.



Chapter 1, Section 1.5 - Check Your Understanding


Question # 11. Explain the distinction between interpretation and compilation. What are the comparative advantages and disadvantages of the two approaches?
Compiler produces machine code from high-level language. After the compilation, the machine code can be directly run on the target system which is locus during runtime. The machine code produced on one architecture cannot be run on a machine with different architecture. The compiled program is faster than its interpreter counterpart.

The interpreter is usually the locus when the program is running. The program written in high-level language is directly run on the target machine through interpreter. In a sense, the high-level code is machine instruction for interpreter. Most of the interpreter are slower in execution as most of the decisions during the course of the program are deferred until the control reaches to the particular statement. However the debugging is much more easier to do in interpreter as interpreter has control throughout the execution of the program. Moreover the interpreter can do useful features like on-the-fly compilation so that the program can generate code during execution which is again consumed/executed by interpreter.

Question #12. Is Java compiled or interpreted (or both)? How do you know?
Java is both compiled and interpreted. Java compiler transforms Java source code to bytecode. Java Virtual Machine (interpreter) executes bytecode.

Question #13. What is the difference between a compiler and a pre-processor?
Pre-processor is needed step before compilation. Compilation transforms the code substantially but pro-processing is usually is light-weight such as removing comments, replacing macros etc.

Question #14. What was the intermediate form employed by the original AT&T C++ compiler?
The intermediate form produced by AT & T C++ compiler is "C".

Questions #15. What is P-code?
P-code is intermediate code that are produced by Pascal compiler. P-code is run by Pascal interpreter during runtime.

Question #16. What is bootstrapping?
Typically the programming language compiler is written by itself meaning that a C compiler is usually written using C. However at first there will not be any compiler to compile the code written in C. Usually a tiny interpreter is written in a different language to produce machine instruction (tiny compiler). Later the tiny compiler produced by interpreter is used to compile the compiler. This is called bootstrapping. In similar fashion more features are added incrementally to produce high quality compiler.

Question #17. What is a just-in-time compiler?
Just-in-time compiler is a feature of interpretor that converts byte-codes to machine instruction while the program is under execution. This is done mainly to increase performance (speed of execution)

Question #18. Name two languages in which a program can write new pieces of itself "on the fly"
List and Prolog (Python, Perl, TCL also have similar features)

Question #19. Briefly describe three "unconventional" compilers - compilers whose purpose is not to prepare a high-level program for execution on a microprocessor
  1. SQL - Translates statements to operations on database
  2. Compilers to translate logic-level circuit specification into photographic masks for computer chips
  3. TEX that translates document to commands for printers

Question #20. List six kinds of tools that commonly support the work of a compiler within a larger programming environment
  1. Debuggers
  2. Editors
  3. Pretty-Printers
  4. Style Checkers
  5. Configuration Management
  6. Profilers
Question #21. Explain how IDEs differs from a collection of command-line tools
All the tools are integrated in an environment often collaborates amongst themselves where as the command line tools are used merely in isolation. For example when a program crashes, IDE points which line of the code is causing the issue and pops up the code in the editor. The developer can make the change and save the file. IDE automatically builds it.

26 February 2017

Programming Language Pragmatics [Chapter 1, Section 1.3] Check Your Understanding


This post has my answers for "Check Your Understanding" questions in section 1.3, Chapter 1 of the book Programming Language Pragmatics by Michael L. Scott.

Chapter 1, Section 1.3 - Check Your Understanding

Question #1: What is the difference between machine language and assembly language?
Machine language is written using the instructions set of the processor directly. Each operation supported by the processor is given a code using which the operation is carried out. The code written in Machine language will be in hexadecimal. But in the case of assembly language the program is written using mnemonic (often represented as operations such as MOV, STORE, ADD, SUB etc) which later translated to machine instructions by software called assembler. The assembly language also has provisions for macro definition which expanded by assembler before producing machine code.

Question #2: In what way(s) are high level languages an improvement on assembly language? In what circumstances does it still make sense to program in assembler?
While assembly language is faster to execute, high-level languages can be easily learnt by programmers, ported to varied architecture without requiring to rewrite entire logic on many architectures and saves programmers time since high-level languages are not one-to-one mapping of machine instructions. High level languages often use functions (in the context of mathematical functions) to produce highly expressive code. However assembler will be default choice for system specific performance reasons.

Question #3: Why are there so many programming languages?
There are several programming languages because of the following reasons - evolution, special purpose, personal choice, 

Question #4: What makes a programming language successful?
The programming languages are successful because of one or several of the following reasons - expressive power, Ease of use, ease of implementation, standardization, open source, excellent compilers, economic, patroage and internia.

Question #5: Name three languages in each of the following categories: von Neumann, functional, object-oriented. Name two logic languages. Name two widely used concurrent languages
von Neumann - C, Ada, Fortran
Functional: Haskell, ML, Scheme
Object-oriented: Java, C++, Smalltalk
Logic Languages: Prolog, spreadsheets
Concurrent Languages: C++, Java 

Question #6: What distinguishes declarative languages from imperative languages?
Imperative languages solves a problem by sequence of steps with each steps produces some side effects. The imperative language focuses on how a problem should be solved rather than what to do. The declarative languages on the other hand focuses on what needs to done.

Question #7: What organizations spearheaded the development of Ada?
US Department of Defence

Question #8: What is generally considered the first high-level programming language?
FORTRAN?

Question #9: What was the first functional language?
Lisp, Scheme?

Question #10: Why aren't concurrent languages listed as category in Figure 1.1?
Concurrency support is available in many of languages such as Java, C++ and C. Several concurrency packages are available as language extensions

25 February 2017

Abstraction - Events IN, Solutions OUT

Abstraction is a great tool for mankind. The history of human evolution has seen uncountable number of evidences on the usefulness of abstraction. Abstraction is to absorb important attributes and leaving out unimportant attributes. Very state that we are in is the fruit of our ability to abstract - Ideas.

Image result for abstraction problem solving
Ideas - what are ideas. Ideas are fruits of abstraction of events happening around us or impulse of information that happens elsewhere (which again an event to us). In problem solving domain, ideas are output of abstraction (elevated thinking) and inference (desirable response from higher plane of thinking). 

While most of us think creativity is for people who are brainy. But the truth is that the creativity is fruit of hard work, systematic way of abstracting the problem and connecting those events with our experience. Like anything, it is only the practice that makes it smart work. The first step towards solving problems is to understand a problem or rather find/recognize a problem, understanding it at higher plane and giving way for ideas to emerge. 

Abstraction is what it took us where we are and it is the only thing that is going to take us where we ought to go.

PS 1: This is hangover of reading programming languages pragmatics which i think is a wonderful book. I will be reading for next several months (so surely there are going to be numerous posts on that)

PS 2: I am posting after an year. I have to admit that i ran out of ideas and since i am reading a book i think i will get a lot more ideas