Tuesday, April 8, 2014

How to Open Blogger Links in New Tabs

By default, all links and hyperlinks in Blogger opens in your current window. If you ever thought of changing the default action by Blogger and gave up on it entirely, I want you to be happy because the solution is right here. I will quickly walk you through how to force links in Blogger to open in new tab.

5 Easy Steps To Force Links In Blogger To Open In New Tab


Blogger vs WordPress


1. Login to your Blogger account
2. Navigate to TEMPLATE > Edit TEMPLATE
3. Search for the <head> tag in your template’s code.
Hint: Use Ctrl+F to find the code.
4. Copy the code below and Paste it below the tag

<base target='_blank'/>

5. Hit the save button and you are done.

It’s that easy? yeah. Don’t forget to drop your comment to show some love.

Thanks

Fazle Rabbi

PSTU


Poets of the Fall - Carnival of Rust

There is nothing to say about Poets of the Fall
They r not as like as other Rock Band
একটা example দিলেই বুজবেন এরা কি জিনিস...
২০০৩ থেকে ২০১৩ সাল পর্যন্ত এদের album
বের হইছে হাতে গোনা ৬ টা ।
But each of them is super hit.
My favourit album is
"Carnival of Rust"
Which was fall by those poets in 2006.

If ur heart is weak then don't try this album at home.
coz there is a chance for heart failure

Download Link

 

http://adf.ly/j2upJ


To get more "most wanted" album
Stay tuned with me at >>>

www.fazlerabbicse.blogspot.com
www.fb.com/fazlerabbi.cse

Saturday, April 5, 2014

Java Program to Implement crammers rule


import java.util.Scanner;

public class CramerBackEnd {
    public  float calcdeterminant(float temp2[][] ) {  // returns the value of the calculated determinant
        float diter1= temp2[0][0]*( (temp2[1][1]*temp2[2][2] )-(temp2[2][1]*temp2[1][2]) );
        float diter2= temp2[0][1]*( (temp2[1][0]*temp2[2][2] )-(temp2[2][0]*temp2[1][2]) );
        float diter3= temp2[0][2]*( (temp2[1][0]*temp2[2][1] )-(temp2[2][0]*temp2[1][1]) );
        float result = diter1-diter2+diter3;
        return result;
    }   
}
   
public class MainCramers {
    public static void main(String args[]){
       Scanner scan = new Scanner(System.in)  ;
       CramerBackEnd process = new CramerBackEnd();
      
        float matrix[][] =    new float[5][5];
        float temp1[][]=      new float [5][5];
        float temp2[][]=      new float [5][5];
      
        System.out.println("plz give the value of the 3x4 matrix:");
        for(int i =0;i<3;i++){ //  loop i begins
            for(int j=0;j<4;j++) { // loop j begins
              
        System.out.println(" the matrix"+(i+1)+ (j+1) );
              
        matrix[i][j]= scan.nextFloat();
                temp1[i][j]= matrix[i][j];
                temp2[i][j]= matrix[i][j];
              
             } //  loop j ends
        }// loop i  ends
       
       matrix[0][0]= matrix[0][3]; matrix[1][0]= matrix[1][3]; matrix[2][0]= matrix[2][3];  //
       temp1[0][1]= matrix[0][3]; temp1[1][1]= matrix[1][3]; temp1[2][1]= matrix[2][3];  //
       temp2[0][2]= matrix[0][3]; temp2[1][2]= matrix[1][3]; temp2[2][2]= matrix[2][3];  //
      
       float determinant = process.calcdeterminant(matrix);
      
        System.out.println("the determinant:"+determinant);
     
       System.out.printf("The value of X1:");
       float var1 = process.calcdeterminant(matrix)/determinant;
       System.out.printf("%.5f\n",var1);
      
       System.out.printf("The value of X1:");
       float var2 = process.calcdeterminant(temp1)/determinant;
       System.out.printf("%.5f\n",var2);
      
       System.out.printf("The value of X1:");
       float var3 = process.calcdeterminant(temp2)/determinant;
       System.out.printf("%.5f\n",var3);
      
    }
}

