Sunday, 9 October 2011

Disable Memory Dump Files & Save HDD Space on Windows 7




If your computer crashes, it will create a dump file. From this dump file you can diagnose the source of the problem. It is unlikely you will need this file; if you do, you can always turn the option back on. This section will show you how to save space by disabling memory dump files in Windows 7.
1. Click Start and click Control Panel.
2. Type Advanced in the search box.
3. Click on View advanced system settings in the search results.
4. Under Startup and Recovery, click Settings.
5. In the Write debugging information drop down, click (none) and click OK.
6. You will now save space and not store (possibly) useless information.

Register Your Windows XP license key (success to check)


Follow these simple step to the success

Step 1

First, go to START, RUN, And write here, REGEDIT




Step 2

And ENTER. Registry window will be open
Here select, HKEY_LOCAL_MACHINE




Step 3

Then Software,


Step 4

Then Microsoft,


Step 5

Then WindowsNT,




Step 6

Then CurrentVersion,



Step 7

And Then WPAEvents,



Step 8

In WPAEvents, Right click on OOBETimer key and click Modify,



Step 9

Change 71 to 72



Step 10

And Then Exit the regitry.
Again go to Start and Run, And write
%systemroot%\system32\oobe\msoobe.exe /a
here.



Step 11

It will be display Activate Windows, don’t worry about that! Please choose: I want to telephone a customer service representative to activate Windows.



Step 12

Next and Click on change product key:
write this product key here,
DHXQ2-WRGCD-WGYJY-HHYDH-KKX9B
And Press update



Step 13

It will be display Activate windows. Don’t care and choose
“Remind me later”.
And Restart Your computer,
Again go to Start and open Run box and write here,
%systemroot%\system32\oobe\msoobe.exe /a
It will alert the Windows activated already!




Monday, 25 July 2011

Pakistani girl turns world’s youngest MCP qualified Proud Of Pakistan


STAFF REPORT-IBD: Umema Adil, 13, has won laurels for Pakistan with her extraordinary achievement of becoming the world’s youngest Microsoft Certified Professional (MCP) in Asp.Net.

She has recently passed the MCTS exam for Windows Applications Development, says a press release issued here last week.

Umema is a shining star who has made herself recognized in different fields through her talent. She is excellent in ‘naat’ recitation and has won a total of 60 certificates and shields including four times the City District’s All Karachi Naat Competition; twice the All Sindh Naat Competition, All Pakistan Naat Competition and recently Sindh Hamd-o-Naat Award.

A student of grade eight in Mama Parsi Girls’ School, Karachi, Umema has also won the Best Talent Award for her accomplishments as well as various singing competitions.

Saturday, 23 July 2011

createting calculator on JAVA using awt classes


import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
import ETextField;

