Wednesday, March 4, 2015

Configure BeyondCompare in SVN

Hi Friends,

Here by I am giving the steps to configure the Beyond compare tool in SVN, this will helps us to see the difference of files in BeyondCompare tool which is very user friendly.



Friday, October 4, 2013

NP++ get the search result back

If you close the search result in notepad ++ by automatically,
no need worry or search again, just press F7 to get the result back :)

-girishlc

Wednesday, August 15, 2012

Thursday, December 22, 2011

Finding sizeof structure without using sizeof operator


//FIND OUT THE SIZE OF STRUCTURE WITHOUT USING sizeof OPERATOR
#include<stdio.h>

struct str
{
  int a;
  char d;
  int c;
};


int main()
{
  struct str a, b;
  struct str *pt, *qt;
  int size;

  pt = &a;
  qt = &b;

  size = (void*)pt-(void*)qt;

  printf("Size of struct = %d\n", size);

  return 0;
}

Friday, December 16, 2011

XOR ed value handling

In case encryption is done using xor, if you print/store these value in xml using %s then you may get wrong value; since there might be having non-printable chars,
to handle this kind of issue use character by character value to convert into equal integers using %d.
 enc_data[i] = src[i]^src[j];        // ENCRYPTING USING XOR

void xor_rev(char *src, int *enc_data)
{
  int i = 0, j, len;

  len = strlen(src);
  j = len - 1;

  for(i, j; i < len; ++i,--j)
    {
    enc_data[i] = src[i]^src[j];        // ENCRYPTING USING XOR
    }
  enc_data[i] = '\0';
}

void xor_test(int *enc_data, char *result)
{
  int x, y, len;

  len = strlen(src);

  printf("\nResult is \n");             //REMOVE LATER
  for(y = len-1, x = 0; y >=0 ; --y, ++x)
  {
    result[x]=src[y]^enc_data[x];
    printf("%c", result[x]);
  }
  printf("\n");
}