text:
/**
 * @file r_star_tree_descent_heuristic_impl.hpp
 * @author Andrew Wells
 *
 * Implementation of RStarTreeDescentHeuristic, a class that chooses the best child of a node in
 * an R tree when inserting a new point.
 */
#ifndef __MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_DESCENT_HEURISTIC_IMPL_HPP
#define __MLPACK_CORE_TREE_RECTANGLE_TREE_R_STAR_TREE_DESCENT_HEURISTIC_IMPL_HPP

#include "r_star_tree_descent_heuristic.hpp"

namespace mlpack {
namespace tree {

template<typename TreeType>
inline size_t RStarTreeDescentHeuristic::ChooseDescentNode(
    const TreeType* node,
    const arma::vec& point)
{
  bool tiedOne = false;
  std::vector<double> originalScores(node->NumChildren());
  double origMinScore = DBL_MAX;

  if (node->Children()[0]->IsLeaf())
  {
    // If its children are leaf nodes, use minimum overlap to choose.
    double bestIndex = 0;

    for (size_t i = 0; i < node->NumChildren(); i++)
    {
      double sc = 0;
      for (size_t j = 0; j < node->NumChildren(); j++)
      {
        if (j != i)
        {
          double overlap = 1.0;
          double newOverlap = 1.0;
          for (size_t k = 0; k < node->Bound().Dim(); k++)
          {
            double newHigh = std::max(point[k],
                node->Children()[i]->Bound()[k].Hi());
            double newLow = std::min(point[k],
                node->Children()[i]->Bound()[k].Lo());
            overlap *= node->Children()[i]->Bound()[k].Hi() < node->Children()[j]->Bound()[k].Lo() || node->Children()[i]->Bound()[k].Lo() > node->Children()[j]->Bound()[k].Hi() ? 0 : std::min(node->Children()[i]->Bound()[k].Hi(), node->Children()[j]->Bound()[k].Hi()) - std::max(node->Children()[i]->Bound()[k].Lo(), node->Children()[j]->Bound()[k].Lo());
            newOverlap *= newHigh < node->Children()[j]->Bound()[k].Lo() || newLow > node->Children()[j]->Bound()[k].Hi() ? 0 : std::min(newHigh, node->Children()[j]->Bound()[k].Hi()) - std::max(newLow, node->Children()[j]->Bound()[k].Lo());
          }
          sc += newOverlap - overlap;
        }
      }

      originalScores[i] = sc;
      if (sc < origMinScore)
      {
        origMinScore = sc;
        bestIndex = i;
      }
      else if (sc == origMinScore)
      {
        tiedOne = true;
      }
    }

    if (!tiedOne)
      return bestIndex;
  }

  // We do this if it is not on the second level or if there was a tie.
  std::vector<double> scores(node->NumChildren());
  if (tiedOne)
  {
    // If the first heuristic was tied, we need to eliminate garbage values.
    for (size_t i = 0; i < scores.size(); i++)
      scores[i] = DBL_MAX;
  }

  std::vector<int> vols(node->NumChildren());
  double minScore = DBL_MAX;
  int bestIndex = 0;
  bool tied = false;

  for (size_t i = 0; i < node->NumChildren(); i++)
  {
    if (!tiedOne || originalScores[i] == origMinScore)
    {
      double v1 = 1.0;
      double v2 = 1.0;
      for (size_t j = 0; j < node->Bound().Dim(); j++)
      {
        v1 *= node->Children()[i]->Bound()[j].Width();
        v2 *= node->Children()[i]->Bound()[j].Contains(point[j]) ? node->Children()[i]->Bound()[j].Width() : (node->Children()[i]->Bound()[j].Hi() < point[j] ? (point[j] - node->Children()[i]->Bound()[j].Lo()) :
            (node->Children()[i]->Bound()[j].Hi() - point[j]));
      }

      assert(v2 - v1 >= 0);
      vols[i] = v1;
      scores[i] = v2 - v1;

      if (v2 - v1 < minScore)
      {
        minScore = v2 - v1;
        bestIndex = i;
      }
      else if (v2 - v1 == minScore)
      {
        tied = true;
      }
    }
  }

  if (tied)
  {
    // We break ties by choosing the smallest bound.
    double minVol = DBL_MAX;
    bestIndex = 0;
    for (size_t i = 0; i < scores.size(); i++)
    {
      if (scores[i] == minScore)
      {
        if (vols[i] < minVol)
        {
          minVol = vols[i];
          bestIndex = i;
        }
      }
    }
  }

  return bestIndex;
}

/**
 * We simplify this to the same code as is used in the regular R tree, since the
 * inserted node should always be above the leaf level.  If the tree is
 * eventually changed to support rectangles, this could be changed to match the
 * above code; however, the paper's explanation for their algorithm seems to
 * indicate the above is more for points than for rectangles.
 */
template<typename TreeType>
inline size_t RStarTreeDescentHeuristic::ChooseDescentNode(
    const TreeType* node,
    const TreeType* insertedNode)
{
  std::vector<double> scores(node->NumChildren());
  std::vector<int> vols(node->NumChildren());
  double minScore = DBL_MAX;
  int bestIndex = 0;
  bool tied = false;

  for (size_t i = 0; i < node->NumChildren(); i++)
  {
    double v1 = 1.0;
    double v2 = 1.0;
    for (size_t j = 0; j < node->Children()[i]->Bound().Dim(); j++)
    {
      v1 *= node->Children()[i]->Bound()[j].Width();
      v2 *= node->Children()[i]->Bound()[j].Contains(insertedNode->Bound()[j]) ? node->Children()[i]->Bound()[j].Width() :
              (insertedNode->Bound()[j].Contains(node->Children()[i]->Bound()[j]) ? insertedNode->Bound()[j].Width() : (insertedNode->Bound()[j].Lo() < node->Children()[i]->Bound()[j].Lo() ? (node->Children()[i]->Bound()[j].Hi() - insertedNode->Bound()[j].Lo()) : (insertedNode->Bound()[j].Hi() - node->Children()[i]->Bound()[j].Lo())));
    }

    assert(v2 - v1 >= 0);
    vols[i] = v1;
    scores[i] = v2 - v1;

    if (v2 - v1 < minScore)
    {
      minScore = v2 - v1;
      bestIndex = i;
    }
    else if (v2 - v1 == minScore)
    {
      tied = true;
    }
  }

  if (tied)
  {
    // We break ties by choosing the smallest bound.
    double minVol = DBL_MAX;
    bestIndex = 0;
    for (size_t i = 0; i < scores.size(); i++)
    {
      if (scores[i] == minScore)
      {
        if (vols[i] < minVol)
        {
          minVol = vols[i];
          bestIndex = i;
        }
      }
    }
  }

  return bestIndex;
}

} // namespace tree
} // namespace mlpack

#endif


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>osp-common</artifactId>
    <groupId>org.sakaiproject.osp</groupId>
    <version>10.6</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>osp-common-tool</artifactId>
  <groupId>org.sakaiproject.osp</groupId>
  <name>OSP Common Tool</name>
  <organization>
    <name>Sakai Project</name>
    <url>http://sakaiproject.org/</url>
  </organization>
  <inceptionYear>2004</inceptionYear>
  <packaging>war</packaging>
  <dependencies>
    <dependency>
      <groupId>org.sakaiproject.kernel</groupId>
      <artifactId>sakai-kernel-util</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.kernel</groupId>
      <artifactId>sakai-kernel-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.osp</groupId>
      <artifactId>osp-common-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.osp</groupId>
      <artifactId>osp-common-tool-lib</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.metaobj</groupId>
      <artifactId>sakai-metaobj-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.metaobj</groupId>
      <artifactId>sakai-metaobj-impl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.metaobj</groupId>
      <artifactId>sakai-metaobj-tool-lib</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
    </dependency>
    <!-- OSP tag library -->
    <dependency>
      <groupId>org.sakaiproject.osp</groupId>
      <artifactId>osp-depend-jsf-widgets-sun</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.jsf</groupId>
      <artifactId>jsf-widgets-sun-depend</artifactId>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.jsf</groupId>
      <artifactId>jsf-tool</artifactId>
    </dependency>
    <dependency>
      <groupId>org.sakaiproject.jsf</groupId>
      <artifactId>jsf-app</artifactId>
    </dependency>
    <dependency>
      <groupId>aopalliance</groupId>
      <artifactId>aopalliance</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib-full</artifactId>
      <version>2.0.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <version>1.7.0</version>
    </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.1</version>
    </dependency>
    <dependency>
      <groupId>commons-digester</groupId>
      <artifactId>commons-digester</artifactId>
      <version>1.6</version>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <version>1.6</version>
    </dependency>
<!--${sakai.ehcache.groupId}${sakai.ehcache.artifactId}${sakai.ehcache.version}-->
<!--${sakai.hibernate.groupId}${sakai.hibernate.artifactId}${sakai.hibernate.version}-->
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
    </dependency>
    <dependency>
      <groupId>jdom</groupId>
      <artifactId>jdom</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
    </dependency>
    <!-- provided by inheritance
    <dependency>
      <groupId>jsf</groupId>
      <artifactId>jsf-impl</artifactId>
      <version>1.1.01</version>
    </dependency>
    <dependency>
      <groupId>jsf</groupId>
      <artifactId>jsf-api</artifactId>
      <version>1.1.01</version>
    </dependency>-->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
    </dependency>
    <dependency>
      <groupId>jta</groupId>
      <artifactId>jta</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>portlet-api</groupId>
      <artifactId>portlet-api</artifactId>
      <version>1.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.portlet</groupId>
      <artifactId>portlet-api</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
<!--javax.servletservlet-api${sakai.servletapi.version}-->
<!--${sakai.spring.groupId}${sakai.spring.artifactId}${sakai.spring.version}-->
    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>velocity</groupId>
      <artifactId>velocity</artifactId>
      <version>1.3.1</version>
    </dependency>
<!--org.sakaiprojectsakai-util${sakai.version}-->
    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>2.0.2</version>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <directory>src/bundle</directory>
        <includes>
          <include>**/*.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>src/java</directory>
        <includes>
          <include>**/*.hbm.xml</include>
        </includes>
      </resource>
    </resources>
<!-- java source -->
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <testResources>
      <testResource>
        <directory>src/webapp</directory>
        <includes>
          <include>**/*.xml</include>
          <include>**/*.xsd</include>
          <include>**/*.properties</include>
        </includes>
      </testResource>
<!--includes:  include: **/*Test.java -->
    </testResources>
  </build>