public class AwtCalc extends java.applet.Applet implements ActionListener
{

private Button[] buttons = new Button[19];
private String[] buttonText = { " 1 ", " 2 ", " 3 ", " + ", " - ",
" 4 ", " 5 ", " 6 ", " x ", " / ",
" 7 ", " 8 ", " 9 ", "^ ", "sqrt",
" C ", " 0 ", " . ", " = "};

private ETextField result; // Calculator display screen
private String input = ""; // stores user input
private Label label;
private Color forecolor, // Calculator foreground color
backcolor, // Calculator background color
fieldcolor; // the display screen's color
private Font font,
buttonfont;
private int oper = 0, // stores the integer constants representing
oldoper = 0, // the operators
newoper = 0;
private double answer,
num1 = 0.0,
num2 = 0.0,
num3 = 0.0;
private final int ADD=1, // integer constants representing operators
SUB = 2,
MULT = 3,
DIVI = 4,
POW = 5,
SQRT = 6;
private boolean firstpress = true, //determines first button press
morenums = false, //"" if more numbers are being pressed
equals = false, //"" if equal button has been pressed
clearscreen = false, //clears screen
decnumber = false, //"" if a user entered a float
doubleclick = false; //"" if mouse was doubleclicked

public void init() {

font = new Font( "Courier", Font.ITALIC, 10 );
buttonfont = new Font( "Courier", Font.PLAIN, 12 );
setBackground( Color.lightGray );

//initialize colors

result = new ETextField( 125, 18 );
label = new Label( "AWT Calculator" );
setLayout( new FlowLayout() );

add( result );
add( label );

//initialize and add buttons
for ( int i = 0; i < 19; i++ ) {
buttons[i] = new Button( buttonText[i] );
buttons[i].setFont( buttonfont );
buttons[i].addActionListener( this );

if ( i <= 2 )
add( buttons[i] );
else if ( i >= 3 && i <= 7)
add( buttons[i] );
else if ( i >=8 && i <= 12 )
add( buttons[i] );
else if ( i >= 13 && i <= 17 )
add( buttons[i] );
else
add( buttons[i] );

if ( i == 2 )
add( new Label( " " ) );
else if ( i == 7 )
add( new Label( " " ) );
else if ( i == 12 )
add( new Label( " " ) );
else if ( i == 17 )
add( new Label( " " ) );

}
buttons[15].setForeground( Color.red );
result.setBackground( Color.white );
label.setFont( font );


}

//==============================================================================
// Interface method that determines which button was pressed then determines
// the appropriate action.
//==============================================================================
public void actionPerformed( ActionEvent e )
{

// "if" block is not entered if the button is an operator
if ( e.getSource() != buttons[3] && e.getSource() != buttons[4]
&& e.getSource() != buttons[8] && e.getSource() != buttons[9]
&& e.getSource() != buttons[13] && e.getSource() != buttons[14]
&& e.getSource() != buttons[15] && e.getSource() != buttons[18] ) {

if ( clearscreen ) { // clears screen if user enters number before an
clearScreen(); // operator after pressing equals
clearscreen = false;
}

if ( e.getSource() == buttons[0] ) {
input += "1"; // concoctenate "1" to input
result.setText( input );
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[1] ) {
input += "2"; // concoctenate "2" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[2] ) {
input += "3"; // concoctenate "3" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[5] ) {
input += "4"; // concoctenate "4" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[6] ) {
input += "5"; // concoctenate "5" to input
showAnswer( input );
} // end if

else if ( e.getSource() == buttons[7] ) {
input += "6"; // concoctenate "6" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[10] ) {
input += "7"; // concoctenate "7" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[11] ) {
input += "8"; // concoctenate "8" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[12] ) {
input += "9"; // concoctenate "9" to input
showAnswer( input );
} // end else if

else if ( e.getSource() == buttons[16] ) {
input += "0"; // concoctenate "0" to input
showAnswer( input );
} // end else if
else if ( e.getSource() == buttons[17] ) {
if ( decnumber == false ) {
decnumber = true;
input += ".0"; // concoctenate "." to input
showAnswer( input );
}
}
} // end if

// check if user entered the addition operator
if ( e.getSource() == buttons[3] ) {
clearscreen = false;
decnumber = false;
oper = ADD; // oper is set to addition
clickCheck( input ); // checks if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} // end if

// check if user entered the subtraction operator
else if (e.getSource() == buttons[4] ) {
clearscreen = false;
decnumber = false;
oper = SUB; // oper is set to subtraction
clickCheck( input ); // check if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} // end else if

// check if user entered the multiplication operator
else if (e.getSource() == buttons[8] ) {
clearscreen = false;
decnumber = false;
oper = MULT; // oper is set to multiplication
clickCheck( input ); // check if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} //end else if

// check if user entered the divide operator
else if (e.getSource() == buttons[9] ) {
clearscreen = false;
decnumber = false;
oper = DIVI; // oper is set to divide
clickCheck( input ); // check if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} // end else if

// check if user entered the exponential operator
else if ( e.getSource() == buttons[13] ) {
clearscreen = false;
decnumber = false;
oper = POW; // oper is set to exponential
clickCheck( input ); // check if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} // end else if

// check if user entered the square root operator
else if ( e.getSource() == buttons[14] ) {
clearscreen = false;
oper = SQRT; // oper is set to square root
clickCheck( input ); // check if user doubleclicked
if ( doubleclick == false )
processNumbers(); // if no double click continue to process
input = ""; // clear variable to store new input
} // end else if

// check if user entered the clear operator
if (e.getSource() == buttons[15] ) {
clearScreen();
} // end if

// check if user entered the equal operator
if (e.getSource() == buttons[18] ) {
equals = true;
clearscreen = true;
clickCheck( input ); //check if user double-clicked
if ( doubleclick == false )
processNumbers(); //continue to process numbers if
input = Double.toString( answer ); //if no double-click
} // end if

} // end actionPerformed()

//==============================================================================
//Method processNumbers is where processes the numbers inputed by the user
//==============================================================================
public void processNumbers() {

// the program enters this "if" block when an operator is pressed for the
// first time
if ( firstpress ) {

if ( equals ) {
num1 = answer; //answer is stored in num1 if user enters equal operator
equals = false; // equals is set to false to allow additional input
} // end if
else
num1 = Double.valueOf( input ).doubleValue(); // converts a string number to double

oldoper = oper; // store current operator to oldoper

// if operator is square root, calculation and output is done immediately
if ( oper == SQRT ) {
answer = calculate( oldoper, num1, 0.0 );
showAnswer( Double.toString( answer ) );
morenums = true;
}
firstpress = false; // no longer the first operator
} // end if

// "if" block is entered if now more than two numbers are being entered to
// be calculated
else if ( !morenums ) {

num2 = Double.valueOf( input ).doubleValue(); //converts second num to double
answer = calculate( oldoper, num1, num2 ); //calculate num1 and num2 with
showAnswer( Double.toString( answer) ); //the past operator
newoper = oper; //store current operator to
//new oper
if ( !equals )
morenums = true; //tells program that more than two numbers have
else { //entered
morenums = false; //if equal operator is pressed, firstpress
firstpress = true; //returns to true
} // end else
} // end if

// if more than two numbers are being inputted to calculate, this "if" block
// is accessed
else if (morenums) {

if ( equals ) {

newoper = oper;
morenums = false;
firstpress = true; // if equals is pressed set firstpress to false
} // end if

num3 = Double.valueOf( input ).doubleValue();
answer = calculate( newoper, answer, num3 );
showAnswer( Double.toString(answer) );

newoper = oper;
} // end else if
} // end processNumbers()

//==============================================================================
//Method calculate determines which operator was entered and calculates
//two numbers depending on the operator pressed
//==============================================================================
public double calculate( int oper, double number1, double number2 )
{
double answer = 0.0;

switch( oper ) {
case ADD:
answer = number1 + number2;
break;
case SUB:
answer = number1 - number2;
break;
case MULT:
answer = number1 * number2;
break;
case DIVI:
answer = number1 / number2;
break;
case POW:
answer = Math.pow( number1, number2 );
break;
case SQRT:
answer = Math.sqrt( number1 );
break;
} // end switch

return answer;
} // end calculate()

//==============================================================================
//Method showAnswer outputs the results in the calculators displays screen
//==============================================================================
public void showAnswer( String s )
{
double answer;

answer = Double.valueOf(s).doubleValue();
if ( decnumber )
result.setText( Double.toString(answer) );
else
result.setText( s ); //all output are displayed as integers at start

} // end showAnswer

//==============================================================================
//Method clickCheck determines if the user double clicked and returns a boolean
//value. If doubleclick is true, the program ignores the input
//==============================================================================
public boolean clickCheck( String s ) {
if ( s == "" )
doubleclick = true;
else
doubleclick = false;

return doubleclick;
}

//==============================================================================
//Method clearScreen clears calculator display screen and sets variables to
//default.
//==============================================================================
public void clearScreen()
{
oper = 0; // reinitialize variables to default
input = "";
answer = 0;
decnumber = false;
morenums = false;
firstpress = true;
equals = false;
showAnswer( Integer.toString( (int)answer) );
}

public void paint( Graphics g )
{
//draw border
g.drawRect( 0, 0, size().width - 1, size().height - 1 );
g.drawLine( 0, 0, 0, size().height );
}
} // end program

checking data on sql through win form weather entry is added or failed or no double entry


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication8
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int flag = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection conn = new SqlConnection("server=WEBNET;database=scott;user=sa;password=aptech");
                conn.Open();
                string select = "select * from reg";
                SqlCommand comm = new SqlCommand(select, conn);
                SqlDataReader dr = comm.ExecuteReader();
                while (dr.Read())
                {
                    if (dr["rollno"].ToString() == textBox1.Text)
                    {
                        MessageBox.Show("Record already exists");
                        flag = 1;
                    }
                }
                if (textBox1.Text.Equals("") || textBox2.Text.Equals("") || textBox3.Text.Equals("") || textBox4.Text.Equals(""))
                {
                    MessageBox.Show("values cannot be empty");
                }
                else if(flag==0)
                {
                    string insert;
                    insert = "insert into reg values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')";
                    SqlCommand comm1 = new SqlCommand(insert, conn);
                    flag = 0;
                    dr.Close();
                    comm1.ExecuteNonQuery();
               
               
               
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Occured");
            }
        }
       
    }
}

C# Sharp WinForm , SqlServer Adding Data Through Textbox, Radio button,Massage box


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string gender;
           
            if (radioButton1.Checked)
            {
                gender = radioButton1.Text.ToString();
            }
            else
            {
                gender = radioButton2.Text.ToString();
            }
            SqlConnection cn = new SqlConnection("server=LAB2-86;database=studentsdb;user=sa;password=aptech");
       
            string insert;
            insert = "insert into db values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + gender + "')";
            SqlCommand sc = new SqlCommand(insert, cn);
            cn.Open();
            if (MessageBox.Show("Do want to insert record? ", "Winform", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
            {
                sc.ExecuteNonQuery();
            }
            string select = "select * from db";
            SqlDataAdapter da = new SqlDataAdapter(select, cn);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dataGridView1.DataSource = dt;
            cn.Close();
        }
    }
}

data grid view export data to exel


private void Excel_Click(object sender, EventArgs e)
>         {
>             if (dataGridView1.Rows.Count != 0)
>             {
>                 SaveFileDialog sfd = new SaveFileDialog();
>                 sfd.Filter = "Microsoft Excel 97/2000/XP(*.xls)|
> *.xls";
>                 sfd.FileName = "Report.xls";
>                 if (sfd.ShowDialog() == DialogResult.OK)
>                 {
>                     StreamWriter wr = new StreamWriter(sfd.FileName);
>
>                     int cols = dataGridView1.Columns.Count;
>                     for (int i = 0; i < cols; i++)
>                     {
>
> wr.Write(dataGridView1.Columns[i].Name.ToUpper() + "\t");
>                     }
>
>                     wr.WriteLine();
>
>                     for (int i = 0; i < (dataGridView1.Rows.Count -
> 1); i++)
>                     {
>                         for (int j = 0; j < cols; j++)
>                         {
>
> wr.Write(dataGridView1.Rows[i].Cells[j].Value + "\t");
>                         }
>                         wr.WriteLine();
>                     }
>                     wr.Close();
>                     label9.Text = "Your file has been successfully
> saved !";
>                 }
>             }
>             else
>             {
>                 MessageBox.Show("Error");
>             }
>         }

Another C# Sharp WinForm With Massage Box Creating Connection To SqlServer adding,delete,update Data Through Textbox


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=WEBNET;database=myfirstdb;user=sa;password=aptech");
            string insert;
            insert = "insert into employee values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "' )";
            SqlCommand cm = new SqlCommand(insert,cn);
            cn.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Record added succesfully");
            cn.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=WEBNET;database=myfirstdb;user=sa;password=aptech");
            string delete;
            delete = "delete from employee where empno='" + textBox1.Text + "' ";
            SqlCommand cm = new SqlCommand(delete, cn);
            cn.Open();
            cm.ExecuteNonQuery();
            cn.Close();


