Tuesday, April 15, 2014

Calculator made using self made functions and built in functions using #include . math.h is only used for trigonometric and log functions and square root. Other functions are not included in math.h library. This calculator can calculate sum,subtraction,multiplication,division,modulus,power,factorial,square root,sin x, cos x, tan x , sec x , cosec x , cot x , log with base e , log with base 10

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

void header()
{
printf("\n");
printf("Built and Designed by Arslan-ud-Din-Shafiq\n\nReg. No .DDP-SP14-BSE-005");
printf("\n");
}

void line()
{
int i;
    for(i=1;i<=48;i++)
    printf("=");
}
float sum(float a,float b)
{
    return a+b;
}
float subtract(float c , float d)
{
    return c-d;
}
float multiply(float e,float f)
{
    return e*f;
}
float divide(float g,float h)
{
    return g/h;
}
int mod(int i,int j)
{
    return i%j;
}
int fact(int k)
{
    int i,p=1;
    for(i=1;i<=k;i++)
    p*=i;
    return p;
}
int pwr(int n , int r)
{
    int k, result=1;
    for(k=1;k<=r;k++)
    result*=n;
    return result;
}
int main()
{
    float x,y;
    char m,s,c,t;
    line();
    header();
    line();

    while(m!=-1)
       {
        printf("\nEnter 1st Number = ");
        scanf("%f",&x);
        printf("\nEnter 2nd Number =  ");
        scanf("%f",&y);
        printf("\nYou can use following Arithmatic Operations (+,-,*,^,/,%,!)\n(s) for sin \n(c)for cos \n(t) for tan \n(l) for log with base e\n(r) for square root \n(L) for log with base 10\n(z) for sec x\n(v) for cosec x\n(w) for cot x\n PRESS (e) tp END the Program =  ");
        m=getche();
        printf("\n");
        switch(m)
    {
        case'+':
        line();
        printf("\nSum of %.2f and %.2f is = %.2f\n\n",x,y,sum(x,y));
        line();
        break;
        case'-':
        line();
        printf("\nSubtraction of %.2f and %.2f is = %.2f\n",x,y,subtract(x,y));
        line();
        break;
        case'*':
        line();
        printf("\nProduct of %.2f and %.2f is = %.2f\n",x,y,multiply(x,y));
        line();
        break;
        case'/':
        line();
        printf("\nDivision of %.2f and %.2f is = %.2f\n",x,y,divide(x,y));
        line();
        break;
        case'%':
        line();
        printf("\nModulus of %d and %d is = %d\n",x,y,mod(x,y));
        line();
        break;
        case'!':
        line();
        printf("\nFactorial of %d is = %d\n",x,fact(x));
        line();
        printf("\nFactorial of %d is = %d\n",y,fact(y));
        line();
        break;
        case'^':
        line();
        printf("\n%d raised to power %d is = %d\n",x,y,pwr(x,y));
        line();
        break;
        case'r':
        line();
        printf("\nSquare root of %.2f is  =  %.2f",x,sqrt(x));
        printf("\nSquare root of %.2f is  =  %.2f",y,sqrt(y));
        line();
        break;
        case's':
        printf("Press (a) if 'x' is in radian or (b) if 'x' is in degrees  :  ");
        s=getche();
        printf("\n");
        switch(s)
        {
            case'a':
            line();
            printf("\nsin %.1f = %.4f\n",x,sin(x));
            line();
            printf("\nsin %.1f = %.4f\n",y,sin(y));
            line();
            break;
            case'b':

            {  float i,j;
               i=x*0.01746;
               j=y*0.01746;
               line();
               printf("\nsin %.1f = %.4f\n",x,sin(i));
               line();
               printf("\nsin %.1f = %.4f\n",y,sin(j));
               line();
            }
        break;
        }
        break;
        case'c':
        printf("Press (a) if 'x' is in radian or (b) if 'x' is in degrees  :  ");
        c=getche();
        printf("\n");
        switch(c)
        {
            case'a':
            line();
            printf("\ncos %.1f = %.4f\n",x,cos(x));
            line();
            printf("\ncos %.1f = %.4f\n",y,cos(y));
            line();
            break;
            case'b':

            {  float i,j;
               i=x*0.01746;
               j=y*0.01746;
               line();
               printf("\ncos %.1f = %.4f\n",x,cos(i));
               line();
               printf("\ncos %.1f = %.4f\n",y,cos(j));
               line();
            }
        break;
        }
        break;
        case't':
        printf("\nPress (a) if 'x' is in radian or (b) if 'x' is in degrees  :  ");
        t=getche();
        printf("\n");
        switch(t)
        {
            case'a':
            line();
            printf("\ntan %.1f = %.4f\n",x,tan(x));
            line();
            printf("\ntan %.1f = %.4f\n",y,tan(y));
            line();
            break;
            case'b':

            {  float i,j;
               i=x*0.01746;
               j=y*0.01746;
               line();
               printf("\ntan %.1f = %.4f\n",x,tan(i));
               line();
               printf("\ntan %.1f = %.4f\n",y,tan(j));
               line();
            }
        break;
        }
        break;
        case'l':
        line();
        printf("\nNatural log of %.2f = %.2f  \n",x,log(x));
        line();
        printf("\nNatural log of %.2f = %.2f  \n",y,log(y));
        line();
        break;
        case'L':
        line();
        printf("\nLog of %.2f with base 10 = %.2f\n",x,log10(x));
        line();
        printf("\nLog of %.2f with base 10 = %.2f\n",y,log10(y));
        line();
        break;
        case'e':
        {
            int i;
            printf("\nEnter -1 to end : ");
            scanf("%d",&i);
            printf("\n");
            if(i==-1)
        {
            line();
            printf("\nYou are getting out of this program.....Press Enter.\n");
            line();
            return 0;
        }
        }
        break;
        case'z':
            {
               float v,w;
               v=1/(cos(x));
               w=1/(cos(y));
               printf("sec %.2f = %.2f",x,v);
               printf("sec %.2f = %.2f",y,w);
            }
        break;
        case'v':
        {
            float a,b;
            b=1/(sin(x));
            a=1/(sin(y));
            printf("cosec %.2f = %.2f",x,b);
            printf("cosec %.2f = %.2f",y,a);
        }
        break;
        case'w':
        {
            float a,b;
            b=1/(tan(x));
            a=1/(tan(y));
            printf("cot %.2f = %.2f",x,b);
            printf("cot %.2f = %.2f",y,a);
        }
        default:
        line();
        printf("\nInvalid Input\n");
        line();
    }

       }
return 0;
}

