Tuesday, March 26, 2013

Five Opportunities for Mobile Computing

Thousands of startup companies see mobile computing as their chance to strike it big. We picked five.

About three dozen mobile-computing startup companies get funded by investors each month in the United States, according to PricewaterhouseCoopers. Around the world, tens of thousands more entrepreneurs are dreaming and coding and trying to invent something big.
Here’s what we think are five large opportunities in mobile computing, and a startup company pursuing each.
Transportation
If you live in San Francisco, you’ve probably seen cars roving around with hot-pink furry mustaches on their grills. This signals that the drivers are for hire through Lyft, a ride-sharing app offered by startup Zimride. Anyone with a car can become a limo driver and pick up fares, who can hail a driver using the app. Lyft takes about 20 percent of the revenue from each ride.
Zimride and competitors Uber and SideCar are using smartphones to challenge the taxi industry. It hasn’t been smooth. In November, the California Public Utilities Commission fined all three for operating illegal taxi companies.
Who’ll win the struggle isn’t clear. But the mobile-app companies have a numerical advantage. In San Francisco, there are 1,700 licensed cabs but more than 380,000 registered cars.
How much? San Francisco taxicabs licenses have been sold for $300,000. (Source: SFMTA)
Internet Access
Many people in poorer countries are still using feature phones with prepaid minutes. A switch to smartphones is happening fast—yet few can afford a data plan to connect to the Internet.
Blaast, a startup based in Helsinki, Finland, thinks the key to these markets will be shrinking the apps people use and making them work cheaply over older, slower wireless networks. The company compresses and caches streamlined versions of apps like Facebook and Twitter, offering access to a package of applications for 5 to 10 cents per day.
How many? India has nearly as many cell-phone subscribers (1.1 billion) as people. Only 4 percent use smartphones. (Source: KPCB)
Things That Communicate
What if any object could talk to your phone?
Tagstand, a San Francisco–based startup, sells inexpensive near-field communication (NFC) tags that can be stuck anywhere. The tags communicate information or commands over short distances to phones that also have an NFC chip. When you set your phone down on your bedside table, for example, a tag on the table could turn the phone off and turn your alarm on. Cofounder Omar Seyal says NFC tags at movie theaters’ entrances could automatically silence your phone.
How soon? About one in five smartphones sold has an NFC chip. (Source: ABI Research)
Phone Security
Online bad guys have been paying attention to the swift growth of smartphones and tablets, and malware for the small screen is on the rise.
One of the first to jump to phones’ defense was Lookout, whose security apps are now used by 30 million people. Lookout’s free software for Android can scan downloaded apps for malware and back up smartphone contacts. Features include Signal Flare, which can help find a missing phone by logging its location as the battery is dying, and Lock Cam, which will silently take and send a photo of any person who tries and fails three times to unlock your smartphone.
All this warms up users for the company’s premium service, which costs $3 per month and adds extras like the ability to remotely erase your phone’s memory.
How safe? By 2016, consumers will spend more than $2.4 billion a year downloading mobile security software. (Source: Infonetics)
Credit Card Payments
Smartphones and tablets are changing the way people pay for things. One startup in the field is Braintree, which processes credit card payments, mostly for high-profile Web merchants.
Braintree recently launched Venmo Touch, an app that will let any other app execute a payment with “one touch” if a person’s credit card information is already on file. The feature is available with popular apps like the last-minute hotel booker HotelTonight and the errand-running service TaskRabbit.
Braintree CEO Bill Ready says the company is processing more than $1 billion in mobile transactions annually. It charges 2.9 percent of the purchase price, plus another 30 cents for each transaction, though it pays most of that money on to banks and card companies.
How much? In 2013, people in the U.S. will spend about $13 billion using mobile phones. (Source: Forrester)

Android Application Tutorial-Music