 private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection cn = new SqlConnection("server=LAB2-80;database=myfirstdb;user=sa;password=aptech");
            string update;
            update = "update emp set empno='"+textBox1.Text+"',name='"+textBox2.Text+"',location='"+textBox3.Text+"' where empno='"+textBox1.Text+"' ";
            SqlCommand cm = new SqlCommand(update, cn);
            cn.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Record updated succesfully");
            cn.Close();
        }



        }
    }
}

C# Sharp WinForm Ceating Connection To SqlServer adding,delete,update Data Through Textbox


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace mydatabase
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string insert = "insert into Students values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";
            SqlCommand cm = new SqlCommand(insert, sc);
            sc.Open();
            //cm.ExecuteNonQuery();
            try
            {
                cm.ExecuteNonQuery();
                MessageBox.Show("Data Insert Successfully");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            sc.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string delete = "delete from Students where std_ID=('" + textBox1.Text + "')";
            SqlCommand cm = new SqlCommand(delete, sc);
            sc.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Data Delete Successfully");
            sc.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection sc = new SqlConnection("Server=LAB2-86;Database=ApStudents;user=sa;password=aptech");
            string update = "update Students set std_ID='" + textBox1.Text + "',S_Name='" + textBox2.Text + "',S_Address='" + textBox3.Text + "' where std_ID='" + textBox1.Text + "' ";
            SqlCommand cm = new SqlCommand(update, sc);
            sc.Open();
            cm.ExecuteNonQuery();
            MessageBox.Show("Data Update Successfully");
            sc.Close();
        }
    }
}