C Program to Implement crammers rule

#include <stdio.h>

int det3(int a[3][3]);

int main(void)
{
    int A[3][3];
    int B[3];

    printf("This program uses Cramer's Rule to solve a linear system.\
            Enter each of 3 linear equations as four integers separated by space.\
              For example, x - 2y + 3z = 4 should be entered as 1 -2 3 4");
    printf("\n\nEnter equation 1: ");
    scanf("%i %i %i %i", &A[0][0], &A[0][1], &A[0][2], &B[0]);
    printf("Enter equation 2: ");
    scanf("%i %i %i %i", &A[1][0], &A[1][1], &A[1][2], &B[1]);
    printf("Enter equation 3: ");
    scanf("%i %i %i %i", &A[2][0], &A[2][1], &A[2][2], &B[2]);

    /*Finding determinants*/

    int detx[3][3] = {{B[0],A[0][1],A[0][2]},{B[1],A[1][1],A[1][2]},
                          {B[2],A[2][1],A[2][2]}};
    int dety[3][3] = {{A[0][0],B[0],A[0][2]},{A[1][0],B[1],A[1][2]},
                          {A[2][0],B[2],A[2][2]}};
    int detz[3][3] = {{A[0][0],A[0][1],B[0]},{A[1][0],A[1][1],B[1]},
                          {A[2][0],A[2][1],B[2]}};

    /* Code that determines if the system has a unique solution */

      if(det3(A)!=0)
             printf("\nSystem has a unique solution ( %d, %d, %d)",
             det3(detx)/det3(A), det3(dety)/det3(A), det3(detz)/det3(A));
      else
             printf("\nSystem does not have a unique solution because determinant is 0");

    return 0;
}
int det3(int a[3][3])
{
    return (a[0][0]*a[1][1]*a[2][2])-(a[0][0]*a[1][2]*a[2][1]),
                +(a[0][1]*a[1][2]*a[2][0])-(a[0][1]*a[1][0]*a[2][2]),
                +(a[0][2]*a[1][0]*a[2][1])-(a[0][2]*a[1][1]*a[2][0]);
}

Java Program to Implement gauss elimination Method


import java.util.Scanner;


public class GaussElimination {
    public static void main(String args[]){
        Scanner in=new Scanner(System.in);
        System.out.println("press no of eqn:");
        int row = in.nextInt();
        int col = row+1;
        float mat[][]= new float [row][col];
        float x[] = new float [row];
       
        for (int i=0;i<row;i++){
            x[i]=0;
        }
       for(int i=0;i<row;i++){
           for (int j=0;j<col;j++){
               System.out.println("Press MAT"+(i+1)+(j+1));
               mat[i][j]= in.nextFloat();
           }
       }
       for(int i=0;i<row-1;i++){
           for(int j=i+1;j<row;j++){
               float a = mat[j][i];
               float b = mat[i][i];
               for(int k=0;k<col;k++){
                   mat[j][k]=mat[j][k]-mat[i][k]*(a/b);
               }
           }
       }
      
       System.out.println("forward elimination:");
       for(int i=0;i<row;i++){
           for(int j=0;j<col;j++){
               if(mat[i][j]==-0){
                   mat[i][j]=0;
               }
               System.out.printf("%.2f\t",mat[i][j]);
           }
           System.out.println();
       }
    System.out.println("backward substitution");
    for(int i=row-1;i>=0;i--){
        float temp =0;
        for (int j=0;j<col;j++){
            if(j<col-1){
                if(j<=i)
                    temp=mat[i][j]+temp;
                else
                    temp=mat[i][j]*x[j]+temp;
            }
            else
                temp=mat[i][j]/temp;  
        }
    x[i]=temp;
    }
    System.out.println("completed backward subt:");
  System.out.println("\n solutions") ;
  for(int i=0;i<row;i++){
      System.out.println("X"+(i+1)+"="+x[i]);
       
    }
 
    }
    }
   

