Thursday, 6 December 2012

Program for addition of 2 sparse Matrix



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

struct sparse
{
 int r,c,v;
}s1[10],s2[10],s3[10];

void display(struct sparse s[]);
void checksparse(int r,int c,int m[][10])
{
          int i,j,cnt=0,cnt1=0;
          for(i=0;i<r;i++)
          {
                   for(j=0;j<c;j++)
                   {
                             if((m[i][j])==0)
                             {
                                      cnt++;
                             }
                             else
                             {
                                      cnt1++;
                             }
                   }
          }
          if(cnt1>cnt)
          {
                   printf("Addition not possible matrix is not sparse\n");
                   getch();
                   exit();
          }
}

void makematrix(int r,int c,int m[10][10])
{
          int i,j;
          for(i=0;i<r;i++)
          {
                   for(j=0;j<c;j++)
                   {
                   printf("Enter value for m[%d][%d]:",i,j);
                   scanf("%d",&m[i][j]);
                   }
          }

}

void makesparse(int r,int c,int m[][10],struct sparse s[10])
{       int i,j,k=1;
          s[0].r=r;
          s[0].c=c;
          for(i=0;i<r;i++)
          for(j=0;j<c;j++)
          {
                   if(m[i][j]!=0)
                   {
                             s[k].r=i;
                             s[k].c=j;
                             s[k].v=m[i][j];
                             k++;
                   }
          }
          k--;
          s[0].v=k;

}

void addsparse(struct sparse s1[],struct sparse s2[])
{
  int i=1,j=1,k=1;
  s3[0].r=s1[0].r>s2[0].r?s1[0].r:s2[0].r;
  s3[0].c=s1[0].c>s2[0].c?s1[0].c:s2[0].c;

  while((i<=s1[0].v) && (j<=s2[0].v))
  {
          if(s1[i].r==s2[j].r)
          {
                   if(s1[i].c==s2[j].c)
                   {
                             s3[k].r=s1[i].r;
                             s3[k].c=s1[i].c;
                             s3[k].v=s1[i].v+s2[j].v;
                             i++;j++;k++;
                   }
                   else if(s1[i].c<s2[j].c)
                             {
                                      s3[k].r=s1[i].r;
                                      s3[k].c=s1[i].c;
                                      s3[k].v=s1[i].v;
                                      i++;
                                      k++;
                             }
                             else
                             {
                                      s3[k].r=s2[j].r;
                                      s3[k].c=s2[j].c;
                                      s3[k].v=s2[j].v;
                                      j++;
                                      k++;
                             }
          }
          else if(s1[i].r<s2[j].r)
                   {
                             s3[k].r=s1[i].r;
                             s3[k].c=s1[i].c;
                             s3[k].v=s1[i].v;
                             i++;k++;
                   }
                   else
                   {
                             s3[k].r=s2[j].r;
                             s3[k].c=s2[j].c;
                             s3[k].v=s2[j].v;
                             j++;k++;
                   }

          }
          while(i<=s1[0].v)
          {
               s3[k].r=s1[i].r;
               s3[k].c=s1[i].c;
               s3[k].v=s1[i].v;
               i++;k++;
          }
          while(j<=s2[0].v)
          {
               s3[k].r=s1[j].r;
               s3[k].c=s1[j].c;
               s3[k].v=s1[j].v;
               j++;k++;
          }
          k--;
          s3[0].v=k;
          printf("Addition of 2 sparse matricies is ");
          printf("\n");
          display(s3);

}
void display(struct sparse s[])
{
          int i;
          printf("ROW\tCOLUMN\tVALUE\n");
          for(i=0;i<=s[0].v;i++)
          {
                   printf("%d\t%d\t%d\n",s[i].r,s[i].c,s[i].v);
          }
}

void main()
{
          int r1,r2,c1,c2,m1[10][10],m2[10][10];
          clrscr();
          printf("Enter number of rows and columns in first Matrix:");
          scanf("%d%d",&r1,&c1);
          makematrix(r1,c1,m1);
          checksparse(r1,c1,m1);
          printf("Enter number of rows and columns in second Matrix:");
          scanf("%d%d",&r2,&c2);
          makematrix(r2,c2,m2);
          checksparse(r2,c2,m2);
          makesparse(r1,c1,m1,s1);
          makesparse(r2,c2,m2,s2);
          display(s1);
          display(s2);
          addsparse(s1,s2);
          getch();
}

Wednesday, 5 December 2012

Microsoft will make $94 billion on "Google" patents