some logic building question code

Question1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int age;
            int a, b, c;
            Console.WriteLine("Enter your Current Age");
            age= Convert.ToInt32(Console.ReadLine());
            if (age < 18)
            {
                Console.WriteLine("You are a Child");
            }
            else if (18 <=age)
            {
                Console.WriteLine("You are Adult");
            }
            else
            {
                 Console.WriteLine("You are a Child");
            }
            Console.ReadKey();
        }
    }
}



Question2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
          
            for (a = 1; a <=100 ;a++ )
            {
                if (a % 2 !=0 && a % 3 != 0 && a % 5 != 0)
                {
                 
                    Console.WriteLine("{0}",a);
                }

            }
            Console.ReadKey();
        }
    }
}



Question3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            for (a = 0; a <= 255; a++)
            {
                Console.WriteLine("{0} --->{1}", a,Convert.ToChar(a));


            }
            Console.ReadKey();
        } 
    }
}



Question4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            int b;
           int c;
            Console.WriteLine("what your want to do *,+,-,/  select one");
            c = Convert.ToChar(Console.ReadLine());
            Console.WriteLine("Enter First Number");
            a = Convert.ToInt32(Console.ReadLine());
    

            Console.WriteLine("Enter Second Number");
            b = Convert.ToInt32(Console.ReadLine());
            switch (c)
            {
                case '*':
                    c = a * b;
                    Console.WriteLine("The Mul of a and b {0}", c);
                    break;
                case '+':
                    c = a + b;
                    Console.WriteLine("The sum of a & b {0}", c);
                    break;
                case '-':
                    c = a - b;
                    Console.WriteLine("The difference of a & b {0}", c);
                    break;
                case '/':
                    c = a / b;
                    Console.WriteLine("The quotient of a & b {0}", c);
                    break;
            }
            Console.ReadKey();

        }
    }
}


