| About Us | Contact Us | Privacy Policy | Join Us+ |

WorldTrueSight

Get the latest news and reviews about technology!

Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

3 Feb 2019

File Organization In Database[COMPLETE CONCEPT]

Database SQL Server

FILE ORGANIZATION:

           Storage and access method of a file is called file organization.

TYPES OF FILE ORGANIZATION:

1.Sequential File Organization
2.Direct access File Organization

SEQUENTIAL FILE ORGANIZATION:

When we have to access data in sequence.
Example:
Tape-drive. In tape drive if we want to access the 2nd video we have to go through the 1st then we can access the second one . We can’t jump directly to  2nd .
ADVANTAGE OF SEQUENTIAL FILE ORGANIZATION:
Sequential saves memory. Because there is no meta data (header/footer) with a single record.

USES OF SEQUENTIAL FILE ORGANIZATION:
Sequential file organization is helpful when we have to access the whole batch . i.e Electricity bills.

DRAWBACKS OF SEQUENTIAL FILE ORGANIZATION:
1.Time loss
2.Searching is difficult in Sequential file Organization
3.If we try to insert a new data we have to reorganize the whole data.
4.If we are searching a data which is not present in the records. It will search the whole data then tell that the data is not present.

DIRECT FILE ORGANIZATION:

Example:


Hard Drive.

ADVANTAGES OF DIRECT FILE ORGANIZATION:

1.Time saving
2.Searching is easy in Direct file Organization

TYPES OF DIRECT FILE ORGANIZATION:

1.Indexed Sequential
2.Hashing


INDEXED SEQUENTIAL:
           
Indexed Sequential is same as Table of Content in books.
HASHING:
   Hashing is a function but not a specific function. We can made our hashing function.

TYPES OF HASHING FUNCTION:

1.Division method
2.Folding method

DIVISION FUNCTION:

x mod y return remainder. If remainder of two numbers are same then it is called hashing conflict.

SOLUTION OF HASHING CONFLICT:

Add 1 to the remainder.

FOLDING METHOD:

You can fold a number to find that in which track the given record should go.

FOR EXAMPLE:

Suppose a record with Student ID 8530 & you have to use folding method to tell that  which hard drive’s track will hold this record ?

  8      5        3       0

            8       5
      +    3      0
      --------------
           11     5   <------- This record will save in 5th 
     ---------------
track in hard drive!

THANK YOU... 🙂

22 Dec 2018

Assembly Language


DESCRIPTION: 

To Print a star Pattern in assembly we use Nested Loop such that ecx register controls the outer or parent loop and ebx register controls the nested or inner loop.

The provided code will ask for a user input. Such that it will ask the user to enter a number and the program will  print a star pattern according to user's entered number.

Complete Documentation => SOURCE CODE



******************************************************
If you find any query regarding the provided code then you are free to ask in the comment section.
THANK YOU ☺️

21 Dec 2018

IMPLEMENTATION OF VENN DIAGRAM :

The Venn Diagram: When Jon Venn first envisioned his new diagram’s future, he surely couldn’t have expected it to be popular more than a century after he created it. However, it has stood the test of time and has remained a popular diagram for showing correlations between different aspect of a subject or even different subjects entirely. Even in today’s modern world of 3D imaging and greatly advanced technology, the Venn Diagram has a firmly cemented place in many people’s daily life.

     The provided Code works on classes. And apply Polish notation Algorithms. (ie infix to postfix conversion + evaluation)

WORKING :

C# Visual Studio

This code will first convert the given Infix Expression to Postfix using STACK and then evaluate it to give the Shaded Region.

Kindly watch this VIDEO 👇 for better understanding , Hope this video helps you

This video credits belongs to respected owner
we don't own this video!
If you're the owner of this video and wan't us to remove just comment below thank you.



COMPLETE DOCUMENTATION => SOURCE CODE

You can also make the Diagram of your own choise. The only change you have to make is in the arrays behind the Calculate button.
C# Visual Studio
 ***************************************************
If you find any Query regarding the provided Code then you can ask in the comment section
Thank You 🙂


TIC TAC TOE in ASSEMBLY 8086 Processor