Google told a court that Microsoft will make more than $94 billion by using Google's patented wireless technology.
Michael Dansky, an expert for Google's Motorola Mobility unit, told the last day of the patent trial that the $94 billion figure included a wireless adapter that Microsoft no longer sells.

Microsoft declined to comment on the figure.

According to Reuters,  the trial looked at how much royalty Microsoft should pay Google for a licence to some of Motorola's patents. Google bought Motorola earlier this year for $12.5 billion.

It wants $4 billion a year for its wireless and video patents, while Vole thinks that $1 million a year is a nice round figure.
At stake is also the power of Motorola's patents to protect Google from similar spats with its rivals.

Apple and Microsoft have been taking on Google and its chums, like Samsung, which use the Android operating system on their mobile devices rather than have that nasty problem where they have to compete and make better products.

Dansky told the court that Motorola's video patents were crucial to Microsoft and other tech companies, and deserve a high royalty.

It would be difficult to sell smart phones or tablets without Motorola's technology, he told the court.
The court is not expected to release a ruling for several weeks as both companies must file further legal briefs. 


SanDisk 32 GB Mobile microSDHC Flash Memory Card SDSDQ-032G-AFFP

Automated Software


Software development is undoubtedly a complex and laborious process. Software engineers really work hard to carry out a particular software. But now a European experiment is going on which will automate the building and testing phase of programming, thus reducing the time and efforts used in this process.
Software Development Cycle
Software Development
First Ever Computer Program:
Computer programming has came a long way since days when Ada Lovelace wrote the first ever computer program in 1842. It was a small program written to calculate Bernoulli numbers. These days programming was not as complex and was not more than an individual effort.
Present day Scenario:
These days’ computer programs are getting more and more complex. A team of software developers works for years to develop a program, building the concept, coding, testing, debugging and then finally releasing and maintenance of programs.
Now if we need to reduce the time and effort in software development process, the only thing we can do is to “Automate the Process.”
The ETICS project:
ETICS project is a giant leap in the field of software development. It will automate the most of the software programming tasks thus helping software developers, managers and testers and will also help to obtain high quality. This will also help in reducing the cost of software and time taken in development.
The new system:
This new system will help software developers and users to automate the most of the process in development and testing execution. This amazing platform will use latest in “Grid” software and it can operate in multiple platforms. It can also be customized and developed further as it is an open source project.
Developers can install the client interface of system and then they can use results from round-the-clock builds. Tests can also be monitored via web and configuration metadata of software can also be browed and edited via a secure web application.
Mr. Alberto Di Meglio: Man behind this project
Mr. Alberto Di Meglio of CERN, the European organization for nuclear research is leading the research. In his words:
“By automating many of their day-to-day tasks, the ETICS system supports software managers, developers and testers in obtaining higher quality software.”
Development:
The ETICS platform has been developed in two phases over 3 years and has been continuously refined in collaboration with users. Some more new functions are being developed for ETICS 2 which will help software developers to run complex tests over distributed networks.
We must hope that this new system will surely bring a new revolution in the field of software development and testing.

SanDisk Ultra 32 GB MicroSDHC Class 10 UHS-1 Memory Card with Adapter (SDSDQU-032G-AFFP-A)

Robots can Learn

If the current research of Dr. Ashutosh Saxena of Cornell's Personal
Robotics Laboratory becomes successful then Robots of future will
learn to manipulate objects and will develop the ability of
generalization. This learning procedure will help Robots to adapt
according to new environments.

The main theory behind this is the use of machine learning programming
which leads to observation of events by Robots and find commonalities.
For an example a robot will see different cups, learn the common
characteristics of cups and will then identify cups in future no
matter what size and shape they will have. This kind of process will
also teach robots to handle cups correctly.

According to Saxsena, these new robots would be able to make decisions
like how to place cups on different places. Like a cup will be placed
upright on table while upside down in dishwasher. Robots will get
training of placing strategies and will be able to apply then on other
objects by the process of generalization.

In testing process scientists placed different things like a plate,
mug, glass, bowl, spoon and some other objects at different surfaces
like on flat surface, hook, stemware holder etc. Robots then tested
the suitable locations for placement of these objects after studying
the environment and gave priority to best locations to place an
object.

After such training Robot placed objects 98% correct at previously
seen environment and objects. This accuracy was 95% for new objects
and environments and that can be improved further by longer periods of
training.

The base of all this is the contextual relations in 3-Dimensions.
Although making a Robot that acts just like humans will take long time
but by making Robots like these is a giant leap in Robotics.