Question5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            int b;
            
            Console.WriteLine("Enter Number for Table");
            a = Convert.ToInt32(Console.ReadLine());
            for (b = 1; b <= 10; b++)
            {
               
                Console.WriteLine("{0}X {1}={2}",a, b,a*b);
            }
            Console.ReadKey();
        }
    }
}


radio button with sqldata


 private void button1_Click(object sender, EventArgs e)
        {
            string gender;
            if (radioButton1.Checked)
            {
                gender = radioButton1.Text.ToString();
            }
            else
            {
                gender = radioButton2.Text.ToString();
            }
            SqlConnection cn = new SqlConnection("server=WEBNET;database=scott;user=sa;password=aptech");
            string insert;
            insert = "insert into student values('" + textBox1.Text + "','" + textBox2.Text + "','" + gender + "')";
            SqlCommand comm = new SqlCommand(insert, cn);
            cn.Open();
            if (MessageBox.Show("Do want to insert record? ","Winform",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning)==DialogResult.OK)
            {
                comm.ExecuteNonQuery();
            }
                cn.Close();
        }

salary calculator


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int mon,tues,wed,thurs,fri;
            int twhour, salrary;
            int ovtime;

            Console.WriteLine("working hour of monday");
            mon = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of tuesday");
            tues = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of wedday");
            wed = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of thursday");
            thurs = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("working hour of friday");
            fri = Convert.ToInt32(Console.ReadLine());

            twhour = mon + tues + wed + thurs + fri;
            Console.WriteLine("the total working hour is {0}",twhour);

            salrary = twhour * 500;
            Console.WriteLine("the total salary is {0} $", salrary);

            if(twhour>40)
            {
                ovtime = twhour - 40;
                Console.WriteLine("over time hour are{0} ",ovtime);
            }
            Console.ReadKey();
        }
    }
}

