Monday, October 1, 2012

Shutdown option missing from the Start Menu and Ctrl+Alt+Del dialog box

To resolve the issue, perform the following:
 
Click Start, Run.
Type gpedit.msc and click OK.
Navigate to the following path:
 
User Configuration\Administrative Templates\Start Menu and Taskbar 
 
Double-click "Remove and Prevent Access to the Shut Down command"
Select "Not configured" or "Disabled"
Close Group Policy window.

Friday, December 10, 2010

css resource

Free CSS | Free CSS Templates, Open Source CSS Templates and CC CSS Templates

http://www.free-css.com/

421 Sorry, cleartext sessions are not accepted on this server.

need to use TLS. Try to preceed your server host name with ftpes://, like ftpes://example.org .

Monday, November 22, 2010

how to get multiple checkbox value in php

 if (isset($_POST['fieldname'])) {  $names = $_POST['fieldname'];  }

               foreach ($names as $value )
                       {
                         echo "$value" ;
                       }

Thursday, November 11, 2010

datagridview control column row programitically

 Adding datagridview column row programitically And button control .


private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                MessageBox.Show((e.RowIndex + 1) + "  Row  " + (e.ColumnIndex + 1) + "  Column button clicked ");
            }
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            dataGridView1.ColumnCount = 3;
            dataGridView1.Columns[0].Name = "Product ID";
            dataGridView1.Columns[1].Name = "Product Name";
            dataGridView1.Columns[2].Name = "Product Price";

            string[] row = new string[] { "1", "Product 1", "1000" };
            dataGridView1.Rows.Add(row);
            row = new string[] { "2", "Product 2", "2000" };
            dataGridView1.Rows.Add(row);
            row = new string[] { "3", "Product 3", "3000" };
            dataGridView1.Rows.Add(row);
            row = new string[] { "4", "Product 4", "4000" };
            dataGridView1.Rows.Add(row);

            DataGridViewButtonColumn btn = new DataGridViewButtonColumn();
            dataGridView1.Columns.Add(btn);
            btn.HeaderText = "Click Data";
            btn.Text = "Click Here";
            btn.Name = "btn";
            btn.UseColumnTextForButtonValue = true;

            DataGridViewButtonColumn btn1 = new DataGridViewButtonColumn();
            dataGridView1.Columns.Add(btn1);
            btn1.HeaderText = "Click Data";
            btn1.Text = "Click Here";
            btn1.Name = "btn";
            btn1.UseColumnTextForButtonValue = true;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {


                string rup = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();

                if (rup == "Click Here")
                {
                    MessageBox.Show("this is test");
                }
               
                MessageBox.Show((e.RowIndex + 1) + "  Row  " + (e.ColumnIndex + 1) + "  Column button clicked ");
            }
        }

c# connecting mysql and select ,insert ,delete

The MySQL Connector/Net allows you to create a graphical Windows application that is data-based. When your application runs, it must connect to a MySQL database. To support this connection, you can use the MySqlConnection class that is defined in the MySql.Data.MySqlClient namespace. Before using this class, you can first include that namespace in your file.

How to include :
1. Add Reference
2. Browse
3. Select File 'MySql.Data.dll'
at
C:\Program Files\MySQL\MySQL Connector Net
1.0.3\bin.\NET 1.1
4. You put code
using MySql.Data.MySqlClient;

Create a connection with mysql database :

MySqlConnection conn = new MySqlConnection("Network Address=localhost;" + "Initial Catalog='test';"   +"Persist Security Info=no;" + "User Name='root';" + "Password=''");

After creating a connection string, to apply it and actually establish the connection, you must call the MySqlConnection.Open(). Its syntax is:
public void Open();
 
As you can see, this method doesn't take any argument. 
The MySqlConnection object that calls it is responsible 
to get the connection string ready. If the connection 
fails, the compiler would throw a MySqlException exception. 
If the connection string doesn't contain a data source or 
server, the compiler would throw an  
InvalidOperationException
exception. 
After using a connection and getting the necessary information from it, you should terminate it. To close a connection, you can call the MySqlConnection.Close() method. Its syntax is:

public void Close();


This method is simply called to close the current connection. While you should avoid 
calling the Open() method more than once if a connection is already opened, you can 
call the Close() method more than once.


 Select Data : 

 To read data from a mysql table add following code under a button . 


