Friday, January 27, 2017

Necessary conditions for deadlocks in computing

Earlier I have described about deadlock in computing. In this article, I am going to discuss about  the necessary conditions, those hold simultaneously in a system to arise deadlock situation.

We can discuss these necessary conditions more precisely in terms of a directed graph called a system resource-allocation graph. So I used related  diagrams with description.
In this diagrams rounded rectangles visualize a resource and dots inside it visualize number of instances of the resource.Circles visualize processes.


Mutual Exclusion

In this scenario, there is a one resource(R1) with non-shareable mode. That means only one process can be used at a time. If another process requests that resource(P1), the requesting process(P1) must be wait until the resource has been released by first process(P2). 


Saturday, January 7, 2017

What is deadlock in computing?


In a multi-programming environment, Processes want resources to do their corresponding process. When a process requests a resource and if it is not available at that instant, then the process enters to a waiting state. Sometimes this process can’t get out from the waiting state because the process has been hold by another process. This situation is called a deadlock. 

Let’s discuss this situation in detail.


Tuesday, October 25, 2016

Simple DIY project using HC-SR04 Ultrasonic Sensor


You can create a circuit to measure the water level of a water tank using this HC-SR04 Ultrasonic Sensor. You only have to add few lines in to the code that I used to display measured distance from this sensor. Revised code is given below.


int echoPin = 2;  //Define Echo pin
int trigPin = 3;     // Define Trig pin
long  inches, duration, cm;   //Define variables
int height=300; //define depth of tank in cm
int firstLED = 4; // define LEDs pin
int secondLED = 5;
int thirdLED = 6;
int fourthLED = 7;

void setup() {

Serial.begin (9600);
pinMode(trigPin, OUTPUT);  //Define output pin
pinMode(firstLED, OUTPUT);
pinMode(secondLED, OUTPUT);
pinMode(thirdLED, OUTPUT);
pinMode(fourthLED, OUTPUT);
pinMode(echoPin, INPUT);  //Define input pin

}

Friday, September 2, 2016

Get to know about Ultrasonic Sensor HC-SR04


Ultrasonic Sensor HC-SR04 is used to measure distance. We can find precise distance to an object from sensor, or can used to detect when something is within range of the sensor. It can measure distance with high accuracy from 2cm to 400 cm. Its operation is not affected by sunlight or black material .Because it uses sound to measure distance.

Ultrasonic range finder measure distance by emitting a pulse of ultrasonic sound that travels through the air until it hits an object. It measure how long it takes the sound pulse to travel in its round trip journey back to the sensor when the pulse hits the object. Then it sends an electrical signal to the Arduino with information about how long it took for the sonic pulse to travel.

Ultrasonic range finder has 2 transducers.

  •         Transmitting transducer
  •     Receiving transducer



Tuesday, August 9, 2016

Create knight rider circuit using arduino MEGA 2560

Last time I discussed about Arduino Mega 2560 micro controller board . Now I'm going to discuss about a simple project using Arduino Mega 2560. Let's start it.

 We want following components to make the circuit with the Arduino MEGA 2560 .

                                                                       
LED
 10 LEDs
Male to male jumper wires





One bread board














   
270 Ohms Resister



Monday, August 1, 2016

Get inspired with Arduino MEGA 2560

What is Arduino Mega 2560 ?


    The Mega 2560 is a micro controller board which is designed for more complex projects like 3D printers and robotics projects. It has


  •  54 digital input/output pins - 15 can be used as PWM outputs
  •  16 analog inputs
  •  4 UARTs - referred to as universal asynchronous receiver/transmitter that translate data in asynchronous serial communication format
  •  a 16 MHz crystal oscillator - used to create an electrical signal with a precise frequency.
  •  a USB connection
  •  a power jack
  •  an ICSP header - referred to as in-circuit serial programming that used to programme micro controllers 
  •  a reset button. 



How to send Slack notification using a Python script?

 In this article,  I am focussing on sending Slack notifications periodically based on the records in the database. Suppose we have to monit...