Sunday, 10 July 2011

Website of board of revenue Sindh hacked


Karachi: The Website of Board of Revenue Sindh has been hacked. The website has been hacked by a group named MMA.

The hackers have not been able to hack the website completely.

Tuesday, 28 June 2011

JAX Innovation Awards 2011: Of Java

JAX Innovation Awards 2011: The Winners are...

Tonight at JAXconf 2011, the great journey of the JAX Innovation Awards nomination and voting process came to its conclusion at the Awards ceremony in the Hilton Convention Center, San Jose. After an intensive 3 month program of nominations, judging and community votes, which saw thousands of votes cast, the Awards were presented by judging panel chair, Sebastian Meyen, and Mark Hazell, of organizers S&S Media.

The JAX Innovation Awards recognized and rewarded the excellence and innovation across the Java Ecosystem, with 3 categories determined by community voting.

So, as the famous saying goes, the winners are:
Most Innovative Java Technology - JRebel 
Most Innovative Java Company – Red Hat 
Top Java Ambassador – Martin Odersky
Jevgeni Kabanov, founder and CTO of Zero Turnaround, the company behind JRebel, expressed his thanks to the communities for nominating and voting for JRebel as Most Innovative Java Technology.
Accepting his award via video link, Top Java Ambassador winner Martin Odersky said, “It is a great honour to be made Top Java Ambassador. I see it as recognition of 16 years of passionate work, first around Java, then around Scala, in which my goal has always been to blend functional programming methods in a smooth way into the Java environment.”


The presenters were joined on stage by Dan Allen, of Red Hat, to accept the Most Innovative Java Company Award.
Additionally, the Jury‘s Special Award goes to Brian Goetz. Sebastian Meyen pronounced the official Jury statement, stressing that Brian Goetz has demonstrated that he will not rest on the laurels of Java’s past success, but will elevate Java to the next level going forward. Brian deserves this award because of the impact of his work, which will ripple far and wide through the community.

