Organizational Structure of BOP

In this blog, I am talking about my group presentation in the course Fundamental Of Management(mg-223).

Objective:

We have to make groups and every group consist five members and We are required to take an organizational structure of any organization by taking hand to hand information or collect information from internet about your selected organization and make a good effort and present in a class.

Working:

Our group have selected organizational structure of BOP(Bank Of Punjab).We have arrange meeting with manager of BOP of (Hayatabad phase-1) branch and grap information about their organization and make notes of that.And then we have divided Presentation in five parts and every group member select their part in presentation accordingly to their choice.Ali Husnain(group-member) selected intro and Kashif Ali(group-member) selected planning part of presentation.Sarim Ali(group-member) and Hassan Shabibr cheema(group-member) selected leading and controlling part of presentation and I have selected the organizing.And now we are ready for presentation.

Presentation:

Intro:

The Bank of Punjab (BOP) head quartered in BOP tower, Main Boulevard ,  Gulberg,  Lahore is one of the prominent financial institution of the country with PACRA(Pakistan Credit Rating Agency Limited).
Bank Of Punjab To be a customer focused bank with service excellence.

Read More »

Guide to establish Android Network Connection

Most of the application in android now a days use data from internet it might be contacts, game data, weather or other information.This data is provided from internet through Web API’s.

In this tutorial we can take an example of Github Query App and make a connection of Android App to internet.

Creating Layout

After starting empty activity in a new project in Android Studio,First thing you have to do is  to open activity_main.xml and make some changes.Delete a Constraint Layout and create a new Linear Layout.Create a EditText, inside Linear Layout, where user can enter their input data and give proper ID to EditText and other properties.Create a TextView,inside Linear Layout, to show the Url and give proper ID and other properties.You have to create a ScrollView,inside Linear Layout, to scroll on a result. Create a TextView inside the ScrollView and give proper ID to this and other properties.

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="22sp"
        android:id="@+id/et_search_box"
        android:hint="Enter a query and click search" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="22sp"
        android:id="@+id/tv_url_display"
        android:layout_marginTop="8dp"
        android:hint="your search will be shown here"/>
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="18sp"
            android:id="@+id/tv_github_search_result_json"
            android:hint="make a search"/>
    </ScrollView>
</LinearLayout>

Now move to MainActivity.java and make some changes.Create a variable for EditText and TextView inside the MainActivity class.Read More »

Vector Grapher

Vector Grapher was our group project of CS-103 course. Idea was proposed by my colleague Ahmed Waheed. Group project is considered as a  foremost in any course . That’s why we decided to do something new and unique to check our skills that we had learned in computer programming course, in a better way and  output should be a productive project  not only a project.This is our first ever project in university so we were so excited, passionate and zealous about our project and little bit confused.But at that time we didn’t  know what to do ?

Then we saw this in Calculus-II Book:

Screenshot from 2018-07-17 13-16-22

Helix seen in above screen shot was our motivation. We decided to do this as group project in CS-103.We meet our Calculus Instructor, Professor Dr. M. Tariq Rahim, told him about our idea. Dr. M. Tariq Rahim said that’s a brilliant idea. This is never done by any student in Fast university yet.But this is not a bit difficult job, you can do this very easily by working hard. If you need any help, I will be there for you.  We were motivated and we finalized to take Vector grapher as a semester project.

First most Difficult part was accomplished,Second task i.e making a proposal to submit to our course instructor of Computer Programming, Assistant Professor M. Tehseen Khan. Making a proposal was not as simple as piece of cake we had a call of almost half hour for writing proposal at midnight to submit , because we were not able to submit proposal in time.

Read More »

SSH

Introduction

SSH is a secure protocol used as the primary means of connecting to another Linux machine remotely. It provides you a command line interface where you can type your command that you want to run on anonther machine. After connection, all command you type in your local terminal are sent to remotely connected machine and executed there.SSH stand for Secure Shell.

Working

SSH connection is working on client-server model. This means that for an SSH connection to be established, the user’s computer must have SSH client and the remote machine must have SSH server. This software listen for a connection on specified network port and authenticate connection request, and spawns the appropriate environment if the user provides the correct credentials.