</project>

redpajama_set_name: RedPajamaGithub


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Main extends CI_Controller {

  function __construct()
  {
    parent::__construct();
  }

  function index()
  {
    $this->load->view('main_view', array('markers' => $this->get_all(FALSE)));
  }

  function search($x, $y, $distance, $kinds = NULL)
  {
    if ($kinds) {
      $kinds = explode('%7C', $kinds);
    }

    $result = json_encode($this->db_model->get_records(
                      array($x, $y), (int) $distance, $kinds));
    print($result);
  }

  function fetch_record($id)
  {
    $result = json_encode($this->db_model->get_record($id));
    print($result);
  }

  function get_all($print = TRUE)
  {
    $result = json_encode($this->db_model->get_all_records());

    if ($print) print $result;
    return $result;
  }
}


text:
<!DOCTYPE html>

    <link href="css/awsdocs.css" rel="stylesheet" type="text/css">

    <meta charset="utf-8">

AWS::S3::BucketPolicy

The AWS::S3::BucketPolicy type applies an Amazon S3 bucket policy to an Amazon S3
                        bucket.

AWS::S3::BucketPolicy Snippet: Declaring an Amazon S3 Bucket Policy

Topics

Syntax

Properties

Examples

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{
   "Type" : "AWS::S3::BucketPolicy",
   "Properties" : {
      "Bucket" : String,
      "PolicyDocument" : JSON
   }
}

YAML

Type: AWS::S3::BucketPolicy
Properties:
  Bucket: String
  PolicyDocument: JSON

Properties

Bucket

The name of the Amazon S3 bucket to which the policy applies.

Required: Yes

Type: String

You cannot update this property. If you want to add or remove a bucket from a
                                 bucket policy, you must modify your AWS CloudFormation template by creating a new
                                 bucket policy
                                 resource and removing the old one. Then use the modified template to update your AWS
                                 CloudFormation
                                 stack.

PolicyDocument

A policy document containing permissions to add to the specified bucket. For
                                 more information, see Access Policy Language Overview in the
                                 Amazon Simple Storage Service Developer Guide.

Required: Yes

Type: JSON object

Update requires: No interruption

Examples

Bucket policy that allows GET requests from specific referers

The following sample is a bucket policy that is attached to the
                        myExampleBucket bucket and allows GET requests that originate from
                        www.example.com and example.com:

JSON

"SampleBucketPolicy" : {
  "Type" : "AWS::S3::BucketPolicy",
  "Properties" : {
    "Bucket" : {"Ref" : "myExampleBucket"},
    "PolicyDocument": {
      "Statement":[{
	    "Action":["s3:GetObject"],
	    "Effect":"Allow",
	    "Resource": { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "myExampleBucket" } , "/*" ]]},
	    "Principal":"*",
        "Condition":{
          "StringLike":{
            "aws:Referer":[
              "http://www.example.com/*",
              "http://example.com/*"
            ]
          }
        }
      }]
    }
  }
}

YAML

SampleBucketPolicy:
  Type: AWS::S3::BucketPolicy
  Properties:
    Bucket:
      Ref: "myExampleBucket"
    PolicyDocument:
      Statement:
        -
          Action:
            - "s3:GetObject"
          Effect: "Allow"
          Resource:
            Fn::Join:
              - ""
              -
                - "arn:aws:s3:::"
                -
                  Ref: "myExampleBucket"
                - "/*"
          Principal: "*"
          Condition:
            StringLike:
              aws:Referer:
                - "http://www.example.com/*"
                - "http://example.com/*"


text:
This tests loading of a simple TEXT and no HTML when the HTTP content-type is set to "text/html" .
 Expected : This page should have simple TEXT .

<script>
  window.location="resources/getpage.pl?type=text/html&switch=nohtml&content=type_txt.txt";
</script>


text:
namespace CubeServer.Tests.Controllers
{
    using System;
    using System.Text;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Web.Http.Results;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using CubeServer.Controllers;

    /// <summary>
    /// Summary description for StatusControllerTests
    /// </summary>
    [TestClass]
    public class StatusControllerTests
    {
        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void GetStatusReturnsVersionString()
        {
            var statusController = new StatusController();
            var result = statusController.Get() as OkNegotiatedContentResult<string>;

            Assert.IsNotNull(result, "Did not get a result or result was not of expected type");
            Assert.IsNotNull(result.Content, "Result did not have any content");

            var expectedStatusString = statusController.GetType().Assembly.GetName().Version.ToString();
            Assert.AreEqual(expectedStatusString, result.Content, "Status result");
        }
    }
}


text: {{ngModel.collector[id].magicNumber}}


text:
Tweet Japan's weather

# Usage
Write crontab like this ...

`0 7 * * * python /path/to/TweetWeather/tweet_weather.py 大阪府 today`

`0 22 * * * python /path/to/TweetWeather/tweet_weather.py 大阪府 tomorrow`


text:
using stab.query;

public class IntList2 {
	public static bool test() {
		var list = Query.range(0, 5).toList();
		list.removeAt(2);
		return list.sequenceEqual(Query.asIterable(new int[] { 0, 1, 3, 4 }));
	}
}


text:
protoc --objc_out=Pod/Generated/goodow -Iprotos protos/goodow_bool.proto
protoc --objc_out=Pod/Generated/goodow/channel -Iprotos protos/goodow_channel.proto


text:
package org.hecl.midp20.lcdui;

import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;

import org.hecl.HeclException;
import org.hecl.Interp;
import org.hecl.IntThing;
import org.hecl.ObjectThing;
import org.hecl.Properties;
import org.hecl.StringThing;
import org.hecl.Thing;

import org.hecl.misc.HeclUtils;

public class TextBoxCmd extends ScreenCmd {
    public static void load(Interp ip) {
	ip.addCommand(CMDNAME,cmd);
	ip.addClassCmd(TextBox.class,cmd);
    }
    public static void unload(Interp ip) {
	ip.removeCommand(CMDNAME);
	ip.removeClassCmd(TextBox.class);
    }

    public Thing cmdCode(Interp interp,Thing[] argv) throws HeclException {
	Properties p = WidgetInfo.defaultProps(TextBox.class);
	p.setProps(argv,1);
	TextBox w = new TextBox(p.getProp(WidgetInfo.NTITLE).toString(),
				p.getProp(WidgetInfo.NTEXT).toString(),
				HeclUtils.thing2len(
				    p.getProp(WidgetInfo.NMAXLEN),1),
				WidgetInfo.toTextType(p.getProp(WidgetInfo.NTYPE)));
	p.delProp(WidgetInfo.NTITLE);
	p.delProp(WidgetInfo.NTEXT);
	p.delProp(WidgetInfo.NMAXLEN);
	p.delProp(WidgetInfo.NTYPE);
	return ObjectThing.create(setInstanceProperties(interp,w,p));
    }

    protected TextBoxCmd() {}

    public Thing cget(Interp ip,Object target,String optname)
	throws HeclException {
	TextBox tb = (TextBox)target;

	if(optname.equals(WidgetInfo.NTYPE))
	    return WidgetInfo.fromTextType(
		tb.getConstraints() & ~TextField.CONSTRAINT_MASK);
	if(optname.equals(WidgetInfo.NTEXT))
	    return StringThing.create(tb.getString());
	if(optname.equals(WidgetInfo.NMAXLEN))
	    return IntThing.create(tb.getMaxSize());
	if(optname.equals("-password"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.PASSWORD));
	if(optname.equals("-uneditable"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.UNEDITABLE));
	if(optname.equals("-sensitive"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.SENSITIVE));
	if(optname.equals("-non_predictive"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.NON_PREDICTIVE));
	if(optname.equals("-initial_caps_word"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.INITIAL_CAPS_WORD));
	if(optname.equals("-initial_caps_sentence"))
	    return IntThing.create(0 != (tb.getConstraints()&TextField.INITIAL_CAPS_SENTENCE));
	if(optname.equals("-caretposition"))
	    return IntThing.create(tb.getCaretPosition());
	return super.cget(ip,target,optname);
    }

    public void cset(Interp ip,Object target,String optname,Thing optval)
	throws HeclException {
	TextBox tb = (TextBox)target;

	if(optname.equals(WidgetInfo.NTYPE)) {
	    int c = (tb.getConstraints() & TextField.CONSTRAINT_MASK);
	    tb.setConstraints(c | WidgetInfo.toTextType(optval));
	    return;
	}

	if(optname.equals(WidgetInfo.NTRUNCATE)) {
	    int max = tb.getMaxSize();
	    String newtext = optval.toString();
	    if (newtext.length() > max) {
		newtext = newtext.substring(0, max);
	    }
	    tb.setString(newtext);
	    return;
	}

	if(optname.equals(WidgetInfo.NGROW)) {
	    int max = tb.getMaxSize();
	    String newtext = optval.toString();
	    int textlen = newtext.length();
	    if (textlen > max) {
		int newmax = tb.setMaxSize(textlen);
		if (newmax < textlen) {
		    newtext = newtext.substring(0, newmax);
		}
	    }
	    tb.setString(newtext);
	    return;
	}

	if(optname.equals(WidgetInfo.NTEXT)) {
	    tb.setString(optval.toString());
	    return;
	}
	if(optname.equals(WidgetInfo.NMAXLEN)) {
	    int len = IntThing.get(optval);
	    if(len <1)
		throw new HeclException("Invalid length specifier.");
	    tb.setMaxSize(len);
	    return;
	}
	int c = tb.getConstraints();
	if(optname.equals("-password")) {
	    c &= ~TextField.PASSWORD;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.PASSWORD : 0));
	    return;
	}
	if(optname.equals("-uneditable")) {
	    c &= ~TextField.UNEDITABLE;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.UNEDITABLE : 0));
	    return;
	}
	if(optname.equals("-sensitive")) {
	    c &= ~TextField.SENSITIVE;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.SENSITIVE : 0));
	    return;
	}
	if(optname.equals("-non_predictive")) {
	    c &= ~TextField.NON_PREDICTIVE;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.NON_PREDICTIVE : 0));
	    return;
	}
	if(optname.equals("-initial_caps_word")) {
	    c &= ~TextField.INITIAL_CAPS_WORD;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.INITIAL_CAPS_WORD : 0));
	    return;
	}
	if(optname.equals("-initial_caps_sentence")) {
	    c &= ~TextField.INITIAL_CAPS_SENTENCE;
	    tb.setConstraints(c | (HeclUtils.thing2bool(optval) ?
			      TextField.INITIAL_CAPS_SENTENCE : 0));
	    return;
	}
	super.cset(ip,target,optname,optval);
    }

    private static TextBoxCmd cmd = new TextBoxCmd();
    private static final String CMDNAME = "lcdui.textbox";
}

