T

.

Sunday, 16 September 2018

Design and Analysis of Algorithms-Course Outline

Course Description: The design and analysis of algorithms is the core subject matter of Computer
Science. Given a problem, we want to (a) nd an algorithm to solve the problem, (b) prove that the
algorithm solves the problem correctly, (c) prove that we cannot solve the problem any faster, and (d)
implement the algorithm. Designing an algorithm for a computational problem involves knowledge of the
problem domain, a thorough knowledge of the data structures that are available and suitable and no small
measure of creativity. This course concentrates on the above problems, studying useful algorithm design
techniques, and methods for analyzing algorithms.

Data Communication & Networks-Course Outline

GC University Lahore
Department of Computer Science

Course Title: Data Communication & Networks
Course Code: CS - 3106
Course Duration: One Semester (16 weeks of study)
Credit Hour:  03
Course Instructor:Mr. Yahya Khurram 

Course Description: To introduce students to the concept of computer communication. Analogue & digital transmission. Network Layers, Network models (OSI, TCP/IP) and Protocol Standards. Emphasis is given on the understanding of modern network concepts.
Pre-Requisite: None
Course Co-Requisite: Wireless & Mobile Communication

Course Goals & Objective
Goal No.1: Explain introduction to Data Communication, Internet Communication Model, OSI reference Model and TCP/IP protocol architecture.      
              
       Obj No.01:           Explain data communication and computer networks (LAN, WAN, MAN & Wireless LAN), also explain different LAN topologies.
Obj No.02:           Describe OSI reference Model in detail with each layer functionality and different protocols working at different layers.
Obj No.03:           Discuss Guided transmission media (Twisted Pair, Coaxial Cable, Optical Fiber)& Unguided transmission Media.
Obj No.04:          Explain TCP/IP protocol architecture in detail and comparison of TCP/IP with OSI Model.   
Obj No.05:           Discuss LAN protocol architecture and explain popular protocols in detail (TCP, UDP, HTTP, F|TP, SMTP etc.)
   

Goal No.2: Explain Digital Data Communication and Data Link control in detail

Obj No.01:           Explain the Synchronous and Asynchronous communication also discusses error detection and error correction in detail.
Obj No.02:           Describe flow control in data link control, Explain Stop and Wait flow control in detail.
Obj No.03:          Explain different techniques of error control in detail (Stop and Wait ARQ, Go back N ARQ, Selective Reject ARQ).        
Obj No.04:          Discuss the High Level Data Link (HDLC) protocol functionality. 
Obj No.05:          Discuss Analog transmission, Digital transmission and Transmission impairments
       
Goal No.3: Explain & describe the Multiplexing,  Spread Spectrum, Encoding Schemes and Transmission Media.

Obj No.01:          Describe the concept of Frequency Division Multiplexing and Time Division Multiplexing.
                   Obj No.02:          Explain Basic concept of Spread Spectrum, also explain Frequency Hopping spread spectrum and Direct Sequence Spread spectrum.
Obj No.03:           Explain guided transmission media. Discuss wireless transmission and wireless propagation.
                   Obj No.04:          Explain Line of sight propagation and mobile transmission in detail.
                   Obj No.04:          Explain Switched, IP Networks and Inter-networking
       Obj No.05:          Explain Encoding Schemes (Digital Data – Digital Signal, Analog Data – Digital Signal, Digital Data – Analog Signal, Analog Data – Analog Signal).

Goal No.4: Describe the Circuit Switching and Packet Switching. Explain the routing in Switched Networks.

Obj No.01:          Discuss Concept of Circuit switching.
                   Obj No.02:          Discuss Circuit switching networks and control signaling in circuit switching.
Obj No.03:           Explain Packet switching principles and two types of packet switching (Datagram & Virtual Circuits) . Discuss packet size in packet switching.
                   Obj No.04:          Discuss the comparison of circuit switching and packet switching and which is better in different scenarios.
Obj No.05:          Discuss the routing and circuit switching networks and packet switching networks in detail.
                       
Teaching & Learning Strategies

