## My Professional Profile

I am Johnson Augustine Sr.Software Engineer and System Architect. I have 10 Yrs of hands on expertise in ASP.net MVC 5 , Angular 5 , C# MVC Razor, WPF MVVM , Android , IOS Swift 3 , IOS11 MSSQL,MySQL Database,,PHP,C/C++/Visual C++/G++/QT++,Com,DirectX,Open CV,EMGU CV , embedded System Development , [Raspberry PI]. ,html,Javascript,Jquery,Ajax.CSS , Networking ,Cyber security, Ethical Hacking You can see my professional profile at http://linkedin.com/in/johnsontaugustine Email : johnsonaugustine@live.com

## Friday, 25 January 2013

### Two lightbox jquery image slide shows overlapping each other

Two light box jquery image slide shows overlapping each other Why?

It is due to the light box version , some of the .js files are conflicting each other , to overcome this problem
just insert z-index as a  factor of 1000

eg : z-index:10001

Will solve the problem

## Saturday, 19 January 2013

### What is Lychrel Numbers?

This site is about a set of numbers that do not form a palindrome through the process of reversing and adding their digits. These numbers have become known as "Lychrel Numbers".

Eg 196

### Find the occurances of similar digits using C

Logic

int contains_repeat(int x)
{
int occurances = 0;
while(x>0)
{
if(occurances & 1 << (x % 10)) return 1;
occurances |= 1 << (x % 10);
x = x / 10;
}
return 0;
}

### Next Palindrome number using c

#include <stdio.h>
#include <math.h>
#define TRUE 1

int main()
{
long n, t, r = 0, c, d;

printf("Enter an integer\n");
scanf("%ld", &n);    /* n must be a natural number */

while (TRUE)
{
n++;
t = n;

/* Calculating reverse of number */

while(t)
{
r *= 10;  /* Compound assignment operator r*=10 => r=r*10 */
r += t%10;
t /= 10;
}

/* if reverse equals original then it is palindrome */

if (r == n)
{
d = (int)sqrt(n);

/* Checking prime */

for (c = 2; c <= d; c++)
{
if (n%c == 0)
break;
}
if (c == d+1)
break;
}
r = 0;
}

printf("%ld\n",n);

return 0;
}

### C Development

Write a program that accepts a rupee amount(less than one thousand) and computes the number of HUNDRED, FIFTY, TWENTY, TEN, FIVE, TWO  and ONE rupee currencies needed for that amount. Your solution must use the *fewest* number of currencies that are possible for the given rupee amount.
[You may assume that the input is an integer amount greater than 0.]

Eg. Input : 346

Output : HUNDRED-3, TWENTY-2, FIVE-1, ONE-1

Code : by Johnson

#include<stdio.h>
#include<conio.h>
void main()
{
int c,c1,changes[7],a[7]={100,50,20,10,5,2,1},i=0;
clrscr();
printf("Enter amount ");
scanf("%d",&c);
while(c>0)
{
c1=c;
c=c%a[i];
changes[i]=(c1-c)/100;
i++;
}

for(j=0;j<7;j++)
{
if(changes[j]>0)
{
printf("Currencies of a[j]= %d \n" changes[j]);
}
}

}

### A program to find sum of digits repeatedly until a single digit is obtained?

A program to find sum of digits repeatedly until a single digit is obtained?

#include<stdio.h>
#include<conio.h>
main()
{
int n,s=0,sum=0,i,d;

printf("enter the number");
scanf("%d",&n);
while(n>0)
{
d=n%10;
s=s+d;
n=n/10;
}
while(s>0)
{
i=s%10;
sum=sum+i;
s=s/10;
}
printf("%d",sum);
getch();
}

### C Logic

Assume The Motor Vehicles Department has notified numbers between 1000 and 9999(both inclusive) as available for the new series KL-35 A. Write a program to print all fancy numbers in this series. Following
are the conditions for fancy numbers:

1. All digits are the same.
2. Sum of all digits added until getting a single digit gives the number 9.

//find fancy number