C Program to Implement gauss elimination Method

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
  float mat[4][4],temp,temp1,x,y,z;
  int i,n,j;
  clrscr();
  printf("\nEnter size of matrix: ");
  scanf("%d",&n);
  for(i=0; i<n; i++)
  {
   printf("\n\nenter the value of %d eqvation",i+1);
   for(j=0; j<n; j++)
   {
    printf("\nenter the value of coeffcient %d: ",j+1);
    scanf("%f",&mat[i][j]);
   }
   printf("\nenter the value of constent: ");
   scanf("%f",&mat[i][j]);
  }

  printf("\n Your Matrix \n\n");
  for(i=0;i<n;i++)
  {
   for(j=0;j<n+1;j++)
   {
    printf(" %g ",mat[i][j]);
   }
   printf("\n\n");
  }

  temp=mat[1][0]/mat[0][0];
  temp1=mat[2][0]/mat[0][0];
  for(i=0,j=0;j<n+1;j++)
  {
   mat[i+1][j]=mat[i+1][j]-(mat[i][j]*temp);
   mat[i+2][j]=mat[i+2][j]-(mat[i][j]*temp1);
  }

  temp=mat[2][1]/mat[1][1];
  for(i=1,j=0;j<n+1;j++)
  {
   mat[i+1][j]=mat[i+1][j]-(mat[i][j]*temp);
  }


  for(i=0;i<n;i++)
  {
   for(j=0;j<n+1;j++)
   {
    printf(" %.3f ",mat[i][j]);
   }
   printf("\n\n");
  }

  z = mat[2][3]/mat[2][2];
  y = (mat[1][3] - mat[1][2]*z)/mat[1][1];
  x = (mat[0][3] - mat[0][2]*z - mat[0][1]*y)/mat[0][0];
  printf("\n\nx = %.3f",x);
  printf("\n\ny = %.3f",y);
  printf("\n\nz = %.3f",z);
  getch();
}


/*
______________________________________

         OUT PUT
______________________________________


enter the value of 1 eqvation
enter the value of coeffcient 1: 2

enter the value of coeffcient 2: 1

enter the value of coeffcient 3: 1

enter the value of constent: 10


enter the value of 2 eqvation
enter the value of coeffcient 1: 3

enter the value of coeffcient 2: 2

enter the value of coeffcient 3: 3

enter the value of constent: 18


enter the value of 3 eqvation
enter the value of coeffcient 1: 1

enter the value of coeffcient 2: 4

enter the value of coeffcient 3: 9

enter the value of constent: 16

  Your Matrix

 2  1  1  10

 3  2  3  18

 1  4  9  16

 2.000  1.000   1.000   10.000

 0.000  0.500   1.500   3.000

 0.000  0.000  -2.000  -10.000



x = 7.000

y = -9.000

z = 5.000


*/

Java Program to Implement bisection Method

import java.util.Scanner;

public class Bisection {

    public static double f(double x) {    // start of the method f
        double temp = Math.pow(x, 10) - 1;
        return temp;
    }// end of the method f

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        double x = 0;

        System.out.println("enter X (lower):");
        double a = input.nextDouble();

        System.out.println("enter X (upper):");
        double b = input.nextDouble();

        System.out.println("enter max iteration number:");
        int n = input.nextInt();
        int i;
        for (i = 1; i <= n; i++) { // for loop starts
            double temp = x;
            float error;
            x = (a + b) / 2;
            error = Math.abs((float) (((x - temp) / x) * 100));
            System.out.println("Iteration:" + i + "\ta=" + a + "\tb=" + b + "\tRoot:" + x + "\terror:" + error + "%");

            if (f(x) * f(a) < 0) {
                b = x;
            }

            if (f(x) * f(a) > 0) {
                a = x;
            }

            if (f(x) * f(a) == 0) {
                System.out.println("the root equals: " + x);
                break;
            }
           
        }// ends for loop here