The course will be taught by a combination of lectures, presentations and directed reading material. Unannounced quizzes will be taken during the lectures. All lectures may comprise of a power point presentation, handouts and white board demonstrations. The students will be given the assignments related to the topic covered during the different lecture. Each student will be asked to select a research topic and give at least one assessed presentation to the class.

Lecture Duration will be of 90 Minutes.

Time Management Matrix

  • Goal No.1    18%:  3 Weeks
  • Goal No.2    25%:       4 Weeks
  • Goal No.3    25%:       4 Weeks
  • Goal No. 4   32%:       5 Weeks         

Assessment Strategy

  • Semester Work (Assignments +Quizzes) : 05% + 15 %
  • Mid Term : 20%
  • Final Term (Objective + Subjective): 10 + 50 = 60%

Evaluation is based on how well the student will perform in class, assignments and quizzes. Performance will be monitored throughout the semester. The examination will test the student’s understanding of the various concepts discussed during the course.
The written examination requires students to complete a theoretical paper covering all aspects of the course.

Friday, 13 July 2018

Microsoft Urges Congress to Regulate Use of Facial Recognition

Bradford L. Smith, the company’s president, compared the technology to products like medicines and cars that are highly regulated, and he urged Congress to study it and oversee its use.“We live in a nation of laws, and the government needs to play an important role in regulating facial recognition technology,” 

Mr. Smith wrote. He added: “A world with vigorous regulation of products that are useful but potentially troubling is better than a world devoid of legal standards.”


Now, Microsoft is moving to position itself as an industry leader by calling for government regulation of facial recognition, and for “the development of norms around acceptable uses,” of the technology. The company may also be trying to get out ahead of a budding movement in states like California to tightly regulate the technology.

Wednesday, 11 July 2018

GCU BSCS Entry Test 2018 Details

For more Details and Preparation Sources.Contact through
Email: saadaslam816@gmail.com
Facebook: saadaslam7355
WhatsApp: 0302-4609017
Or post  your comments below in the comments section




Friday, 6 April 2018

DSA Mid Term Syllabus


DSA Pre-Mid Topics
1.    All General Algorithms related to search and sort.
2.    Arrays. General arrays and traversal algorithms.
a.     Polynomial algorithms, general matrices.
b.    Dynamic arrays, dynamic declaration, dynamic growth and shrinking.
c.     Inorder insertion. Deletion, inorder deletion.
d.    2D array search, traversal. Complex 2D/3D loops for any purpose.
3.    Algorithm techniques:
         Brute Force vs Divide & Conquer.
4.    Time cost. Loop cost, nested loop, initialization and boundary checking cost. Exact cost verses order of complexity.
5.    Stack: 
          using Array and Linked list. Stack ordering, ToH problem, in-order insertion in stack using a temporary stack, stack search and delete using temporary stack, Sorting using stack.

DSA-Mids Solution-2018


Roll No:-BSCS-2017 Name:____________ Section:

Saturday, 31 March 2018

Coupling and Cohesion-OOP



Name:                       Saad Aslam
Roll No:                    0043-BSCS-16
Section:                    E2
Subject:                    Object Oriented Programming

Topics :
Ø Coupling
Ø Reduce Coupling
§  Calling Separate Methods
§  Encapsulation
§  Responsibilty driven design
§  Localizing Changes
Ø Implicit Coupling
Ø Cohesion
Ø Refactoring
§  Refactoring and testing
§  Refactoring for language independence





 
CH #6                            Coupling and Cohesion
REDUCE COUPLING
Ø  By calling separate methods:
If same code is used in different methods again and again than instead of writing  the same code in different methods ,we can implement a separate method and write that code which is similar in different methods and then call that code in that methods where the code was used.


Ø  Encapsulation:
To avoid tight coupling ,we need to use encapsulation by making all public fields to public .This will help us in decoupling the classes and hence decrease in tight coupling.
(“Never make fields public!”)
Proper
encapsulation in
classes reduces
coupling and thus
leads to a better

