Natural Language Processing

Natural Language
Refers to the language spoken by people, e.g. English, Japanese, as opposed to artificial languages, like C++, Java, etc.


Natural Language Processing
NLP is the branch of computer science focused on developing systems that allow computers to communicate with people using everyday language.NLP is related to human -computer interaction.  NLP encompasses anything a computer needs to understand natural language and also generate natural language.NLP is a sub field of artificial intelligence. Devoted to make computers “understand” statements  written in human language. 

Why Natural Language Processing  
kJfmmfj  mmmvvv  nnnffn333

Uj iheale eleee mnster vensi credur

Baboi oi cestnitze

Coovoel2^ ekk; ldsllk lkdf vnnjfj?

Fgmflmllk mlfm kfre xnnn!
Computers “see” text in English the same we have seen the above text!
People have no trouble understanding language 
  • Common sense knowledge 
  • Reasoning capacity 
  • Experience 
Computers have 
  • No common sense knowledge 
  • No reasoning capacity 
 that’s why we need natural language processing. 

Steps in natural language processing
 
Morphological analysis
Individual words are analyzed into their component and non word tokens. punctuation are separated from word .
e.g   carried= carry+ed

Syntactic analysis
.grammatical structure of sentence is analyze. some word sequence may be rejected if they violate the rules of language . e.g  syntactic analyzer reject the sentence 
  Boy the go  the to store


Semantic analysis
. determine possible meaning of sentence.
. Sentence which has no meaning is rejected.
. For eg “ colorless green ideas ” has no meaning.

Discourse Analysis
. The meaning of  an individual sentence may depends on  the sentence that precede it and may influence the meaning of sentences that follow it.
e.g  “john wanted it” the word ‘it’  depends upon john.


Pragmatic analysis
. It derives knowledge from external commonsense information.
. It means understanding purposeful use of language in situation.
e.g   “ DO you know what time it is?”
   should be interpreted as a request.

Natural Language Processing

Natural Language
Refers to the language spoken by people, e.g. English, Japanese, as opposed to artificial languages, like C++, Java, etc.

Software Development Fundamentals


Management fundamentals

Estimation and Scheduling
Well-run projects go through three basic steps to create a software schedule. They first estimate the size of the project, then they estimate the effort needed to build a product of that size, and then they estimate a schedule based on the effort estimate.


Planning
software development problems
  •  Ill-defined contract
  •  Unstable problem definition
  •  Inexperienced management
  •  Political pressures
  •  Ineffective change control
  •  Unrealistic deadlines

 software project includes these activities
  • Estimation and scheduling
  • Determining how many people to have on the project team, what technical skills are needed, when to add people, and who the people will be
  • Deciding how to organize the team
  • Choosing which life cycle model to use
  • Managing risks
  • Making strategic decisions such as how to control the product's feature set and whether to buy or build pieces of the product
Tracking
Once you've planned a project, you track it to check that it's following the plan—that it's meeting its schedule, cost,' and quality targets. Typical management-level tracking controls include task lists, status meetings, status reports, milestone reviews, budget reports, and management by walking around. Typical technical-level tracking controls include technical audits, technical reviews, and quality gates that control whether you consider milestones to be complete.

Measurement
You need to have a basic knowledge of software measurement to develop efficiently. You need to understand the issues involved in collecting metrics, including how much or how little data to collect and how to collect it. You should have a knowledge of specific metrics you can use to analyze status, quality, and productivity. An organization that wants to develop rapidly needs to collect basic metrics in order to know what its development speed is and whether it's improving or degrading over time.

Requirements Management
  Requirements management is the process of gathering requirements; recording them in a document, email, user-interface storyboard, executable prototype, or some other form; tracking the design and code against them; and then managing changes to them for the rest of the project.
Here are the fundamentals of requirements management
  • Requirements-analysis methodologies including structured analysis, data structured analysis, and
    object-oriented analysis
  • System-modeling practices such as class diagrams, data flow diagrams, entity-relationship diagrams,data-dictionary notation, and state transition diagrams
  • Communication practices such as Joint Application Development (JAD), user-interface prototyping, and general interview practices
  • The relationships between requirements management and the different life cycle models including evolutionary prototyping, staged releases, spiral, waterfall, and code-and-fix

 Design Management
 Just as it makes sense to create a set of blueprints before you begin building a house, it makes sense to create an architecture and design before you begin building a software system. A design error left undetected until system testing typically takes 10 times as long to fix as it would if it were detected at design time.

 Software Configuration Management
 the practice of managing project artifacts so that the project stays in a consistent state over time. SCM includes practices for evaluating proposed changes, tracking changes, handling multiple versions, and keeping copies of project artifacts as they existed at various times.