TIC TAC TOE :


Tic-Tac-Toe is a two-player game with two symbols denoting the two players: X and O. The playing board is a 3x3 square.
The rules are as follows:
  •  Each player takes a turn placing his character (X or O) into one of the nine squares.
  •  A player cannot place his symbol in a square that is already occupied by a symbol.
  •  The game ends when a player creates a winning combination of his symbols or when there are no empty squares remaining.
  •  Winning combination is defined as three horizontally adjacent, three vertically adjacent, or three diagonally adjacent symbols
  •   If neither player creates a winning combination when all nine squares are occupied, the game is a draw, often referred to as a "cat game."

IMPLEMENTATION :

Implementation of TIC TAC TOE in Assembly is a little bit harder than other Programming Languages.The provided code will work in Three Levels :
  • Easy  ( 3x3)
    TIC TAC TOE in ASSEMBLY 8086 Processor


  • Medium (4x4)
    TIC TAC TOE in ASSEMBLY 8086 Processor


  • Hard (5x5)
    TIC TAC TOE in ASSEMBLY 8086 Processor
Such that the number of Rows and Columns increases with the increase of Level.


COMPLETE DOCUMENTATION = > SOURCE CODE
*****************************************************
If you find any query regarding this code.then you are free to ask in the comment section

22 Sep 2018

Addition + Subtraction + Multiplication + Division In Assembly Language x86

equation code in assembly language processor x86

Welcome back,
Before we are start I want to tell you we are using Irvine Libraries and 86x processor to perform such operations as mentioned above !

Things which are discussed below in this content are listed below:

  • Addition in assembly language x86 => 8086
  • Subtraction in assembly language x86 => 8086
  • Multiplication in assembly language x86 => 8086
  • Division in assembly language x86 => 8086
I'm using Irvine Library on visual studio 2010 Professional to run assembler to execute my code!
If you want to setup this platform visit => VS 2010 Pro + Irvine Lib FULL !

FOR BETTER UNDERSTANDING:

"Processor has only register in use i.e. eax which is use to display so u may   hold data in other registers but make sure to place your final result in the eax register to make your program error free, this whole game of assembly is passing values to the free register and right register where eax is accumulator"

Addition in assembly language code:

Suppose value is: 8+2 => 10 
Addition in assembly language code

Subtraction in assembly language code:

Suppose value is: 8-2 => 10
Subtraction in assembly language code

Multiplication in assembly language code:

Suppose value is: 8*2 => 10
multiplication in assembly language code

Division in assembly language code:

Addition + Multiplication and Division Together, Focus "PASSING VALUES"

Suppose equation is: (3*4) + (6/2) + (5*2) = 25 

mov 3 to eax and mov 4 to ebx and use mul ebx to put 12 in eax
now mov eax to ecx as shown in code !
mov 6 to eax and mov 2 to ebx and div ebx to put answer in eax
now use add ecx,eax means answer of 3 * 4 + 6 / 2 is in ecx register
eax is free now put 5 in eax and 2 in ebx again !
again use mul ebx and add eax which is 5 * 2 = 10 into ecx to get your answer which is 25 !
division in assembly language code



28 Jul 2018

ROUND ROBIN IN C


Added on: 28 / 7 / 2018
Description:

In this post, I'm sharing the code of round robin and some details are below how round robin works !

QUEUE APPLICATION [ ROUND ROBIN ]

If you are a beginner and doesn't understand how round robin works then this will help you out understanding the round robin . The code is also very simple !

You give process to your queue/array
you set their arrival time [ when they will come in queue/array ]
you will give each process their burst time also [ how long they will be processed ]

In last, you will set the quantum number  ↓
QUANTUM NUMBER =  the time which will process each process and if any process has more instructions/burst time then it will come after every process is done with the limit of quantum !

CODE LINK => CLICK ME !

27 Jun 2018

STACK IMPLEMENTATION IN C


Added on: 27 / 6 / 2018

Description:

Read Carefully To Understand How It Works !

In this stack , we will allow capacity of 4 bytes, and a TOP variable which will handle the insert and delete functions which standard is Push and Pop.

Insert function = Push()
Delete function = Pop()