Sunday, April 13, 2014

Installing iOS SDK and Xcode on Windows 7


Mac on Windows + ios SDK & X-code on windows 7


X-code SDK - Hardik patel's Blog img 1


The TechExxpert guide has been updated to fully allow Xcode 4.1 to work.  that the past fixes did not work. 



 Please let me know if this guide works/doesn't work.This guide has been modified ..





Apple has been adamantly refusing to create an iPhone SDK support for Windows-based machines. Luckily, there is a work around to be able to fully run the iOS SDK and Xcode support for most all PC's.

The following steps involve installing a virtual machine on your PC, updating the virtual machine to 10.7 , then running the machine and downloading and installing the iOS SDK and Xcode on to the virtual machine.

There are other ways to install OS X on your machine but they involve creating a new partition and installing the Operating System directly to your hard drive. Those ways are much harder and have more confusing steps that could potentially damage your computer. This method is easier and safer to use. 

The process will take 2-3 hours, but most of the time is consumed by large downloads. There's no software to buy or developer fees to pay.



PROCEDURE 

1.    Follow the steps   : here to download and install a virtualized version of OS X Lion on your PC.

__________________________________________________________________________________

2.   If you don't have a free Apple Dev Account, create one here.  You'll need this to be able to download Xcode 4.1 for free. In OS X, open the App Store and download Xcode. You can view progress of the download under the Purchases tab.








__________________________________________________________________________________

3. Once the progress bar is finished, it will say it is installed but it really isn't. Open the Applications folder from Finder. Double-click on the Install Xcode icon













__________________________________________________________________________________


4.  Follow the on-screen directions then wait for the installation to finish.








__________________________________________________________________________________

5. Once it's done, it should open by itself. If it doesn't, you will NOT find the iPhone SDK in your dock. You will need to open your hard drive. Then Click on Developer, then on Applications.













__________________________________________________________________________________

7. You will now see an icon for Xcode, click it and you can start coding applications.

__________________________________________________________________________________


 Here to download and install a virtualized version of OS X Lion on your PC 


Requirements

A laptop or desktop computer that supports virtualization (most newer computers do).
At least 1 GB of RAM (the more, the better).

VMWare Workstation (this is a paid program but a little research will get you it for free).

VMWare Hard Drive (vmx files, it is in a self-extracting .exe file)

OS X Lion (VMDK File) 