// Variables:
// mode:java
// coding:utf-8
// End:


text:
package com.tasomaniac.floodlight.fragments;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Spinner;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.tasomaniac.floodlight.R;
import com.tasomaniac.floodlight.model.Action;
import com.tasomaniac.floodlight.model.Flow;
import com.tasomaniac.floodlight.utils.JSONException;
import com.tasomaniac.floodlight.utils.flowmanager.FlowManagerPusher;

public class FlowModFragment extends SherlockFragment {

	private static final String STATE_ACTIVATED_POSITION = "activated_position";
	public static final String ARG_ITEM_ID = "item_id";

	private ViewGroup mRootView;
	EditText mFormName;
	EditText mFormPriority;
	EditText mFormCookie;
	EditText mFormIdleTimeout;
	EditText mFormHardTimeout;
	EditText mFormOutport;
	EditText mFormActionPort;
	private Spinner mActionsSpinner;

	private AsyncTask<String, Void, String> downloader;

	private String ip;
	private String dpid;
	private Flow flow;

	private boolean tek;

	public FlowModFragment() {
	}
	private Callbacks mCallbacks = sDummyCallbacks;
	private int mActivatedPosition = ListView.INVALID_POSITION;

	public interface Callbacks {
		public void onFlowPushed(String dpid);
	}

	private static Callbacks sDummyCallbacks = new Callbacks() {
		@Override
		public void onFlowPushed(String dpid) {
		}
	};

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		if (savedInstanceState != null
				&& savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
//			setActivatedPosition(savedInstanceState
//					.getInt(STATE_ACTIVATED_POSITION));
		}
	}

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if (!(activity instanceof Callbacks)) {
			throw new IllegalStateException(
					"Activity must implement fragment's callbacks.");
		}

		mCallbacks = (Callbacks) activity;
	}

	@Override
	public void onDetach() {
		super.onDetach();
		mCallbacks = sDummyCallbacks;
	}

	@Override
	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		if (mActivatedPosition != ListView.INVALID_POSITION) {
			outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
		}
	}

	@Override
	public void onDestroy() {
		super.onDestroy();

		if (downloader != null
				&& downloader.getStatus() == AsyncTask.Status.RUNNING) {
			downloader.cancel(true);
			downloader = null;
		}
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		if (getArguments() != null) {
			ip = getArguments().getString("ip");
//			dpid = getArguments().getString("dpid");
			flow = (Flow) getArguments().getSerializable("flow");
			tek= getArguments().getBoolean("tek");

//			flow.set
		}

		getSherlockActivity().getSupportActionBar().setTitle(R.string.title_flows);
		setHasOptionsMenu(true);

		if(tek)
		{
		// Inflate a "Done/Discard" custom action bar view.
        LayoutInflater inflater = (LayoutInflater) getSherlockActivity().getSupportActionBar().getThemedContext()
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        final View customActionBarView = inflater.inflate(
                R.layout.actionbar_custom_view_done_discard, null);
        customActionBarView.findViewById(R.id.actionbar_done).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {

                    	setUpDownloader();
                    }
                });
        customActionBarView.findViewById(R.id.actionbar_discard).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        // "Discard"
                        //finish();
                    	mFormName.setText("");
                    	mFormPriority.setText("");
                    	mFormCookie.setText("");
                    	mFormIdleTimeout.setText("");
                    	mFormHardTimeout.setText("");
                    	mFormOutport.setText("");
                    	mFormActionPort.setText("");
                    	mActionsSpinner.setSelection(0);
                    	//TODO: clear form
                    }
                });

        // Show the custom action bar view and hide the normal Home icon and title.
        final ActionBar actionBar = getSherlockActivity().getSupportActionBar();
        actionBar.setDisplayOptions(
                ActionBar.DISPLAY_SHOW_CUSTOM,
                ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME
                        | ActionBar.DISPLAY_SHOW_TITLE);
        actionBar.setCustomView(customActionBarView, new ActionBar.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
		}

	}

	public void setUpDownloader()
	{
		//TODO: action secilmemeisse uyari belki
    	downloader = new AsyncTask<String, Void, String>() {

			protected void onPreExecute() {

				flow.setName(mFormName.getText().toString());
				flow.setPriority(mFormPriority.getText().toString());
				flow.setCookie(mFormCookie.getText().toString());
				flow.setIdleTimeOut(mFormIdleTimeout.getText().toString());
				flow.setHardTimeOut(mFormHardTimeout.getText().toString());
				flow.setOutPort(mFormOutport.getText().toString());

				flow.getActions().get(0).setValue(mFormActionPort.getText().toString());
			};

			@Override
			protected String doInBackground(String... params) {

				try {
					return FlowManagerPusher.push(ip, flow);
				} catch (IOException e) {
				} catch (JSONException e) {
				}
				// Check to see that all the controller information is here
				return null;
			}

			protected void onPostExecute(String result) {

				if(!TextUtils.isEmpty(result))
				{
					AlertDialog.Builder b = new  AlertDialog.Builder(getActivity());
					b.setTitle(R.string.res_title)
					.setMessage(result)
					.setPositiveButton(R.string.ok,
							new OnClickListener() {

								@Override
								public void onClick(DialogInterface dialog, int which) {

									mCallbacks.onFlowPushed(dpid);
								}
							});
					b.create().show();
				}

			};

		}.execute(ip);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		mFormName.setText(flow.getName());
		mFormPriority.setText(flow.getPriority());
		mFormCookie.setText(flow.getCookie());
		mFormIdleTimeout.setText(flow.getIdleTimeOut());
		mFormHardTimeout.setText(flow.getHardTimeOut());
		mFormOutport.setText(flow.getOutPort());

		if(flow.getActions()!=null && flow.getActions().size()>0)
		{
			mFormActionPort.setText(flow.getActions().get(0).getValue());

			int pos = 0;
			String type = flow.getActions().get(0).getType();
			String[] type_arr = getResources().getStringArray(R.array.actions_array);
			for(int i=0; i<type_arr.length; i++)
			{
				if(type_arr[i].equals(type))
				{
					pos = i;
					break;
				}
			}
			mActionsSpinner.setSelection(pos);
		}

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		mRootView = (ViewGroup) inflater.inflate(R.layout.sign_in_form,
				container, false);

		mFormName = (EditText) mRootView.findViewById(R.id.form_name);
		mFormPriority = (EditText) mRootView.findViewById(R.id.form_priority);
		mFormCookie = (EditText) mRootView.findViewById(R.id.form_cookie);
		mFormIdleTimeout = (EditText) mRootView.findViewById(R.id.form_idle_timeout);
		mFormHardTimeout = (EditText) mRootView.findViewById(R.id.form_hard_timeout);
		mFormOutport = (EditText) mRootView.findViewById(R.id.form_outport);
		mFormActionPort = (EditText) mRootView.findViewById(R.id.form_action_port);

		mActionsSpinner = (Spinner) mRootView.findViewById(R.id.form_actions_spinner);

		mActionsSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int pos, long arg3) {

				//TODO: bircok action a olanak sagla
				List<Action> a = new ArrayList<Action>();
				a.add(new Action(getResources().getStringArray(R.array.actions_array)[pos]));
				flow.setActions(a);

				if(pos==0 || pos ==3)
					mFormActionPort.setVisibility(View.GONE);
				else
					mFormActionPort.setVisibility(View.VISIBLE);

			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
			}
		});
		return mRootView;
	}

	@Override
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

		super.onCreateOptionsMenu(menu, inflater);
		if(!tek)
		{
			menu.add(Menu.NONE, 1222, Menu.NONE, "PUSH")
			.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
		}
	}

	@Override
	public boolean onOptionsItemSelected(
			com.actionbarsherlock.view.MenuItem item) {

		if(item.getItemId() == 1222)
		{
			setUpDownloader();
			return true;
		}

		return super.onOptionsItemSelected(item);
	}
}


text:
<?php
require_once('lib/template.php');
printHeader('Quick Recipes!','quick');
?>

Quick Recipes! <?=$quickicon?>

Need something yummy in a jiffy? These quick recipes should do the trick. You can always look for the kitchen-timer icon next to the recipe name on any recipe category page, or come to this page for a list of just the fast recipes.

<?php

$prevCat = '';
$res = getQuick();
while($row = pg_fetch_assoc($res)){
    if($row['catlabel'] !== $prevCat){
        if($prevCat !== ''){
            print "
";
        }

        $prevCat = $row['catlabel'];
        print "
" . htmlentities($prevCat) . "
";
        print "
";
    }

    print "
{$row['name']}".($row['quick'] == 't' ? $quickicon : '') . ($row['favorite'] == 't' ? $favoriteicon : '')."
";
}

print "

";

printFooter();


text:
<?php

namespace Application\Models\Ads;

class Ad
{
    /**@var int*/
    protected $id;
    /**@var int*/
    protected $advertiserId;
    /**@var string*/
    protected $partName;
    /**@var int*/
    protected $carMake;
    /**@var int*/
    protected $carCategory;
    /**@var string*/
    protected $carModel;
    /**@var string*/
    protected $description;
    /**@var float*/
    protected $price;
    /**@var string*/
    protected $status;
    /**@var string*/
    protected $dateadd;
    /**@var string*/
    protected $updatedAt;
    /**@var string*/
    protected $images;
    /**@var string*/
    protected $yearStart;
    /**@var string*/
    protected $yearEnd;
    /**@var string*/
    protected $currency;
    /**@var int*/
    protected $views;
    /**@var int*/
    protected $contactDisplayed;
    /**@var string*/
    protected $expirationDate;
    /**@var string*/
    protected $stare;
    /**@var string*/
    protected $codeOem;

    // from joins
    protected $stateId;

    /**
     * @return string
     */
    public function getCodeOem()
    {
        return $this->codeOem;
    }