        if (i > n)
         {
            System.out.println("max iteration exceeded:");

         }
    }
}

C Program to Implement bisection Method



#include<stdio.h>
#include <math.h>
#include<conio.h>
#define ESP 0.001
#define F(x) (x)*(x)*(x) + (x)*(x) + (x) + 7
void main()
{
  int i = 1;
  float x0,x1,x2;
  double f1,f2,f0,t;
  clrscr();
  printf("\nEnter the value of x0: ");
  scanf("%f",&x0);

  printf("\nEnter the value of x1: ");
  scanf("%f",&x1);
  printf("\n__________________________________________________________________\n");
  printf("\niteration\t x0\t       x1\t x2\t   f0\t   f1\t   f2");
  printf("\n___________________________________________________________________\n");
  do
  {
  x2=(x0+x1)/2;
  f0=F(x0);
  f1=F(x1);
  f2=F(x2);
  printf("\n%d %f %f %f %lf %lf %lf", i, x0,x1,x2,f0,f1,f2);
  if(f0*f2<0)
   {
    x1=x2;
   }
   else
   {
    x0=x2;
   }
   i++;
  }while(fabs(f2)>ESP);
printf("\n__________________________________________________________\n");
printf("\n\nApp.root = %f",x2);
getch();
}

/*
 OUT PUT
---------


Enter the value of x0: -2

Enter the value of x0: -1

Enter the value of x1: -2

__________________________________________________________

    x0         x1        x2        f0       f1      f2
__________________________________________________________

-1.000000 -2.000000 -1.500000 -5.000000 2.000000 -1.750000
-1.500000 -2.000000 -1.750000 -1.750000 2.000000  0.062500
-1.500000 -1.750000 -1.625000 -1.750000 0.062500 -0.859375
-1.625000 -1.750000 -1.687500 -0.859375 0.062500 -0.402344
-1.687500 -1.750000 -1.718750 -0.402344 0.062500 -0.170898
-1.718750 -1.750000 -1.734375 -0.170898 0.062500 -0.054443
-1.734375 -1.750000 -1.742188 -0.054443 0.062500  0.003967
-1.734375 -1.742188 -1.738281 -0.054443 0.003967 -0.025253
-1.738281 -1.742188 -1.740234 -0.025253 0.003967 -0.010647
-1.740234 -1.742188 -1.741211 -0.010647 0.003967 -0.003341
-1.741211 -1.742188 -1.741699 -0.003341 0.003967  0.000313
__________________________________________________________


App.root = -1.741699


*/

Java Program to Implement Iterative Method

import java.util.Scanner;

public class IterativeProcess {

    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        float a, x, b, c, sum;

        float result[] = new float[100];

        System.out.println("for the quadratic equation:ax^2+bx+c");
        System.out.println("enter the value of a:?");
        a = input.nextFloat();

        System.out.println("enter the value of b:?");
        b = input.nextFloat();

        System.out.println("enter the value of c:?");
        c = input.nextFloat();

        System.out.println("enter the starting value of x:?");
        x = input.nextFloat();
        x = (-c - a * x * x) / b;
       
        result[0]=x;
        System.out.printf("The equation is: %.2fx^2 + (%.2f)x + %f = 0 \n", a, b, c);

        //   for(int i=x;i<=10;i++){ // loop starts here

        for (int i =0;; i++) { // loop starts here
         
           // System.out.printf("The value at SN:=%d is:%f \n", i+1, result[i]); 
           
            sum =  (-c - a * x * x) / b;
            result[i+1] = sum;

            if (result[i+1] == x) {
                break;
            }
             System.out.printf("The value at SN:=%d is:%f \n", i+1, result[i]); 
            x = sum;
           


        }// loop ends here
        if ((result[1] - result[2]) >(result[2] - result[3])) {
            System.out.println("\n........................... The function is Converging...........................");
        } else {
            System.out.println("\n ........................ ..The function is Diverging..........................");
        }
    }
}