The encapsulation guideline (hiding implementation information from view) suggests that only information about what a class can do should be visible to the outside, not about how it does it.This has a great advantage: if no other class knows how our information is stored, then we can easily change how it is stored without breaking other classes.

Ø  Responsibility-driven design:
Responsibility-driven design expresses the idea that each class should be responsible for handling
its own data. Often, when we need to add some new functionality to an application, we
need to ask ourselves in which class we should add a method to implement this new function.
Which class should be responsible for the task? The answer is that the class that is responsible
for storing some data should also be responsible for manipulating it.

Ø  Localizing Changes:
Another aspect of the decoupling and responsibility principles is that of localizing change. We
aim to create a class design that makes later changes easy by localizing the effects of a change.
Ideally, only a single class needs to be changed to make a modification. Sometimes several
classes need change, but we then aim at this being as few classes as possible. In addition, the
changes needed in other classes should be obvious, easy to detect, and easy to carry out.
To a large extent, we can achieve this by following good design rules such as using
responsibility-driven design and aiming for loose coupling and high cohesion. In addition, however,
we should have modification and extension in mind when we create our applications. It is important
to anticipate that an aspect of our program might change, in order to make this change easy.

WORSE FORM OF COUPLING
Implicit Coupling:
          There is an even worse form of coupling: implicit coupling.
          Implicit coupling is a situation where one class depends on the internal information of another,but this dependence is not immediately obvious. The tight coupling in the case of the public fields was not good, but at least it was obvious. If we change the public fields in one class and forget about the other, the application will not compile any more and the compiler will point out the problem. In cases of implicit coupling, omitting a necessary change can go undetected.
          This is a fundamental problem, because every time a command is added, the help text needs to be changed, and it is very easy to forget to make this change. The program compiles and runs, and everything seems fine. A maintenance programmer may well believe that the job is finished and release a program that now contains a bug.
This is an example of implicit coupling.

THINKING AHEAD

Q:What is Model View Controller Pattern?

COHESION
A unit of code should always be responsible for one, and only one, task. The principle of cohesion can be applied to classes and methods: classes should display a high degree of cohesion, and so should methods.

Ø  Cohesion in Methods:
When we talk about cohesion of methods, we seek to express the ideal that any one method should be responsible for one, and only one, well-defined task.We can see an example of a cohesive method in the Game class. This class has a private method named printWelcome to show the opening text, and this method is called when the game starts in the play method.

Ø  Cohesion in Classes:
The rule of cohesion of classes states that each class should represent one single, well-defined entity in the problem domain.

BENEFITS OF COHESION

There are several ways in which high cohesion benefits a design. The two most important ones
are readability and reuse

REFACTORING

        Refactoring is the activity of restructuring existing classes and methods to adapt them to
changed functionality and requirements. Often in the lifetime of an application, functionality is
gradually added. One common effect is that, as a side-effect of this, methods and classes slowly
grow in length.
     Refactoring is the rethinking and redesigning of class and method structures. Most commonly,the effect is that classes are split in two or that methods are divided into two or more methods.
Refactoring can also include the joining of multiple classes or methods into one, but that is less
common than splitting.

Ø  Refactoring and testing:
Before we provide an example of refactoring, we need to reflect on the fact that, when we
refactor a program, we are usually proposing to make some potentially large changes to something
that already works. When something is changed, there is a likelihood that errors will be
introduced. Therefore, it is important to proceed cautiously; and, prior to refactoring, we should establish that a set of tests exists for the current version of the program. If tests do not exist, then we should first decide how we can reasonably test the functionality of the program and record those tests (for instance, by writing them down) so that we can repeat the same tests later.

Refactoring will follow the following two steps:

■  The first step is to refactor in order to improve the internal structure of the code, but without
making any changes to the functionality of the application. In other words, the program should,
when executed, behave exactly as it did before. Once this stage is completed, the previously
established tests should be repeated to ensure that we have not introduced unintended errors.