MainActivity
****************************************************************
package com.nanolaser;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
   
}
*******************************************************************
Splash
*******************************************************************
package com.nanolaser;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
public class Splash extends Activity{
     MediaPlayer ourSong;
 @Override
 protected void onCreate(Bundle TravisLoveBacon) {
  // TODO Auto-generated method stub
  super.onCreate(TravisLoveBacon);
  setContentView(R.layout.splash);
  ourSong=MediaPlayer.create(Splash.this, R.raw.music);
  ourSong.start();
  Thread timer=new Thread(){
   public void run(){
    try{
     sleep(5000);
    
    }catch(InterruptedException e){
     e.printStackTrace();
    }finally{
     Intent openStartingPoint=new Intent("com.nanolaser.MAINACTIVITY");
     startActivity(openStartingPoint);
    
    }
   
   }
  };
  timer.start();
 }
 @Override
 protected void onPause() {
  // TODO Auto-generated method stub
  super.onPause();
  ourSong.release();
  finish();
 }
   
}
***************************************************************
activity_main
****************************************************************
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
</RelativeLayout>

*******************************************************************
splash
*******************************************************************
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/splash_background"
   
    >
   
</LinearLayout>
*********************************************************************
AndroidManifest.xml
*********************************************************************
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nanolaser"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="8" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Splash"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
                <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.nanolaser.MAINACTIVITY" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>



Monday, March 18, 2013

Android-Button&setting up values



Layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="top"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >
    <Button
        android:id="@+id/bSub"
        android:layout_width="250sp"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/tvDisplay"
        android:layout_below="@+id/tvDisplay"
        android:layout_marginTop="51dp"
        android:text="@string/Subtractone"
        android:textSize="20sp" />
    <Button
        android:id="@+id/bAdd"
        android:layout_width="250sp"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/tvDisplay"
        android:layout_below="@+id/tvDisplay"
        android:text="@string/Addone"
        android:textSize="20sp" />
    <TextView
        android:id="@+id/tvDisplay"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="You total is 0"
        android:textSize="45sp" />
</RelativeLayout>




***************************************************************************

Main Activity:

package com.nanolaser;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity {
    int counter;
    Button add, sub;
    TextView display;
   
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
     counter=0;
     add=(Button)findViewById(R.id.bAdd);
     sub=(Button)findViewById(R.id.bSub);
     display=(TextView)findViewById(R.id.tvDisplay);
     add.setOnClickListener(new View.OnClickListener() {

   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
    counter++;
    display.setText("You total is "+counter);
   }
  });
     sub.setOnClickListener(new View.OnClickListener() {

   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
     counter--;
     display.setText("You total is "+counter);
   }
  });
 }
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
  // Inflate the menu; this adds items to the action bar if it is present.
  getMenuInflater().inflate(R.menu.main, menu);
  return true;
 }
}


**************************************************************

Sunday, March 17, 2013

Android Application Development-Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nanolaser.leize"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.nanolaser.leize.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Saturday, March 16, 2013

Object Oriented Program-Python

 class exampleClass:
 eyes='blue'
 age=22
 def thisMethod(self):
  return 'hey this method worked'

exampleObject=exampleClass()
exampleObject.eyes
exampleObject.age
exampleObject.thisMethod()



**********************************************************************


 class className:
 def createName(self,name):
  self.name=name
 def displayName(self):
  return self.name
 def saying(self):
  print "hello %s" % self.name


first=className()
second=className()
first.createName('bucky')
second.createName('tony')
first.displayName()
first.saying()


*************************************************************************

Wednesday, March 13, 2013

The Algorithm That Helps You Friend People You Don’t Know

Computer scientists have developed an algorithm that uses the structure of a social network to find the best strategy for friending people you don’t know.