Quality-Assurance Fundamental

projects try to save time by reducing the time spent on quality-assurance practices such as design and
code reviews. Other projects—running late—try to make up for lost time by compressing the testing
schedule, which is vulnerable to reduction because it's usually the critical-path item at the end of the project.These are some of the worst decisions a person who wants to maximize development speed can make because higher quality (in the form of lower defect rates) and reduced development time go hand in hand.

Error-Prone Modules
An error-prone module is a module that's responsible for a disproportionate number of defects.Barry Boehm reports that about 20 percent of the modules in a program are typically responsible for about 80 percent of the errors (Boehm 1987b).Modules with such high defect rates are more expensive and time-consuming to deliver than less error-prone modules.

Testing
The most common quality-assurance practice is Undoubtedly execution testing, finding errors by executing a program and seeing what it does. The two basic kinds of execution testing are unit tests, in which the developer checks his or her own code to verify that it works correctly, and system tests, in which an independent tester checks to see whether the system operates as expected.

Technical Reviews
Technical reviews include all kinds of reviews that are used to detect defects in requirements, design, code, test cases, or other project artifacts.

  • walkthrough:- The term "walkthrough" is loosely defined and refers to any meeting at which two or more developers review technical work with the purpose of improving its quality.
  • Code reading:- In code reading, the author of the code hands out source listings to two or more
    reviewers. The reviewers read the code and report any errors to the author of the code.
  • Inspections:- The "moderator" hands out the work product to be inspected before the inspection meeting. The "reviewers" examine the work product before the meeting and use checklists to stimulate their review. During the inspection meeting, the "author" usually paraphrases the material being inspected, the reviewers identify errors, and the "scribe" records the errors. After the meeting, the moderator produces an inspection report that describes each defect and indicates what will be done about it.

Software Development Fundamentals


Management fundamentals

Estimation and Scheduling
Well-run projects go through three basic steps to create a software schedule. They first estimate the size of the project, then they estimate the effort needed to build a product of that size, and then they estimate a schedule based on the effort estimate.

General Strategy for Rapid Development

We can achieve rapid development by following a four part strategy:
  1. Avoid classic mistakes.
  2. Apply development fundamentals.
  3. Manage risks to avoid catastrophic setbacks.
  4. Apply schedule-oriented practices
Four Dimensions of Development

People
people ware issues strongly influence productivity, it is also now crystal clear that any organization that's serious about improving productivity should look first to the people ware issues of motivation, teamwork, staff selection, and training. There are other ways to improve productivity, but people ware offers the greatest potential benefit. If you are serious about rapid development, you have to be serious about people ware issues.

any organization that wants to improve its productivity should be actively trying all these things.
  • Team organization
  • Motivation.
Process
Process, as it applies to software development, includes both management and technical methodologies.

A focus on process can help.
  • work avoidance.
  • Quality assurance.
  • Development fundamentals.
  • Risk management.
  • Resource targeting.
  • Life cycle planning.
  • Customer orientation.

Product
The most tangible dimension of the people/process/product/technology compass is the product dimension, and a focus on product size and product characteristics presents enormous opportunities for schedule reduction.
Both product size and product characteristics offer opportunities to cut development time.
  • Product size.
  • Product characteristics.

Technology
 The current move toward component ware (VBXs and OCXs) might eventually produce similarly dramatic results. Choosing tools effectively and managing the risks involved are key aspects of a rapid-development initiative.



Classic Mistakes

Some ineffective development practices have been chosen so often, by so many people, with such
predictable, bad results that they deserve to be called "classic mistakes."

People
  • Undermined motivation.
  • Weak personnel.
  • Uncontrolled problem employees.
  • Heroics.
  • Adding people to a late project.
  • Noisy, crowded offices.
  • Friction between developers and customers.
  • Unrealistic expectations.
  • Lack of effective project sponsorship.
  • Lack of stakeholder buy-in.
  • Lack of user input. 
  • Politics placed over substance.
  • Wishful thinking.
Process
  • Overly optimistic schedules.
  • Insufficient risk management.
  • Contractor failure.
  • Insufficient planning.
  • Abandonment of planning under pressure.
  • Wasted time during the fuzzy front end.
  • Shortchanged upstream activities.
  • Inadequate design
  • Shortchanged quality assurance.
  • Insufficient management controls.
  • Premature or overly frequent convergence.
  • Omitting necessary tasks from estimates.
  • Planning to catch up later.
  • Code-like-hell programming.
