Sunday 20 December 2015

GUI - GRAPHICAL USER INTERFACE

What is a window?

Window is a rectangular portion of the monitor's screen that display its contents like menu, icon, a text file or an image file apparently independent of the res of the display screen .

What is a GUI?

GUI - Graphical User Interface is an environment that can work with the graphical objects and allow the event based interactions with the program
There are 3 GUI elements :
  1. The Explorer - manages the GUI 
  2. The Task bar - grey bar on the bottom of the window with the icons of active programs, clock, calendar and other utilities. 
  3. The Start Menu - A once button approach for accessing programs, help and system settings 

The components of GUI

  1. Icons : for representing applications/ programs 
  2. Menu : including placement and names of the options and styles 
  3. Tiled window : to view multiple windows of programs or data or multiple view of a single program or data block simultaneously 
  4. Dialog box : to select an option/ file/ setting. When an option is selected, previous selection will be turned off 
  5. Check box : for selection of multiple options as in specifying program or file attributes 
  6. Scroll bar : along the edges to show the relative position of the contents such as the beginning or the end of he text or to move to a different position such as another part of a spreadsheet 
  7. Support for pointing device typically, a mouse to select and drag screen elements 

Features of GUI

  1. It makes the computer operations easier to learn and use. 
  2. It allows multi tasking by allowing multiple programs to be displayed simultaneously, resulting in a large increase in flexibility. 
  3. Multiple windows can be opened simultaneously 
  4. An icon- small picture or symbol, represents applications, program, file, device and drive on the desktop and within application programs 
  5. Commands are issued in GUI using a mouse or touch pad or track ball to move the pointer on the screen for selecting objects 

Thursday 17 December 2015

HISTORY OF UNIX

  • UNIX OS development was started in the year 1969 at the AT & T Bell Laboratory.
  • Some of the team members were were withdrawn from the MULTICS Project  and started working on the UNIX OS.
  • Thompson and Dennis Richie designed and developed a simple multi tasking OS supporting two users.
  • It had an elegant file system, command interpreter and a set of utilities.
  • One of the members named Brian suggested the name UNICS in the year 1970s.

BSD UNIX


  • Berkley has worked on the UNIX OS that was developed by the AT & T Laboratory and created his own UNIX OS named, BSD UNIX.
  • A student called Bill Joy defined a standard editor of the UNIX system, called as VI Editor that used C Shell.
  • It has:
  1. better file management
  2. more versatile main features
  3. better method for linking files


HISTORY OF WINDOWS PROGRAMMING

Nov 1983 : 

Microsoft announced MICROSOFT WINDOWS , an extension of MS DOS Operating System that would provide a graphical operating environment for PC users

Nov 1985 : 

Windows 1.0 was released.It has easy to use graphical user interface, device independent graphics and multi tasking supportIt includes, MS DOS executive,  Clock, Calendar, Notepad, Terminal, Calculator, Control Panel, Program Information File (PIF), Editor, Print Spooler, Clip board, RAM drive, Windows Write, Windows PaintMicrosoft called it as a new software environment for developing and running applications that use bitmap displays and mouse pointing devices.With this, the GUI era begun

July 1993 : 

Windows NT ( formerly, Windows New Technology) as releasedIt was a new milestone of the companyWindows NT was the 1st Microsoft Operating System to combine support for high end client/server business applications with the industry's leading personal productivity applications

1995 : 

Windows 95 was released

1998 : 

Windows 98 was releasd

Feb 2000: 

Windows 2000 professional, upgraded from Windows NT 4.0, was releasedIt made hardware installations easier than the NT4.0 by adding support for a wide variety of plug and play hardware, incuding advanced network and wireless products, USB devices, etc.

Aug 2001 : 

WindowsXP was released.

Wednesday 16 December 2015

INTRODUCTION TO UNIX


  • UNIX is an operating system that was first developed in 1960s.
  • It is a suitable multi user, multi tasking operating system for servers, desktops and laptops.
  • It also has a GUI similar to the Microsoft Windows.
  • There are mainly 3 versions of UNIX:
  • Sun Solaris
  • GNU/LINUX
  • Mac OS X


PROGRAMMING PARADIGMS

What is Structured Programming?

Structured programming is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify structure

What are the features of Structured Programming?


    1. Emphasis on doing things (algorithm)
    2. Large programs are divided into smaller programs known as functions
    3. Most of the functions share the global data
    4. Functions transform data from one form to another
    5. Employs top-down approach

List down some program paradigms.


    1. Procedural programming – COBOL, FORTRAN, Pascal, C
    2. Functional Programming – LISP
    3. Logic Programming – PROLOG
    4. Structured Programming
    5. Object Oriented Programming
    6. 4th Generation Programming – Dbase
    7. Visual / Event Driven Programming – Visual Basic