#include<stdio.h>
#include<conio.h>
int all_the_same(int x);
void main()
{

int n,s=0,sum=0,i,d,kond;
clrscr();
printf("Fancy numbers between 1000 and 9999 are");

for(kond=1000;kond<=9999;kond++)

{
n=kond;s=0;sum=0;
if(all_the_same(n)==1)
{
printf("\n%d  ", n);
getch();
}
else
{

while(n>0)
{
d=n%10;
s=s+d;
n=n/10;
}
while(s>0)
{
i=s%10;
sum=sum+i;
s=s/10;
}
if(sum==9)
{
printf("\n%d  ",kond);
getch();

}

}

}
getch();
}

int all_the_same(int x)
{
int cnt=0;
int digit = x%10;

while(x>0)
{
if((x%10) != digit)
cnt++;
x = x/10;
}

if(cnt==0)
{
cnt=0;
return 1;
}
else
{
return 0;
}
}

### Pascals triangle using c++

What is pascals triangle ?

`Code`

#include <iostream>
int main()
{
int n;
std::cin >> n;
for (int y = 0; y < n; y++)
{
int c = 1;
std::cout.width(n - y );// Added only this.
for (int x = 0; x <= y; x++)
{
std::cout << c << " ";
c = c * (y - x) / (x + 1);
}
std::cout<<std::endl;
}
std::cout<<std::endl;
return 0;
}

### Sort names using C

#include < stdio.h >
#include < conio.h >
#include < alloc.h >

void main()
{
char *list[100],temp[10];
int n,i,j;
clrscr();
printf("How many names?\n");
scanf("%d",&n);
printf("Enter %d names \n",n);
for(i=0;i < n;i++)
{
list[i]=(char *)malloc(100);
flushall();
gets(list[i]);
}
for(i=0;i < n-1;i++)
{
for(j=i+1;j < n;j++)
{
strcmp(list[i],list[j]);
{
strcpy(temp,list[i]);
strcpy(list[i],list[j]);
strcpy(list[j],temp);
}
}
}
printf("The %d names in sorted order are\n",n);
for(i=0;i < n;i++)
{
puts(list[i]);
}
}

### Magic Number using C

What is a magic number ?

eg : 998001

998+001 =999 ^2 = 998001

Logic

first = x / 1000
last = x % 1000
sum = first + last
squared = sum * sum

eg : 998001

998+001 =999 ^2 = 998001

## Wednesday, 16 January 2013

### php mysql_query() Error when executing a function

Solution .

Check the version of your php and mysql database , if it is > than 5.6 then use mysqli_query().

If you are getting access denied error , then check the database user permissions or if you are using cpanel , then check the required user is assigned to the database.

### Write a “Hello World” program in C without using a semicolon?

void
main()
{
if( printf( "Hello, world!\n" ) ) {}
}

### C++: Write a function to swap two integers without using a temporary variable, + or - operator.?

C++: Write a function to swap two integers without using a temporary variable, + or - operator.?

int swap_data( int &a, int &b ) {
a ^= b;
b ^= a;
a ^= b;
}

## Monday, 7 January 2013

### how to delete a file/image from remote server using asp.net c#

To do this use the bellow code ,

System.IO.File.Delete(path);

where path is the relative path to the file .

### How to find a selected item from a data list in asp.net c#

To do this use the code bellow under any commend triggers

int i = e.Item.ItemIndex;
//    string id = datalist1.DataKeys[i].ToString();

### How to avoid when sub menus are viewing under an image

Sub menu problem in html :How to avoid when  sub menu's are viewing under an image or div

To avoid this issue you should use an z index value with your sub menu css

### What is MVC ?

Model-View-Controller, an architecture for building interactive applications that lies at the heart of the Rails framework.

to know about Microsoft MVC hit the bellow link

http://www.asp.net/mvc/overview/what-is-mvc

### Display data in list view in asp.net 2.0 c#

private void Fill_List()
{

string query = "Your sql query here"
obj.table(query);  // table is a data table object view previous post [Ref. Data base connection class]
List_DataSource = obj.dt;
List_DataBind();
}

### What is IonCube PHP loader?

It is used to encrypt programs/source codes written in php to avoid unauthorized usage/access and reproduction of a software or website by understanding the inner logic . Because normal php codes are plain text and  products developed in this , one can easily view the source code .