Sunday 25 August 2013

Windows 8.1 is ready

Windows 8.1 is ready

 

They said they'd do it by the end of August. And as we head into the last stretch, it seems Microsoft has released to manufacturing (RTMed) Windows 8.1, its next release of Windows.
Windows SuperSite editor Paul Thurrott tweeted on August 23 that Windows 8.1 had RTM'd. Thurrott said the final RTM build number is 9600.16384.130821-1623.
I talked to another contact of mine who said the internal RTM e-mail made the rounds inside the Windows division on August 23. A third source close to the company confirmed Microsoft RTM'd Windows 8.1 on August 23, and announced internally that the quality metrics for Windows 8.1 were back in line with those of Windows 7.
Microsoft may have opted against announcing Windows 8.1's  RTM on Friday so that the news wouldn't be overshadowed by the announcement that CEO Steve Ballmer is retiring some time within the next 12 months. As I blogged previously, my sources said Microsoft was targeting Monday August 26 as the day it would RTM Windows 8.1.
In June, officials said that Microsoft would be providing the final RTM bits to OEMs before the end of August.
The real question on some developers', IT pros', and other users' minds is whether Microsoft will make the RTM bits available to anyone early.

 

Amped Wireless RTA15 High Power Dual Band AC 700mW Wi-Fi Router

Amped Wireless RTA15 High Power Dual Band AC  Wi-Fi Router

 

The good: The powerful Amped Wireless RTA15 router offers long Wi-Fi range, decent data speed, and a robust Web interface. The device is ready to work right out of the box.
The bad: Compared with similarly priced routers, the RTA15’s performance falls short, especially in terms of Wi-Fi signal stability.
The bottom line: The Amped Wireless RTA15 is a decent Wi-Fi router, but better firmware is needed for it to live up to its high cost and our expectation.

The RTA15 High Power Dual Band AC 700mW Wi-Fi router is the next step in Amped Wireless's quest for bringing great Wi-Fi range to its customers. The router packs even more power than the company's previous models and it's the first to support the 802.11ac Wi-Fi standard.
In my testing, it indeed offered very long range. Unfortunately the benefit of the large Wi-Fi coverage was, to some extent, canceled out by the signal's instability. The router's wireless data rates, though fast, were slower than those of similarly priced routers.

ways to trick Android into using less data

ways to trick Android into using less data

Apps are moving to the cloud. Streaming services like Netflix and Spotify are big. And just about every one of us is addicted to social networking.
There's just one thing standing in the way: your data plan.
With unlimited plans dwindling, most smartphone users are stuck with tiered options that sometimes make data usage more stressful than fun.

 Whether you're actively using them or not, apps love to eat up data. They're checking for updates, running ads, and refreshing your user content in the background. The good intentions are there, but most times, the conveniences these practices bring don't outweigh the depleted data reserves. It's time to tame those apps.

Update apps on Wi-Fi only
Head to the Google Play store and tap Menu > Settings > Auto-update apps. Here, be sure that "Auto-update apps over Wi-Fi only" is selected. You also have the option to choose "Do not auto-update apps," but it's less preferable, since you'll have to remember to update apps manually.
(Credit: Screenshot by Sharon Vaknin/CNET)
Configure in-app data settings
To give you a fluid experience, many apps ping servers in the background to keep their content updated. For instance, Google+ backs up your photos and videos as they're captured, while Mint can be configured to refresh banking data.
These conveniences are great, but they come at a cost, so dive into the app settings and disable the data-sucking options you don't absolutely need.
Restrict background data
Even apps that don't allow you to fine-tune data settings could still be loading background data. In Ice Cream Sandwich and later versions of Android, one way to find out which ones are guilty is to go to Settings > Data Usage, and scroll down to reveal a list of apps with accompanying data usage stats.
Then, tap an app to view its usage data, and take a look at the two numbers next to the pie chart. "Foreground" refers to the data used when you're actively using the app, while "Background" reflects the data used when the app is running in the background.

Big screens, big batteries

Big screens, big batteries