Define Event Driven Programming.

Event Driven Programming is a programming paradigm or system architecture that decomposes a program into a set of event handlers.The primary source of events is hardware I/O

What is an event?

An event can be anything such as , button click or mouse click on a window

Explain how an Event Driven Programming works, with a simple example.


  • Event Driven Programming is a programming paradigm or system architecture that decomposes a program into a set of event handlers.
  • An event can be anything such as : mouse click or button click on  window.
  • The primary source of events is hardware I/O.
  • Each window is sent messages via function calls that tell it what has happened based on the events, which are then processed accordingly.
  • If a button is clicked, the parent window is sent a message via a function call to tell what has happened
  • Each window has a window procedure that handles all of the messages sent to it.

Differentiate Procedural and Event Driven Programming.

Procedural Programming Code : We write the set of instructions, and they are executed in the sequence specified or decided by the logic
Event Driven Programming Code : It waits for certain events to occur and then react accordingly
e.g:
Calculation of a math problem :
Procedural Programming
Because, the algorithm to solve the math problem can be programmed sequentially.
Web Browser / GUI : 
Event driven programming
Because, events are good to handle a lot of things at once, or stuff we might not expect to happen or expect to happen, just not sure when.

Explain Windows Programming Paradigms.

  • A Paradigm is essentially a high level model of what computation is about.
  • Following are some programming paradigms :
    • Procedural :
      • It focus on grouping organizations and/or code by similar operations or by operations that can be done on them.
        • e.g : COBOL, FORTRAN, Pascal, C
    • Functional :
      • Program contains entirely functions.
      • Program itself is written as function which receives inputs as arguments and output as result.
      • There is no assignment statements, thus, a variable value once assigned will never change
      • It acts as an abstract for solution to polymorphism.
      • Function can create or manipulate other functions.
        • e.g : LISP
    • Logical :
      • Basic constructs of logical programming : term and statements are inherited from logic
      • There are 3 types of statements in logical programming : facts, rules and queries
      • Logical relationship between various entities are declared
      • Programmer writes the database of term and rules.
      • User supplies the queries
      • System tries to prove it. If it matches a fact, then succeeds.
      • Logical Programming Languages, tend to be declarative languages.
      • They concentrate more on the relationship between the parts of the problem, rather than the sequence to solve the problem
        • e.g : SQL, PROLOG
    • Structured
      • Structured Programming is a subset of procedural programming paradigm that enforces a logical structure on the program being written to make it more efficient and easy to understand and modify structure
      • There are 3 types of structures that can be used in a program : Sequence, Decision and Loop
    • Object Oriented
      • Here, Data type and Function type of data structures are defined.
      • Data structure become the object with data and function.
      • Relationship between objects can be created. E.g : Inheritance.
    • 4th Generation Languages (4GL) :
      • 1GL - Machine Language - String of 1, 0
      • 2GL - Assembly Language
      • 3GL - 
        • High Level Languages like C, C++, etc.
        • These programs are compiled into machine language using Java Virtual Machine as a part of the OS
      • 4GL 
        • These are closer to the natural languages than 3GL
        • Most of the languages used to retrieve database are 4GL
          • e.g : SQL
    • Visual / Event Driven : Visual Programming
      •  It is programming paradigm or system architecture that decomposes a program into a set of event handlers.
      • Events can be anything such as , button click or mouse click on window
      • The primary source of events is hardware IO
      • Each window is sent messages via function calls, telling it what has happened, based on the events, which are then processed accordingly.
      • Each window has a window procedure that handles all of the messages sent to it.
        • e.g : Visual Basic

Saturday 28 November 2015

TUTORIAL 2

USING TAGS

Include the following in the page

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.         WELCOME TO MY PAGE
  5. </body>
  6. </html>

<!DOCTYPE html>
  • specifies the type of webpage is html
  • it instructs the web browser which version of html is being used, html indicates HTML5
  • if document type declaration is not specified, browser may behave in a peculiar way
<html> the opening tag, denotes the beginning of the html document

</htmlthe closing tag, denotes the end of html document
  • whatever is written between will be considered as html document
<bodydenotes the beginig of the body of the html page

</bodydenotes the end of the body
  • So whatever you have typed now within the <body> and </body>, is the body 
  • WELCOME TO MY PAGE is the body here, and displayed in the browser window

  • </html </body> - closes the respective elements
  • All the tag do not have the closing tags. there are certain tags which do not have the closing tags
  • Tags which do hold any contents will close themselves. So they do not need a separate closing tag