    /**
     * @param string $codeOem
     * @return Ad
     */
    public function setCodeOem($codeOem)
    {
        $this->codeOem = $codeOem;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getStateId()
    {
        return $this->stateId;
    }

    /**
     * @param mixed $stateId
     * @return Ad
     */
    public function setStateId($stateId)
    {
        $this->stateId = $stateId;
        return $this;
    }

    /**
     * @return string
     */
    public function getStare()
    {
        return $this->stare;
    }

    /**
     * @param string $stare
     * @return Ad
     */
    public function setStare($stare)
    {
        $this->stare = $stare;
        return $this;
    }

    /**
     * @return string
     */
    public function getExpirationDate()
    {
        return $this->expirationDate;
    }

    /**
     * @param string $expirationDate
     * @return Ad
     */
    public function setExpirationDate($expirationDate)
    {
        $this->expirationDate = $expirationDate;
        return $this;
    }

    /**
     * @return int
     */
    public function getContactDisplayed()
    {
        return $this->contactDisplayed;
    }

    /**
     * @param int $contactDisplayed
     * @return Ad
     */
    public function setContactDisplayed($contactDisplayed)
    {
        $this->contactDisplayed = $contactDisplayed;
        return $this;
    }

    /**
     * @return int
     */
    public function getViews()
    {
        return $this->views;
    }

    /**
     * @param int $views
     * @return Ad
     */
    public function setViews($views)
    {
        $this->views = $views;
        return $this;
    }

    /**
     * @return string
     */
    public function getCarModel()
    {
        return $this->carModel;
    }

    /**
     * @param string $carModel
     * @return Ad
     */
    public function setCarModel($carModel)
    {
        $this->carModel = $carModel;
        return $this;
    }

    /**
     * @return string
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * @param string $currency
     * @return Ad
     */
    public function setCurrency($currency)
    {
        $this->currency = $currency;
        return $this;
    }

    /**
     * @return string
     */
    public function getYearStart()
    {
        return $this->yearStart;
    }

    /**
     * @param string $yearStart
     * @return Ad
     */
    public function setYearStart($yearStart)
    {
        $this->yearStart = $yearStart;
        return $this;
    }

    /**
     * @return string
     */
    public function getYearEnd()
    {
        return $this->yearEnd;
    }

    /**
     * @param string $yearEnd
     * @return Ad
     */
    public function setYearEnd($yearEnd)
    {
        $this->yearEnd = $yearEnd;
        return $this;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     * @return Ad
     */
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * @return string
     */
    public function getImages()
    {
        return $this->images;
    }

    /**
     * @param string $images
     * @return Ad
     */
    public function setImages($images)
    {
        $this->images = $images;
        return $this;
    }

    /**
     * @return int
     */
    public function getAdvertiserId()
    {
        return $this->advertiserId;
    }

    /**
     * @param int $advertiserId
     * @return Ad
     */
    public function setAdvertiserId($advertiserId)
    {
        $this->advertiserId = $advertiserId;
        return $this;
    }

    /**
     * @return string
     */
    public function getPartName()
    {
        return $this->partName;
    }

    /**
     * @param string $partName
     * @return Ad
     */
    public function setPartName($partName)
    {
        $this->partName = $partName;
        return $this;
    }

    /**
     * @return int
     */
    public function getCarMake()
    {
        return $this->carMake;
    }

    /**
     * @param int $carMake
     * @return Ad
     */
    public function setCarMake($carMake)
    {
        $this->carMake = $carMake;
        return $this;
    }

    /**
     * @return int
     */
    public function getCarCategory()
    {
        return $this->carCategory;
    }

    /**
     * @param int $carCategory
     * @return Ad
     */
    public function setCarCategory($carCategory)
    {
        $this->carCategory = $carCategory;
        return $this;
    }

    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @param string $description
     * @return Ad
     */
    public function setDescription($description)
    {
        $this->description = $description;
        return $this;
    }

    /**
     * @return float
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * @param float $price
     * @return Ad
     */
    public function setPrice($price)
    {
        $this->price = $price;
        return $this;
    }

    /**
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param string $status
     * @return Ad
     */
    public function setStatus($status)
    {
        $this->status = $status;
        return $this;
    }

    /**
     * @return string
     */
    public function getDateadd()
    {
        return $this->dateadd;
    }

    /**
     * @param string $dateadd
     * @return Ad
     */
    public function setDateadd($dateadd)
    {
        $this->dateadd = $dateadd;
        return $this;
    }

    /**
     * @return string
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * @param string $updatedAt
     * @return Ad
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;
        return $this;
    }

}


text:
<!DOCTYPE html>
<title>Canvas test: 2d.fillStyle.parse.rgba-percent</title>

<link rel="stylesheet" href="../tests.css">

Pass

Fail

These images should be identical:

<canvas id="c" class="output" width="100" height="50">
FAIL (fallback content)
</canvas>

Expected output:


text:
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <machine/_inttypes.h>

#include <assert.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include "_libproc.h"

#if defined(__i386__) || defined(__amd64__)
#define BREAKPOINT_INSTR	0xcc	/* int 0x3 */
#define	BREAKPOINT_INSTR_SZ	1
#elif defined(__mips__)
#define BREAKPOINT_INSTR	0xd	/* break */
#define	BREAKPOINT_INSTR_SZ	4
#elif defined(__powerpc__)
#define BREAKPOINT_INSTR	0x7fe00008	/* trap */
#define BREAKPOINT_INSTR_SZ 4
#else
#error "Add support for your architecture"
#endif

static int
proc_stop(struct proc_handle *phdl)
{
	int status;

	if (kill(proc_getpid(phdl), SIGSTOP) == -1) {
		DPRINTF("kill %d", proc_getpid(phdl));
		return (-1);
	} else if (waitpid(proc_getpid(phdl), &status, WSTOPPED) == -1) {
		DPRINTF("waitpid %d", proc_getpid(phdl));
		return (-1);
	} else if (!WIFSTOPPED(status)) {
		DPRINTFX("waitpid: unexpected status 0x%x", status);
		return (-1);
	}

	return (0);
}

int
proc_bkptset(struct proc_handle *phdl, uintptr_t address,
    unsigned long *saved)
{
	struct ptrace_io_desc piod;
	unsigned long paddr, caddr;
	int ret = 0, stopped;

	*saved = 0;
	if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
	    phdl->status == PS_IDLE) {
		errno = ENOENT;
		return (-1);
	}

	DPRINTFX("adding breakpoint at 0x%lx", address);

	stopped = 0;
	if (phdl->status != PS_STOP) {
		if (proc_stop(phdl) != 0)
			return (-1);
		stopped = 1;
	}

	/*
	 * Read the original instruction.
	 */
	caddr = address;
	paddr = 0;
	piod.piod_op = PIOD_READ_I;
	piod.piod_offs = (void *)caddr;
	piod.piod_addr = &paddr;
	piod.piod_len  = BREAKPOINT_INSTR_SZ;
	if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
		DPRINTF("ERROR: couldn't read instruction at address 0x%"
		    PRIuPTR, address);
		ret = -1;
		goto done;
	}
	*saved = paddr;
	/*
	 * Write a breakpoint instruction to that address.
	 */
	caddr = address;
	paddr = BREAKPOINT_INSTR;
	piod.piod_op = PIOD_WRITE_I;
	piod.piod_offs = (void *)caddr;
	piod.piod_addr = &paddr;
	piod.piod_len  = BREAKPOINT_INSTR_SZ;
	if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
		DPRINTF("ERROR: couldn't write instruction at address 0x%"
		    PRIuPTR, address);
		ret = -1;
		goto done;
	}

done:
	if (stopped)
		/* Restart the process if we had to stop it. */
		proc_continue(phdl);

	return (ret);
}

int
proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
    unsigned long saved)
{
	struct ptrace_io_desc piod;
	unsigned long paddr, caddr;
	int ret = 0, stopped;

	if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
	    phdl->status == PS_IDLE) {
		errno = ENOENT;
		return (-1);
	}

	DPRINTFX("removing breakpoint at 0x%lx", address);

	stopped = 0;
	if (phdl->status != PS_STOP) {
		if (proc_stop(phdl) != 0)
			return (-1);
		stopped = 1;
	}

	/*
	 * Overwrite the breakpoint instruction that we setup previously.
	 */
	caddr = address;
	paddr = saved;
	piod.piod_op = PIOD_WRITE_I;
	piod.piod_offs = (void *)caddr;
	piod.piod_addr = &paddr;
	piod.piod_len  = BREAKPOINT_INSTR_SZ;
	if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {
		DPRINTF("ERROR: couldn't write instruction at address 0x%"
		    PRIuPTR, address);
		ret = -1;
	}

	if (stopped)
		/* Restart the process if we had to stop it. */
		proc_continue(phdl);

	return (ret);
}

/*
 * Decrement pc so that we delete the breakpoint at the correct
 * address, i.e. at the BREAKPOINT_INSTR address.
 */
void
proc_bkptregadj(unsigned long *pc)
{
	*pc = *pc - BREAKPOINT_INSTR_SZ;
}

/*
 * Step over the breakpoint.
 */
int
proc_bkptexec(struct proc_handle *phdl, unsigned long saved)
{
	unsigned long pc;
	unsigned long samesaved;
	int status;

	if (proc_regget(phdl, REG_PC, &pc) < 0) {
		DPRINTFX("ERROR: couldn't get PC register");
		return (-1);
	}
	proc_bkptregadj(&pc);
	if (proc_bkptdel(phdl, pc, saved) < 0) {
		DPRINTFX("ERROR: couldn't delete breakpoint");
		return (-1);
	}
	/*
	 * Go back in time and step over the new instruction just
	 * set up by proc_bkptdel().
	 */
	proc_regset(phdl, REG_PC, pc);
	if (ptrace(PT_STEP, proc_getpid(phdl), (caddr_t)1, 0) < 0) {
		DPRINTFX("ERROR: ptrace step failed");
		return (-1);
	}
	proc_wstatus(phdl);
	status = proc_getwstat(phdl);
	if (!WIFSTOPPED(status)) {
		DPRINTFX("ERROR: don't know why process stopped");
		return (-1);
	}
	/*
	 * Restore the breakpoint. The saved instruction should be
	 * the same as the one that we were passed in.
	 */
	if (proc_bkptset(phdl, pc, &samesaved) < 0) {
		DPRINTFX("ERROR: couldn't restore breakpoint");
		return (-1);
	}
	assert(samesaved == saved);

	return (0);
}


