All That I Study
Saturday, February 23, 2013
Wednesday, February 13, 2013
Syntax vs Semantics
Semantics ~ Meaning
Syntax ~ Symbolic representation
So two programs written in different languages could do the same thing (semantics) but the symbols used to write the program would be different (syntax).
A compiler will check your syntax for you (compile-time errors), and derive the semantics from the language rules (mapping the syntax to machine instructions say), but won't find all the semantic errors (run-time errors, e.g. calculating the wrong result because the code says add 1 instead of add 2).
Actually there are not two levels but three:
- lexical level: how characters are combined to produce language elements (
i
andf
producesif
) - syntactical level: how language elements are combined to produce language expressions (
if
,(
,42
,==
,answer
and)
produces a conditional statement) - semantic level: how language expressions are converted to CPU instructions in order to form a meaning (a conditional statement allows to execute one branch or the other depending on the result of the boolean expression)
Syntax refers to formal rules governing the construction of valid statements in a language.
Semantics refers to the set of rules which give the meaning of a statement.
Semantics refers to the set of rules which give the meaning of a statement.
Sources: http://programmers.stackexchange.com/questions/113800/whats-the-difference-between-syntax-and-semantics
What Does Parsing Mean?
This may not be complete explanation but i find it helpful to understand:
Parsing is the process of analyzing text made of a sequence of tokens to determine its grammatical structure with respect to a given (more or less) formal grammar.
The parser then builds a data structure based on the tokens. This data structure can then be used by a compiler, interpreter or translator to create an executable program or library.
If I gave you an english sentence, and asked you to break down the sentence into its parts of speech (nouns, verbs, etc.), you would be parsing the sentence.
That's the simplest explanation of parsing I can think of.
That said, parsing is a non-trivial computational problem. You have to start with simple examples, and work your way up to the more complex.
Source: http://stackoverflow.com/questions/2933192/whats-the-best-way-to-explain-parsing-to-a-new-programmer
Saturday, January 19, 2013
Configuring Pidgin for Gtalk on Ubuntu
Default settings may not work for you like they did not for me. Here is what worked for me:
Once you have setup your account change the following settings on
accounts->abc@gmail.com->edit account
Basic->Protocol set to XMPP
Advanced->Connect port to 443
Advanced->Talk Port to talk.google.com
Advanced->Connection Security to old-style SSL
You might also want to go to
Tools->Plugins->Libnotify Popups ->Configure Plugin-> Uncheck Buddy signs on, to disable annoying notifications every time somebuddy comes online.
Once you have setup your account change the following settings on
accounts->abc@gmail.com->edit account
Basic->Protocol set to XMPP
Advanced->Connect port to 443
Advanced->Talk Port to talk.google.com
Advanced->Connection Security to old-style SSL
You might also want to go to
Tools->Plugins->Libnotify Popups ->Configure Plugin-> Uncheck Buddy signs on, to disable annoying notifications every time somebuddy comes online.
Friday, January 18, 2013
Solved: Ubuntu Touchpad Problem on Vaio VGN-CS24GH
This is a little off from the topics of this blog but this bug troubled me so much that I had to put the solution that worked, out. Here is what I did:
Run the following commands on terminal:
sudo modprobe -r psmouse
sudo modprobe psmouse proto=imps
sudo gedit /etc/modprobe.d/touchpad.conf
Write the following line in file touchpad.conf:
options psmouse proto=imps
Close the file. That's it!
As of now this is working perfectly on my laptop, Sony Vaio VGN-CS24GH, I hope it works for you too!
Run the following commands on terminal:
sudo modprobe -r psmouse
sudo modprobe psmouse proto=imps
sudo gedit /etc/modprobe.d/touchpad.conf
Write the following line in file touchpad.conf:
options psmouse proto=imps
Close the file. That's it!
As of now this is working perfectly on my laptop, Sony Vaio VGN-CS24GH, I hope it works for you too!
Compiling C, C++ Programs on Ubuntu
If you are a developer you need C and
C++ Compiler for your development work.In ubuntu you can install the
build-essential for C and C++ compilers.
Install C and C++ Compilers in Ubuntu
sudo aptitude install build-essential
This will install all the required
packages for C and C++ compilers
Testing C and C++ Programs
Compiling Your first C Programs
Now you need to open first.c file
sudo gedit first.c
add the following lines save and exit
the file
Firstly compile the code using the
following command
cc -c first.c
that would produce an object file you
may need to add to the library.
then create an executable using the
following command
cc -o first first.c
Now run this executable using the
following command
./first
Output should show as follows
Hello, world
Compiling your first C++ program
If you want to run c++ program follow
this procedure
g++ is the compiler that you must use.
you should use a .cpp file extension
rather than a .c one
You need to create a file
sudo gedit first.cpp
add the following lines save and exit
the file
Run your C++ Program using the
following command
g++ first.cpp -o test
./test
Output should show as follows
Hello World!
OR
1. Install the 'build-essential'
package.
$ sudo apt-get install build-essential
2. Write your first C program.
gedit myhello.c
paste this code into it, and save
#include <stdio.h>
main()
{
printf("Hello Ubuntu Lover!\n");
}
3. Compile your first C program
$ gcc myhello.c -o myhello
4. Run your first C program
$ ./myhello
Hello Ubuntu Lover!
5. Write your first C++ program
gedit myhello.cpp
paste this code into it, and save
#include <iostream>
using namespace std;
int main()
{
cout << "Hello Ubuntu Lover in C++" << endl;
return 0;
}
6. Compile your first C++ program
g++ myhello.cpp -o myhellocpp
7. Run your first C++ program
$ ./myhellocpp
Hello Ubuntu Lover in C++
$ sudo apt-get install build-essential
2. Write your first C program.
gedit myhello.c
paste this code into it, and save
#include <stdio.h>
main()
{
printf("Hello Ubuntu Lover!\n");
}
3. Compile your first C program
$ gcc myhello.c -o myhello
4. Run your first C program
$ ./myhello
Hello Ubuntu Lover!
5. Write your first C++ program
gedit myhello.cpp
paste this code into it, and save
#include <iostream>
using namespace std;
int main()
{
cout << "Hello Ubuntu Lover in C++" << endl;
return 0;
}
6. Compile your first C++ program
g++ myhello.cpp -o myhellocpp
7. Run your first C++ program
$ ./myhellocpp
Hello Ubuntu Lover in C++
Source of information:
- How to write and run c/c++ programs on ubuntu
- How to Install C and C++ Compilers in Ubuntu and testing your first C and C++ Program
Monday, November 5, 2012
Quality Policy: Definition & Examples
Juran defines Quality Policy as "Overall intentions and direction of an organization with regard to quality, as formally expressed by top management."
Words to notice in this definition are intention and direction.
Below are few examples of Quality Policies:
Kinetic India:
" We shall strive to deliver products to meet and exceed Customer expectations of Quality, Delivery and cost "
This policy shall be deployed through
Continual improvement in product quality by process control & variability reduction.
Up gradation of manufacturing technology and skills
Cost reduction through elimination of waste in all Business processes.
Development of Human Resources
Development and participation of our suppliers
Tata Motors
Tata Motors is committed to maximizing customer satisfaction and strives to achieve the goal of excellence through ongoing development; manufacture and sale of reliable, safe, cost effective, quality products and services of international standards, by using environmentally sustainable technologies for improving levels of efficiency and productivity within its plants and ancillaries.
Tata Motors also has a commitment towards improving the quality of life of its employees, both within and outside its plants and offices, through improved work practices and social welfare schemes.
Toshiba Electron Tubes and Devices
1. We shall conduct quality-related activities in order to provide customers with the best possible products.
2. We shall observe all relevant laws, regulations, and contracts, and make efforts to continuously improve quality. By ensuring the quality and safety of our products, we will meet our customers' requirements and increase customer satisfaction.
3. We shall establish a quality management system and work to continuously improve the system.
4. We shall do our best to provide products of consistent quality. We shall investigate and identify the root cause of any inconsistencies based on data,and make all required improvements in order to ensure consistent quality.
Dabur Research Foundation
We are committed to quality compliances in all our deliverables.
-Consistent and Continuous Quality Management.
-The Management is fully committed to Quality and ensures all resources to accomplish this task.
-We value our 4C's- Compliance, Credibility, Consistency and Confidentiality.
-At DRF, Quality is a relentless commitment to continuous improvements in processes and systems, to provide consistent quality services to meet our customer requirements.
L&T Electricals Saudi Arabia Co. Ltd
It is our policy to:
-Deliver Electrical products and services meeting or exceeding customer requirement and expectation while improving value to stakeholder.
-Comply with statutory and regulatory requirements related to product, services, health & safety.
-Achieve operational efficiency by attaining productivity and profitability.
-Encourage development and involvement of employee at all level.
-LTESA management is fully committed to implement Quality Management System and continually improve its effectiveness in the organization.
Words to notice in this definition are intention and direction.
Below are few examples of Quality Policies:
Kinetic India:
" We shall strive to deliver products to meet and exceed Customer expectations of Quality, Delivery and cost "
This policy shall be deployed through
Continual improvement in product quality by process control & variability reduction.
Up gradation of manufacturing technology and skills
Cost reduction through elimination of waste in all Business processes.
Development of Human Resources
Development and participation of our suppliers
Tata Motors
Tata Motors is committed to maximizing customer satisfaction and strives to achieve the goal of excellence through ongoing development; manufacture and sale of reliable, safe, cost effective, quality products and services of international standards, by using environmentally sustainable technologies for improving levels of efficiency and productivity within its plants and ancillaries.
Tata Motors also has a commitment towards improving the quality of life of its employees, both within and outside its plants and offices, through improved work practices and social welfare schemes.
Toshiba Electron Tubes and Devices
1. We shall conduct quality-related activities in order to provide customers with the best possible products.
2. We shall observe all relevant laws, regulations, and contracts, and make efforts to continuously improve quality. By ensuring the quality and safety of our products, we will meet our customers' requirements and increase customer satisfaction.
3. We shall establish a quality management system and work to continuously improve the system.
4. We shall do our best to provide products of consistent quality. We shall investigate and identify the root cause of any inconsistencies based on data,and make all required improvements in order to ensure consistent quality.
Dabur Research Foundation
We are committed to quality compliances in all our deliverables.
-Consistent and Continuous Quality Management.
-The Management is fully committed to Quality and ensures all resources to accomplish this task.
-We value our 4C's- Compliance, Credibility, Consistency and Confidentiality.
-At DRF, Quality is a relentless commitment to continuous improvements in processes and systems, to provide consistent quality services to meet our customer requirements.
L&T Electricals Saudi Arabia Co. Ltd
It is our policy to:
-Deliver Electrical products and services meeting or exceeding customer requirement and expectation while improving value to stakeholder.
-Comply with statutory and regulatory requirements related to product, services, health & safety.
-Achieve operational efficiency by attaining productivity and profitability.
-Encourage development and involvement of employee at all level.
-LTESA management is fully committed to implement Quality Management System and continually improve its effectiveness in the organization.
Subscribe to:
Posts (Atom)