MySqlConnection conn = new MySqlConnection("Network Address=localhost;" + "Initial Catalog='test';" +"Persist Security Info=no;" +
                                                                "User Name='root';" +
                                                                "Password=''");

            MySqlCommand command = conn.CreateCommand();
            MySqlDataReader Reader;
            command.CommandText = "select name from student where id='1'";
            conn.Open();
            Reader = command.ExecuteReader();
            while (Reader.Read())
            {
                string thisrow = "";
                for (int i = 0; i < Reader.FieldCount;i++)
                    thisrow += Reader.GetValue(i).ToString() + ",";
                MessageBox.Show(thisrow);
            }
            conn.Close();







 Insert Data: 



 MySqlConnection conn = new MySqlConnection("Network Address=localhost;" + "Initial Catalog='test';" + "Persist Security Info=no;" +  "User Name='root';" +"Password=''");

            conn.Open();

            MySqlCommand command = conn.CreateCommand();

            command.CommandText = "insert into student(name,address)values('sanjoy','kaunia')";

            MySqlDataReader result = command.ExecuteReader();

            MessageBox.Show("successfully inserted");

            result.Close();

            conn.Close();






Delete Data:



MySqlConnection conn = new MySqlConnection("Network Address=localhost;" + "Initial Catalog='test';" + "Persist Security Info=no;" +
                                                                "User Name='root';" +
                                                                "Password=''");

            conn.Open();

            MySqlCommand command = conn.CreateCommand();

            command.CommandText = "delete from student where id='1'";

            MySqlDataReader result = command.ExecuteReader();

            MessageBox.Show("successfully deleted");

            result.Close();

            conn.Close();
       

Tuesday, November 9, 2010

c implementation order n square

#include    //Header File

#include      //Header File


int main()
{
 clrscr();

 int A[100];
  int tempnum ; 

 for(int i=0;i<100;i++)
 {
  A[i]=i;
 }

 A[10]=5;
 A[15]=50;



 for(int k=0; k<100;k++)
 {
   tempnum=A[k] ;
  for(int j=k+1;j<100;j++)
  {
   if(tempnum==A[j]) cout << A[j] << "\n" ;
  }

 }

getche();
return 0;
}

Example order n in c programming

#include    //Header File

#include      //Header File


int main()
{
 clrscr();

 int A[100];

 int Temp[100];




 for(int i=0;i<100;i++)
 {
  A[i]=i;
 }

 A[10]=5;
 A[15]=50;



 for(int k=0; k<100;k++)
 {
  Temp[k]=0;
 }

 for (int j=0;j<100;j++)
 {

  Temp[A[j]]=Temp[A[j]]+1;
 }



  for (int m=0;m<100;m++)
 {
   if(Temp[m]>=2) cout<< "\n\n" << A[m] ;
 }


getche();
return 0;
}

Radix sort using c pointer

#include 
#include 
#include 

void radix(int a[],int n,int m)
{
typedef struct node
{
int data;
struct node * next;
}NODE;

NODE * ptr,*start,*prev;
NODE *front[10], *rear[10];
int k=1,i,j,y,p;;
/*creating initial linked list*/
start=NULL;
for(i=0;i< n;++i)
{
ptr=(NODE *)malloc(sizeof(NODE));
ptr->data=a[i];
ptr->next=NULL;
if(start==NULL)
start=ptr;
else
prev->next=ptr;
prev=ptr;
}

/*radix sort*/
for(i=1;i<=m;i++)
{
for(j=0;j<10;j++)
front[j]=NULL;
/*placing elements into queues*/
ptr=start;
while(ptr!=NULL)
{y=ptr->data/k %10;/*y is the digit*/
if(front[y]==NULL)
{
front[y]=ptr;
rear[y]=ptr;
}
else
{
rear[y]->next=ptr;
rear[y]=ptr;
}

ptr=ptr->next;
}

start=NULL;
for(j=0;j< 10;++j)
if(front[j]!=NULL)
{
if(start==NULL)
start=front[j];
else rear[p]->next=front[j];
p=j;
}
rear[p]->next=NULL;
k=k*10;
}
/*copying back to array*/
ptr=start;
for(i=0;i< n;++i,ptr=ptr->next)
a[i]=ptr->data;

}