It's been with great interest that I've been following the growth of the new tabletop PC category. These systems are in some ways all-in-one desktops, similar to the Apple iMac, but with the added ability to fold down flat, as in the case of the new HP Envy Rove 20. Others feel more like megatablets, for example the 18-inch Dell XPS 18, which is a close cousin to Windows 8 slates such as Microsoft's Surface Pro. Both types combine big screens and big batteries to create a unique experience, with features of a personal computer, a piece of consumer electronics equipment, and even living-room furniture.
That's why I use the unofficial term tabletop PC to describe them. Since late 2012, we've reviewed models from Sony, Asus, Dell, HP, and Lenovo. The Dell and Asus models are the most hybrid-like, with screens that detach from traditional-looking stands. The HP, Sony, and Lenovo models are thicker and heavier, with built-in kickstands that can stand up or at an angle, or fold down flat. All of them function just fine facing straight up from a coffee table or kitchen counter, and you can expect plenty of custom built-in furniture options should this trend take off.

 
 


 Lenovo IdeaCentre Horizon 27 
 
It functions perfectly well as a desktop all-in-one, but to see it really shine, push the spring-loaded hinge down and lay the system flat on your table, desk, or even the floor. Aura, a touch-centric operating-system overlay, switches on automatically when you fold the system down, and a collection of several custom apps and games is available in this mode, including the requisite air hockey (seemingly the first app everyone thinks to install on a tabletop PC), Texas Hold 'Em poker, and Monopoly.

Thursday 22 August 2013

C program to reverse an array


C program to reverse an array

C program to reverse an array: This program reverses the array elements. For example if a is an array of integers with three elements such that
a[0] = 1
a[1] = 2
a[2] = 3
Then on reversing the array will be
a[0] = 3
a[1] = 2
a[0] = 1
C programming code
#include <stdio.h>

int main()
{
   int n, c, d, a[100], b[100];

   printf("Enter the number of elements in array\n");
   scanf("%d", &n);

   printf("Enter the array elements\n");

   for (c = 0; c < n ; c++)
      scanf("%d", &a[c]);

   for (c = n - 1, d = 0; c >= 0; c--, d++)
      b[d] = a[c];

   for (c = 0; c < n; c++)
      a[c] = b[c];

   printf("Reverse array is\n");

   for (c = 0; c < n; c++)
      printf("%d\n", a[c]);

   return 0;
}
Output of program:
Enter the number of elements in array
5
Enter the array elements
2
23
362
9856
Reverse array is
9865
362
23
2

Reverse array by swapping (without using additional memory)
#include <stdio.h>

int main() {
  int array[100], n, c, t, end;

  scanf("%d", &n);
  end = n - 1;

  for (c = 0; c < n; c++) {
    scanf("%d", &array[c]);
  }

  for (c = 0; c < n/2; c++) {
    t          = array[c];
    array[c]   = array[end];
    array[end] = t;

    end--;
  }

  printf("Reversed array elements are:\n");

  for (c = 0; c < n; c++) {
    printf("%d\n", array[c]);
  }

  return 0;
}
C program to reverse an array using pointers
#include <stdio.h>
#include <stdlib.h>

void reverse_array(int*, int);

int main()
{
   int n, c, *pointer;

   scanf("%d",&n);

   pointer = (int*)malloc(sizeof(int)*n);

   if( pointer == NULL )
      exit(EXIT_FAILURE);

   for ( c = 0 ; c < n ; c++ )
      scanf("%d",(pointer+c));

   reverse_array(pointer, n);

   printf("Original array on reversal is\n");

   for ( c = 0 ; c < n ; c++ )
      printf("%d\n",*(pointer+c));

   free(pointer);

   return 0;
}

void reverse_array(int *pointer, int n)
{
   int *s, c, d;

   s = (int*)malloc(sizeof(int)*n);

   if( s == NULL )
      exit(EXIT_FAILURE);

   for ( c = n - 1, d = 0 ; c >= 0 ; c--, d++ )
      *(s+d) = *(pointer+c);

   for ( c = 0 ; c < n ; c++ )
      *(pointer+c) = *(s+c);

   free(s);
}
Array is passed to function and a new array is created and contents of passed array (in reverse order) are copied into it and finally contents of new array are copied into array passed to function.
-------------------------------**************************----------------------------------------