SSH Authentication

Clinet generally authenticate using SSH keys which are very secure. Password logins are encrypted and easy to understand for new user.SSH keys are a matching set of cryptographic keys which can be used for authentication. Each set contains a public and a private key. The public key can be shared freely without concern, while the private key must be vigilantly guarded and never exposed to anyone.

To authenticate using SSH keys, a user must have an SSH key pair on their local computer. On the remote server, the public key must be copied to a file within the user’s home directory at ~/.ssh/authorized_keys. This file contains a list of public keys, one-per-line, that are authorized to log into this account.

When a client connects to the host, wishing to use SSH key authentication, it will inform the server of this intent and will tell the server which public key to use. The server then check its authorized_keys file for the public key, generate a random string and encrypts it using the public key. This encrypted message can only be decrypted with the associated private key. The server will send this encrypted message to the client to test whether they actually have the associated private key.

Upon receipt of this message, the client will decrypt it using the private key and combine the random string that is revealed with a previously negotiated session ID. It then generates an MD5 hash of this value and transmits it back to the server. The server already had the original message and the session ID, so it can compare an MD5 hash generated by those values and determine that the client must have the private key.

Installation

To install SSH o your machine simple open Terminal on your machine and type a command:

sudo apt install openssh-client

And then open the Terminal  on the machine you want to connect to your machine  and install openssh-server :

sudo apt install openssh-server

Read More »

Presentation On Voltage Multiplier

I have done with the  presentation in my Basic Electronic Course, in my very first semester.First thing you have to do,when you are asked to do a presentation on a topic of your own choice, is ‘selection of topic’.You get confused what to do or what not to do. But I my self selected a topic that is ‘Voltage Multiplier’ and search for appropiate data on internet and in books about my topic.After  that, I Set up a following document on Voltage Multiplier that is given below.

           Voltage Multiplier

maxresdefault

Definition:

A voltage multiplier is an electrical circuit that converts A.C electrical power from a lower voltage to higher D.C voltage typically using network of capacitors and diodes.

Purpose:

The main purpose of voltage multiplier is, when required voltages typically range from 10 to 30 kV and current exceeds 5 milliamperes.When this type of power source is required  you may want to consider a voltage multiplier because they are inexpensive, easy to design, versatile and can provide virtually any output voltage that is an odd or even multipe of the input voltage.

Read More »

Regular Expression

A regular expression (or regex, or regexp) is a way to describe complex search patterns using sequences of characters.

Regular expressions are patterns that can be matched against strings. Regular expressions are important tools for text processing. Many text editors and most programming languages have some built-in support for regular expressions.

Regular expressions are used for searching through data. They allow you to search for pieces of text that match a certain form, instead of searching for a piece of text identical to the one you supply. For example, the regular expression [0-9]+ allows you to search through a file for any integer number.

Certain characters have special purposes in regular expressions. These are called meta-characters or meta-symbols. Meta-characters are not part of the strings that are matched by a pattern. Instead, they are part of the syntax that is used for representing patterns. Typically, the following characters are meta-characters:

      .   *   |   ?   +   (   )   [   ]   {   }   ^   $   \

These characters have special meaning in regular expressions. For example, parentheses are used for grouping, just as they are in arithmetic. If you want to use a meta-character as a regular character instead of with its special meaning, you have to “escape” it by preceding it with a backslash, such as \*\(\$, or \\.

MATCH ANY NUMBER LINE

We’ll start with a very simple example – Match any line that only contains numbers.

^[0-9]+$

Let’s walk through this piece-by-piece.

  • ^ – Signifies the start of a line.
  • [0-9] – Matches any digit between 0 and 9
  • + – Matches one or more instance of the preceding expression.
  • $ – Signifies the end of the line

We could replace [0-9] with \d which will do the same thing.

The great thing about this expression (and regular expressions in general) is that it can be used, without much modification, in any programing language.

import re

with open('test.txt', 'r') as f:
  test_string = f.read()
  regex = re.compile(r'^([0-9]+)$', re.MULTILINE)
  result = regex.findall(test_string)
  print(result)