void main()
{
int a[100],n,i,m;
char temp;
do
{
clrscr();
printf("===========================RADIX SORT=
==========================================\n");
printf("ENTER NUMBER OF NUMBERS AND NUMBER OF DIGITS\n");
scanf("%d%d",&n,&m);
printf("ENTER ELEMENTS\n");
for(i=0;i< n;++i)
scanf("%d",&a[i]);
radix(a,n,m);
printf("SORTED LIST\n");
for(i=0;i< n;++i)
printf("%d ",a[i]);
printf("\nDO YOU wish to continue?[y/n]\n");
scanf("%c",&temp);


}while(temp=='y'|| temp=='Y');
printf("\n-------------------------------------
--------------------------------------------\n");
getch();
}

Radix sort algorithm implementation in c using counting sort

/* radix sort */

#include 
#include 
#include  

#define LEN  72 /* maximum string length */
#define K  256 /* number of possible characters */
//#define MAX_STRINGS 50



void counting_sort (unsigned char *A[], 
unsigned char *B[], int n, int h) {
 int  C[K];
 int  i, j;

 for (i=0; i
 /* all counts are now zero */

 for (j=0; j

 /* C[i] is number of times character i occurs */

 for (i=1; i
 /* C[i] is number of times i or less occurs */

 for (j=n-1; j>=0; j--) {

  /* place elements in the array from largest to smallest */
  /* -1 is because arrays start out at 0 in C */

  B[C[A[j][h]]-1] = A[j];
  C[A[j][h]]--;
 }
}

/* this radix sort sorts the n pointers to strings 
of size d in the array A
 * by the strings they point to.
 */
void radix_sort (unsigned char *A[], int n, int d) {
 int  i, j;
 unsigned char *B[50];

 /* we're assuming here that digit 0 is the highest order digit,
  * like in real life, not like in the book
  */
 for (i=d-1; i>=0; i--) {

  /* stable sort A into B */

  counting_sort (A, B, n, i);

  /* copy the results back into A */

  for (j=0; j }
}


/* main program */

int main () {
 unsigned char A[50][5+1],
   *Ap[50],s[50];
 int  i, n;

        clrscr() ; 

 /* get a bunch of strings into the array A */

 for (n=0;n<8;n++) {
  gets (s);
  if (feof (stdin)) break;

  /* make sure the string is no longer than LEN */

  s[LEN] = 0;

  /* make sure the string is no shorter than LEN */

  while (strlen(s)

  /* put the string into the next position in A */

  strcpy (A[n++],s);
 }

 /* make Ap an array of pointers to the strings in A */

 for (i=0; i
 /* sort the pointers */

 radix_sort (Ap,n,LEN);

 /* print them out */

 for (i=0; i

 getch() ; 

 return 0 ;
}

Marge sort algorithgm c implementation

#include
#include
#include

int *a;

merge(int p,int q,int r)
{
  int n1,n2,i,j,k;
  int *L,*R;
  n1=q-p+1;
  n2=r-q;
  L=(int*)malloc(sizeof(int)*(n1+2));
  R=(int*)malloc(sizeof(int)*(n2+2));
  for(i=1;i<=n1;i++)
  L[i]=a[p+i-1];
  for(j=1;j<=n2;j++)
  R[j]=a[q+j];
  L[n1+1]=-1;
  R[n2+1]=-1;
  i=1;
  j=1;
  for(k=p;k<=r;k++)
  {
  if(L[i]<=R[j]&&L[i]!=-1)
  {
   a[k]=L[i];
   i++;
  }
  else
  {
   if(R[j]!=-1)
   {
    a[k]=R[j];
    j++;
   }
   else
   {
    while(L[i]!=-1)
    {
     a[k]=L[i];
     i++;
     k++;

    }
   }
  }

  }
  free(L);
  free(R);
}

merge_sort(int p,int r)
{
  int q;
  if(p
  {
  q=(p+r)/2;
  if((p+r)%2==0)
   q=q-1;
  merge_sort(p,q);
  merge_sort(q+1,r);
  merge(p,q,r);
  }
}

void main()
{
 clrscr();
 int i,j,k,p,r;
 printf("How many numbers : ");
 scanf("%d",&i);
 a=(int*)malloc(sizeof(int)*(i+1));
 printf("\nEnter the numbers : ");
 for(k=1;k<=i;k++)
 {
  scanf("%d",&j);
  a[k]=j;
 }
 p=1;
 r=i;
 merge_sort(p,r);
 printf("\nSorted list is :   ");

 for(k=1;k<=i;k++)
  printf("   %d",a[k]);

 free(a);
 getch();
}

Tuesday, October 12, 2010

Some website designing neccessary thing

25+ Useful Javascript Tab Navigation Scripts

Nifty Corners: rounded corners without images

http://www.noupe.com/css/47-excellent-ajax-css-forms.html

Publish Post

mylittleadmin user datbase Error : url that was requested not exits

Few  days ago i was working in SQL Server . I wanted to upload aspx website to server .

when i went to create database for that project . i was getting error when i click in user database .

Url that  was requested not exits
Also no query window was showing me from tools . throwing

Message :  time out session . 


Solution for this problem : check database user server role from security and make server role . sysadmin ,dbcreator

you can get ride of this type of error .

Friday, October 8, 2010

5 great freelance sites for developers

http://www.rawseo.com/news/2009/06/04/5-great-freelance-sites-for-developers/

here is some of the freelance website list .