C program for binary search


C program for binary search

C program for binary search: This code implements binary search in c language. It can only be used for sorted arrays, but it's fast as compared to linear search. If you wish to use binary search on an array which is not sorted then you must sort it using some sorting technique say merge sort and then use binary search algorithm to find the desired element in the list. If the element to be searched is found then its position is printed.

C programming code for binary search
#include <stdio.h>

int main()
{
   int c, first, last, middle, n, search, array[100];

   printf("Enter number of elements\n");
   scanf("%d",&n);

   printf("Enter %d integers\n", n);

   for ( c = 0 ; c < n ; c++ )
      scanf("%d",&array[c]);

   printf("Enter value to find\n");
   scanf("%d",&search);

   first = 0;
   last = n - 1;
   middle = (first+last)/2;

   while( first <= last )
   {
      if ( array[middle] < search )
         first = middle + 1;   
      else if ( array[middle] == search )
      {
         printf("%d found at location %d.\n", search, middle+1);
         break;
      }
      else
         last = middle - 1;

      middle = (first + last)/2;
   }
   if ( first > last )
      printf("Not found! %d is not present in the list.\n", search);

   return 0;  
}
Output of program:
Enter number of elements
5
Enter 5 integers
3
6
4
8
Enter value to find
6
6 found at location 2
-------------------------------**************************----------------------------------------

Linear search c program


Linear search c program

#include <stdio.h>
 
int main()
{
   int array[100], search, c, number;
 
   printf("Enter the number of elements in array\n");
   scanf("%d",&number);
 
   printf("Enter %d numbers\n", number);
 
   for ( c = 0 ; c < number ; c++ )
      scanf("%d",&array[c]);
 
   printf("Enter the number to search\n");
   scanf("%d",&search);
 
   for ( c = 0 ; c < number ; c++ )
   {
      if ( array[c] == search )     /* if required element found */
      {
         printf("%d is present at location %d.\n", search, c+1);
         break;
      }
   }
   if ( c == number )
      printf("%d is not present in array.\n", search);     
 
   return 0;
}
Output of program:
Enter the number of elements in array
5
Enter  5  numbers
6
5
4
9
2
1
Enter the number to search
6
6 is present at location 1

Linear search for multiple occurrences
In the code below we will print all the locations at which required element is found and also the number of times it occur in the list.
#include <stdio.h>

int main()
{
   int array[100], search, c, n, count = 0;

   printf("Enter the number of elements in array\n");
   scanf("%d",&n);

   printf("Enter %d numbers\n", n);

   for ( c = 0 ; c < n ; c++ )
      scanf("%d",&array[c]);

   printf("Enter the number to search\n");
   scanf("%d",&search);

   for ( c = 0 ; c < n ; c++ )
   {
      if ( array[c] == search )   
      {
         printf("%d is present at location %d.\n", search, c+1);
         count++;
      }
   }
   if ( count == 0 )
      printf("%d is not present in array.\n", search);
   else
      printf("%d is present %d times in array.\n", search, count);

   return 0;
}

C program for linear search using function
#include <stdio.h>

int linear_search(int*, int, int);

int main()
{
   int array[100], search, c, n, position;

   printf("Enter the number of elements in array\n");
   scanf("%d",&n);

   printf("Enter %d numbers\n", n);

   for ( c = 0 ; c < n ; c++ )
      scanf("%d", &array[c]);

   printf("Enter the number to search\n");
   scanf("%d",&search);

   position = linear_search(array, n, search);

   if ( position == -1 )
      printf("%d is not present in array.\n", search);
   else
      printf("%d is present at location %d.\n", search, position+1);

   return 0;
}

int linear_search(int *pointer, int n, int find)
{
   int c;

   for ( c = 0 ; c < n ; c++ )
   {
      if ( *(pointer+c) == find )
         return c;
   }

   return -1;
}
Time required to search an element using linear search algorithm depends on size of list. In best case element is present at beginning of list and in worst case element is present at the end. Time complexity of linear search is O(n).
-------------------------------**************************----------------------------------------