The JAX Innovation Awards 2011 were announced back in March and, after a period of community nominations, deliberation by a panel of independent Java experts, and a final round of community voting, we would like to congratulate the winners of each category: JRebel, Red Hat, Martin Odersky and Brian Goetz. We would also like to thank everyone who nominated, voted and took part in the JAX Innovation Awards 2011, and helped to make the Awards such a success.

Java Tech Journal: The free PDF magzine

JTJ - 2011 - 05Not only is Java the world's number one programming language, but it also provides the backbone to a rich and complex ecosystem of tools and projects. With such a diverse community relying on Java, a major update is always going to be a tricky business - stability and backwards compatibility are big issues, and there's no shortage of contrasting ideas about what should be included in a new release of Java. Sun once estimated that it takes around 18 months to evaluate and approve proposals for changes to Java (and that's before you factor in the time it takes to build, test and release the change.) There's no such thing as a quick Java release, but Java 7 has taken longer than most: in 2007, the Java in Production blog gave 2009 as an approximate launch date. This delay is in no small part due to the acquisition of Sun by Oracle. The original Java 7 roadmap was masterminded by Sun Microsystems, before the legal wranglings (largely centred around MySQL) turned the acquisition of Sun by Oracle into a near-twelve-month battle. It's hardly surprising Java 7 has been a long time coming. Things finally came to a head with the proposal of Plan B. This put forward the idea of releasing JDK 7 in 2011, minus Lambda, Jigsaw, and part of Coin, as oppose to waiting until 2012 and delivering JDK7 with all of the initially planned features. Ultimately, the community and Oracle opted for a quicker update, with less features, which means we'll have to wait until 2012 and Java 8 to get our hands on lambda expressions, literal expressions for immutable lists, sets, and maps, and other deferred features. Although the open debate regarding Java 7 language features is a prime example of an open community in action, the Plan A vs. Plan B debate (and the eventual outcome) highlighted the average Java users' frustration at the language's pace of change. It's been a long wait, but Java 7 is almost here! NetBeans 7 is already available with support for the Java SE Java Development Kit 7, and the latest 10.5 release of IntelliJ IDEA offers full Java 7 support. With Oracle recently announcing that the Java Development Kit 7 will be generally available on July 28, 2011, and work already underway for Java EE 7 and Java SE 8, this is an exciting time for Java! Not to mention JCP.next JSR 1 and JCP.next JSR 2, which Oracle have already submitted to “update and revitalise” the JCP: often criticised as one of the major bottlenecks when it comes to moving Java forward. In this issue, we scrutinise the new features of Java 7, ask how relevant they will be to your typical Java developer, and look at Java 7 support in IntelliJ IDEA. Has the long wait been worth it? Read on to find out!
click the pic to get free pdf file to read the whole story.!!!!!

Sunday, 26 June 2011

What Makes a Password Stronger


For all its benefits, the Internet can be a hassle when it comes to remembering passwords for email, banking, social networking and shopping.
Many people use just a single password across the Web. That's a bad idea, say online-security experts.
"Having the same password for everything is like having the same key for your house, your car, your gym locker, your office," says Michael Barrett, chief information-security officer for online-payments service PayPal, a unit of eBay Inc.

Mr. Barrett has different passwords for his email and Facebook accounts -- and that's just for starters. He has a third password for financial websites he uses, such as for banks and credit cards, and a fourth for major shopping sites such as Amazon.com (Nasdaq: AMZN - News). He created a fifth password for websites he visits infrequently or doesn't trust, such as blogs and an online store that sells gardening tools.
A spate of recent attacks underscores how hackers are spending more time trying to crack into big databases to obtain passwords, security officials say. In April, for instance, hackers obtained passwords and other information of 77 million users in Sony Corp.'s (NYSE: SNE -News) PlayStation Network, while Google Inc. (Nasdaq: GOOG - News) said this month that hackers broke into its email system and gained passwords of U.S. government officials.
So-called brute force attacks, by which hackers try to guess individual passwords, also appear to be on the rise, Mr. Barrett says.
PayPal says two out of three people use just one or two passwords across all sites, with Web users averaging 25 online accounts. A 2009 survey in the U.K. by security-software company PC Tools found men to be particularly bad offenders, with 47% using just one password, compared with 26% of women.
Another PC Tools survey last year showed that 28% of young Australians from 18 to 38 years old had passwords that were easily guessed, such as a name of a loved one or pet, which criminals can easily find on Facebook or other public sites. Other passwords can be easily guessed, too. Hackers last year posted a list of the most popular passwords of Gawker Media users, including "password," "123456," "qwerty," "letmein" and "baseball."
"If your password is on that list, please change it," says Brandon Sterne, security manager at Mozilla Corp., which makes the Firefox browser and other software. Hackers "will take the first 100 passwords on the list and go through the entire user base" of a website to crack a few accounts, he says.
People typically start changing online passwords after they've been hacked, says Dave Cole, general manager of PC Tools. However, "after a relatively short time, all but the most paranoid users regress to previous behaviors prior to the security breach," he says. He and other security experts recommend people change or rotate passwords a few times a year.
To come up with a strong password, some security officials recommend taking a memorable phrase and using the first letter of each word. For example, "to be or not to be, that is the question," becomes "tbontbtitq." Others mash an unlikely pair of words together. The longer the password -- at least eight characters, experts say -- the safer it is.
Once people figure out a phrase for their password, they can make it more complex by replacing letters with special characters or numbers. They can also capitalize, say, the second character of every password for added security. Hence "tbontbtitq" becomes "tB0ntbtitq."
No matter how good a password is, it is unsafe to use just one. Mr. Barrett recommends following his lead and having strong ones for four different kinds of sites -- email, social networks, financial institutions and e-commerce sites -- and a fifth for infrequently visited or untrustworthy sites.
Even the strongest passwords, however, are useless if criminals install so-called malware on computers that allow them to track a person's keystrokes. Security experts say people can avoid this by keeping their antivirus and antispyware software updated and by avoiding downloading files from unknown websites and email senders.
Some security experts recommend slightly modifying passwords within each category of site. Companies such as Microsoft Corp. (Nasdaq: MSFT - News) offer free password-strength checkers, but users shouldn't rely on them wholly because such strength tests don't gauge whether a password contains easily found personal information, such as a birthday or a pet's name.
It's especially important to have a separate password for an email account, says Mozilla's Mr. Sterne. Many sites have "Forgot my password" buttons that, when clicked, initiate a password-recovery process by email. Hackers who break into an email account can then intercept those emails and take control of each account registered using that address.
Some websites, such as Google and Facebook, now let people register a phone number along with their account. If a person forgets his passwords, the sites reset the passwords by calling or sending a text message to that person.
Mr. Barrett says people should be able to remember four or five good passwords. If not, they can write them down on a piece of paper and stick it in their wallet, and then throw the cheat sheet away once all the passwords are memorized.
People who still struggle to remember them all can use a password manager. Several, such as LastPass, are free. LastPass prompts users to create a master password and then generates and stores random passwords for different sites. Some security experts warn against using managers that store passwords remotely, but LastPass Chief Executive Joe Siegrist says hackers can't access the passwords because all data is encrypted.
The worst thing that people can do after creating their different passwords: Put it on a sticky note by their monitor. "That defeats the entire purpose," says Mr. Sterne.
Heather O'Neill, a 27-year-old tech-company employee in San Francisco, had her Google email account broken into earlier this year. She says she used the same password for several sites, and that it was a weak one.
"I can't have one password for everything," she says. "Everything is going to be different."