"Abraham Lincoln vs. John F Kennedy
Abraham Lincoln was elected to Congress in 1846.
John F Kennedy was elected to Congress in 1946.
Abraham Lincoln was elected President in 1860.
John F. Kennedy was elected President in 1960.
The names Lincoln and Kennedy each contain seven letters.
Both were particularly concerned with civil rights.
Both wives lost a child while living in the White House.
Both Presidents were shot on a Friday.
Both Presidents were shot in the head.
Lincoln's secretary was named Kennedy.
Kennedy's secretary was named Lincoln.
Both were assassinated by Southerners.
Both were succeeded by Southerners named Johnson.
Andrew Johnson, who succeeded Lincoln, was born in 1808.
Lyndon Johnson, who succeeded Kennedy, was born in 1908.
John Wilkes Booth, who assassinated Lincoln, was born in 1839.
Lee Harvey Oswald, who assassinated Kennedy, was born in 1939.
Both assassins were known by their three names.
Both names are composed of fifteen letters."
Aware Center, Bhagawatipuram, Maheswaram Cross Roads, R R District, 501359, Telangana.
welcome
welcome to our college social blog
we have lot of information about our college fest and events etc
all of our college members join in this site .
to add to this blog
click on follow then select google
after that log in with your gmail id
thank you
KARTHIK REDDY.
Friday, January 28, 2011
TOP 100 funniest one-liners, quotes and jokes on the internet! Part 5
"I got in a fight one time with a really big guy, and he said, 'I'm going to mop the floor with your face.' I said, 'You'll be sorry.' He said, 'Oh, yeah? Why?' I said, 'Well, you won't be able to get into the corners very well.'"
TOP 100 funniest one-liners, quotes and jokes on the internet! Part 1
"Children: You spend the first 2 years of their life teaching them to walk and talk. Then you spend the next 16 years telling them to sit down and shut-up."
TOP 100 funniest one-liners, quotes and jokes on the internet! Part 1
"I asked God for a bike, but I know God doesn't work that way. So I stole a bike and asked for forgiveness"
c lesson1
Lesson One.
Some Historical Background.
The 'C' programming language was designed and developed by Brian Kernighan, and
Dennis Ritchie at The Bell Research Labs. 'C' is a Language specifically
created
in order to allow the programmer access to almost all of the machine's
internals
- registers, I/O slots and absolute addresses. However, at the same time,
'C' allows for as much data hiding and programme text modularisation as is
needed to allow very complex multi-programmer projects to be constructed in an
organised and timely fashion. During the early 1960s computer Operating Systems
started to become very much more complex with the introduction of
multi-terminal
and multi-process capabilities. Prior to this time Operating Systems had been
carefully and laboriously crafted using assembler codes, and many programming
teams realised that in order to have a working o/s in anything like a
reasonable time this was now longer economically feasible. This then was the
motivation to produce the 'C' Language, which was first implemented in
assembler on a Digital Equipment Corporation PDP-7. Of course once a simple
assembler version was working it was possible to rewrite the compiler in 'C'
itself. This was done in short order and therefore as soon as the PDP-11 was
introduced by DEC it was only necessary to change the code generator section
of the compiler and the new machine had a compiler in just a few weeks. 'C' was
then used to implement the UNIX o/s. This means, that a complete UNIX can be
transported, or to use the simple jargon of today; 'ported to a new machine in
literally just a few months by a small team of competent programmers.
Enough of the past. Lets see the various actions, or compilation phases through
which the `C' compilation system has to go in order that your file of `C'
program text can be converted working program.
Assuming that you are able to work an editor and can enter a script and create
a file. Please enter the following tiny program.
#ident "@(#) Hello World - my first program"
#include <stdio.h>
char *format = "%s",
*hello = "Hello World...\n";
main()
{
printf ( format, hello );
}
Now save it in a file called hello.c. Lower case is allowed - encouraged, no
less - under the UNIX operating system.
Now type:
cc -o hello hello.c
The computer will apparently pause for a few moments and then the
Shell, or Command Line Interpreter prompt will re-appear.
Now type:
hello
Lo and behold the computer will print
Hello World...
Let's just look at what the computer did during the little pause.
The first action is to activate a preliminary process called the pre-processor.
In the case of hello.c all it does is to replace the line
#include <stdio.h>
with the file stdio.h from the include files library. The file stdio.h provides
us with a convenient way of telling the compiler that all the i/o functions
exist. There are a few other little things in stdio.h but they need not
concern us at this stage.
In order to see what the pre-processor actually outputs, you might like to
issue the command:
cc -P hello.c
The 'cc' command will activate the 'C' compilation system and the -P option
will stop the compilation process after the pre-processing stage, and another
file will have appeared in your directory. Have a look, find hello.i and use
the editor in view mode to have a look at it. So issue the command:
view hello.i
You will see that a number of lines of text have been added at the front of the
hello.c program. What's all this stuff? Well, have a look in the file called
/usr/include/stdio.h again using the view command.
view /usr/include/stdio.h
Look familiar?
Now the next stage of getting from your program text to an executing program is
the compilation of your text into an assembler code program. After all that is
what a compiler is for - to turn a high level language script into a program.
Lets see what happens by issuing the command
cc -S hello.c
Once again there is another file in your directory - this time with a .s
suffix.
Lets have a look at it in the same way as the .i file
view hello.s
You will doubtless notice a few recognizable symbols and what appears to be a
pile of gibberish. The gibberish is in fact the nmemonics for the machine
instructions which are going to make the computer do what you have programmed
it to do.
Now this assembler code has to be turned into machine instructions.
To do this issue the command.
cc -g -c hello.s
Now, yet again there is another file in your directory - this time the suffix
is ".o". This file is called the object file. It contains the machine
instructions corresponding exactly to the nmemonic codes in the .s file.
If you wish you can look at these machine codes using one of the commands
available to examine object files.
dis -L -t .data hello.o >hello.dis
The output from these commands won't be very meaningful to you at this stage,
the purpose of asking you to use them is merely to register in your mind the
fact that an object file is created as a result of the assembly process.
The next stage in the compilation process is called by a variety of names -
"loading", "linking", "link editing". What happens is that the machine
instructions in the object file ( .o ) are joined to many more instructions
selected from an enormous collection of functions in a library. This phase of
the compilation process is invoked by the command:-
cc -o hello hello.o
Now, at last, you have a program to execute! So make it do it's thing by
putting the name of the executable file as a response to the Shell or Command
Line Interpreter prompt.
hello
Presto, the output from your program appears on the screen.
Hello World...
You are now allowed to rejoice and have a nice warm fuzzy to hold!
You have successfully entered a `C' program, compiled it, linked it, and
finally, executed it!
Having gone through all the various stages of editing, pre-processing,
compiling, assembling, linking, and finally executing, by hand as it were, you
can now rest assured that all the stages are automated by the 'cc' command, and
you can forget how to invoke them! Just remember that the computer has to do
them in order for you to have a program to execute.
The single command you use to activate the C Compiler is:
cc -o hello hello.c
The word after the -o option is the name of the executable file, if you don't
provide a name here the compiler dreams up the name "a.out". The source file
MUST have the .c extension otherwise the compiler complains and stops working.
Notes:
The command names used in the above text are those of standard UNIX,
Your particular system may well use a different name for the 'C' compiler.
bcc - for Borland 'C'.
gcc - GNU 'C', which is standard on the Linux operating system.
lc - Lattice 'C', available on IBM and clone P.C.s as well as the Amiga.
Check in the Documentation which came with your compiler.
The same notions apply to the text editor.
Differences between 'C' and other languages.
In the years since 'C' was developed it has changed remarkable little.
This fact is a bouquet to the authors, who had the vision and understanding to
create a language which has endured so well. The strengths and weaknesses
should be pointed out here.
The big plus is that it is possible to do everything ( well at least 99.9% ) in
'C' while other languages compel you to write a procedure, subroutine or
function in assembler code.
'C' has very good facilities for creating tables of constant data within the
source file.
'C' doesn't do very much to protect you from yourself. This means that the
resulting code executes faster than most other high level languages, but a much
greater degree of both care and understanding is demanded from the programmer.
'C' is not a closely typed language, although the newer compilers are offering
type checking as part of the language itself as opposed to having to use a
separate program for mechanised debugging.
'C' is a small language with very few intrinsic operations.
All the heavy work is done by explicit library function calls.
'C' allows you to directly and conveniently access most of the internals of
the machine ( the memory, input output slots, and CPU registers ) from the
language without having to resort to assembler code.
'C' compilers have an optimisation phase which can be invoked if desired.
The output code can be optimised for either speed or memory usage. The code
will be just as good as that produced by an assembly code programmer of normal
skill - real guru programmers can do only slightly better.
Copyright notice:-
(c) 1993 Christopher Sawtell.
I assert the right to be known as the author, and owner of the
intellectual property rights of all the files in this material,
except for the quoted examples which have their individual
copyright notices. Permission is granted for onward copying,
but not modification, of this course and its use for personal
study only, provided all the copyright notices are left in the
text and are printed in full on any subsequent paper reproduction.
--
+----------------------------------------------------------------------+
| NAME Christopher Sawtell |
| SMAIL 215 Ollivier's Road, Linwood, Christchurch, 8001. New Zealand.|
| EMAIL chris@gerty.equinox.gen.nz |
| PHONE +64-3-389-3200 ( gmt +13 - your discretion is requested ) |
+----------------------------------------------------------------------+
c lesson1
This archive contains a complete course for you to learn the 'C' computer
language itself.
The language used is correct conversational English, I have written the
lessons using the same language constructions which I would use if I were
teaching you directly.
An outline of the course is available for you to read below
The course is intended to demonstrate the language
itself and a selection of the simpler standard library functions.
I have assumed that you have had sufficient exposure to computing
to be able to use a programmer's editor of your choice and are
confident in the use of the command line interpreter, whether it
be a unix shell, or a DOS ( shudder :-) prompt. Some knowledge,
of computers and the jargon is assumed, but complicated concepts are
fully explained. In other words the intent is to teach 'C' per se,
not 'the fundamentals of how to program a computer using 'C' as
a teaching medium.'
'C' is not a computer language for rank beginners. Start with
an interpretive language and proceed to a compiled language
which has an extensive error message vocabulary and run-time
checking facilities. In the interests of speed of execution 'C'
does very little to protect you from yourself!
Throughout the course the fact that a compiler is a translater
from a high level language to assembler code is kept to the fore,
you are frequently advised to examine the assembler code which is
output by the compiler. Some minimal knowledge of computer architecture
is therefore assumed.
Whilst I have taken considerable care to ensure that this material is
free of errors I am well aware that to err is a common human failing,
and in this I don't claim to be different from anybody else.
Therefore your gentle critique is welcome together with notification
of any factual errors.
It is planned to make the lessons available as a printed book,
complete with a programme diskette if there is sufficient interest.
Syllabus for the 'C' Language Course.
1 a) Historical introduction to the Language.
b) Demonstration of a very simple program.
c) Brief explanation of how the computer turns
your program text into an executing program.
d) The basic differences between 'C' and other languages.
The advantages and disadvantages.
We make the assumption that you are able to turn on your machine,
use the Operating System at the Control Line Interpreter prompt
"$ ", "c:>" or whatever, and to use an editor to enter program text.
2 a) How the 'C' language arranges for the storage of data.
An explanation of the keywords associated with data.
The storage classes:- static auto volatile const.
The variable types:- char int long float double
The meaning of:- signed unsigned
b) Introduction to the concept of pointers.
c) Explanation of reading from the keyboard and writing to the screen.
i.e. printf and scanf, the print formatted and scan formatted
functions.
d) The use of arguments to the main() function, argc argv env.
e) A simple program to format text.
3 Structures, arrays and pointers.
a) Explanation of more coplex data structures.
b) Programs which demonstrate uses of pointers.
4 The operators of the language, arithmetic, pointer, logical, bitwise.
a) Precedence.
b) The unique bit and shifting operators.
( for a high level language )
5 a) The Preprocesser.
b) Header files
What they are and what you put in them, both your own and
those provided by the 'C' compiler vendor.
A simple title which includes all sorts of things,
both very useful and a number of traps.
6 The library, why we have them and some of the more useful routines.
a) How to read the book.
b) The string functions as an example.
7 a) Mistakes and how avoid making them.
b) Debugging strategies.
c) The assert macro.
8 a) More on the representation of data vis. struct, typdef.
b) Tables of all sorts.
Arrays of structures.
Pre-initialisation of data structures.
( Including jump or dispatch tables )
The bit-field.
c) Use of header files in this.
9 a) The control structures of the language, what (not) to use and when.
10 a) File IO
This is an enormous subject and we we will
really only just scratch on the surface.
11 a) Lint, and more on errors / bugs and how to avoid them.
12 The stack and a quick dip into assembler
a) A study of the function calling mechanism used by most 'C'
compilers and the effect on compiler output code of using
the register storage class and the optimiser.
13 The heap.
a) The 'heap', it's management, malloc(), calloc() and free().
14 Portability Issues.
a) Defaults for storage sizes.
b) 'endianism'. Yes, there are big-endian and little-endian computers!
c) Functions which can be called with a variable number of arguments.
15 Sample programs.
Much is to be gained from examining public domain packages
examining the code and reviewing the author's style.
We will look at a number of functions and complete packages.
in particular we will examine a number of sorting functions,
a multi-threading technique, queues, lists, hashing, and trees.
/* ----------------------------------------- */
Copyright notice:-
(c) 1993 Christopher Sawtell.
I assert the right to be known as the author, and owner of the
intellectual property rights of all the files in this material,
except for the quoted examples which have their individual
copyright notices. Permission is granted for onward copying,
but not modification, of this course and its use for personal
study only, provided all the copyright notices are left in the
text and are printed in full on any subsequent paper reproduction.
--
+----------------------------------------------------------------------+
| NAME Christopher Sawtell |
| SMAIL 215 Ollivier's Road, Linwood, Christchurch, 8001. New Zealand.|
| EMAIL chris@gerty.equinox.gen.nz |
| PHONE +64-3-389-3200 ( gmt +13 - your discretion is requested ) |
+----------------------------------------------------------------------+
Subscribe to:
Posts (Atom)