Imagine you want to friend an influential person on Facebook who you don’t know and with whom you have no friends in common. How would you go about the task?
One option is simply to send an invitation directly to that person. But without anybody to recommend you, the chances of him or her accepting the invitation are slim.
But there is another strategy: to start friending people who are close to you on the network but more likely to know your target. The idea here is to build a set of friends that your target shares so that when you finally send the important invitation, your target can see that you have similar social circles and so is more likely to accept.
There’s a problem, of course, which is that the structure of the social network is hidden to ordinary users. There is no way of knowing how close you are to your target or who to friend to maximise your chances of getting there.
Today, Wei Chen at Microsoft Research Asia in Beijing and a few pals put forward a solution. These guys suggest that social network companies should offer this kind of “active friending” as a service.
The idea is that you name your target and the company then suggests the friending strategy that is most likely to produce the desired outcome. They’ve even developed and tested an algorithm that does the job.
Social networks already suggest potential friends based on information such as who your existing friends know, who you email and so on.
But this “passive friending” is an entirely undirected service. There is no goal other than to increase your number of friends and the amount of time you spend on the network.
So Wei and co have developed an algorithm called SITINA (Selective Invitation with Tree and In-Node Aggregation) which when given a target, suggests potential friends with the goal of maximising your chances of friending them.
The strategy has some important subtleties. For example, one way to reach a target is to find the shortest route across the network. But the problem with this is that it relies on each person in the chain accepting their invitations.
A better strategy, say Wei and co, is to chart many routes across the network so that it is more likely that at least one will result in the desired connection. What’s more, this strategy can produce several friends in common giving the target invitation a higher chance of success.
But this too has a downside–it means that you have to handle a large number of invitations which is time consuming and tedious.
So there is clearly a balance between flooding the network with invitations and charting the shortest route to reach the target. This where SITINA comes in.
This algorithm is designed to optimise the process so that it maximise the chances of friending a target given a limited budget of invitations.
Wei and co say they’ve tested it on a group of 169 Facebook users who they recruited for the task. The test consisted of giving each Facebook user a set of targets and a limited number of invitations and challenging them to friend each target on their own. In parallel, these users were also given recommendations by SITINA which they also used.
Wei and co say their algorithm significantly outperformed the manual approach. “User study and experimental results manifest that active friending can effectively maximize the acceptance probability of the friending target,” they say.
That’s an interesting idea that could clearly generate substantial demand among social network users who want to initiate contact with distant targets.
However, an important question that Wei and co have not addressed is the impact this algorithm could have on the targets. It doesn’t take much imagination to think of ways this kind of approach could be abused–as a tool for stalking, for example.
Then there are questions of privacy. This approach not only reveals one or more paths across the network to a target but also a certain number of the target’s friends. It may even make it possible to reconstruct a given target’s social network.
Given the high profile mis-steps that various social networks have made in creating unwanted links between people on their networks, it’s clear that the legal and privacy issues that active friending raises need to be carefully studied before releasing it into the wild.

Monday, March 11, 2013

Algorithms Get a Human Hand in Steering Web

Trading stocks, targeting ads, steering political campaigns, arranging dates, besting people on “Jeopardy” and even choosing bra sizes: computer algorithms are doing all this work and more.