Instructions
Before you start, make sure that you have enabled Virtualization in the BIOS of your computer. This is usually disabled by default by computer manufacturers.

Steps: 

 Video tutorial :   Available  
__________________________________________________________________

1. From the file downloaded, double click on Mac OS X Lion VMware Files.exe. Click Run thenYes. This will decompress the files.

2. Once done, a folder named Mac OS X Lion VMware Files will appear, double click it.


3. You will need to follow the instructions in this video to unlock VMWare. Instead of using the files from the video, use the files from Step 2.


4. From Step 1, you should have also gotten a folder named Mac OS X Lion. Open that up and open the file named Mac OS X Lion.vmx. Double-click this file. It will open in VMWare Workstation.

5. On the left column, click on Edit Virtual Machine Settings. In the Memory tab, you can edit how much RAM OS X will get. In the Sound tab, change to Specify host sound card, change it to your sound card. After the machine has started and sound doesn't work, change to Use default host sound card


6.  At the bottom of the box is an Add button, click it. Select Hard Disk from the left, click Next. Choose Use and existing virtual disk.

7. Browse for the Mac OS X Lion Installer.vmdk that was downloaded from the torrent. ClickFinish. Click OK to close the box.

8. On the left column, click Power on this virtual machine.

9. If a box asks to repair the image, click Repair. Once the box comes up, click I copied it, clickOK. A message about the CD Drive may come up, just click OK.

10. The machine should power up in a few moments, ready to go. For ease of use, click in VMWare Workstation, click File > Add to Favorites.

11. You should now have a Install Mac OS X screen. At the top, click Utilities then Disk Utility. Select the 42.45 GB Hard Disk. Click on the Erase tab. Now you can name your hard drive what you want. Then click on Erase. Click Erase again.

12. Once the process is done, close out of the Disk Utility box, the Install screen will come back up. Click ContinueAgree. Select the 40GB Hard Disk to install Lion. Click Install. The process will take about 30 minutes. Once it's done, the account setup will start. Once that's done, Lion will start.

13. To be able to use the machine in full screen, in OS X open Preferences, click on Displays. Now select the resolution of your monitor. Now in VMWare, click on the Full Screen button on the toolbar (10th button from the left).

14. Now you're done, you can use this OS as a normal to install programs.


________________________________________________________________




Video tutorial  

Install Android OS on your PC or Laptop

Install and Run Android 4.0 SDK and Ice Cream Sandwich on PC



Google announced Android 4.0, Ice Cream Sandwich, on October 19. Android 4.0 SDK has also been released for developers. 1st smart phone Samsung Galaxy Nexus with Google Android 4.0 (Ice Cream Sandwich) will be available for customers in November 2011.
In this tutorial we will learn how to run Android 4.0 SDK  and Ice Cream Sandwich in an emulator and explore the features of new Google Mobile OS.
See below the step-by-step instructions on how to set up and install the Android 4.0 SDK on your PC.
Step 1 - Download the Android SDK files from: HERE. Select x86 or Windows Version if you are using Microsoft Windows OS.
Step 2 - Extract or install the Android SDK files you just downloaded to any location on your PC.
Step 3 - Now, open the folder where you have extracted the SDK and run the “SDK Manager” application.
Step 4 - The application will load and fetch all the Android SDK packages.
Step 5 - Once the SDK manger complete the loading process, now you can select the packages you want to install. Here, we will be only selecting the “Android 4.0 (API 14)” and “Android SDK Platform-tools” (under Tools).
Step 6 - Now Click on “Install  packages…”. You will be prompted to confirm the packages you have selected for installation.
Step 7 - Then Click on the “Install” button and wait for the all the packages to download from internet and install.
Click Finish and Close the SDK Manager, when all the packages are downloaded and installed on your PC.

Set Up Android 4.0 Emulator

Once you installed Android SDK r14 packages and tools, now its time to set up the Android Emulator so that you can run Android 4.0 (Ice Cream Sandwich) on your PC.
Step 8 - Open Android SDK folder and run “AVD Manager”. Click on “New” and create a Virtual Device with details as in the screenshot below.
Step 9 - Click “OK” on the result window.
Step 10 -Select the virtual device you just created from the list and click on “Start”.
Step 11 - No need to change anything in the Launch Options Just Click on the “Launch” button.
Step 12 - The emulator will start after a few Command Prompt windows flicker and then you will see the following screen where your Android device will be booting up. It may take around 5 minutes to boot when loading for the first time.
Step 13 - Once your Android 4.0 loaded in Emulator, you will see the Welcome Screen.