In code below , when stack is full , it will generate overflow message while inserting again and underflow message while deleting when stack is empty.

Otherwise data will be insert with the help of top.

15 May 2018

HOW TO MAKE A TELEPHONE DIRECTORY IN C LANGUAGE ?

DESCRIPTION :

This is a simple TELEPHONE DIRECTORY in which we can ADD a NEW ENTRY on Runtime . Also DISPLAY , EDIT & DELETE an ENTRY on RUNTIME . And DISPLAY ALL ENTRIES.

DATASTRUCTURE :

LINKED LIST  

LIBRARIES :


  1.  #include<stdio.h>  : This library is used for Input and Output. i-e Printf and Scanf are the functions of stdio.h 
  2. #include<stdlib.h> : This library is used for malloc and calloc function . 
  3. #include<string.h> : This library is used for comparison (in this project). String library has more other functions but we will only use it for comparison here.

STEP 1 : Make a Structure :


We will use STRUCT because C-Language(Procedural Oriented Language) does not allow Classes. char Array is use to store First Name , Last Name , Address & City because C - Language does not allow dataType string.  

Computerized Telephone Directory

STEP 2 : Make a Function NewEntry() :

This function will call when user wants to ADD a new Entry. Malloc will reserve in memory for New Node on RunTime. This Function has a return type struct Person because it will return a Node . At beginning the Linked List is NULL i-e *start = NULL . 

Computerized Telephone Directory

STEP 3 : Make a Function SaveNewEntry() :

This Function will Call the above function NewEntry() & take input from the user on RunTime . And after taking all the input it will save it in a new Node either start , End or Mid of the Linked List & generate a message "YOUR ENTRY IS ADDED". If the user is not greater than 18, it will genarate a message that "You are not eligible to register". Means the user (greater than age 18) are eligible to get a connection.

Computerized Telephone Directory
Computerized Telephone Directory
Computerized Telephone Directory


STEP 4 : Make a Function DisplayAll() :

This Function will Display all the Entries present in the whole TELEPHONE DIRECTORY.
Status Pointer is use to visit each node. If the status is not equals to NULL then it will Print or Display all Data present in the Directory. 

Computerized Telephone Directory

STEP 5 : Make a Function DeleteAnEntry() :

This Function will Delete a specific Entry by asking the First Name from the User . If there is No Entry then the user will generate a message that there is no entry in Directory. It will use a function strcmp to compare the first name given by the user with the first name present in the LINKED LIST. And also ask the user if he/she is sure or not. If the answer is YES then it will Delete the whole Entry and display a message "Record Deleted" .

Computerized Telephone Directory
Computerized Telephone Directory
Computerized Telephone Directory

STEP 6 : Make a Function DisplayAnEntry() :

This Function will Display an specific Entry. Status Pointer is use to search a node . Here Status will start from the first Node (start) and visit every node until it will find the code entered by the user . When the code entered by the user is similar to the code of status then it will stop searching and return the entry where status stands.

Computerized Telephone Directory

STEP 7 : Make a Function EditAnEntry() :

This Function will Edit the existing Entry after searching the Entry by First Name . If the Linked List is empty and there is no entry to edit then it will generate a message "Empty Directory". If the user name does not match with the user name exist in the Linked List then it will generate a message "No matching records find" .  
Computerized Telephone Directory
Computerized Telephone Directory

STEP 8 : Make a Function Choise() :

This Function will ask the user if he/she wants to Add a New Entry or Display an Entry or Edit an Entry or Delete an Entry or Display All Entries or he/she wants to End the Program. The user will add a number 1 to add a new Entry , 2 for Display an Entry , 3 for Edit an Entry , 4 to Delete an Entry , 5 to Display all Entries and 6 to End the Program .

Computerized Telephone Directory

STEP 9 : MAIN( )

We will call the function choise() in main and we will use switch Case to call every above function . 
Computerized Telephone Directory

BIG O COMPEXITY :

All the functions have the complexity O(n) because the loop will traverse all the nodes and ends with NULL .

HOW MANY ENTRIES WE CAN ADD IN THIS DIRECTORY ?