eg<br> - denotes the line break

it doesnt wrap any content
this might also be written like <br/> 
it is a self closing tag. that mean, closing by itself.
generally used in xhtml coding
xhtml is another version of html based on another markup lanuage xml

  • Any tag which has content must be closed
  • Syntax : opening tag -> content -> closing tag
  • This makes the code easier to understand


TUTORIAL 1

WHAT IS HTML?

HTML - Hyper Text Markup Language
It is the standard markup language used to create web pages.
A markup language is a set of markup tags
HTML documents are described by HTML tags
Each HTML tag describes different document content
It is used by most websites to create visually engaging webpages, user interfaces for web applications, and user interfaces for many mobile applications
HTML markup consists of several key components, including those called tags (and their attributes), character-based data types, character references and entity references. 
We are here to learn HTML. 

              WHAT WE NEED TO START WITH HTML?

              Notepad is a common text editor on Windows-based computers (usually found under the Programs > Accessories menu) 
              Mac OSX computers come bundled with TextEdit 
              But any program that lets you fiddle with text will do. 

              LETS BEGIN !

              Type this in to your text editor: 
              My First HTML Page Welcome here 
              Now create a folder called “html” wherever you like to save files on your computer and save the file as “myfirstpage.html”. 
              It is important that the extension “.html” is specified
              Some text editors, such as Notepad, will automatically save it as “.txt” otherwise. 
              You also need to ensure that your file is being saved as plain text. 
              Make sure you check the “Plain text” format option before creating a new file. 
              Open a web browser and type in the location of the file, you just saved (e.g : “C:\html\myfirstpage.html”), in the address bar and hit return. 
              Alternatively, go to the File menu of the browser, select Open, and browse for the file. 
              Here we have created a very simple webpage of our own. Its that easy....

              You may be tempted to use a dedicated software program such as Adobe Dreamweaver. 

              You should be very careful when using these programs, especially if you are a beginner

              Software programs such as these will never give you the same control over a web page as coding by hand. 

              If you do decide to use specialized code-editing software, we recommend one in which you are still coding by hand. 

              Saturday 14 November 2015

              CONSTANTS

              Constants in C refer to the fixed values that do not change during the execution of a program
              There are basically 2 types of constants in C :
              1. Primary Constants
              2. Secondary Constants

              In this lesson, we will learn only about the primary constants: Numeric and Character Constants


              NUMERIC CONSTANTS


              There are two types of Numeric Constants 
              1. Integer Constants
              2. Real Constants

              INTEGER CONSTANTS

              An integer constant refers to a sequence of digits.There are 3 types of integers
              1. Decimal : Consists of a set of digits 0 to 9
              2. Octal : Consists of any combination of digits from 0 to 7 with a leading 0
              3. Hexadecimal :
              They may include alphabets A/a to F/f
              These alphabets represent the numbers 10 to 15 respectively
              Consists of the digits preceded by 0x or 0X
              Other rules for construction Integer Constants :
              1. It must not have a decimal point
              2. It could be either positive or negative
              3. If no sign precedes, it is assumed to be positive
              4. Embedded spaces/ blanks, commas and non-numeric characters are not permitted
              5. The allowable range for integer constants is -32768 to 32767 for 16 bit machines and -2 147 483 648 to 2 147 483 647 in 32 bit machines
              6. It is also possible to store large integer constants on these machines by appending qualifiers such as U/u, L/l and UL/ul to the constants

              REAL CONSTANTS

              A real constant is often called a Floating Point Constant.
              It could be written in two forms :
              1. Fractional Form
              2. Exponential Form
              Rules for constructing Real Constants for Fractional Form
              1. It must have at-least one digit (0-9)
              2. It must have a decimal point
              3. It could be either positive or negative, by default it is positive
              4. Embedded spaces, commas are not allowed with in a real constant
              Rules for constructing Real Constants for Exponential Form
              1. This form is usually used if he value of the constant is either too small or too large
              2. Here the real constant is represented in 2 parts
              3. Mantissa - the part before 'e'
              4. Exponent - the part following 'e'
              The general syntax : 
              mantissa e exponent
              1. Mantissa part and the exponential part should be separated by letter 'e'
              2. Mantissa part could be either positive or negative, by default it is positive
              3. Exponent must have at-least one digit which must be a positive or negative integer, by default it is positive
              4. Blank is not allowed
              5. Range of real constants expressed in Exponential Form is -3.4e38 to 3.4e38

              CHARACTER CONSTANTS


              There are 2 kinds of Character constants :
              1. Single Character Constants :
                • contains a single character enclosed within a pair of single quote marks 
                e.g: 
                '5'  'X'  ';'  ' '
                here '5' is character and different from number 5
              2. String Constants :
                • It is a sequence of characters enclosed in double quotes
                • The characters may be letters, numbers, special characters and blank spaces 
                e.g: 
                "Hello" "1987" "&...!" "X"
                here "X" is a string , different from character 'X'

              IDENTIFIERS

              In C, the names of variables, arrays, functions, labels and various user defined items are called identifiers.
              The variables, arrays, functions, etc. can be identified by giving them meaningful names.
              These names are called identifiers


              RULES FOR IDENTIFIERS


              1. The first character of an identifier must be an alphabet or an underscore
              2. Identifiers must consist of only alphabets, digits or underscore
              3. Special symbos are not allowed
              4. Keywords should not be used as the identifiers
              5. Identifier should be a single word, i.e., No blank space is allowed
              6. Identifiers can be both uppercase and lowercase. C is case sensitive, i.e., uppercase letters are different from lowercase letters
              e.g : ADD , AdD, add are different identifiers
               
              Valid Identifiers
              Invalid Identifiers
              ADD
              3add
              Numerics not allowed in the beginning
              Add
              add+123
              + is not allowed
              _add
              for
              it is a keyword
              Student_Name
              ABC XYZ
              Blank not allowed
              Name
              Student%123
              % Is not allowed
              A312B
              _Add*5Add
              * is not allowed
               
               

              Friday 13 November 2015

              KEYWORDS

              • The keywords are reserved for specific meanings in C language
              • C has nearly 32 keyword
              • Keywords, combined with the formal C syntax, forms the C programming language
              • The variables should not be named with any of the keywords as the meanings cannot be changed
              • All the keywords are lower case letters
              • Keywords are also called as reserved words
              • All the keywords have pre-defined meanings
              autodoubleintstruct
              breakelselongswitch
              caseenumregistertypedef
              charexternreturnunion
              constfloatshortunsigned
              continueforsignedvoid
              defaultgotosizeofvolatile
              doifstaticwhile
              • auto
                • auto is used to define a variable of storage class automatic. 
                • Variables declared within function bodies are automatic by default. 
                • They are recreated each time a function is executed. 
                • Since, automatic variables are local to a function, automatic variables are also called local variables.
              • break and continue
                • The break statement is used to jump out of the innermost enclosing loop (while, do, for or switch statements) explicitly and pass control to next statement immediately following the loop. 
                • In other hand, continue statement is used to skip certain statements inside the loop.
              • switch, case and default 
                • The switch statement tests the value of a expression and test with the different "case" values. 
                • We can use "default" value, if it doesn't matches any of "case" values. 
              • char
                • The char keyword is used for indicating the variable is of the type character. 
              • const 
                • const makes the value of a pointer or a variable unmodifiable. 
                • This value cannot be changed in program.
              • do and while 
                • while and do are used for looping in C. 
              • double and float
                • double and float are used for indicating floating type variables. 
                • Keywords float and double represents single precision and double precision floating point data respectively. 
              • if and else 
                • if and else are used in decision making in C.
              • enum : 
                • enum is used to define enumerated type data type. 
                • Enumerated data type creates a set of constant of type int. 
              • extern
                • Keyword extern is used for indicating the variable is external 
                • It is declared outside every function and can be accessed by any function. 
              • for 
                • Keyword for is used for looping in C. 
              • goto 
                • Keyword goto is used for unconditional jump to a labeled statement inside that function. 
              • int 
                •  int is used for indicating the variable is of type integer.
              • short, long, signed and unsigned : 
                • short, long, signed and unsigned are type modifiers that alters the meaning of base data type to yield new type.
              • return 
                • Keyword return terminates the execution of current function and returns the value to the calling function
              • sizeof 
                • sizeof is used to find the number of bytes of an object.
              • register 
                • Variable of storage class register are much faster than normal variables
              • static 
                • static is used for indicating the variable is of storage class static. 
                • The value of the static variables persists until the end of the program. 
              • struct 
                • struct is used in creating a structure which provide means to group different types of variable under one name for easier handling.
              • typedef 
                • Keyword typedef is used to explicitly associate a type with an identifier.
              • union
                • Union is used in creating a union which provide means to group different types of variable under one name for easier handling.
              • void 
                • void is used to indicate that a function takes no arguments or returns no value.
              • volatile 
                • volatile is used to create a volatile object. 
                • A volatile object can be modified in unspecified way by the hardware.

              C TOKENS

              • One or more characters grouped together to form basic elements of C are known as C Tokens
              • The C Tokens include identifiers, constants, variables, keywords, operators, strings and some special symbols