FCFS Task Allocation in CloudSim

Hi All,

Today I’m going to write an Application in Java using CloudSim 3.0.3 Library, which simulates the Cloud and performs Tasks Allocation to the VMs on the basis of FCFS, First-Come-First-Served Scheduling Policy, in the Cloud. There are many ways to write this program. I’m writing in one of those ways. The Post is for all who know the basics of OOPs and Java Platform. Let’s first see the architecture of CloudSim. It is shown below.

cloudsim_arch

In CloudSim, UserCode forms the top layer, where the user creates specification and scheduling policies for the Cloud Environment. Below Diagram shows the Classes or Entities that form the CloudSim Library and their relationships.

cloudsim-class

Let’s now see the sequence diagram of any Cloudsim Application.

cloudsim-flowFrom all these diagrams, we must have understood the working of CloudSim Application. Finally, let’s see the exact working style of Cloudsim Entities in the below diagram.

clousim-work style Continue reading “FCFS Task Allocation in CloudSim”

Just Another Trick to By-Pass Samsung Lock for Android

This is a tutorial to unlock your Samsung Galaxy Ace Duos S6802 phone which is closed to Internet. The phone was locked by “Too Many Wrong Password Attempts” and since the phone is closed to internet, the Gmail Authentication will also not allow you to login. This provides you a unique way to unlock your phone. It uses Samsung Kies for unlocking.

A Tutorial to unlock your Samsung Galaxy Ace Duos S6802 phone which is closed to Internet and which was locked by “Too Many Wrong Password Attempts”

When to use this trick?

1. You (or may be a curious kid) tried to lock your phone by attempting “Too Many Wrong Passwords, Patterns or Passcodes”
2. Once you give wrong attempts too many times, it (the OS itself) will lock your phone to check your real identity via Gmail (normally, you phone is synchronised with your Gmail Account).
3. Unfortunately, You have Disconnected your phone from Internet (may be to be Cost Effective, if you are like me)

What you have to do to unlock your phone?

1. Connect your phone to Internet (But, obviously using an unusual way)

How to do that?

By By-Passing the Screen Lock using a trick.

Enough of that Boring Intro, let’s do the TRICK!!! 😉

Requirements:

1. Samsung Kies
2. USB Cable for your phone
3. Your Phone (Samsung Galaxy Ace Duos GT-S6802)

Video Tutorial for the Trick

Procedure:

1. Connect your phone to the computer that has Samsung Kies installed in it.
2. Once successfully connected, Click on “Firmware Upgrade” option (Don’t Panic, all your data will be safe, this is just another trick)
3. The firmware will start downloading.
4. Once, the download finishes, your phone will be automatically unlocked for a moment, for the phone to get upgraded. (This’ how, where, we bypassed the Screen Lock)
5. You have to immediately, disconnect the phone from the computer by simply removing the cable and Activate Internet in your phone.
6. Now, your phone again get that screen lock, but no worry, you can unlock it, by entering your Gmail credentials.

That’s it, no more Locks…
Happy Exploring
🙂
#NecessityIsTheMotherOfInvention

Dynamic Memory Allocation in C

Hi,
In this, I would like to post the program that was given for my juniors in my school. They were very new to Programming and I was standing there helping them sot out their problems while implementing it. They were asked to implement a 2D Dynamic Array. I tried to explain them as far as I could in this blog. Below is the explanation of the concept behind 2D Dynamic Array Creation.

Dynamically, if we wanna create anything, we have to go for “Pointers”. Pointers  are capable of storing memory locations. We can create memory locations of our desired size dynamically and assign them to pointers. So, a pointer can very well suit our dynamic needs.

Below is a program fragment for creating 2d dynamic array. The Program actually is meant for our Juniors in Lab. They were asked to implement a 2d dynamic array for constant rowsize and variable column size.

source code:
#include<stdio.h>
#include<malloc.h>
int main(){
int **p; int i, j, x,y[10],tmp;
printf("Enter Rowsize x");
scanf("%d",&x);

//user-casting the null pointer for
//the demanded amount of memory, here, "x" many
//memory locations are created and the starting
//address of the first memory location is returned via
// a null pointer. This is assigned to the pointer
//for the pointer
p = (int **)malloc(x*sizeof(int *));
printf("Enter varying ColumnSize for each row");
for(i=0;i<x;i++)
{
printf("nrow%d:",i+1);
scanf("%d",&y[i]);

//pointer for the column data *(p+i)
//has to be the size of the column data
//y[i] many memory locations of size
//int (2 bytes) is created and the starting
//address is returned via a null pointer
//which is user-casted and used
p[i]= (int *)malloc(y[i]*sizeof(int *));
}
printf("nEnter elementsn");
for(i=0;i<x;i++)
for(j=0;j<y[i];j++){
scanf("%d",&tmp);
p[i][j] = tmp;
}
printf("nEntered elementsn");
for(i=0;i<x;i++){
for(j=0;j<y[i];j++)
printf("%dt",p[i][j]);
printf("n");
}
return 0;
}

-Happy Coding