We can add entries as much as we want because the directory is created by using the Data Structure Linked List  and Linked List have no indexing. 
******************************************************************************
If you have any Query regarding this project feel free to ask in the Comment Section.
Thanks 😃

14 May 2018

HOW TO MAKE A SCHOOL/UNIVERSITY MANAGEMENT SYSTEM  IN C#?

DESCRIPTION :



This is a simple UNIVERSITY MANAGEMENT SYSTEM in which all the authorities like ADD , DELETE and VIEW the teacher and ADD , DELETE & VIEW the Student are assigned to ADMIN . Student can only VIEW his/her courses , Schedule & Attendance.Teacher can VIEW his/her courses , schedule & Student's Attendance. 

Step 1: Make All forms:



                              Sample How To Make a Form

To make a UNIVERSITY MANAGEMENT SYSTEM first make forms.

 1. LOGIN FORM :
 MANAGEMENT SYSTEM
2. ADMIN LOGIN :


 MANAGEMENT SYSTEM

3. TEACHER LOGIN :

 MANAGEMENT SYSTEM
4.STUDENT LOGIN :
MANAGEMENT SYSTEM
5.ADMIN LMS:
 MANAGEMENT SYSTEM

6. TEACHER LMS :
 MANAGEMENT SYSTEM
7. STUDENT LMS :
 MANAGEMENT SYSTEM


8. ADD TEACHER :
 MANAGEMENT SYSTEM

9. ADD STUDENT :
 MANAGEMENT SYSTEM

10. ADD SCHEDULE :
 MANAGEMENT SYSTEM

11. ADD COURSES :
 MANAGEMENT SYSTEM

12. ATTENDANCE :
 MANAGEMENT SYSTEM

13.ASSIGN COURSES:
MANAGEMENT SYSTEM

STEP 2 : MAKE A CONNECTION CLASS :

First connect your project with SQL.

HOW TO CONNECT PROGRAM WITH DATABASE ?

Click the LINK below 👇

Hope this might help !!

                                       Connection Class  
MANAGEMENT SYSTEM

DATABASE TABLES :

  • Teacher  : 
  • Admin : 
     MANAGEMENT SYSTEM
  • Student Attendance : 
     MANAGEMENT SYSTEM
  • Courses : 
     MANAGEMENT SYSTEM
  • Schedule : 
     MANAGEMENT SYSTEM
  • Student Info   
     MANAGEMENT SYSTEM

STEP 3: Working on BUTTONS :

 1. LOGIN FORM :
(Double tap on button to work on it)
 MANAGEMENT SYSTEM
Here Form2 is the TeacherLogin Form

2. ADMIN LOGIN :
 MANAGEMENT SYSTEM
Here , txtNameAdmin & txtPasswordAdmin are the textBoxName assigned in AdminLogin Form. And AdminLMS is a class.

3. TEACHER LOGIN :
 MANAGEMENT SYSTEM
4.STUDENT LOGIN :

 MANAGEMENT SYSTEM
5.ADMIN LMS:

 MANAGEMENT SYSTEM
MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
6. TEACHER LMS :
 MANAGEMENT SYSTEM
7. STUDENT LMS :
 MANAGEMENT SYSTEM
8. ADD TEACHER :

 MANAGEMENT SYSTEM

9. ADD STUDENT :
 MANAGEMENT SYSTEM
10. ADD SCHEDULE :

MANAGEMENT SYSTEM
11. ADD COURSES :

 MANAGEMENT SYSTEM
12. ATTENDANCE :

 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
13. Assign Courses :

 MANAGEMENT SYSTEM
All the text Box and buttons names should be meaningful.

Step 4 : Make Classes :

( Add  SQL Libraries when working on classes )👇 

  • using System.Data.SqlClient ;
  • using System.Data ;

1.Admin Class :

 MANAGEMENT SYSTEM


 MANAGEMENT SYSTEM

 MANAGEMENT SYSTEM

 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM
 MANAGEMENT SYSTEM

2. Teacher Class :

 MANAGEMENT SYSTEM

3. Courses Class :

 MANAGEMENT SYSTEM

4 . Student Class :

 MANAGEMENT SYSTEM
#********************#****************##****************##