Java Program to Implement N-R (NewtonRaphson) METHOD

import java.util.Scanner;
public class NewtonRaphson2 {
    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
       
        System.out.println("guess the initial value:");
        float x= input.nextFloat();
        float err=0;
        System.out.println("enter the no: of iteration:");  
        int time= input.nextInt();
        System.out.println("\n Iteration \t\t X \t\t\t Error(%)");
       
        for(int i =1;i<=time;i++)
        {
            float temp =x;
            x= x-(((float)Math.exp(-x))-x)/((-(float)Math.exp(-x))-1);
            err =Math.abs(((x-temp)/x)*100);
                   
            if(err<0.0001)
            {
                System.out.println(i-1 + "\t\t" + x + "\t\t" +err+ "%" /*+ "\n This is done....."*/);
                break;
            }
           
            else if (i<=2)
                System.out.println(i-1 + "\t\t" + x + "\t\t" + err +"%");
            else
                System.out.println(i + "\t\t" + x + "\t\t" + err+ "%");
       
        if(err<0.0001)
        {
            System.out.println(i + "\t\t" + x + "\t\t" + err +"%");
        }
        else
             System.out.println(i-1 + "\t\t" + x + "\t\t" + err +"%");
       
    }
}
}

C Program to Implement N-R (NewtonRaphson) METHOD

#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int user_power,i=0,cnt=0,flag=0;
int coef[10]={0};
float x1=0,x2=0,t=0;
float fx1=0,fdx1=0;

void main()
{

    clrscr();

    printf("\n\n\t\t\t PROGRAM FOR NEWTON RAPHSON GENERAL");

    printf("\n\n\n\tENTER THE TOTAL NO. OF POWER:::: ");
    scanf("%d",&user_power);

    for(i=0;i<=user_power;i++)
    {
        printf("\n\t x^%d::",i);
        scanf("%d",&coef[i]);
    }

    printf("\n");

    printf("\n\t THE POLYNOMIAL IS ::: ");
    for(i=user_power;i>=0;i--)//printing coeff.
    {
        printf(" %dx^%d",coef[i],i);
    }

    printf("\n\tINTIAL X1---->");
    scanf("%f",&x1);

    printf("\n ******************************************************");
    printf("\n ITERATION    X1    FX1    F'X1  ");
    printf("\n **********************************************************");

    do
    {
            cnt++;
            fx1=fdx1=0;
            for(i=user_power;i>=1;i--)
            {
                fx1+=coef[i] * (pow(x1,i)) ;
            }
            fx1+=coef[0];
            for(i=user_power;i>=0;i--)
            {
                fdx1+=coef[i]* (i*pow(x1,(i-1)));
            }
            t=x2;
            x2=(x1-(fx1/fdx1));

            x1=x2;

            printf("\n %d         %.3f  %.3f  %.3f ",cnt,x2,fx1,fdx1);

    }while((fabs(t - x1))>=0.0001);
    printf("\n\t THE ROOT OF EQUATION IS %f",x2);
    getch();
}





















/*
This program have written for the course named Numerical Method
        Author : Fazle Rabbi
        My social site's link
______________________________________________________________
https://www.facebook.com/FazleRabbi.CSE
https://twitter.com/Fazle_Rabbi_CSE
http://lnkd.in/bzuUfbM
https://plus.google.com/u/0/106347450745435143158/posts
http://www.youtube.com/channel/UC4Ni4G1TIydmdXNFxeqskvQ
http://www.flickr.com/photos/108286097@N08/
https://vimeo.com/user22555382
http://www.pinterest.com/fazlerabbicse/
https://foursquare.com/user/71317652
            Website:
______________________________________________________________
www.fazlerabbicse.blogspot.com
www.awesome-fazle-rabbi.tumblr.com

            Email me
______________________________________________________________
fazlerabbicse@gmail.com
fazlerabbi@ojooo.com
*/