Product
  • Requirements gold-plating.
  • Feature creep.
  • Developer gold-plating.
  • Push-me, pull-me negotiation.
  • Research-oriented development.
Technology
  • Silver-bullet syndrome.
  • Overestimated savings from new tools or methods.
  • Switching tools in the middle of a project.
  • Lack of automated source-code control.












General Strategy for Rapid Development

We can achieve rapid development by following a four part strategy:
  1. Avoid classic mistakes.
  2. Apply development fundamentals.
  3. Manage risks to avoid catastrophic setbacks.
  4. Apply schedule-oriented practices

Human Computer Interaction

Study about the interaction between human and computer




NIELSEN'S TEN USABILITY HEURISTICS
  • Visibility of system status(Feedback) :The system should always keep users informed about what is going on, through appropriate feedback within reasonable time.
  • Match between system and the real world (METAPHOR):The system should speak the users’ language, with words, phrases and concepts familiar to the user, rather than  system oriented terms.
  • User control and freedom (NAVIGATION): Users often choose system functions by mistake and will need a clearly marked “emergency exit” to leave the unwanted state without having to go through an extended dialogue. Supports undo and redo and a clear way to navigate.
  • Consistency and standards (CONSISTENCY):Users should not have to wonder whether different words, situations, or actions mean the same thing. Follow platform conventions
  • Error prevention (PREVENTION):Even better than good error messages is a careful design, which prevents a problem from occurring in the first place
  • Recognition rather than recall (MEMORY):Minimize the user’s memory load. Make objects, actions, and options visible.
  • Flexibility and efficiency of use (EFFICIENCY):Accelerators — unseen by the novice user — may often speed up the interaction for the expert user such that the system can cater to both inexperienced and experienced users. Allow users to tailor frequent actions.
  • Aesthetic and minimalist design(DESIGN):Dialogues should not contain information, which is irrelevant or rarely needed. Every extra unit of information in a dialogue competes with the relevant units of information and diminishes their relative visibility.
  • Help users recognize, diagnose, and recover from errors (RECOVERY):Error messages should be expressed in plain language (no codes), precisely indicate the problem, and constructively suggest a solution.
  • Help and documentation (Help):Even though it is better if the system can be used without documentation, it may be necessary to provide help and documentation. Any such information should be easy to search, focused on the user’s task, list concrete steps to be carried out, and
    not be too large.

Human Computer Interaction

Study about the interaction between human and computer

Introduction to Rapid Application Development

the ideas of prototyping and iterative development into a methodology called RAD that focused on developing systems in a short time-frame with small teams of highly qualified, motivated and experienced staff.


Advantages of RAD methodology 
  • increased speed:-the goal of delivering applications quickly is addressed through the use of CASE tools which focus on converting requirements to code as quickly as possible
  • increased quality:- the quality is defined as both the degree to which a delivered application meets the needs of users as well as the degree to which a delivered system has low maintenance coasts
  • early visibility;- because of prototyping
  • productivity of developers will be increase
Disadvantages of RAD
  • Reduced scalability:- the delivered solution may lack the scalability of a solution that was designed as a full application from the start
  • Reduced features:- due to the time boxing , where features are pushed off to later versions in favor of delivering an applications in a short time frame
  • less efficient
 Core Elements of RAD
  • Prototyping:-is a technique it allows to see flaws and so look for ways to improve the system. it serves as a communications vehicle for allowing persons who require the system to review the proposed user interaction with the system.
  • Iterative Development:-iterative development means creating increasingly functional versions of a system in short development cycles . the process is repeated until all functionality has been developed.
  • Time Boxing:- time boxing is the process of putting off features to future application versions in order to complete the current version in as short amount of time as possible.
  • Parallel Development :- the System is split into subsystems that can be developed and tested autonomously by multiple SWAT(Skilled workers with Advanced Tools) teams operating in parallel.   
  • Team Members:- The RAD methodology recommends the use of small teams consists of experienced, versatile and motivated members that are able to perform  multiple roles.
  • Management Approach:- in Addition to enforcing a strict timeline, management must focus on team member selection , team motivation and on clearing bureaucratic or political obstacles
  • RAD tools:- RAD focus of the latest tools is as important today as it was when the methodology was initially created. 