■  The second step is taken only once we have reestablished the baseline functionality in the refactored version. Then we are in a safe position to enhance the program. Once that has been
done, of course, testing will need to be conducted on the new version.

               Doing good refactoring is as much about thinking in a certain mindset as it is about technical skills. While we make changes and extensions to applications, we should regularly question whether an original class design still represents the best solution. As the functionality changes, arguments for or against certain designs change. What was a good design for a simple application might not be good any more when some extensions are added.

Recognizing these changes and actually making the refactoring modifications to the source
code usually saves a lot of time and effort in the end. The earlier we clean up our design, the
more work we usually save.

Ø  Refactoring for language independence:

          If we want to have language independence in the program, then ideally we should have just one place in the source code where the actual text of command words is stored and have everywhere else refer to commands in a language-independent way. A programming language feature that makes this possible is enumerated types, or enums.

           In its simplest form, an enumerated type definition consists of an outer wrapper that uses the word enum rather than class and a body that is simply a list of variable names denoting the
set of values that belong to this type. By convention, these variable names are fully capitalized.
We never create objects of an enumerated type. In effect, each name within the type definition
represents a unique instance of the type that has already been created for us to use. We refer to these instances as CommandWord.GO, CommandWord.QUIT, etc. Although the syntax for using them is similar, it is important to avoid thinking of these values as being like the numeric class constants Despite the simplicity of their definition, enumerated type values are proper objects and are not the same as integers.

SUMMARY

Ø  Good class design can make a huge difference when an application needs to be corrected, modified,or extended. It also allows us to reuse parts of the application in other contexts (for example, for other projects) and thus creates benefits later.
Ø  There are two key concepts under which class design can be evaluated: coupling and cohesion.
Ø  Coupling refers to the interconnectedness of classes, cohesion to modularization into appropriate units. Good design exhibits loose coupling and high cohesion.
Ø  One way to achieve a good structure is to follow a process of responsibility-driven design. Whenever we add a function to the application, we try to identify which class should be responsible for which part of the task.
Ø  When extending a program, we use regular refactoring to adapt the design to changing requirement and to ensure that classes and methods remain cohesive and loosely coupled.


CONCEPT SUMMARY

■  Coupling The term coupling describes the interconnectedness of classes. We strive for loose
coupling in a system—that is, a system where each class is largely independent and communicates with other classes via a small, well-defined interface.

■  Cohesion The term cohesion describes how well a unit of code maps to a logical task or entity.In a highly cohesive system, each unit of code (method, class, or module) is responsible
for a well-defined task or entity. Good class design exhibits a high degree of cohesion.

■  Code duplication Code duplication (having the same segment of code in an application more
than once) is a sign of bad design. It should be avoided.

■  Encapsulation Proper encapsulation in classes reduces coupling and thus leads to a better
design.

■  Responsibility-driven design Responsibility-driven design is the process of designing
classes by assigning well-defined responsibilities to each class. This process can be used to
determine which class should implement which part of an application function.

■  Localizing change One of the main goals of a good class design is that of localizing change:
making changes to one class should have minimal effects on other classes.

■  Method cohesion A cohesive method is responsible for one, and only one, well-defined task.

■  Class cohesion A cohesive class represents one well-defined entity.

■  Refactoring Refactoring is the activity of restructuring an existing design to maintain a good
class design when the application is modified or extended.

■  Switch statement A switch statement selects a sequence of statements for execution from
multiple different options.

                                                                                        

Syllabus Before Mids-OOP



OOP(Object Oriented Programming)
Topics:
1.     Compilation process in java
2.     Bytecode
3.     Objects
4.     Classes
5.     Instance variables, State
6.     Methods, Behaviours
7.     Classes as Reference type
8.     Classes to create object
9.     Passing object as parameter to different objects. =>Student s2=new Student(s); (*Imp)
10.                       Primitive and non primitive data types
11.                       Inheritance(*Imp)
12.                       Using Is-A relationship(*Imp)
13.                       Polymorphism(*Imp)
14.                       Overloading and overriding(*Imp)
15.                       Encapsulation(*Imp)
                                           i.            Basics of encapsulation