text:
require "slim-rails"
require "jquery-rails"

require "predictor"
require "teams"

module WebUi
  require "web_ui/engine"
end


text:
<!doctype html>

    <title>Code coverage report for src/confirm.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / src/ confirm.js

        88.89%
        Statements
        16/18

        80%
        Branches
        8/10

        100%
        Functions
        6/6

        88.89%
        Lines
        16/18

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

1×

1×

2×

2×

5×

5×
4×
2×

5×

2×

2×
1×

2×

2×
1×

1×

  /**
   * 对话框
   *
   * @module Dialog
   */

  'use strict';

  var Dialog = require('./dialog');

  /**
   * Confirm
   * 确认弹窗
   *
   * @class Confirm
   * @extends Dialog
   * @constructor
   */
  var Confirm = Dialog.extend({

    defaults: {
      /**
       * 是否显示遮罩层
       *
       * @attribute mask
       * @default true
       * @type {Boolean}
       */
      mask: true,
      data: {
        /**
         * 自定义取消操作按钮
         *
         * @attribute data.cancel
         * @default <span class="btn btn-default">取消</span>
         * @type {String}
         */
        cancel: '<span class="btn btn-default">取消</span>',

        /**
         * 自定义确认操作按钮
         *
         * @attribute data.submit
         * @default <span class="btn btn-primary">确定</span>
         * @type {String}
         */
        submit: '<span class="btn btn-primary">确定</span>',

        /**
         * 标题
         *
         * @attribute data.title
         * @default 确认
         * @type {String}
         */
        title: '确认'
      },
      delegates: {
        'click [data-role=submit]': function() {
          this.submit();
        },
        'click [data-role=cancel]': function() {
          this.cancel();
        }
      }
    },

    setup: function() {
      var self = this;

      if (!self.option('trigger')) {
        self.hide(function() {
          this.destroy();
        });
      }

      Confirm.superclass.setup.apply(self);
    },

    /**
     * 确定或绑定确定事件回调
     *
     * @param {Function} [callback] 事件回调函数
     * @method submit
     */
    submit: function(callback) {
      Iif (callback) {
        return this.on('submit', callback);
      } else {
        /**
         * 确定事件
         *
         * @event submit
         * @param {object} e Event.
         */
        if (this.fire('submit')) {
          this.close();
        }
      }
    },

    /**
     * 取消或绑定取消事件回调
     *
     * @param {Function} [callback] 事件回调函数
     * @method cancel
     */
    cancel: function(callback) {
      Iif (callback) {
        return this.on('cancel', callback);
      } else {
        /**
         * 取消事件
         *
         * @event cancel
         * @param {object} e Event.
         */
        if (this.fire('cancel')) {
          this.close();
        }
      }
    }

  });

  module.exports = Confirm;

  Code coverage
  generated by istanbul at Wed Jan 04 2017 10:44:43 GMT+0800 (CST)


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace MyApp.Web.Mvc.Resources {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class Strings {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Strings() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyApp.Web.Mvc.Strings", typeof(Strings).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Compute hash codes.
        /// </summary>
        public static string ComputeHashCodes {
            get {
                return ResourceManager.GetString("ComputeHashCodes", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Courses.
        /// </summary>
        public static string Courses {
            get {
                return ResourceManager.GetString("Courses", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Create random files.
        /// </summary>
        public static string CreateRandomFiles {
            get {
                return ResourceManager.GetString("CreateRandomFiles", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Standards.
        /// </summary>
        public static string Standards {
            get {
                return ResourceManager.GetString("Standards", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Students.
        /// </summary>
        public static string Students {
            get {
                return ResourceManager.GetString("Students", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Teachers.
        /// </summary>
        public static string Teachers {
            get {
                return ResourceManager.GetString("Teachers", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Tools.
        /// </summary>
        public static string Tools {
            get {
                return ResourceManager.GetString("Tools", resourceCulture);
            }
        }
    }
}


text:
package com.google.shipshape.util.rpc;

import com.google.common.base.Throwables;
import com.google.common.reflect.TypeToken;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FieldDescriptor;
import com.google.protobuf.GeneratedMessage;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;

/**
 * K-RPC method interface.
 *
 * @see Method.ServerImpl
 * @see Method.Simple
 * @see Method.Streaming
 */
public interface Method<I, O> {
  /** Sets the {@link Function} for a class to determine a {@link Method.Info}'s parameter names. */
  public static void setParametersDescriptor(Class<?> cls, Function<Class<?>, String[]> getParams) {
    ReflectionUtil.PARAMETER_DESCRIPTORS.put(cls, getParams);
  }

  /** Entry-point for an RPC call. This is usually called by a type-safe adapter. */
  public void baseCall(Context ctx, JsonObject params, OutputChannel<JsonElement> results)
      throws Exception;

  /** Returns a simple {@link Method} returning a single value. */
  public static <I, O> Simple<I, O> simple(final String name, final Simple<I, O> f,
      final Class<I> inputClass, final Class<O> outputClass) {
    final String[] params = ReflectionUtil.getFieldNames(inputClass);
    return new Simple<I, O>() {
      @Override
      public String getName() {
        return name;
      }
      @Override
      public String[] getParams() {
        return params;
      }
      @Override
      public Type getInputType() {
        return inputClass;
      }
      @Override
      public Type getOutputType() {
        return outputClass;
      }
      @Override
      public O call(Context ctx, I params) throws Exception {
        return f.call(ctx, params);
      }
    };
  }

  /** Returns a streaming {@link Method} returning 0+ results through an {@link OutputChannel}. */
  public static <I, O> Streaming<I, O> streaming(final String name, final Streaming<I, O> f,
      final Class<I> inputClass, final Class<O> outputClass) {
    final String[] params = ReflectionUtil.getFieldNames(inputClass);
    return new Streaming<I, O>() {
      @Override
      public String getName() {
        return name;
      }
      @Override
      public String[] getParams() {
        return params;
      }
      @Override
      public Type getInputType() {
        return inputClass;
      }
      @Override
      public Type getOutputType() {
        return outputClass;
      }
      @Override
      public void call(Context ctx, I params, OutputChannel<O> stream) throws Exception {
        f.call(ctx, params, stream);
      }
    };
  }

  /** Interface for {@link Method}s being registered with an RPC {@link Server}. */
  public interface ServerImpl<I, O> extends Method<I, O> {
    default public boolean isStreaming() {
      return true;
    }
    default public String getName() {
      return getClass().getSimpleName();
    }
    default public String[] getParams() {
      return ReflectionUtil.getFieldNames(getInputType());
    }
    default public Type getInputType() {
      return ReflectionUtil.getParameterTypes(getClass())[0];
    }
    default public Type getOutputType() {
      return ReflectionUtil.getParameterTypes(getClass())[1];
    }
    default public Info getInfo() {
      return new Info(getName(), getParams(), isStreaming());
    }
  }

  /** {@link Method} returns 0 or more results through an {@link OutputChannel}. */
  @FunctionalInterface
  public interface Streaming<I, O> extends ServerImpl<I, O> {
    public void call(Context ctx, I params, OutputChannel<O> results) throws Exception;

    default public void baseCall(Context ctx, JsonObject params,
        OutputChannel<JsonElement> results) throws Exception {
      call(ctx,
          ctx.getGson().fromJson(params, getInputType()),
          results.transformingStream(ctx.getGson()::toJsonTree));
    }
  }

  /** {@link Method} returning exactly 1 result. */
  @FunctionalInterface
  public interface Simple<I, O> extends ServerImpl<I, O> {
    public O call(Context ctx, I params) throws Exception;

    default public void baseCall(Context ctx, JsonObject params,
        OutputChannel<JsonElement> results) throws Exception {
      O result = call(ctx, ctx.getGson().fromJson(params, getInputType()));
      results.send(ctx.getGson().toJsonTree(result));
      results.onCompleted();
    }
    default public boolean isStreaming() {
      return false;
    }
  }

  /** RPC {@link Method} information. */
  public static class Info {
    // This interface must be kept in sync w/ Protocol.MethodInfoSerializer

    public final String name;
    public final String[] params;
    public final boolean stream;

    public Info(String name, String[] params, boolean stream) {
      this.name = name;
      this.params = params;
      this.stream = stream;
    }
  }
}

class ReflectionUtil {
  static final Map<Class<?>, Function<Class<?>, String[]>> PARAMETER_DESCRIPTORS =
      new HashMap<>();

  static {
    Method.setParametersDescriptor(GeneratedMessage.class, (cls) -> {
          try {
            Descriptor descriptor = (Descriptor) cls.getMethod("getDescriptor").invoke(null);
            List<FieldDescriptor> fields = descriptor.getFields();
            String[] names = new String[fields.size()];
            int i = 0;
            for (FieldDescriptor f : fields) {
              names[i] = f.getName();
              i++;
            }
            return names;
          } catch (NoSuchMethodException|IllegalAccessException|InvocationTargetException e) {
            throw Throwables.propagate(e);
          }
        });
  }

  static String[] getFieldNames(Type t) {
    Class cls = TypeToken.of(t).getRawType();

    // Check for class specific parameter descriptions
    for (Class superCls : PARAMETER_DESCRIPTORS.keySet()) {
      if (superCls.isAssignableFrom(cls)) {
        String[] names = PARAMETER_DESCRIPTORS.get(superCls).apply(cls);
        Arrays.sort(names);
        return names;
      }
    }

    // Fallback to generic reflection method
    Field[] fields = cls.getDeclaredFields();
    String[] names = new String[fields.length];
    for (int i = 0; i < fields.length; i++) {
      names[i] = fields[i].getName();
    }
    Arrays.sort(names);
    return names;
  }

  static Type[] getParameterTypes(Class cls) {
    TypeToken t = getMethodInterface(cls);
    Type[] types = ((ParameterizedType) t.getType()).getActualTypeArguments();
    if (types.length != 2) {
      throw new IllegalStateException("unknown method type signature: " + Arrays.toString(types));
    }
    return types;
  }

  static TypeToken getMethodInterface(Type t) {
    TypeToken token = TypeToken.of(t);
    Set<TypeToken> interfaces = token.getTypes().interfaces();
    for (TypeToken i : interfaces) {
      if (i.getRawType().equals(Method.ServerImpl.class)) {
        return i;
      }
    }
    throw new IllegalArgumentException(
        "Type " + t + " does not implement the Method.ServerImpl interface");
  }
}


text:
/*******************************************************************************************************
*   JobObjectWrapper
*
* AssemblyInfo.cpp
*
* http://https://github.com/alonf/JobObjectWrapper
*
* This program is licensed under the MIT License.
*
* Alon Fliess
********************************************************************************************************/
#include "stdafx.h"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("JobObjectWrapper 2017")];
[assembly:AssemblyDescriptionAttribute(".NET Wrapper for Win32 Job Object")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("CodeValue")];
[assembly:AssemblyProductAttribute("JobManagement")];
[assembly:AssemblyCopyrightAttribute("Copyright (c) CodeValue 2017")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];

//
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly:AssemblyVersionAttribute("0.1.0.0")];

[assembly:ComVisible(false)];

[assembly:CLSCompliantAttribute(true)];


text:
package org.collprod.bicingbcn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;

import junit.framework.Assert;

import org.collprod.bicingbcn.etl.PhoenixWriter;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import com.google.common.collect.Lists;

public class EtlStreamTest {
	// FIXME hardcoded, load from config and broadcast
	// JDBC driver name and database URL
	final String JDBC_DRIVER = "org.apache.phoenix.jdbc.PhoenixDriver";
	final String DB_URL = "jdbc:phoenix:localhost";

	private Connection con = null;
	private BicingStationDao.Value stationInfo;
	private PhoenixWriter phoenixWriter;

	@Before
	public void setup() {
		stationInfo = BicingStationDao.Value.create(1400940246L * 1000L, 1, 41.3979520, 2.18004200, "Gran Via Corts Catalanes", 21,
				760, Lists.newArrayList(24,369,387,426), "OPN", 13, 9);
		phoenixWriter = new PhoenixWriter();
	}

	/**
	 * Ignored as it implies a side effect in the database
	 * */
	@Ignore
	@Test
	public void testUpsertBicingTime() throws ClassNotFoundException, SQLException  {
		PreparedStatement stmtBicingDimTime = null;
		try {
			// Prepare DB connection
			// Register JDBC driver
			Class.forName(JDBC_DRIVER);
			con = DriverManager.getConnection(DB_URL);

			// Create, load and execute update statement
			stmtBicingDimTime = phoenixWriter.buildBicingDimTime(con);
			phoenixWriter.loadBicingDimTimeStatement(stationInfo, stmtBicingDimTime);
			stmtBicingDimTime.executeUpdate();

			// Commit to database
			con.commit();

		} catch (SQLException e) {
			throw e;
		} finally {
			// Close DB resources
			if (stmtBicingDimTime != null) {
				stmtBicingDimTime.close();
			}
			if (con != null) {
				con.close();
			}
		}
	}

	/**
	 * Ignored as it assumes a particular state of the database
	 * */
	@Ignore
	@Test
	public void testLookupBicingTime() throws SQLException, ClassNotFoundException {
		Class.forName(JDBC_DRIVER);
		con = DriverManager.getConnection(DB_URL);
		PreparedStatement stmtCheckExistsTimetagDimTime = con.prepareStatement("SELECT TIMETAG from BICING_DIM_TIME WHERE TIMETAG = ?");
			// in milliseconds
		stmtCheckExistsTimetagDimTime.setTimestamp(1, new Timestamp(stationInfo.updatetime()));
		ResultSet queryResults = stmtCheckExistsTimetagDimTime.executeQuery();
		boolean exists =  queryResults.next();
		Assert.assertTrue(exists);
		stmtCheckExistsTimetagDimTime.close();
		con.close();
	}

	/**
	 * Ignored as it assumes a particular state of the database
	 * */
	@Ignore
	@Test
	public void testLookupStationState() throws ClassNotFoundException, SQLException {
		PreparedStatement stmtGetStationInfo = null;
		Long stationId = 510L;
		try  {
			Class.forName(JDBC_DRIVER);
			con = DriverManager.getConnection(DB_URL);
			stmtGetStationInfo = phoenixWriter.buildLookupStationStatement(con);
			PhoenixWriter.DimStationRecord stationInfo = phoenixWriter.lookupStationRecord(stmtGetStationInfo, stationId);
			System.out.println(stationInfo);

		} catch (SQLException e) {
			throw e;
		} finally {
			// Close DB resources
			if (stmtGetStationInfo != null) {
				stmtGetStationInfo.close();
			}
			if (con != null) {
				con.close();
			}
		}
	}

	@Test
	public void testBicingBigTableUpsert() throws ClassNotFoundException, SQLException {
		PreparedStatement stmtGetStationInfo = null;
		PreparedStatement stmtUpsertBicingBigTableStatement= null;

		try  {
			Class.forName(JDBC_DRIVER);
			con = DriverManager.getConnection(DB_URL);
			stmtGetStationInfo = phoenixWriter.buildLookupStationStatement(con);

			stmtUpsertBicingBigTableStatement = phoenixWriter.buildBicingBigTableStatement(con);
			stmtGetStationInfo = phoenixWriter.buildLookupStationStatement(con);
			phoenixWriter.loadBicingBigTableStatement(stationInfo, 0, stmtUpsertBicingBigTableStatement, stmtGetStationInfo);
			stmtUpsertBicingBigTableStatement.executeUpdate();

			con.commit();
		} catch (SQLException e) {
			throw e;
		} finally {
			// Close DB resources
			if (stmtGetStationInfo != null) {
				stmtGetStationInfo.close();
			}
			if (stmtUpsertBicingBigTableStatement != null) {
				stmtUpsertBicingBigTableStatement.close();
			}
			if (con != null) {
				con.close();
			}
		}
	}

}


text:
package promidi;

abstract class MidiDevice{

	/**
	 * the MidiDevice for this input
	 */
	final javax.sound.midi.MidiDevice midiDevice;

	/**
	 * the number of the midiDevice
	 */
	final int deviceNumber;

	/**
	 * Initializes a new MidiIn.
	 * @param libContext
	 * @param midiDevice
	 * @throws MidiUnavailableException
	 */
	MidiDevice(
		final javax.sound.midi.MidiDevice midiDevice,
		final int deviceNumber
	){
		this.midiDevice = midiDevice;
		this.deviceNumber = deviceNumber;
	}

	String getName(){
		return midiDevice.getDeviceInfo().getName();
	}

	void open(){
		try{
			if(!midiDevice.isOpen()){
				midiDevice.open();
			}
			}catch (Exception e){
				throw new RuntimeException(
					"You wanted to open an unavailable output device: "+deviceNumber + " "+getName()
				);
			}
	}

	/**
	 * Closes this device
	 */
	public void close(){
		if(midiDevice.isOpen())midiDevice.close();
	}

}


text:
goog.module('goog.ui.TabBarTest');
goog.setTestOnly();

const Component = goog.require('goog.ui.Component');
const Container = goog.require('goog.ui.Container');
const EventType = goog.require('goog.events.EventType');
const GoogEvent = goog.require('goog.events.Event');
const KeyCodes = goog.require('goog.events.KeyCodes');
const TabBar = goog.require('goog.ui.TabBar');
const TabBarRenderer = goog.require('goog.ui.TabBarRenderer');
const UiTab = goog.require('goog.ui.Tab');
const dom = goog.require('goog.dom');
const events = goog.require('goog.events');
const testSuite = goog.require('goog.testing.testSuite');

let sandbox;
let tabBar;

// Fake keyboard event object.
class FakeKeyEvent {
  constructor(keyCode) {
    this.keyCode = keyCode;
    this.defaultPrevented = false;
    this.propagationStopped = false;
  }

  preventDefault() {
    this.defaultPrevented = true;
  }

  stopPropagation() {
    this.propagationStopped = true;
  }
}

/** @suppress {visibility} suppression added to enable type checking */
function setHighlightedIndexFromKeyEvent() {
  let bar;
  let baz;
  let foo;

  // Create a tab bar with some tabs.
  tabBar.addChild(foo = new UiTab('foo'));
  tabBar.addChild(bar = new UiTab('bar'));
  tabBar.addChild(baz = new UiTab('baz'));

  // Verify baseline assumptions.
  assertNull('No tab must be highlighted', tabBar.getHighlighted());
  assertNull('No tab must be selected', tabBar.getSelectedTab());
  assertTrue(
      'Tab bar must auto-select tabs on keyboard highlight',
      tabBar.isAutoSelectTabs());

  // Highlight and selection must move together.
  tabBar.setHighlightedIndexFromKeyEvent(0);
  assertTrue('Foo must be highlighted', foo.isHighlighted());
  assertTrue('Foo must be selected', foo.isSelected());

  // Highlight and selection must move together.
  tabBar.setHighlightedIndexFromKeyEvent(1);
  assertFalse('Foo must no longer be highlighted', foo.isHighlighted());
  assertFalse('Foo must no longer be selected', foo.isSelected());
  assertTrue('Bar must be highlighted', bar.isHighlighted());
  assertTrue('Bar must be selected', bar.isSelected());

  // Turn off auto-select-on-keyboard-highlight.
  tabBar.setAutoSelectTabs(false);

  // Selection must not change; only highlight should move.
  tabBar.setHighlightedIndexFromKeyEvent(2);
  assertFalse('Bar must no longer be highlighted', bar.isHighlighted());
  assertTrue('Bar must remain selected', bar.isSelected());
  assertTrue('Baz must be highlighted', baz.isHighlighted());
  assertFalse('Baz must not be selected', baz.isSelected());
}

testSuite({
  setUp() {
    sandbox = dom.getElement('sandbox');
    tabBar = new TabBar();
  },

  tearDown() {
    tabBar.dispose();
    dom.removeChildren(sandbox);
  },

  testConstructor() {
    assertNotNull('Tab bar must not be null', tabBar);
    assertEquals(
        'Tab bar renderer must default to expected value',
        TabBarRenderer.getInstance(), tabBar.getRenderer());
    assertEquals(
        'Tab bar location must default to expected value', TabBar.Location.TOP,
        tabBar.getLocation());
    assertEquals(
        'Tab bar orientation must default to expected value',
        Container.Orientation.HORIZONTAL, tabBar.getOrientation());

    const fakeRenderer = {};
    const fakeDomHelper = {};
    /** @suppress {checkTypes} suppression added to enable type checking */
    const bar = new TabBar(TabBar.Location.START, fakeRenderer, fakeDomHelper);
    assertNotNull('Tab bar must not be null', bar);
    assertEquals(
        'Tab bar renderer must have expected value', fakeRenderer,
        bar.getRenderer());
    assertEquals(
        'Tab bar DOM helper must have expected value', fakeDomHelper,
        bar.getDomHelper());
    assertEquals(
        'Tab bar location must have expected value', TabBar.Location.START,
        bar.getLocation());
    assertEquals(
        'Tab bar orientation must have expected value',
        Container.Orientation.VERTICAL, bar.getOrientation());
    bar.dispose();
  },

  testDispose() {
    // Set tabBar.selectedTab_ to something non-null, just to test dispose().
    /**
     * @suppress {visibility,checkTypes} suppression added to enable type
     * checking
     */
    tabBar.selectedTab_ = {};
    assertNotNull('Selected tab must be non-null', tabBar.getSelectedTab());
    assertFalse('Tab bar must not have been disposed of', tabBar.isDisposed());
    tabBar.dispose();
    assertNull('Selected tab must be null', tabBar.getSelectedTab());
    assertTrue('Tab bar must have been disposed of', tabBar.isDisposed());
  },

  testAddRemoveChild() {
    assertNull('No tab must be selected', tabBar.getSelectedTab());

    const first = new UiTab('First');
    tabBar.addChild(first);
    assertEquals(
        'First tab must have been added at the expected index', 0,
        tabBar.indexOfChild(first));
    first.setSelected(true);
    assertEquals('First tab must be selected', 0, tabBar.getSelectedTabIndex());

    const second = new UiTab('Second');
    tabBar.addChild(second);
    assertEquals(
        'Second tab must have been added at the expected index', 1,
        tabBar.indexOfChild(second));
    assertEquals(
        'First tab must remain selected', 0, tabBar.getSelectedTabIndex());

    const firstRemoved = tabBar.removeChild(first);
    assertEquals(
        'removeChild() must return the removed tab', first, firstRemoved);
    assertEquals(
        'First tab must no longer be in the tab bar', -1,
        tabBar.indexOfChild(first));
    assertEquals(
        'Second tab must be at the expected index', 0,
        tabBar.indexOfChild(second));
    assertFalse('First tab must no longer be selected', first.isSelected());
    assertTrue('Remaining tab must be selected', second.isSelected());

    const secondRemoved = tabBar.removeChild(second);
    assertEquals(
        'removeChild() must return the removed tab', second, secondRemoved);
    assertFalse('Tab must no longer be selected', second.isSelected());
    assertNull('No tab must be selected', tabBar.getSelectedTab());
  },

  testGetSetLocation() {
    assertEquals(
        'Location must default to TOP', TabBar.Location.TOP,
        tabBar.getLocation());
    tabBar.setLocation(TabBar.Location.START);
    assertEquals(
        'Location must have expected value', TabBar.Location.START,
        tabBar.getLocation());
    tabBar.createDom();
    assertThrows(
        'Attempting to change the location after the tab bar has ' +
            'been rendered must throw error',
        () => {
          tabBar.setLocation(TabBar.Location.BOTTOM);
        });
  },

  testIsSetAutoSelectTabs() {
    assertTrue(
        'Tab bar must auto-select tabs by default', tabBar.isAutoSelectTabs());
    tabBar.setAutoSelectTabs(false);
    assertFalse(
        'Tab bar must no longer auto-select tabs by default',
        tabBar.isAutoSelectTabs());
    tabBar.render(sandbox);
    assertFalse(
        'Rendering must not change auto-select setting',
        tabBar.isAutoSelectTabs());
    tabBar.setAutoSelectTabs(true);
    assertTrue(
        'Tab bar must once again auto-select tabs', tabBar.isAutoSelectTabs());
  },

  testGetSetSelectedTab() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    assertNull('No tab must be selected', tabBar.getSelectedTab());

    tabBar.setSelectedTab(baz);
    assertTrue('Baz must be selected', baz.isSelected());
    assertEquals('Baz must be the selected tab', baz, tabBar.getSelectedTab());

    tabBar.setSelectedTab(foo);
    assertFalse('Baz must no longer be selected', baz.isSelected());
    assertTrue('Foo must be selected', foo.isSelected());
    assertEquals('Foo must be the selected tab', foo, tabBar.getSelectedTab());

    tabBar.setSelectedTab(foo);
    assertTrue('Foo must remain selected', foo.isSelected());
    assertEquals(
        'Foo must remain the selected tab', foo, tabBar.getSelectedTab());

    tabBar.setSelectedTab(null);
    assertFalse('Foo must no longer be selected', foo.isSelected());
    assertNull('No tab must be selected', tabBar.getSelectedTab());
  },

  testGetSetSelectedTabIndex() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChildAt(foo = new UiTab('foo'), 0);
    tabBar.addChildAt(bar = new UiTab('bar'), 1);
    tabBar.addChildAt(baz = new UiTab('baz'), 2);

    assertEquals('No tab must be selected', -1, tabBar.getSelectedTabIndex());

    tabBar.setSelectedTabIndex(2);
    assertTrue('Baz must be selected', baz.isSelected());
    assertEquals(
        'Baz must be the selected tab', 2, tabBar.getSelectedTabIndex());

    tabBar.setSelectedTabIndex(0);
    assertFalse('Baz must no longer be selected', baz.isSelected());
    assertTrue('Foo must be selected', foo.isSelected());
    assertEquals(
        'Foo must be the selected tab', 0, tabBar.getSelectedTabIndex());

    tabBar.setSelectedTabIndex(0);
    assertTrue('Foo must remain selected', foo.isSelected());
    assertEquals(
        'Foo must remain the selected tab', 0, tabBar.getSelectedTabIndex());

    tabBar.setSelectedTabIndex(-1);
    assertFalse('Foo must no longer be selected', foo.isSelected());
    assertEquals('No tab must be selected', -1, tabBar.getSelectedTabIndex());
  },

  /** @suppress {visibility} suppression added to enable type checking */
  testDeselectIfSelected() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    // Start with the middle tab selected.
    bar.setSelected(true);
    assertTrue('Bar must be selected', bar.isSelected());
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    // Should be a no-op.
    tabBar.deselectIfSelected(null);
    assertTrue('Bar must remain selected', bar.isSelected());
    assertEquals(
        'Bar must remain the selected tab', bar, tabBar.getSelectedTab());

    // Should be a no-op.
    tabBar.deselectIfSelected(foo);
    assertTrue('Bar must remain selected', bar.isSelected());
    assertEquals(
        'Bar must remain the selected tab', bar, tabBar.getSelectedTab());

    // Should deselect bar and select the previous tab (foo).
    tabBar.deselectIfSelected(bar);
    assertFalse('Bar must no longer be selected', bar.isSelected());
    assertTrue('Foo must be selected', foo.isSelected());
    assertEquals('Foo must be the selected tab', foo, tabBar.getSelectedTab());

    // Should deselect foo and select the next tab (bar).
    tabBar.deselectIfSelected(foo);
    assertFalse('Foo must no longer be selected', foo.isSelected());
    assertTrue('Bar must be selected', bar.isSelected());
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());
  },

  /** @suppress {visibility} suppression added to enable type checking */
  testHandleTabSelect() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    assertNull('No tab must be selected', tabBar.getSelectedTab());

    tabBar.handleTabSelect(new GoogEvent(Component.EventType.SELECT, bar));
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    tabBar.handleTabSelect(new GoogEvent(Component.EventType.SELECT, bar));
    assertEquals('Bar must remain selected tab', bar, tabBar.getSelectedTab());

    tabBar.handleTabSelect(new GoogEvent(Component.EventType.SELECT, foo));
    assertEquals(
        'Foo must now be the selected tab', foo, tabBar.getSelectedTab());
  },

  /** @suppress {visibility} suppression added to enable type checking */
  testHandleTabUnselect() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    bar.setSelected(true);
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    tabBar.handleTabUnselect(new GoogEvent(Component.EventType.UNSELECT, foo));
    assertEquals(
        'Bar must remain the selected tab', bar, tabBar.getSelectedTab());

    tabBar.handleTabUnselect(new GoogEvent(Component.EventType.SELECT, bar));
    assertNull('No tab must be selected', tabBar.getSelectedTab());
  },

  testHandleTabDisable() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    // Start with the middle tab selected.
    bar.setSelected(true);
    assertTrue('Bar must be selected', bar.isSelected());
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    // Should deselect bar and select the previous enabled, visible tab (foo).
    bar.setEnabled(false);
    assertFalse('Bar must no longer be selected', bar.isSelected());
    assertTrue('Foo must be selected', foo.isSelected());
    assertEquals('Foo must be the selected tab', foo, tabBar.getSelectedTab());

    // Should deselect foo and select the next enabled, visible tab (baz).
    foo.setEnabled(false);
    assertFalse('Foo must no longer be selected', foo.isSelected());
    assertTrue('Baz must be selected', baz.isSelected());
    assertEquals('Baz must be the selected tab', baz, tabBar.getSelectedTab());

    // Should deselect baz.  Since there are no enabled, visible tabs left,
    // the tab bar should have no selected tab.
    baz.setEnabled(false);
    assertFalse('Baz must no longer be selected', baz.isSelected());
    assertNull('No tab must be selected', tabBar.getSelectedTab());
  },

  testHandleTabHide() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'));
    tabBar.addChild(bar = new UiTab('bar'));
    tabBar.addChild(baz = new UiTab('baz'));

    // Start with the middle tab selected.
    bar.setSelected(true);
    assertTrue('Bar must be selected', bar.isSelected());
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    // Should deselect bar and select the previous enabled, visible tab (foo).
    bar.setVisible(false);
    assertFalse('Bar must no longer be selected', bar.isSelected());
    assertTrue('Foo must be selected', foo.isSelected());
    assertEquals('Foo must be the selected tab', foo, tabBar.getSelectedTab());

    // Should deselect foo and select the next enabled, visible tab (baz).
    foo.setVisible(false);
    assertFalse('Foo must no longer be selected', foo.isSelected());
    assertTrue('Baz must be selected', baz.isSelected());
    assertEquals('Baz must be the selected tab', baz, tabBar.getSelectedTab());

    // Should deselect baz.  Since there are no enabled, visible tabs left,
    // the tab bar should have no selected tab.
    baz.setVisible(false);
    assertFalse('Baz must no longer be selected', baz.isSelected());
    assertNull('No tab must be selected', tabBar.getSelectedTab());
  },

  /** @suppress {visibility} suppression added to enable type checking */
  testHandleFocus() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'), true);
    tabBar.addChild(bar = new UiTab('bar'), true);
    tabBar.addChild(baz = new UiTab('baz'), true);

    // Render the tab bar into the document, so highlight handling works as
    // expected.
    tabBar.render(sandbox);

    // Start with the middle tab selected.
    bar.setSelected(true);
    assertTrue('Bar must be selected', bar.isSelected());
    assertEquals('Bar must be the selected tab', bar, tabBar.getSelectedTab());

    assertNull('No tab must be highlighted', tabBar.getHighlighted());
    tabBar.handleFocus(new GoogEvent(EventType.FOCUS, tabBar.getElement()));
    assertTrue('Bar must be highlighted', bar.isHighlighted());
    assertEquals(
        'Bar must be the highlighted tab', bar, tabBar.getHighlighted());
  },

  /** @suppress {visibility} suppression added to enable type checking */
  testHandleFocusWithoutSelectedTab() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'), true);
    tabBar.addChild(bar = new UiTab('bar'), true);
    tabBar.addChild(baz = new UiTab('baz'), true);

    // Render the tab bar into the document, so highlight handling works as
    // expected.
    tabBar.render(sandbox);

    // Start with no tab selected.
    assertNull('No tab must be selected', tabBar.getSelectedTab());

    assertNull('No tab must be highlighted', tabBar.getHighlighted());
    tabBar.handleFocus(new GoogEvent(EventType.FOCUS, tabBar.getElement()));
    assertTrue('Foo must be highlighted', foo.isHighlighted());
    assertEquals(
        'Foo must be the highlighted tab', foo, tabBar.getHighlighted());
  },

  testGetOrientationFromLocation() {
    assertEquals(
        Container.Orientation.HORIZONTAL,
        TabBar.getOrientationFromLocation(TabBar.Location.TOP));
    assertEquals(
        Container.Orientation.HORIZONTAL,
        TabBar.getOrientationFromLocation(TabBar.Location.BOTTOM));
    assertEquals(
        Container.Orientation.VERTICAL,
        TabBar.getOrientationFromLocation(TabBar.Location.START));
    assertEquals(
        Container.Orientation.VERTICAL,
        TabBar.getOrientationFromLocation(TabBar.Location.END));
  },

  testKeyboardNavigation() {
    let bar;
    let baz;
    let foo;

    // Create a tab bar with some tabs.
    tabBar.addChild(foo = new UiTab('foo'), true);
    tabBar.addChild(bar = new UiTab('bar'), true);
    tabBar.addChild(baz = new UiTab('baz'), true);
    tabBar.render(sandbox);

    // Highlight the selected tab (this happens automatically when the tab
    // bar receives keyboard focus).
    tabBar.setSelectedTabIndex(0);
    tabBar.getSelectedTab().setHighlighted(true);

    // Count events dispatched by each tab.
    const eventCount = {
      'foo': {'select': 0, 'unselect': 0},
      'bar': {'select': 0, 'unselect': 0},
      'baz': {'select': 0, 'unselect': 0},
    };

    function countEvent(e) {
      const tabId = e.target.getContent();
      const type = e.type;
      eventCount[tabId][type]++;
    }

    function getEventCount(tabId, type) {
      return eventCount[tabId][type];
    }

    // Listen for SELECT and UNSELECT events on the tab bar.
    events.listen(
        tabBar,
        [
          Component.EventType.SELECT,
          Component.EventType.UNSELECT,
        ],
        countEvent);

    // Verify baseline assumptions.
    assertTrue('Tab bar must auto-select tabs', tabBar.isAutoSelectTabs());
    assertEquals('First tab must be selected', 0, tabBar.getSelectedTabIndex());

    // Simulate a right arrow key event.
    const rightEvent = new FakeKeyEvent(KeyCodes.RIGHT);
    assertTrue(
        'Key event must have beeen handled', tabBar.handleKeyEvent(rightEvent));
    assertTrue(
        'Key event propagation must have been stopped',
        rightEvent.propagationStopped);
    assertTrue(
        'Default key event must have been prevented',
        rightEvent.defaultPrevented);
    assertEquals(
        'Foo must have dispatched UNSELECT', 1,
        getEventCount('foo', Component.EventType.UNSELECT));
    assertEquals(
        'Bar must have dispatched SELECT', 1,
        getEventCount('bar', Component.EventType.SELECT));
    assertEquals('Bar must have been selected', bar, tabBar.getSelectedTab());

    // Simulate a left arrow key event.
    const leftEvent = new FakeKeyEvent(KeyCodes.LEFT);
    assertTrue(
        'Key event must have beeen handled', tabBar.handleKeyEvent(leftEvent));
    assertTrue(
        'Key event propagation must have been stopped',
        leftEvent.propagationStopped);
    assertTrue(
        'Default key event must have been prevented',
        leftEvent.defaultPrevented);
    assertEquals(
        'Bar must have dispatched UNSELECT', 1,
        getEventCount('bar', Component.EventType.UNSELECT));
    assertEquals(
        'Foo must have dispatched SELECT', 1,
        getEventCount('foo', Component.EventType.SELECT));
    assertEquals('Foo must have been selected', foo, tabBar.getSelectedTab());

    // Disable tab auto-selection.
    tabBar.setAutoSelectTabs(false);

    // Simulate another left arrow key event.
    const anotherLeftEvent = new FakeKeyEvent(KeyCodes.LEFT);
    assertTrue(
        'Key event must have beeen handled',
        tabBar.handleKeyEvent(anotherLeftEvent));
    assertTrue(
        'Key event propagation must have been stopped',
        anotherLeftEvent.propagationStopped);
    assertTrue(
        'Default key event must have been prevented',
        anotherLeftEvent.defaultPrevented);
    assertEquals('Foo must remain selected', foo, tabBar.getSelectedTab());
    assertEquals(
        'Foo must not have dispatched another UNSELECT event', 1,
        getEventCount('foo', Component.EventType.UNSELECT));
    assertEquals(
        'Baz must not have dispatched a SELECT event', 0,
        getEventCount('baz', Component.EventType.SELECT));
    assertFalse('Baz must not be selected', baz.isSelected());
    assertTrue('Baz must be highlighted', baz.isHighlighted());

    // Simulate 'g' key event.
    const gEvent = new FakeKeyEvent(KeyCodes.G);
    assertFalse(
        'Key event must not have beeen handled', tabBar.handleKeyEvent(gEvent));
    assertFalse(
        'Key event propagation must not have been stopped',
        gEvent.propagationStopped);
    assertFalse(
        'Default key event must not have been prevented',
        gEvent.defaultPrevented);
    assertEquals('Foo must remain selected', foo, tabBar.getSelectedTab());

    // Clean up.
    events.unlisten(
        tabBar,
        [
          Component.EventType.SELECT,
          Component.EventType.UNSELECT,
        ],
        countEvent);
  },

  testExitAndEnterDocument() {
    const component = new Component();
    component.render(sandbox);

    const tab1 = new UiTab('tab1');
    const tab2 = new UiTab('tab2');
    const tab3 = new UiTab('tab3');
    tabBar.addChild(tab1, true);
    tabBar.addChild(tab2, true);
    tabBar.addChild(tab3, true);

    component.addChild(tabBar, true);
    tab2.setSelected(true);
    assertEquals(tabBar.getSelectedTab(), tab2);

    component.removeChild(tabBar, true);
    tab1.setSelected(true);
    assertEquals(tabBar.getSelectedTab(), tab2);

    component.addChild(tabBar, true);
    tab3.setSelected(true);
    assertEquals(tabBar.getSelectedTab(), tab3);
  },
});


text:
'use strict';var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
    switch (arguments.length) {
        case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
        case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
        case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
    }
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var lang_1 = require('angular2/src/facade/lang');
/**
 * Defines template and style encapsulation options available for Component's {@link View}.
 *
 * See {@link ViewMetadata#encapsulation}.
 */
(function (ViewEncapsulation) {
    /**
     * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
     * Element and pre-processing the style rules provided via
     * {@link ViewMetadata#styles} or {@link ViewMetadata#stylesUrls}, and adding the new Host Element
     * attribute to all selectors.
     *
     * This is the default option.
     */
    ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
    /**
     * Use the native encapsulation mechanism of the renderer.
     *
     * For the DOM this means using [Shadow DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
     * creating a ShadowRoot for Component's Host Element.
     */
    ViewEncapsulation[ViewEncapsulation["Native"] = 1] = "Native";
    /**
     * Don't provide any template or style encapsulation.
     */
    ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
})(exports.ViewEncapsulation || (exports.ViewEncapsulation = {}));
var ViewEncapsulation = exports.ViewEncapsulation;
exports.VIEW_ENCAPSULATION_VALUES = [ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None];
/**
 * Metadata properties available for configuring Views.
 *
 * Each Angular component requires a single `@Component` and at least one `@View` annotation. The
 * `@View` annotation specifies the HTML template to use, and lists the directives that are active
 * within the template.
 *
 * When a component is instantiated, the template is loaded into the component's shadow root, and
 * the expressions and statements in the template are evaluated against the component.
 *
 * For details on the `@Component` annotation, see {@link ComponentMetadata}.
 *
 * ### Example
 *
 * ```
 * @Component({
 *   selector: 'greet',
 *   template: 'Hello {{name}}!',
 *   directives: [GreetUser, Bold]
 * })
 * class Greet {
 *   name: string;
 *
 *   constructor() {
 *     this.name = 'World';
 *   }
 * }
 * ```
 */
var ViewMetadata = (function () {
    function ViewMetadata(_a) {
        var _b = _a === void 0 ? {} : _a, templateUrl = _b.templateUrl, template = _b.template, directives = _b.directives, pipes = _b.pipes, encapsulation = _b.encapsulation, styles = _b.styles, styleUrls = _b.styleUrls;
        this.templateUrl = templateUrl;
        this.template = template;
        this.styleUrls = styleUrls;
        this.styles = styles;
        this.directives = directives;
        this.pipes = pipes;
        this.encapsulation = encapsulation;
    }
    ViewMetadata = __decorate([
        lang_1.CONST(),
        __metadata('design:paramtypes', [Object])
    ], ViewMetadata);
    return ViewMetadata;
})();
exports.ViewMetadata = ViewMetadata;
//# sourceMappingURL=view.js.map


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Blogger</title>
  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/bootstrap.css">