But increasingly, behind the curtain there is a decidedly retro helper — a human being.
Although algorithms are growing ever more powerful, fast and precise, the computers themselves are literal-minded, and context and nuance often elude them. Capable as these machines are, they are not always up to deciphering the ambiguity of human language and the mystery of reasoning. Yet these days they are being asked to be more humanlike in what they figure out.
“For all their brilliance, computers can be thick as a brick,” said Tom M. Mitchell, a computer scientist at Carnegie Mellon University.
And so, while programming experts still write the step-by-step instructions of computer code, additional people are needed to make more subtle contributions as the work the computers do has become more involved. People evaluate, edit or correct an algorithm’s work. Or they assemble online databases of knowledge and check and verify them — creating, essentially, a crib sheet the computer can call on for a quick answer. Humans can interpret and tweak information in ways that are understandable to both computers and other humans.
Question-answering technologies like Apple’s Siri and I.B.M.’s Watson rely particularly on the emerging machine-man collaboration. Algorithms alone are not enough.
Twitter uses a far-flung army of contract workers, whom it calls judges, to interpret the meaning and context of search terms that suddenly spike in frequency on the service.
For example, when Mitt Romney talked of cutting government money for public broadcasting in a presidential debate last fall and mentioned Big Bird, messages with that phrase surged. Human judges recognized instantly that “Big Bird,” in that context and at that moment, was mainly a political comment, not a reference to “Sesame Street,” and that politics-related messages should pop up when someone searched for “Big Bird.” People can understand such references more accurately and quickly than software can, and their judgments are fed immediately into Twitter’s search algorithm.
“Humans are core to this system,” two Twitter engineers wrote in a blog post in January.
Even at Google, where algorithms and engineers reign supreme in the company’s business and culture, the human contribution to search results is increasing. Google uses human helpers in two ways. Several months ago, it began presenting summaries of information on the right side of a search page when a user typed in the name of a well-known person or place, like “Barack Obama” or “New York City.” These summaries draw from databases of knowledge like Wikipedia, the C.I.A. World Factbook and Freebase, whose parent company, Metaweb, Google acquired in 2010. These databases are edited by humans.
When Google’s algorithm detects a search term for which this distilled information is available, the search engine is trained to go fetch it rather than merely present links to Web pages.
“There has been a shift in our thinking,” said Scott Huffman, an engineering director in charge of search quality at Google. “A part of our resources are now more human curated.”
Other human helpers, known as evaluators or raters, help Google develop tweaks to its search algorithm, a powerhouse of automation, fielding 100 billion queries a month. “Our engineers evolve the algorithm, and humans help us see if a suggested change is really an improvement,” Mr. Huffman said.
Katherine Young, 23, is a Google rater — a contract worker and a college student in Macon, Ga. She is shown an ambiguous search query like “what does king hold,” presented with two sets of Google search results and asked to rate their relevance, accuracy and quality. The current search result for that imprecise phrase starts with links to Web pages saying that kings typically hold ceremonial scepters, a reasonable inference.
Her judgments, Ms. Young said, are “not completely black and white; some of it is subjective.” She added, “You try to put yourself in the shoes of the person who typed in the query.”
I.B.M.’s Watson, the powerful question-answering computer that defeated “Jeopardy” champions two years ago, is in training these days to help doctors make diagnoses. But it, too, is turning to humans for help.
To prepare for its role in assisting doctors, Watson is being fed medical texts, scientific papers and digital patient records stripped of personal identifying information. Instead of answering questions, however, Watson is asking them of clinicians at the Cleveland Clinic and medical school students. They are giving answers and correcting the computer’s mistakes, using a “Teach Watson” feature.
 
Watson, for example, might come across this question in a medical text: “What neurological condition contraindicates the use of bupropion?” The software may have bupropion, an antidepressant, in its database, but stumble on “contraindicates.” A human helper will confirm that the word means “do not use,” and Watson returns to its data trove to reason that the neurological condition is seizure disorder.
 
“We’re using medical experts to help Watson learn, make it smarter going forward,” said Eric Brown, a scientist on I.B.M.’s Watson team.
Ben Taylor, 25, is a product manager at FindTheBest, a fast-growing start-up in Santa Barbara, Calif. The company calls itself a “comparison engine” for finding and comparing more than 100 topics and products, from universities to nursing homes, smartphones to dog breeds. Its Web site went up in 2010, and the company now has 60 full-time employees.
Mr. Taylor helps design and edit the site’s education pages. He is not an engineer, but an English major who has become a self-taught expert in the arcane data found in Education Department studies and elsewhere. His research methods include talking to and e-mailing educators. He is an information sleuth.
On FindTheBest, more than 8,500 colleges can be searched quickly according to geography, programs and tuition costs, among other criteria. Go to the page for a university, and a wealth of information appears in summaries, charts and graphics — down to the gender and race breakdowns of the student body and faculty.
Mr. Taylor and his team write the summaries and design the initial charts and graphs. From hundreds of data points on college costs, for example, they select the ones most relevant to college students and their parents. But much of their information is prepared in templates and tagged with code a computer can read. So the process has become more automated, with Mr. Taylor and others essentially giving “go fetch” commands that the computer algorithm obeys.
The algorithms are getting better. But they cannot do it alone.
“You need judgment, and to be able to intuitively recognize the smaller sets of data that are most important,” Mr. Taylor said. “To do that, you need some level of human involvement.”