Introduction to Rapid Application Development

the ideas of prototyping and iterative development into a methodology called RAD that focused on developing systems in a short time-frame with small teams of highly qualified, motivated and experienced staff.

Google Cloud Messaging for Android

Google Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device, and also to receive messages from devices on the same connection. The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device. GCM is completely free no matter how big your messaging needs are, and there are no quotas.

 //////////////////////////////////index.php
 <!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
             
            });
            function sendPushNotification(id){
                var data = $('form#'+id).serialize();
                $('form#'+id).unbind('submit');              
                $.ajax({
                    url: "send_message.php",
                    type: 'GET',
                    data: data,
                    beforeSend: function() {
                      
                    },
                    success: function(data, textStatus, xhr) {
                          $('.txt_message').val("");
                    },
                    error: function(xhr, textStatus, errorThrown) {
                      
                    }
                });
                return false;
            }
        </script>
        <style type="text/css">
            .container{
                width: 950px;
                margin: 0 auto;
                padding: 0;
            }
            h1{
                font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
                font-size: 24px;
                color: #777;
            }
            div.clear{
                clear: both;
            }
            ul.devices{
                margin: 0;
                padding: 0;
            }
            ul.devices li{
                float: left;
                list-style: none;
                border: 1px solid #dedede;
                padding: 10px;
                margin: 0 15px 25px 0;
                border-radius: 3px;
                -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
                -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
                box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
                font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
                color: #555;
            }
            ul.devices li label, ul.devices li span{
                font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
                font-size: 12px;
                font-style: normal;
                font-variant: normal;
                font-weight: bold;
                color: #393939;
                display: block;
                float: left;
            }
            ul.devices li label{
                height: 25px;
                width: 50px;              
            }
            ul.devices li textarea{
                float: left;
                resize: none;
            }
            ul.devices li .send_btn{
                background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
                background: -webkit-linear-gradient(0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
                background: -moz-linear-gradient(center top, #0096FF, #005DFF);
                background: linear-gradient(#0096FF, #005DFF);
                text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
                border-radius: 3px;
                color: #fff;
            }
        </style>
    </head>
    <body>
        <?php
        include_once 'db_functions.php';
        $db = new DB_Functions();
        $users = $db->getAllUsers();
        if ($users != false)
            $no_of_users = mysql_num_rows($users);
        else
            $no_of_users = 0;
        ?>
        <div class="container">
            <h1>No of Devices Registered: <?php echo $no_of_users; ?></h1>
            <hr/>
            <ul class="devices">
                <?php
                if ($no_of_users > 0) {
                    ?>
                    <?php
                    while ($row = mysql_fetch_array($users)) {
                        ?>
                        <li>
                            <form id="<?php echo $row["id"] ?>" name="" method="post" onsubmit="return sendPushNotification('<?php echo $row["id"] ?>')">
                                <label>Name: </label> <span><?php echo $row["name"] ?></span>
                                <div class="clear"></div>
                                <label>Email:</label> <span><?php echo $row["email"] ?></span>
                                <div class="clear"></div>
                                <div class="send_container">                              
                                    <textarea rows="3" name="message" cols="25" class="txt_message" placeholder="Type message here"></textarea>
                                    <input type="hidden" name="regId" value="<?php echo $row["gcm_regid"] ?>"/>
                                    <input type="submit" class="send_btn" value="Send" onclick=""/>
                                </div>
                            </form>
                        </li>
                    <?php }
                } else { ?>
                    <li>
                        No Users Registered Yet!
                    </li>
                <?php } ?>
            </ul>
        </div>
    </body>
</html>
/////////////////////////////////////////////////////////////////////GCM.php
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if (isset($_GET["regId"]) && isset($_GET["message"])) {
    $regId = $_GET["regId"];
    $message = $_GET["message"];
   
    include_once './GCM.php';
   
    $gcm = new GCM();

    $registatoin_ids = array($regId);
    $message = array("price" => $message);

    $result = $gcm->send_notification($registatoin_ids, $message);

    echo $result;
}
?>

/////////////////////////////////////////////////////////////////send_message.php

<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if (isset($_GET["regId"]) && isset($_GET["message"])) {
    $regId = $_GET["regId"];
    $message = $_GET["message"];
   
    include_once './GCM.php';
   
    $gcm = new GCM();

    $registatoin_ids = array($regId);
    $message = array("price" => $message);

    $result = $gcm->send_notification($registatoin_ids, $message);

    echo $result;
}
?>