text:
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package impl

import com.intellij.pom.java.LanguageLevel
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.{IStubElementType, StubElement}
import com.intellij.util.io.StringRef
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScTemplateDefinition
import org.jetbrains.plugins.scala.lang.psi.stubs.elements.MaybeStringRefExt

/**
  * @author ilyas
  */
class ScTemplateDefinitionStubImpl(parent: StubElement[_ <: PsiElement],
                                   elementType: IStubElementType[_ <: StubElement[_ <: PsiElement], _ <: PsiElement],
                                   nameRef: StringRef,
                                   private val qualifiedNameRef: StringRef,
                                   private val javaQualifiedNameRef: StringRef,
                                   val isDotty: Boolean,
                                   val isPackageObject: Boolean,
                                   val isScriptFileClass: Boolean,
                                   private val sourceFileNameRef: StringRef,
                                   val isDeprecated: Boolean,
                                   val isImplicitObject: Boolean,
                                   val isImplicitClass: Boolean,
                                   private val javaNameRef: StringRef,
                                   private val additionalJavaNameRef: Option[StringRef],
                                   val isLocal: Boolean,
                                   val isVisibleInJava: Boolean)
  extends ScNamedStubBase[ScTemplateDefinition](parent, elementType, nameRef) with ScTemplateDefinitionStub {

  override def getQualifiedName: String = StringRef.toString(qualifiedNameRef)

  override def javaQualifiedName: String = StringRef.toString(javaQualifiedNameRef)

  override def getSourceFileName: String = StringRef.toString(sourceFileNameRef)

  override def javaName: String = StringRef.toString(javaNameRef)

  override def additionalJavaName: Option[String] = additionalJavaNameRef.asString

  //todo PsiClassStub methods
  override def getLanguageLevel: LanguageLevel = LanguageLevel.JDK_1_5

  override def isEnum: Boolean = false

  override def isInterface: Boolean = false

  override def isAnonymous: Boolean = false

  override def isAnonymousInQualifiedNew: Boolean = false

  override def isAnnotationType: Boolean = false

  override def hasDeprecatedAnnotation: Boolean = false

  override def isEnumConstantInitializer: Boolean = false

  override def getBaseClassReferenceText: String = null
}


text:
<?php

namespace DBORM\KLMBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Tblcountry
 *
 * @ORM\Table(name="TblCountry")
 * @ORM\Entity
 */
class Tblcountry
{
    /**
     * @var string
     *
     * @ORM\Column(name="PK_Country_code", type="string", length=5, nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $pkCountryCode;

    /**
     * @var string
     *
     * @ORM\Column(name="Country", type="string", length=50, nullable=true)
     */
    private $country;

    /**
     * Get pkCountryCode
     *
     * @return string
     */
    public function getPkCountryCode()
    {
        return $this->pkCountryCode;
    }

    /**
     * Set country
     *
     * @param string $country
     * @return Tblcountry
     */
    public function setCountry($country)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return string
     */
    public function getCountry()
    {
        return $this->country;
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace Apache.Ignite.Core.Tests.Cache
{
    using NUnit.Framework;

    [Category(TestUtils.CategoryIntensive)]
    public class CachePartitionedAtomicTest : CacheAbstractTest
    {
        protected override int GridCount()
        {
            return 3;
        }

        protected override string CacheName()
        {
            return "partitioned_atomic";
        }

        protected override bool NearEnabled()
        {
            return false;
        }

        protected override bool TxEnabled()
        {
            return false;
        }

        protected override int Backups()
        {
            return 1;
        }
    }
}


text:
/*
 * remote_service_admin_http_impl.h
 *
 *  \date       Sep 30, 2011
 *  \author    	Apache Celix Project Team
 *  \copyright	Apache License, Version 2.0
 */

#ifndef REMOTE_SERVICE_ADMIN_HTTP_IMPL_H_
#define REMOTE_SERVICE_ADMIN_HTTP_IMPL_H_

#include "remote_service_admin_impl.h"
#include "log_helper.h"
#include "civetweb.h"

struct remote_service_admin {
	bundle_context_pt context;
	log_helper_pt loghelper;

	celix_thread_mutex_t exportedServicesLock;
	hash_map_pt exportedServices;

	celix_thread_mutex_t importedServicesLock;
	hash_map_pt importedServices;

	char *port;
	char *ip;

	struct mg_context *ctx;
};

celix_status_t remoteServiceAdmin_stop(remote_service_admin_pt admin);

#endif /* REMOTE_SERVICE_ADMIN_HTTP_IMPL_H_ */


text:
/*number_phrase([noll,0'0).
number_phrase([ett,0'1).
number_phrase([två,0'2).
number_phrase([tre,0'3).
number_phrase([fyra,0'4).
number_phrase([fem,0'5).
number_phrase([sex,0'6).
number_phrase([sju,0'7).
number_phrase([åtta,0'8).
number_phrase([nio,0'9).

%number_phrase([tio,0'10).
%number_phrase([femton,0'15).
%number_phrase([sjutton,0'17).
%number_phrase([arton,0'18).
%number_phrase([trettio,0'30).
*/

number_phrase([zero], 0).
number_phrase([one], 1).
number_phrase([two], 2).
number_phrase([three], 3).
number_phrase([four], 4).
number_phrase([five], 5).
number_phrase([six], 6).
number_phrase([seven], 7).
number_phrase([eight], 8).
number_phrase([nine], 9).

number_phrase([ten], 10).
number_phrase([eleven], 11).
number_phrase([twelve], 12).
number_phrase([thirteen], 13).
number_phrase([fourteen], 14).
number_phrase([fifteen], 15).
number_phrase([sixteen], 16).
number_phrase([seventeen], 17).
number_phrase([eighteen], 18).
number_phrase([nineteen], 19).

number_phrase([twenty], 20).
number_phrase([twenty,one], 21).
number_phrase([twenty,two], 22).
number_phrase([twenty,three], 23).
number_phrase([twenty,four], 24).
number_phrase([twenty,five], 25).
number_phrase([twenty,six], 26).
number_phrase([twenty,seven], 27).
number_phrase([twenty,eight], 28).
number_phrase([twenty,nine], 29).

number_phrase([thirty], 30).
number_phrase([thirty,one], 31).
number_phrase([thirty,two], 32).
number_phrase([thirty,three], 33).
number_phrase([thirty,four], 34).
number_phrase([thirty,five], 35).
number_phrase([thirty,six], 36).
number_phrase([thirty,seven], 37).
number_phrase([thirty,eight], 38).
number_phrase([thirty,nine], 39).

number_phrase([forty], 40).
number_phrase([forty,one], 41).
number_phrase([forty,two], 42).
number_phrase([forty,three], 43).
number_phrase([forty,four], 44).
number_phrase([forty,five], 45).
number_phrase([forty,six], 46).
number_phrase([forty,seven], 47).
number_phrase([forty,eight], 48).
number_phrase([forty,nine], 49).

number_phrase([fifty], 50).
number_phrase([fifty,one], 51).
number_phrase([fifty,two], 52).
number_phrase([fifty,three], 53).
number_phrase([fifty,four], 54).
number_phrase([fifty,five], 55).
number_phrase([fifty,six], 56).
number_phrase([fifty,seven], 57).
number_phrase([fifty,eight], 58).
number_phrase([fifty,nine], 59).

number_phrase([sixty], 60).
number_phrase([sixty,one], 61).
number_phrase([sixty,two], 62).
number_phrase([sixty,three], 63).
number_phrase([sixty,four], 64).
number_phrase([sixty,five], 65).
number_phrase([sixty,six], 66).
number_phrase([sixty,seven], 67).
number_phrase([sixty,eight], 68).
number_phrase([sixty,nine], 69).

number_phrase([seventy], 70).
number_phrase([seventy,one], 71).
number_phrase([seventy,two], 72).
number_phrase([seventy,three], 73).
number_phrase([seventy,four], 74).
number_phrase([seventy,five], 75).
number_phrase([seventy,six], 76).
number_phrase([seventy,seven], 77).
number_phrase([seventy,eight], 78).
number_phrase([seventy,nine], 79).

number_phrase([eighty], 80).
number_phrase([eighty,one], 81).
number_phrase([eighty,two], 82).
number_phrase([eighty,three], 83).
number_phrase([eighty,four], 84).
number_phrase([eighty,five], 85).
number_phrase([eighty,six], 86).
number_phrase([eighty,seven], 87).
number_phrase([eighty,eight], 88).
number_phrase([eighty,nine], 89).

number_phrase([ninety], 90).
number_phrase([ninety,one], 91).
number_phrase([ninety,two], 92).
number_phrase([ninety,three], 93).
number_phrase([ninety,four], 94).
number_phrase([ninety,five], 95).
number_phrase([ninety,six], 96).
number_phrase([ninety,seven], 97).
number_phrase([ninety,eight], 98).
number_phrase([ninety,nine], 99).

number_phrase([N1,hundred,and|N2], X):-
	nonvar(N1),
	nonvar(N2),
	number_phrase([N1], X1),
	number_phrase(N2, X2),
	X is X1*100 + X2.


text:
import { Component, Input } from '@angular/core';

@Component({
    moduleId: module.id,
    selector: 'contact',
    templateUrl: 'contactform.component.html',
    template:
    `

Contact Page

    `
})

export class ContactComponent {
    title = "Contact Page";
    name  = "Name";
    number = "Phone Number";
    email = "Email Address";
    Message = "Message";

}


text:
title:  Podnety na zamyslenie
date:  09/09/2022
---

V knihe Patriarchovia a proroci si prečítaj text na stranách 483–516 (PP 637–682).

V Božích plánoch pre náš život môžu byť aj dlhé obdobia skúšok a čakania. Niekedy aj samotné čakanie môžeme vnímať ako náročnú skúšku. Trpezliví dokážeme byť vtedy, keď sa sústredíme na Boha a budeme dôverovať, že koná v náš prospech. Na trpezlivé čakanie existuje veľa dôvodov, ale všetky súvisia s naplnením plánu, ktorý má Boh s nami a so svojím kráľovstvom. Ak sa usilujeme veci uponáhľať, môžeme veľa stratiť. Ak však budeme Bohu dôverovať a radovať sa v ňom, môžeme veľa získať.

"Každá skúška je odvážená a vymeraná Pánom Ježišom Kristom. Vďaka milosti, ktorú Boh človeku dáva, nie sú skúšky nad sily človeka." (12MR 81)

"Nezistím, aký zámer má Boh s mojím utrpením, ale On vie, čo je najlepšie, preto mu zverím svoju dušu, telo i ducha ako svojmu vernému Stvoriteľovi. Viem, komu som uveril, a som presvedčený, že on má moc až do onoho dňa zachovať, čo mi bolo zverené. (2Tim 1,12) Ak sa snažíme, aby sme mali viac viery, viac lásky, väčšiu trpezlivosť a dôveru v nášho nebeského Otca, viem, že keď budeme prechádzať cez rôzne konflikty života, budeme cítiť viac pokoja a šťastia. Boh nemá radosť z toho, ak sme ustaraní a trápime sa, akoby sme neboli v Ježišovej náruči. Je potrebné naučiť sa trpezlivo čakať a sledovať situáciu. Myslíme si, že kým máme pocit, že nie sme na správnej ceste, musíme hľadať nejaké vhodné znamenie. To však nie je otázka pocitov, ale viery." (2SM 242)

**Námety na spoločné uvažovanie**

`Čo znamená, že všetky skúšky Ježiš Kristus "odvážil a vymeral"? Ako nám to môže pomôcť v našom čakaní?`

`Podeľte sa v triede o svoje skúsenosti s "trpezlivým čakaním". Z čoho ste mali strach? Z čoho ste sa tešili? Ako ste to zvládli? Čo ste sa naučili? Na aké zasľúbenia ste sa spoliehali?`

`Mnoho ľudí je vystavených "skúške čakania". Ako im môžete pomôcť, kým nastane čas, keď sa Boh rozhodne vykonať to, o čo prosia?`

`Akú úlohu zohráva modlitba v budovaní trpezlivosti? Za ktorých ľudí sa môžete modliť, aby sa naučili byť trpezlivejší?`

Západ slnka: 19.13

---

#### Dodatečné otázky k diskuzi

`Na co jsi přišel, když jsi během týdne přemýšlel o "trpělivém čekání"?`

`Co si myslíš o slovech EGW, že "díky milosti, kterou Bůh člověku dává, nejsou zkoušky nad síly člověka?`

`Kdy jsi naposledy musel na něco čekat trpělivě? Proč?`

`Inspirovala tě něčím naše dnešní diskuze? Čím?`


text:
package mpei.bkm.model.structure.datatypespecification.datatypes;

public class StarDataType extends DataType {
    private DataType type;

    public StarDataType(DataType type) {
        this.type = type;
    }

    public DataType getType() {
        return type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof StarDataType)) return false;

        StarDataType that = (StarDataType) o;

        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return type != null ? type.hashCode() : 0;
    }
}


text:
using System.ComponentModel;
using TankView.Properties;

namespace TankView.ViewModel {
    public class AppSettings : INotifyPropertyChanged {
        private bool _darkMode = Settings.Default.DarkMode;
        private int _audioVolume = Settings.Default.AudioVolume;

        public bool EnableDarkMode {
            get => _darkMode;
            set {
                _darkMode = value;
                Settings.Default.DarkMode = value;
                Settings.Default.Save();
                (App.Current as App)?.SetDarkMode(EnableDarkMode);
                NotifyPropertyChanged(nameof(EnableDarkMode));
            }
        }

        public int AudioVolume {
            get => _audioVolume;
            set {
                _audioVolume = value;
                Settings.Default.AudioVolume = value;
                Settings.Default.Save();
                NotifyPropertyChanged(nameof(AudioVolume));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void NotifyPropertyChanged(string name) {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }
    }
}


text:
require("../html-document-api");
var submits = require("../../dist/builders/submit-view-builder");
var containers = require("../../dist/builders/container-view-builder");
var util = require("../../dist/util");
var jsua = require("@lynx-json/jsua");
var chai = require("chai");
var should = chai.should();
var expect = chai.expect;
var sinon = require("sinon");

describe("builders / submitViewBuilder", function () {
  var node, buildChildViewsStub;

  beforeEach(function () {
    node = {
      spec: {
        hints: [{ name: "submit" }]
      },
      value: {
        action: "/foo"
      }
    };

    buildChildViewsStub = sinon.stub(containers, "buildChildViews");
    buildChildViewsStub.returns(Promise.resolve([]));
  });

  afterEach(function () {
    buildChildViewsStub.restore();
  });

  it("should return view for 'submit' with no children", function () {
    node.value.method = "GET";
    node.value.enctype = "application/x-www-form-urlencoded";

    return submits.submitViewBuilder(node).then(function (view) {
      expect(view).to.not.be.null;
      view.children.length.should.equal(0);
      view.formAction.should.equal(node.value.action);
      view.getAttribute("data-lynx-submit-method").should.equal(node.value.method);
      view.getAttribute("data-lynx-submit-enctype").should.equal(node.value.enctype);
      buildChildViewsStub.called.should.be.true;
    });
  });

  it("should return view for 'submit' with children", function () {
    buildChildViewsStub.returns(Promise.resolve([document.createElement("div")]));

    return submits.submitViewBuilder(node).then(function (view) {
      expect(view).to.not.be.null;
      view.children.length.should.equal(1);
      view.formAction.should.equal(node.value.action);
      expect(view.getAttribute("data-lynx-submit-method")).to.be.null;
      expect(view.getAttribute("data-lynx-submit-enctype")).to.be.null;
      buildChildViewsStub.called.should.be.true;
    });
  });

  it("should resolve the 'action' if a 'base' URI is present", function () {
    node.base = "http://example.com";

    return submits.submitViewBuilder(node).then(function (view) {
      view.formAction.should.equal("http://example.com/foo");
    });
  });

  describe("when clicked", function () {
    var fetchStub, buildFormDataStub, findNearestAncestorViewStub;

    beforeEach(function () {
      node.base = "http://example.com";
      fetchStub = sinon.stub(jsua, "fetch");
      buildFormDataStub = sinon.stub(util, "buildFormData");
      findNearestAncestorViewStub = sinon.stub(util, "findNearestAncestorView");
    });

    afterEach(function () {
      fetchStub.restore();
      buildFormDataStub.restore();
      findNearestAncestorViewStub.restore();
    });

    it("should fetch", function () {
      return submits.submitViewBuilder(node).then(function (view) {
        view.click();

        expect(fetchStub.calledOnce).to.equal(true);
        var args = fetchStub.getCall(0).args;
        expect(args[0]).to.equal("http://example.com/foo");
      });
    });

    it("should build form data", function () {
      return submits.submitViewBuilder(node).then(function (view) {
        view.click();

        expect(buildFormDataStub.calledOnce).to.equal(true);
        var args = buildFormDataStub.getCall(0).args;
        expect(args[0]).to.equal(view);
      });
    });

    it("should assign form data to options.body for POST", function () {
      node.value.method = "POST";
      var formData = new FormData();
      formData.append("name", "bar");
      buildFormDataStub.returns(formData);

      return submits.submitViewBuilder(node).then(function (view) {
        view.click();

        expect(buildFormDataStub.calledOnce).to.equal(true);
        expect(fetchStub.calledOnce).to.equal(true);
        var args = fetchStub.getCall(0).args;
        expect(args[0]).to.equal("http://example.com/foo");
        expect(args[1]).to.not.equal(null);
        expect(args[1].body).to.equal(formData);
      });
    });

    it("should assign form data to query component for GET", function () {
      node.value.method = "GET";
      var formData = new URLSearchParams();
      formData.append("name", "bar");
      buildFormDataStub.returns(formData);

      return submits.submitViewBuilder(node).then(function (view) {
        view.click();

        expect(buildFormDataStub.calledOnce).to.equal(true);
        expect(fetchStub.calledOnce).to.equal(true);
        var args = fetchStub.getCall(0).args;
        expect(args[0]).to.equal("http://example.com/foo?name=bar");
      });
    });

    it("should click submit when value has 'send' property", function () {
      node.value.send = "change";
      var formView = document.createElement("form");
      formView.lynxGetValidationState = function () {
        return "valid";
      };
      findNearestAncestorViewStub.returns(formView);

      return new Promise(function (resolve) {
        submits.submitViewBuilder(node).then(function (view) {
          view.addEventListener("click", function () {
            expect(findNearestAncestorViewStub.calledOnce).to.equal(true);
            expect(buildFormDataStub.calledOnce).to.equal(true);
            expect(fetchStub.calledOnce).to.equal(true);
            resolve();
          });

          view.dispatchEvent(new CustomEvent("jsua-attach"));
          formView.dispatchEvent(new CustomEvent("lynx-validated"));
        });
      });
    });

    it("should click submit when node spec has 'send=change' property", function () {
      node.spec.send = "change";
      var formView = document.createElement("form");
      formView.lynxGetValidationState = function () {
        return "valid";
      };
      findNearestAncestorViewStub.returns(formView);

      return new Promise(function (resolve) {
        submits.submitViewBuilder(node).then(function (view) {
          view.addEventListener("click", function () {
            expect(findNearestAncestorViewStub.calledOnce).to.equal(true);
            expect(buildFormDataStub.calledOnce).to.equal(true);
            expect(fetchStub.calledOnce).to.equal(true);
            resolve();
          });

          view.dispatchEvent(new CustomEvent("jsua-attach"));
          formView.dispatchEvent(new CustomEvent("lynx-validated"));
        });
      });
    });

    it("should click submit when node value has 'send=change' property");
    it("should click submit when node value has 'send=ready' property");
  });
});


text:
<?php

/**
 * -----------------------------------------------------------------------------
 *  Global database settings
 * -----------------------------------------------------------------------------
 *
 *  Set database configurations here to override environment specific
 *  configurations
 *
 */

return array(

);


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.pkgcache;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.ResolvedTargets;
import com.google.devtools.build.lib.cmdline.TargetParsingException;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.FileTarget;
import com.google.devtools.build.lib.packages.NoSuchThingException;
import com.google.devtools.build.lib.packages.OutputFile;
import com.google.devtools.build.lib.packages.Package;
import com.google.devtools.build.lib.packages.RawAttributeMapper;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.packages.Target;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

/**
 * Implementation of --compile_one_dependency.
 */
public final class CompileOneDependencyTransformer {
  private final TargetProvider targetProvider;

  public CompileOneDependencyTransformer(TargetProvider targetProvider) {
    this.targetProvider = targetProvider;
  }

  /**
   * For each input file in the original result, returns a rule in the same package which has the
   * input file as a source.
   */
  public ResolvedTargets<Target> transformCompileOneDependency(
      ExtendedEventHandler eventHandler, ResolvedTargets<Target> original)
      throws TargetParsingException, InterruptedException {
    if (original.hasError()) {
      return original;
    }
    ResolvedTargets.Builder<Target> builder = ResolvedTargets.builder();
    for (Target target : original.getTargets()) {
      builder.add(transformCompileOneDependency(eventHandler, target));
    }
    return builder.build();
  }

  /**
   * Returns a list of rules in the given package sorted by BUILD file order. When
   * multiple rules depend on a target, we choose the first match in this list (after
   * filtering for preferred dependencies - see below).
   */
  private Iterable<Rule> getOrderedRuleList(Package pkg) {
    List<Rule> orderedList = Lists.newArrayList();
    for (Rule rule : pkg.getTargets(Rule.class)) {
      orderedList.add(rule);
    }

    Collections.sort(orderedList, Comparator.comparing(arg -> arg.getLocation()));
    return orderedList;
  }

  /**
   * Returns true if a specific rule compiles a specific source. Looks through genrules and
   * filegroups.
   */
  private boolean listContainsFile(
      ExtendedEventHandler eventHandler,
      Collection<Label> srcLabels,
      Label source,
      Set<Label> visitedRuleLabels)
      throws TargetParsingException, InterruptedException {
    if (srcLabels.contains(source)) {
      return true;
    }
    for (Label label : srcLabels) {
      if (!visitedRuleLabels.add(label)) {
        continue;
      }
      Target target = null;
      try {
        target = targetProvider.getTarget(eventHandler, label);
      } catch (NoSuchThingException e) {
        // Just ignore failing sources/packages. We could report them here, but as long as we do
        // early return, the presence of this error would then be determined by the order of items
        // in the srcs attribute. A proper error will be created by the subsequent loading.
      }
      if (target == null || target instanceof FileTarget) {
        continue;
      }
      Rule targetRule = target.getAssociatedRule();
      if ("filegroup".equals(targetRule.getRuleClass())) {
        RawAttributeMapper attributeMapper = RawAttributeMapper.of(targetRule);
        Collection<Label> srcs = attributeMapper.getMergedValues("srcs", BuildType.LABEL_LIST);
        if (listContainsFile(eventHandler, srcs, source, visitedRuleLabels)) {
          return true;
        }
      } else if ("genrule".equals(targetRule.getRuleClass())) {
        // TODO(djasper): Likely, it makes much more sense to look at the inputs of a genrule.
        for (OutputFile file : targetRule.getOutputFiles()) {
          if (file.getLabel().equals(source)) {
            return true;
          }
        }
      }
    }
    return false;
  }

  private Target transformCompileOneDependency(ExtendedEventHandler eventHandler, Target target)
      throws TargetParsingException, InterruptedException {
    if (!(target instanceof FileTarget)) {
      throw new TargetParsingException(
          "--compile_one_dependency target '" + target.getLabel() + "' must be a file");
    }

    Rule result = null;
    Iterable<Rule> orderedRuleList = getOrderedRuleList(target.getPackage());
    for (Rule rule : orderedRuleList) {
      Set<Label> labels = getInputLabels(rule);
      if (listContainsFile(eventHandler, labels, target.getLabel(), Sets.<Label>newHashSet())) {
        if (rule.getRuleClassObject().isPreferredDependency(target.getName())) {
          result = rule;
          break;
        }
        if (result == null) {
          result = rule;
        }
      }
    }

    if (result == null) {
      throw new TargetParsingException(
          "Couldn't find dependency on target '" + target.getLabel() + "'");
    }

    // TODO(djasper): Check whether parse_headers is disabled and just return if not.
    // If the rule has source targets, return it.
    if (result.getRuleClassObject().hasAttr("srcs", BuildType.LABEL_LIST)
        && !RawAttributeMapper.of(result).getMergedValues("srcs", BuildType.LABEL_LIST).isEmpty()) {
      return result;
    }

    // Try to find a rule in the same package that has 'result' as a dependency.
    for (Rule rule : orderedRuleList) {
      RawAttributeMapper attributes = RawAttributeMapper.of(rule);
      // We don't know which path to follow for configurable attributes, so skip them.
      if (attributes.isConfigurable("deps")
          || attributes.isConfigurable("srcs")) {
        continue;
      }
      RuleClass ruleClass = rule.getRuleClassObject();
      if (ruleClass.hasAttr("deps", BuildType.LABEL_LIST)
          && ruleClass.hasAttr("srcs", BuildType.LABEL_LIST)) {
        for (Label dep : attributes.get("deps", BuildType.LABEL_LIST)) {
          if (dep.equals(result.getLabel())) {
            if (!attributes.get("srcs", BuildType.LABEL_LIST).isEmpty()) {
              return rule;
            }
          }
        }
      }
    }

    return result;
  }

  /** Returns all labels that are contained in direct compile time inputs of {@code rule}. */
  private static Set<Label> getInputLabels(Rule rule) {
    RawAttributeMapper attributeMapper = RawAttributeMapper.of(rule);
    Set<Label> labels = new TreeSet<>();
    for (String attrName : attributeMapper.getAttributeNames()) {
      if (!attributeMapper.getAttributeDefinition(attrName).isDirectCompileTimeInput()) {
        continue;
      }
      // TODO(djasper): We might also want to look at LABEL types, but there currently is the
      // attribute xcode_config, which leads to test errors in Bazel tests.
      if (rule.isAttrDefined(attrName, BuildType.LABEL_LIST)) {
        labels.addAll(attributeMapper.getMergedValues(attrName, BuildType.LABEL_LIST));
      }
    }
    return labels;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>
        <groupId>net.shibboleth.idp</groupId>
        <artifactId>idp-parent</artifactId>
        <version>3.2.0-SNAPSHOT</version>
        <relativePath>/Users/stroucki/svn/shib/java-identity-provider/trunk/idp-parent</relativePath>
    </parent>
-->

<repositories>
  <repository>
  <id>shib-release</id>
  <url>https://build.shibboleth.net/nexus/content/groups/public</url>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  </repository>
</repositories>

    <properties>
        <java-support.version>7.2.0-SNAPSHOT</java-support.version>
        <jetty9-dta-ssl.version>1.0.0</jetty9-dta-ssl.version>
        <shib.groupId>net.shibboleth.idp</shib.groupId>
        <shib.version>3.2.0</shib.version>
        <opensaml.groupId>org.opensaml</opensaml.groupId>
        <opensaml.version>3.2.0</opensaml.version>
        <spring.version>4.2.3.RELEASE</spring.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <name>PrivacyLens</name>
    <groupId>edu.cmu.ece</groupId>
    <artifactId>PrivacyLens</artifactId>
    <version>3</version>
    <packaging>jar</packaging>

    <dependencies>
        <!-- Compile Dependencies -->
    <!--  Gson: Java to Json conversion -->
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.2.4</version>
      <scope>compile</scope>
    </dependency>
    <!-- Apache commons lang -->
    <dependency>
        	<groupId>commons-lang</groupId>
        	<artifactId>commons-lang</artifactId>
        	<version>2.4</version>
          <scope>compile</scope>
        </dependency>
<!-- spring -->
        <dependency>
        	<groupId>org.springframework</groupId>
        	<artifactId>spring-jdbc</artifactId>
        	<version>${spring.version}</version>
          <scope>compile</scope>
        </dependency>

        <dependency>
        	<groupId>org.springframework</groupId>
        	<artifactId>spring-expression</artifactId>
        	<version>${spring.version}</version>
          <scope>compile</scope>
        </dependency>

<!-- db -->
        <dependency>
        	<groupId>c3p0</groupId>
        	<artifactId>c3p0</artifactId>
        	<version>0.9.1.2</version>
          <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-attribute-api</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-authn-api</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-profile-api</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-profile-impl</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-consent-api</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-consent-impl</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-session-api</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-ui</artifactId>
            <version>${shib.version}</version>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-saml-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-storage-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-storage-impl</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.0</version>
        </dependency>

        <!-- Provided Dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>

        <!-- Runtime Dependencies -->
<!-- hsql -->
        <dependency>
        	<groupId>org.hsqldb</groupId>
        	<artifactId>hsqldb</artifactId>
        	<version>2.3.3</version>
          <scope>runtime</scope>
        </dependency>

<!-- mysql -->
        <dependency>
        	<groupId>mysql</groupId>
        	<artifactId>mysql-connector-java</artifactId>
        	<version>5.1.36</version>
          <scope>runtime</scope>
        </dependency>

<!-- joda jsp tags -->
        <dependency>
        	<groupId>joda-time</groupId>
        	<artifactId>joda-time-jsptags</artifactId>
        	<version>1.1.1</version>
          <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <scope>runtime</scope>
            <version>1.0.4</version>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.6</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-profile-api</artifactId>
            <version>${shib.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-saml-impl</artifactId>
            <version>${shib.version}</version>
            <scope>test</scope>
        </dependency>
<!--
        <dependency>
            <groupId>${shib.groupId}</groupId>
            <artifactId>idp-profile-impl</artifactId>
            <version>${shib.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-storage-impl</artifactId>
            <version>${opensaml.version}</version>
            <scope>test</scope>
        </dependency>
-->

        <!-- Managed Dependencies -->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <debug>true</debug>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <configuration>
                            <tasks>
                                <taskdef classpathref="maven.plugin.classpath" resource="wikitexttasks.properties" />
                                <wikitext-to-html markupLanguage="Textile"
                                    file="${basedir}/manual/manual.textile" htmlFilenameFormat="$1.html"
                                    formatOutput="true" emitDoctype="false" title="${project.name}-${project.version}">
<markupLanguageConfiguration locale="en"/>
                                    <stylesheet url="style.css" />
                                </wikitext-to-html>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.datastax.wikitext</groupId>
                        <artifactId>wikitext-core-ant</artifactId>
                        <version>1.3</version>
                        <scope>runtime</scope>
                    </dependency>
                    <dependency>
                        <groupId>org.fusesource.wikitext</groupId>
                        <artifactId>textile-core</artifactId>
                        <version>1.3</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/distribution.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Project Metadata -->
    <url>http://www.privacylens.org</url>

    <inceptionYear>2011</inceptionYear>

    <licenses>
        <license>
            <name>BSD</name>
            <url>http://www.opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/organizations/cmu-cylab-privacylens/PrivacyLens/issues</url>
    </issueManagement>

    <scm>
        <url>https://github.com/cmu-cylab-privacylens/PrivacyLens.git</url>
    </scm>

    <developers>
        <developer>
            <id>stroucki</id>
            <name>Michael Stroucken</name>
            <organization>CMU Cylab</organization>
            <organizationUrl>http://www.cylab.cmu.edu/</organizationUrl>
            <timezone>-5</timezone>
        </developer>
    </developers>

</project>


text:
package com.laurt.mongo.async.core.listener;

import com.mongodb.ReadPreference;
import com.mongodb.event.ClusterClosedEvent;
import com.mongodb.event.ClusterDescriptionChangedEvent;
import com.mongodb.event.ClusterListener;
import com.mongodb.event.ClusterOpeningEvent;

/**
 *
Title: ds
 *
Description: tutorials
 *
Copyright: 2017/9/24 下午5:51
 *
Company: rongshu
 *
author: LiuQingqing
 *
package: com.laurt.mongoasync.listener
 *
 * @version v1.0.0
 */
public class TestClusterListener implements ClusterListener {
    private final ReadPreference readPreference;
    private boolean isWritable;
    private boolean isReadable;

    public TestClusterListener(final ReadPreference readPreference) {
        this.readPreference = readPreference;
    }

    @Override
    public void clusterOpening(final ClusterOpeningEvent clusterOpeningEvent) {
        System.out.println(String.format("Cluster with unique client identifier %s opening",
                clusterOpeningEvent.getClusterId()));
    }

    @Override
    public void clusterClosed(final ClusterClosedEvent clusterClosedEvent) {
        System.out.println(String.format("Cluster with unique client identifier %s closed",
                clusterClosedEvent.getClusterId()));
    }

    @Override
    public void clusterDescriptionChanged(final ClusterDescriptionChangedEvent event) {
        if (!isWritable) {
            if (event.getNewDescription().hasWritableServer()) {
                isWritable = true;
                System.out.println("Writable server available!");
            }
        } else {
            if (!event.getNewDescription().hasWritableServer()) {
                isWritable = false;
                System.out.println("No writable server available!");
            }
        }

        if (!isReadable) {
            if (event.getNewDescription().hasReadableServer(readPreference)) {
                isReadable = true;
                System.out.println("Readable server available!");
            }
        } else {
            if (!event.getNewDescription().hasReadableServer(readPreference)) {
                isReadable = false;
                System.out.println("No readable server available!");
            }
        }
    }
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.engine.impl.asyncexecutor;

import java.util.Collection;

import org.flowable.engine.impl.interceptor.Command;
import org.flowable.engine.impl.interceptor.CommandContext;
import org.flowable.engine.runtime.Job;

/**
 * @author Joram Barrez
 */
public class ResetExpiredJobsCmd implements Command<Void> {

  protected Collection<String> jobIds;

  public ResetExpiredJobsCmd(Collection<String> jobsIds) {
    this.jobIds = jobsIds;
  }

  @Override
  public Void execute(CommandContext commandContext) {
    boolean messageQueueMode = commandContext.getProcessEngineConfiguration().isAsyncExecutorIsMessageQueueMode();
    for (String jobId : jobIds) {
      if (!messageQueueMode) {
        Job job = commandContext.getJobEntityManager().findById(jobId);
        commandContext.getJobManager().unacquire(job);
      } else {
        commandContext.getJobEntityManager().resetExpiredJob(jobId);
      }
    }
    return null;
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TableLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="20dip" >

        <TableRow android:layout_marginTop="10dip" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_marginLeft="20dip"
                android:text="@string/provider"
                android:textAppearance="@android:style/TextAppearance.Large"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" >
            </TextView>

            <EditText
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="20dip"
                android:layout_weight="1"
                android:inputType="text" >
            </EditText>
        </TableRow>

        <TableRow android:layout_marginTop="10dip" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip"
                android:text="@string/phone"
                android:textAppearance="@android:style/TextAppearance.Large"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" >
            </TextView>

            <EditText
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="20dip"
                android:layout_weight="1"
                android:inputType="phone" >
            </EditText>
        </TableRow>

        <TableRow android:layout_marginTop="10dip" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip"
                android:text="@string/policy"
                android:textAppearance="@android:style/TextAppearance.Large"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" >
            </TextView>

            <EditText
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="20dip"
                android:layout_weight="1"
                android:inputType="text" >
            </EditText>
        </TableRow>

        <TableRow android:layout_marginTop="10dip" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip"
                android:text="@string/note"
                android:textAppearance="@android:style/TextAppearance.Large"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" >
            </TextView>

            <EditText
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="20dip"
                android:layout_weight="1"
                android:inputType="text" >
            </EditText>
        </TableRow>
    </TableLayout>

</LinearLayout>


text:
struct yv12_buffer_config;

#ifdef __cplusplus
extern "C" {
#endif

void aom_extend_frame_borders_c(struct yv12_buffer_config* ybf,
                                const int num_planes);
#define aom_extend_frame_borders aom_extend_frame_borders_c

void aom_extend_frame_borders_y_c(struct yv12_buffer_config* ybf);
#define aom_extend_frame_borders_y aom_extend_frame_borders_y_c

void aom_extend_frame_inner_borders_c(struct yv12_buffer_config* ybf,
                                      const int num_planes);
#define aom_extend_frame_inner_borders aom_extend_frame_inner_borders_c

void aom_horizontal_line_2_1_scale_c(const unsigned char* source,
                                     unsigned int source_width,
                                     unsigned char* dest,
                                     unsigned int dest_width);
#define aom_horizontal_line_2_1_scale aom_horizontal_line_2_1_scale_c

void aom_horizontal_line_5_3_scale_c(const unsigned char* source,
                                     unsigned int source_width,
                                     unsigned char* dest,
                                     unsigned int dest_width);
#define aom_horizontal_line_5_3_scale aom_horizontal_line_5_3_scale_c

void aom_horizontal_line_5_4_scale_c(const unsigned char* source,
                                     unsigned int source_width,
                                     unsigned char* dest,
                                     unsigned int dest_width);
#define aom_horizontal_line_5_4_scale aom_horizontal_line_5_4_scale_c

void aom_vertical_band_2_1_scale_c(unsigned char* source,
                                   int src_pitch,
                                   unsigned char* dest,
                                   int dest_pitch,
                                   unsigned int dest_width);
#define aom_vertical_band_2_1_scale aom_vertical_band_2_1_scale_c

void aom_vertical_band_2_1_scale_i_c(unsigned char* source,
                                     int src_pitch,
                                     unsigned char* dest,
                                     int dest_pitch,
                                     unsigned int dest_width);
#define aom_vertical_band_2_1_scale_i aom_vertical_band_2_1_scale_i_c

void aom_vertical_band_5_3_scale_c(unsigned char* source,
                                   int src_pitch,
                                   unsigned char* dest,
                                   int dest_pitch,
                                   unsigned int dest_width);
#define aom_vertical_band_5_3_scale aom_vertical_band_5_3_scale_c

void aom_vertical_band_5_4_scale_c(unsigned char* source,
                                   int src_pitch,
                                   unsigned char* dest,
                                   int dest_pitch,
                                   unsigned int dest_width);
#define aom_vertical_band_5_4_scale aom_vertical_band_5_4_scale_c

void aom_yv12_copy_frame_c(const struct yv12_buffer_config* src_bc,
                           struct yv12_buffer_config* dst_bc,
                           const int num_planes);
#define aom_yv12_copy_frame aom_yv12_copy_frame_c

void aom_yv12_copy_u_c(const struct yv12_buffer_config* src_bc,
                       struct yv12_buffer_config* dst_bc);
#define aom_yv12_copy_u aom_yv12_copy_u_c

void aom_yv12_copy_v_c(const struct yv12_buffer_config* src_bc,
                       struct yv12_buffer_config* dst_bc);
#define aom_yv12_copy_v aom_yv12_copy_v_c

void aom_yv12_copy_y_c(const struct yv12_buffer_config* src_ybc,
                       struct yv12_buffer_config* dst_ybc);
#define aom_yv12_copy_y aom_yv12_copy_y_c

void aom_yv12_extend_frame_borders_c(struct yv12_buffer_config* ybf,
                                     const int num_planes);
#define aom_yv12_extend_frame_borders aom_yv12_extend_frame_borders_c

void aom_yv12_partial_coloc_copy_u_c(const struct yv12_buffer_config* src_bc,
                                     struct yv12_buffer_config* dst_bc,
                                     int hstart,
                                     int hend,
                                     int vstart,
                                     int vend);
#define aom_yv12_partial_coloc_copy_u aom_yv12_partial_coloc_copy_u_c

void aom_yv12_partial_coloc_copy_v_c(const struct yv12_buffer_config* src_bc,
                                     struct yv12_buffer_config* dst_bc,
                                     int hstart,
                                     int hend,
                                     int vstart,
                                     int vend);
#define aom_yv12_partial_coloc_copy_v aom_yv12_partial_coloc_copy_v_c

void aom_yv12_partial_coloc_copy_y_c(const struct yv12_buffer_config* src_ybc,
                                     struct yv12_buffer_config* dst_ybc,
                                     int hstart,
                                     int hend,
                                     int vstart,
                                     int vend);
#define aom_yv12_partial_coloc_copy_y aom_yv12_partial_coloc_copy_y_c

void aom_yv12_partial_copy_u_c(const struct yv12_buffer_config* src_bc,
                               int hstart1,
                               int hend1,
                               int vstart1,
                               int vend1,
                               struct yv12_buffer_config* dst_bc,
                               int hstart2,
                               int vstart2);
#define aom_yv12_partial_copy_u aom_yv12_partial_copy_u_c

void aom_yv12_partial_copy_v_c(const struct yv12_buffer_config* src_bc,
                               int hstart1,
                               int hend1,
                               int vstart1,
                               int vend1,
                               struct yv12_buffer_config* dst_bc,
                               int hstart2,
                               int vstart2);
#define aom_yv12_partial_copy_v aom_yv12_partial_copy_v_c

void aom_yv12_partial_copy_y_c(const struct yv12_buffer_config* src_ybc,
                               int hstart1,
                               int hend1,
                               int vstart1,
                               int vend1,
                               struct yv12_buffer_config* dst_ybc,
                               int hstart2,
                               int vstart2);
#define aom_yv12_partial_copy_y aom_yv12_partial_copy_y_c

int aom_yv12_realloc_with_new_border_c(struct yv12_buffer_config* ybf,
                                       int new_border,
                                       int byte_alignment,
                                       int num_planes);
#define aom_yv12_realloc_with_new_border aom_yv12_realloc_with_new_border_c

void aom_scale_rtcd(void);

#include "config/aom_config.h"

#ifdef RTCD_C
#include "aom_ports/arm.h"
static void setup_rtcd_internal(void) {
  int flags = aom_arm_cpu_caps();

  (void)flags;
}
#endif

#ifdef __cplusplus
}  // extern "C"
#endif

#endif


text:
struct PP_NetAddress_Private;

namespace ppapi {

class HostResource;
class PPB_X509Certificate_Fields;

namespace proxy {

struct PPBURLLoader_UpdateProgress_Params;
struct SerializedDirEntry;
struct SerializedFontDescription;
class SerializedHandle;
class SerializedVar;

}  // namespace proxy
}  // namespace ppapi

namespace IPC {

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> {
  typedef PP_Bool param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template <>
struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> {
  typedef PP_NetAddress_Private param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* p);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<
    ppapi::proxy::PPBURLLoader_UpdateProgress_Params> {
  typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> {
  typedef ppapi::proxy::SerializedDirEntry param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> {
  typedef ppapi::proxy::SerializedFontDescription param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> {
  typedef ppapi::proxy::SerializedHandle param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> {
  typedef ppapi::HostResource param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> {
  typedef ppapi::proxy::SerializedVar param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<
    std::vector<ppapi::proxy::SerializedVar> > {
  typedef std::vector<ppapi::proxy::SerializedVar> param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> {
  typedef ppapi::PpapiPermissions param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

#if !BUILDFLAG(IS_NACL) && !defined(NACL_WIN64)
template <>
struct ParamTraits<ppapi::PepperFilePath> {
  typedef ppapi::PepperFilePath param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* p);
  static void Log(const param_type& p, std::string* l);
};

#endif  // !BUILDFLAG(IS_NACL) && !defined(NACL_WIN64)

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> {
  typedef ppapi::PPB_X509Certificate_Fields param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> {
  typedef ppapi::SocketOptionData param_type;
  static void Write(base::Pickle* m, const param_type& p);
  static bool Read(const base::Pickle* m,
                   base::PickleIterator* iter,
                   param_type* r);
  static void Log(const param_type& p, std::string* l);
};

}  // namespace IPC

#endif  // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using NUnit.Framework;
using ServiceStack.Common;
using ServiceStack.Common.Utils;
using ServiceStack.Html;
using ServiceStack.Markdown;
using ServiceStack.Razor;
using ServiceStack.ServiceHost.Tests.Formats;
using ServiceStack.ServiceInterface.Testing;
using ServiceStack.Text;
using ServiceStack.VirtualPath;

namespace ServiceStack.ServiceHost.Tests.Formats_Razor
{
	public class Person
	{
		public string FirstName { get; set; }
		public string LastName { get; set; }
		public List<Link> Links { get; set; }
	}

	public class Link
	{
		public Link()
		{
			this.Labels = new List<string>();
		}
		public string Name { get; set; }
		public string Href { get; set; }
		public List<string> Labels { get; set; }
	}

	public class CustomViewBase<T> : ViewPage<T>
	{
		public CustomMarkdownHelper Ext = new CustomMarkdownHelper();
		public ExternalProductHelper Prod = new ExternalProductHelper();

		public MvcHtmlString Table(dynamic obj)
		{
			Person model = obj;
			var sb = new StringBuilder();

			sb.AppendFormat("

{0}'s Links
", model.FirstName);
			sb.AppendLine("

Name	Link

");
			sb.AppendLine("
");
			foreach (var link in model.Links)
			{
				sb.AppendFormat("
{0}	{1}
", link.Name, link.Href);
			}
			sb.AppendLine("
");
			sb.AppendLine("
");

			return MvcHtmlString.Create(sb.ToString());
		}

		private static string[] MenuItems = new[] { "About Us", "Blog", "Links", "Contact" };

		public MvcHtmlString Menu(string selectedId)
		{
			var sb = new StringBuilder();
			sb.Append("
\n");
			foreach (var menuItem in MenuItems)
			{
				var cls = menuItem == selectedId ? " class='selected'" : "";
				sb.AppendFormat("
{0}
\n", menuItem, cls);
			}
			sb.Append("
\n");

			return MvcHtmlString.Create(sb.ToString());
		}

		public string Lower(string name)
		{
			return name == null ? null : name.ToLower();
		}

		public string Upper(string name)
		{
			return name == null ? null : name.ToUpper();
		}

		public string Combine(string separator, params string[] parts)
		{
			return string.Join(separator, parts);
		}
	}

	public class CustomMarkdownHelper
	{
		public static CustomMarkdownHelper Instance = new CustomMarkdownHelper();

		public MvcHtmlString InlineBlock(string content, string id)
		{
			return MvcHtmlString.Create(
				"

" + content + "

");
		}
	}

	[TestFixture]
	public class RazorTemplateTests : RazorTestBase
	{
		string staticTemplatePath;
		string staticTemplateContent;
		string dynamicPagePath;
		string dynamicPageContent;
		string dynamicListPagePath;
		string dynamicListPageContent;

		Person templateArgs;

		Person person = new Person {
			FirstName = "Demis",
			LastName = "Bellot",
			Links = new List<Link>
				{
					new Link { Name = "ServiceStack", Href = "http://www.servicestack.net", Labels = {"REST","JSON","XML"} },
					new Link { Name = "AjaxStack", Href = "http://www.ajaxstack.com", Labels = {"HTML5", "AJAX", "SPA"} },
				},
		};

		[TestFixtureSetUp]
		public void TestFixtureSetUp()
		{
			staticTemplatePath = "Views/Shared/_Layout.cshtml";
			staticTemplateContent = File.ReadAllText("~/{0}".Fmt(staticTemplatePath).MapProjectPath());

			dynamicPagePath = "Views/Template/DynamicTpl.cshtml";
            dynamicPageContent = File.ReadAllText("~/{0}".Fmt(dynamicPagePath).MapProjectPath());

			dynamicListPagePath = "Views/Template/DynamicListTpl.cshtml".MapProjectPath();
            dynamicListPageContent = File.ReadAllText("~/{0}".Fmt(dynamicListPagePath).MapProjectPath());

			templateArgs = person;
		}

		[SetUp]
		public void OnBeforeEachTest()
		{
            base.RazorFormat = new RazorFormat {
                VirtualPathProvider = new InMemoryVirtualPathProvider(new BasicAppHost()),
                TemplateProvider = { CompileInParallelWithNoOfThreads = 0 },
            };
            RazorFormat.Init();
		}

		[Test]
		public void Can_Render_RazorTemplate()
		{
			const string mockContents = "[Replaced with Template]";

            RazorFormat.AddFileAndTemplate(staticTemplatePath, staticTemplateContent);
			var page = AddViewPage("MockPage", "/path/to/page", mockContents, staticTemplatePath);

			var expectedHtml = staticTemplateContent.ReplaceFirst(RazorFormat.TemplatePlaceHolder, mockContents);

			var templateOutput = page.RenderToString(templateArgs);

			Console.WriteLine(templateOutput);

			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage()
		{
		    RazorFormat.AddFileAndTemplate(staticTemplatePath, staticTemplateContent);
            var dynamicPage = AddViewPage("DynamicTpl", dynamicPagePath, dynamicPageContent, staticTemplatePath);

			var expectedHtml = dynamicPageContent
				.Replace("@Model.FirstName", person.FirstName)
				.Replace("@Model.LastName", person.LastName);

			expectedHtml = staticTemplateContent.Replace(RazorFormat.TemplatePlaceHolder, expectedHtml);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs);

			Console.WriteLine(templateOutput);

			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_foreach()
		{
            RazorFormat.AddFileAndTemplate(staticTemplatePath, staticTemplateContent);
            var dynamicPage = AddViewPage("DynamicListTpl", dynamicListPagePath, dynamicListPageContent, staticTemplatePath);

			var expectedHtml = dynamicListPageContent
				.Replace("@Model.FirstName", person.FirstName)
				.Replace("@Model.LastName", person.LastName);

			var foreachLinks = "
ServiceStack - http://www.servicestack.net
\r\n"
							 + "
AjaxStack - http://www.ajaxstack.com
";

			expectedHtml = expectedHtml.ReplaceForeach(foreachLinks);

			expectedHtml = staticTemplateContent.Replace(RazorFormat.TemplatePlaceHolder, expectedHtml);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs);

			Console.WriteLine(templateOutput);

			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_IF_statement()
		{
			var template = @"
Dynamic If Markdown Template

Hello @Model.FirstName,

@if (Model.FirstName == ""Bellot"") {

@Model.FirstName

}
@if (Model.LastName == ""Bellot"") {

@Model.LastName

}

heading 3
";

			var expectedHtml = @"
Dynamic If Markdown Template

Hello Demis,

Bellot

heading 3
";

			var dynamicPage = AddViewPage("DynamicIfTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs);

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_Nested_Statements()
		{
			var template = @"
@Model.FirstName Dynamic Nested Markdown Template

heading 1

@foreach (var link in Model.Links) {
	@if (link.Name == ""AjaxStack"") {

@link.Name - @link.Href

	}
}

@if (Model.Links.Count == 2) {

Haz 2 links

	@foreach (var link in Model.Links) {

@link.Name - @link.Href

		@foreach (var label in link.Labels) {

@label

		}
	}

}

heading 3
";

			var expectedHtml = @"
Demis Dynamic Nested Markdown Template

heading 1

AjaxStack - http://www.ajaxstack.com

Haz 2 links

ServiceStack - http://www.servicestack.net

REST

JSON

XML

AjaxStack - http://www.ajaxstack.com

HTML5

AJAX

SPA

heading 3
";

			var dynamicPage = AddViewPage("DynamicNestedTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs);

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_Razor_with_StaticMethods()
		{
			var headerTemplate = @"
Header Links!

Google

Bing

".NormalizeNewLines();

			var template = @"
Welcome to Razor!

@Html.Partial(""HeaderLinks"", Model)

Hello @Upper(Model.LastName), @Model.FirstName

Breadcrumbs

@Combine("" / "", Model.FirstName, Model.LastName)

Menus

@foreach (var link in Model.Links) {

@link.Name - @link.Href

		@foreach (var label in link.Labels) {

@label

		}

}

HTML Table

@Table(Model)".NormalizeNewLines();

			var expectedHtml = @"
Welcome to Razor!

Header Links!

Google

Bing

Hello BELLOT, Demis

Breadcrumbs

Demis / Bellot

Menus

ServiceStack - http://www.servicestack.net

REST

JSON

XML

AjaxStack - http://www.ajaxstack.com

HTML5

AJAX

SPA

HTML Table

Demis's Links

Name	Link

ServiceStack	http://www.servicestack.net

AjaxStack	http://www.ajaxstack.com

".NormalizeNewLines();

            RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

			AddViewPage("HeaderLinks", "/path/to/page", headerTemplate);

			var dynamicPage = AddViewPage("DynamicIfTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_inherit_from_Generic_RazorViewPage_from_model_directive()
		{
			var template = @"@model ServiceStack.ServiceHost.Tests.Formats_Razor.Person

Generic View Page

Form fields

@Html.LabelFor(m => m.FirstName) @Html.TextBoxFor(m => m.FirstName)
";

			var expectedHtml = @"
Generic View Page

Form fields

FirstName <input name=""FirstName"" type=""text"" value=""Demis"" />
".NormalizeNewLines();

			var dynamicPage = AddViewPage("DynamicModelTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_inherit_from_CustomViewPage_using_inherits_directive()
		{
            var template = @"@inherits ServiceStack.ServiceHost.Tests.Formats_Razor.CustomViewBase<ServiceStack.ServiceHost.Tests.Formats_Razor.Person>

Generic View Page

Form fields

@Html.LabelFor(m => m.FirstName) @Html.TextBoxFor(m => m.FirstName)

Person Table

@Table(Model)";

			var expectedHtml = @"
Generic View Page

Form fields

FirstName <input name=""FirstName"" type=""text"" value=""Demis"" />

Person Table

Demis's Links

Name	Link

ServiceStack	http://www.servicestack.net

AjaxStack	http://www.ajaxstack.com

".NormalizeNewLines();

            var dynamicPage = AddViewPage("DynamicModelTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_external_helper()
		{
			var template = @"
View Page with Custom Helper

External Helper

@Ext.InlineBlock(Model.FirstName, ""first-name"")
";

			var expectedHtml =
			@"
View Page with Custom Helper

External Helper

Demis

".NormalizeNewLines();

			RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

			var dynamicPage = AddViewPage("DynamicModelTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_variable_statements()
		{
			var template = @"
Welcome to Razor!

@{ var lastName = Model.LastName; }
Hello @Upper(lastName), @Model.FirstName

Breadcrumbs

@Combine("" / "", Model.FirstName, lastName)

@{ var links = Model.Links; }

Menus

@foreach (var link in links) {

@link.Name - @link.Href

		@{ var labels = link.Labels; }
		@foreach (var label in labels) {

@label

		}

}

";

			var expectedHtml = @"
Welcome to Razor!

Hello BELLOT, Demis

Breadcrumbs

Demis / Bellot

Menus

ServiceStack - http://www.servicestack.net

REST

JSON

XML

AjaxStack - http://www.ajaxstack.com

HTML5

AJAX

SPA

".NormalizeNewLines();

			RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

			var dynamicPage = AddViewPage("DynamicModelTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_RazorPage_with_comments()
		{
			var template = @"
Dynamic If Markdown Template

Hello @Model.FirstName,

@if (Model.FirstName == ""Bellot"") {

@Model.FirstName

}
@*
@if (Model.LastName == ""Bellot"") {
	* @Model.LastName
}
*@

@*
Plain text in a comment
*@

heading 3
";

			var expectedHtml = @"
Dynamic If Markdown Template

Hello Demis,

heading 3
".NormalizeNewLines();

			var dynamicPage = AddViewPage("DynamicIfTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_capture_Section_statements_and_store_them_in_Sections()
		{
			var template = @"
Welcome to Razor!

@{ var lastName = Model.LastName; }
@section Salutations {

Hello @Upper(lastName), @Model.FirstName

}

@section Breadcrumbs {

Breadcrumbs

@Combine("" / "", Model.FirstName, lastName)

}

@{ var links = Model.Links; }
@section Menus {

Menus

@foreach (var link in links) {

@link.Name - @link.Href

		@{ var labels = link.Labels; }
		@foreach (var label in labels) {

@label

		}

}

}

Captured Sections

@RenderSection(""Breadcrumbs"")

@RenderSection(""Menus"")

Salutations

@RenderSection(""Salutations"")";

			var expectedHtml =
			@"
Welcome to Razor!

Captured Sections

Breadcrumbs

Demis / Bellot

Menus

ServiceStack - http://www.servicestack.net

REST

JSON

XML

AjaxStack - http://www.ajaxstack.com

HTML5

AJAX

SPA

Salutations

Hello BELLOT, Demis

".NormalizeNewLines();

			RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

			var dynamicPage = AddViewPage("DynamicModelTpl", "/path/to/tpl", template);

			var templateOutput = dynamicPage.RenderToHtml(templateArgs).NormalizeNewLines();

			Console.WriteLine(templateOutput);

			Assert.That(templateOutput, Is.EqualTo(expectedHtml));

			var razorTemplate = dynamicPage.GetRazorTemplate();

			razorTemplate.Clear();
			Action section;
			razorTemplate.Sections.TryGetValue("Salutations", out section);
			section();

			Assert.That(razorTemplate.Result, Is.EqualTo("\r\n
Hello BELLOT, Demis
\r\n"));
		}

		[Test]
		public void Can_Render_RazorTemplate_with_section_and_variable_placeholders()
		{
			var template = @"
Welcome to Razor!

@{ var lastName = Model.LastName; }

Hello @Upper(lastName), @Model.FirstName,

@section Breadcrumbs {

Breadcrumbs

@Combine("" / "", Model.FirstName, lastName)
}

@section Menus {

Menus

@foreach (var link in Model.Links) {

@link.Name - @link.Href

		@{ var labels = link.Labels; }
		@foreach (var label in labels) {

@label

		}

}

}";
            var websiteTemplatePath = "websiteTemplate.cshtml";

			var websiteTemplate = @"<!doctype html>

	<title>Bellot page</title>

		@RenderSection(""Menus"")

Website Template

@RenderBody()

		@RenderSection(""Breadcrumbs"")

";

			var expectedHtml =
			@"<!doctype html>

	<title>Bellot page</title>

Menus

ServiceStack - http://www.servicestack.net

REST

JSON

XML

AjaxStack - http://www.ajaxstack.com

HTML5

AJAX

SPA

Website Template

Welcome to Razor!

Hello BELLOT, Demis,

Breadcrumbs

Demis / Bellot

".NormalizeNewLines();

			RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

			RazorFormat.AddFileAndTemplate(websiteTemplatePath, websiteTemplate);
			AddViewPage("DynamicModelTpl", "/path/to/page-tpl", template, websiteTemplatePath);

			var razorTemplate = RazorFormat.ExecuteTemplate(
				person, "DynamicModelTpl", websiteTemplatePath);

			var templateOutput = razorTemplate.Result.NormalizeNewLines();

			Console.WriteLine(templateOutput);

			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

		[Test]
		public void Can_Render_Static_RazorContentPage_that_populates_variable_and_displayed_on_website_template()
		{

			var websiteTemplate = @"<!doctype html>

	<title>Static page</title>

		@RenderSection(""Header"")

		@RenderSection(""Menu"")

Website Template

@RenderBody()

".NormalizeNewLines();

	var template = @"
Static Markdown Template

@section Menu {
  @Menu(""Links"")
}

@section Header {

Static Page Title

}

heading 3

paragraph
";

	var expectedHtml = @"<!doctype html>

	<title>Static page</title>

Static Page Title

About Us

Blog

Links

Contact

Website Template

Static Markdown Template

heading 3

paragraph

".NormalizeNewLines();

			RazorFormat.TemplateService.TemplateBaseType = typeof(CustomViewBase<>);

            var websiteTemplatePath = "websiteTemplate.cshtml";
			RazorFormat.AddFileAndTemplate(websiteTemplatePath, websiteTemplate);

			var staticPage = new ViewPageRef(RazorFormat,
				"pagetpl", "StaticTpl", template, RazorPageType.ContentPage) {
					Service = RazorFormat.TemplateService,
                    Template = websiteTemplatePath,
				};

            RazorFormat.AddPage(staticPage);
            RazorFormat.TemplateService.RegisterPage("pagetpl", "StaticTpl");
            RazorFormat.TemplateProvider.CompileQueuedPages();

            var templateOutput = RazorFormat.RenderStaticPage("pagetpl").NormalizeNewLines();

			Console.WriteLine(templateOutput);
			Assert.That(templateOutput, Is.EqualTo(expectedHtml));
		}

	}
}


text:
Users of GMML can:

- Read AMBER prep files
- Read AMBER parameter sets
- Read AMBER library (OFF) files
- Read and write PDB files
- Read and write AMBER topology files
- Read and write AMBER coordinate files
- Build residues and molecules using data from input files
- Build residues and molecules manually
- Build oligosaccharides easily with GLYCAM's simple carbohydrate nomenclature
- Generate all possible conformations of a structure that adhere to a user-defined list of possible glycosidic torsions
- Geometrically modify structures in a variety of ways
- Solvate structures
- Minimize structures through an interface with SANDER, AMBER's primary simulation program
- GMML is the engine behind the new and improved GLYCAM web interface, currently being developed.

### Getting Started
To build:
```
    ./configure
    make
```

To run tests:
```
    make check
```

To install:
```
    make install
```

Building requires:
```
    boost headers (for shared_ptr)
```

If you don't have a configure file, run 'sh autogen.sh' first. This requires:
```
    autoconf
    automake
    libtool
```


text:
//
//   ______     _   _                 _          _____ _____  _  __
//  |  ____|   | | (_)               | |        / ____|  __ \| |/ /
//  | |__   ___| |_ _ _ __ ___   ___ | |_ ___  | (___ | |  | | ' /
//  |  __| / __| __| | '_ ` _ \ / _ \| __/ _ \  \___ \| |  | |  <
//  | |____\__ \ |_| | | | | | | (_) | ||  __/  ____) | |__| | . \
//  |______|___/\__|_|_| |_| |_|\___/ \__\___| |_____/|_____/|_|\_\
//
//
//  Copyright © 2015 Estimote. All rights reserved.

#import <Foundation/Foundation.h>
#import "ESTBeaconOperationProtocol.h"
#import "ESTSettingOperation.h"
#import "ESTSettingDeviceInfoApplicationVersion.h"

NS_ASSUME_NONNULL_BEGIN

/**
 *  ESTBeaconOperationDeviceInfoApplicationVersion allows to create read operations for Device Info ApplicationVersion setting of a device.
 */
@interface ESTBeaconOperationDeviceInfoApplicationVersion : ESTSettingOperation <ESTBeaconOperationProtocol>

/**
 *  Method allows to create read operation for Device Info ApplicationVersion setting.
 *
 *  @param completion Block invoked when the operation is complete.
 *
 *  @return Initialized object.
 */
+ (instancetype)readOperationWithCompletion:(ESTSettingDeviceInfoApplicationVersionCompletionBlock)completion;

@end

NS_ASSUME_NONNULL_END


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>basic_timeout_socket::protocol_type</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../boost__beast__basic_timeout_socket.html" title="basic_timeout_socket">
<link rel="prev" href="next_layer_type.html" title="basic_timeout_socket::next_layer_type">
<link rel="next" href="../boost__beast__basic_timeout_socket__async_op.html" title="basic_timeout_socket::async_op">

Home
Libraries
People
FAQ
More

basic_timeout_socket::protocol_type

The protocol used by the stream.

          Synopsis

using protocol_type = Protocol;

          Description

Copyright © 2016, 2017 Vinnie Falco

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
package eu.seaclouds.platform.planner.aamwriter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import eu.seaclouds.platform.planner.aamwriter.modelaam.Aam;
import eu.seaclouds.platform.planner.aamwriter.modelaam.Constraint;
import eu.seaclouds.platform.planner.aamwriter.modelaam.NodeTemplate;
import eu.seaclouds.platform.planner.aamwriter.modelaam.NodeType;
import eu.seaclouds.platform.planner.aamwriter.modelaam.Operation;
import eu.seaclouds.platform.planner.aamwriter.modelaam.Policy;
import eu.seaclouds.platform.planner.aamwriter.modelaam.TopologyTemplate;
import eu.seaclouds.platform.planner.aamwriter.modeldesigner.DGraph;
import eu.seaclouds.platform.planner.aamwriter.modeldesigner.DLink;
import eu.seaclouds.platform.planner.aamwriter.modeldesigner.DNode;
import eu.seaclouds.platform.planner.aamwriter.modeldesigner.DRequirements;

/**
 * Translates from designer model to AAM.
 *
 * TODO: QoB
 *
 */
public class Translator {
    public static Logger log = LoggerFactory.getLogger(Translator.class);

    private static final String NODE_TYPE_PREFIX = "sc_req.";
    private static final String OPERATION_PREFIX = "operation_";

    public Aam translate(DGraph graph) {

        Aam aam = new Aam(graph.getName());
        for (DNode n : graph.getNodes()) {

            translateDNode(n, aam);
        }

        for (DLink l : graph.getLinks()) {

            translateDLink(l, aam);
        }
        buildGroups(graph, aam);
        return aam;
    }

    private void translateDNode(DNode dnode, Aam aam) {
        /*
         * The names module, container and host used in this code are generic and not following TOSCA spec
         * where each of them are "modules". So:
         * - a module is a component of our software
         * - a container is where a module is hosted (maybe specified or not). E.g: apache, jboss
         * - a host is a VM/PaaS where a module/container is hosted.
         *
         * If the module is to be hosted on a container (e.g. a war using a Tomcat), the node template for the module
         * is a Tomcat, using the war as an artifact.
         *
         * If the module is a standalone module (e.g. a jar that listens on port when run), the node template for the
         * module is a WebApplication, with the jar as an artifact.
         */
        TopologyTemplate topology = aam.getTopologyTemplate();

        NodeTemplate module = new NodeTemplate(dnode.getName());
        topology.addNodeTemplate(module);

        boolean needsContainer = !dnode.getContainer().isEmpty();

        if (!dnode.getLanguage().isEmpty()) {
            module.addProperty("language", dnode.getLanguage());
        }

        module.addProperties(dnode.getOtherProperties());

        /*
         * Handle artifacts
         */
        String artifactValue = dnode.getArtifact();
        if (!artifactValue.isEmpty()) {
            String artifactName;
            String artifactType;

            artifactName = buildArtifactName(dnode, needsContainer);

            artifactType = "tosca.artifacts.File";
            module.addArtifact(artifactName, artifactValue, artifactType);
        }

        /*
         * Handle module_type
         */
        NodeType moduleType = new NodeType(NODE_TYPE_PREFIX + module.getName());

        String derivedFrom = buildDerivedFrom(dnode);
        moduleType.setDerivedFrom(derivedFrom);

        /*
         * If PaaS, set *_support for software requirements: language, container, category
         */
        if (isPlatformEligible(dnode)) {
            /*
             * support item handling
             */
            List<String> supportItems = new ArrayList<String>();
            if (!"".equals(dnode.getLanguage())) {
                String prefix = getPrefixItem(dnode.getLanguage(), dnode.getMinVersion(), dnode.getMaxVersion());
                supportItems.add(prefix);
            }
            if (!"".equals(dnode.getContainer())) {
                supportItems.add(getPrefixItem(dnode.getContainer(), "", ""));
            }
            if (!"".equals(dnode.getCategory())) {
                String prefix = getPrefixItem(dnode.getCategory(), dnode.getMinVersion(), dnode.getMaxVersion());
                supportItems.add(prefix);
            }
            for (String supportItem : supportItems) {
                if (!"".equals(supportItem)) {
                    moduleType.addSupportItemConstraintProperty(supportItem + "_support");
                }
            }
        }
        /*
         * If IaaS,
         *   - set location, disk size, mem size in node_type
         *   - set language, category, versions in node_template
         */
        if (isComputeEligible(dnode)) {
            if (!"".equals(dnode.getNumCpus())) {
                Constraint constraint = buildGreaterEqualsConstraint(dnode.getNumCpus());
                moduleType.addConstrainedProperty("num_cpus", constraint);
            }
            if (!"".equals(dnode.getDiskSize())) {
                Constraint constraint = buildGreaterEqualsConstraint(dnode.getDiskSize());
                moduleType.addConstrainedProperty("disk_size", constraint);
            }
        }
        /*
         * version handling
         */
        {
            if (!"".equals(dnode.getLanguage())) {
                String prefix = getPrefixItem(dnode.getLanguage(), dnode.getMinVersion(), dnode.getMaxVersion());

                Constraint[] constraints1 = buildVersionConstraints(dnode);
                Constraint[] constraints2 = buildVersionConstraints(dnode);

                if (isPlatformEligible(dnode)) {
                    moduleType.addConstrainedProperty(prefix + "_version", constraints1);
                }
                if (isComputeEligible(dnode)) {
                    module.addConstrainedProperty(prefix + "_version", constraints2);
                }
            }
            if (!"".equals(dnode.getCategory())) {
                String prefix = getPrefixItem(dnode.getCategory(), dnode.getMinVersion(), dnode.getMaxVersion());

                Constraint[] constraints1 = buildVersionConstraints(dnode);
                Constraint[] constraints2 = buildVersionConstraints(dnode);
                if (isPlatformEligible(dnode)) {
                    moduleType.addConstrainedProperty(prefix + "_version", constraints1);
                }
                if (isComputeEligible(dnode)) {
                    module.addConstrainedProperty(prefix + "_version", constraints2);
                }
            }
        }

        aam.addNodeType(moduleType);

        moduleType.addResourceTypeConstraintProperty(dnode.getInfrastructure());

        /*
         * Assign node types to node templates
         */
        module.setType(moduleType);
    }

    private void translateDLink(DLink l, Aam aam) {
        TopologyTemplate topologyTemplate = aam.getTopologyTemplate();

        DNode dSource = l.getSource();
        DNode dTarget = l.getTarget();

        NodeTemplate source = topologyTemplate.getNodeTemplate(dSource.getName());
        NodeTemplate target = topologyTemplate.getNodeTemplate(dTarget.getName());

        source.addConnectionRequirement(target, l.getOperationType());
        if (!l.getCredentialsFile().isEmpty()) {
            source.addProperty(DLink.Attributes.CREDENTIALS_FILE, l.getCredentialsFile());
        }
    }

    private void buildGroups(DGraph dgraph, Aam aam) {

        for (DNode dnode : dgraph.getNodes()) {
            Operation operation = new Operation(buildOperationName(dnode), dnode.getName());
            aam.addOperation(operation);
        }

        for (DNode dnode : dgraph.getNodes()) {
            Operation sourceOperation = aam.getOperation(buildOperationName(dnode));
            /*
             * QoSInfo
             */
            if (!"".equals(dnode.getBenchmarkResponseTime()) && !"".equals(dnode.getBenchmarkPlatform())) {
                Policy.QoSInfo info = new Policy.QoSInfo(
                        dnode.getBenchmarkResponseTime(),
                        dnode.getBenchmarkPlatform());
                sourceOperation.addQoSInfo(info);
            }
            /*
             * Dependencies
             */
            List<Policy.Dependency> dependencies = new ArrayList<Policy.Dependency>();
            for (DLink link : dgraph.getLinksFrom(dnode)) {
                Operation targetOperation = aam.getOperation(buildOperationName(link.getTarget()));
                Policy.Dependency dep = new Policy.Dependency(targetOperation, link.getCalls());
                dependencies.add(dep);
            }
            sourceOperation.addDependencies(new Policy.Dependencies(dependencies));

            /*
             * Application QosRequirements if this node is the source of the flow graph
             */
            if (isSource(dgraph, dnode)) {
                DRequirements dreq = dgraph.getRequirements();
                Policy.AppQoSRequirements requirements = new Policy.AppQoSRequirements(
                        dreq.getResponseTime(), dreq.getAvailability(), dreq.getCost(), dreq.getWorkload());
                sourceOperation.addAppQoSRequirement(requirements);
            }
            /*
             * Module QoSRequirements
             */
            if (!dnode.getQos().isEmpty()) {
                Policy.ModuleQoSRequirements requirements = buildModuleQoSRequirements(dnode.getQos());
                sourceOperation.addModuleQoSRequirement(requirements);
            }
        }
    }

    private String buildDerivedFrom(DNode dnode) {
        String derivedFrom;
        String derivedFromSuffix;
        if ("WebApplication".equals(dnode.getType())) {
            derivedFromSuffix = dnode.getContainer();
        }
        else {
            derivedFromSuffix = dnode.getCategory();
        }
        if ("".equals(derivedFromSuffix)) {
            derivedFrom = "seaclouds.nodes.SoftwareComponent";
        }
        else {
            derivedFrom = "seaclouds.nodes." + derivedFromSuffix;
        }
        return derivedFrom;
    }

    private String buildArtifactName(DNode dnode, boolean needsContainer) {
        String artifactName;
        switch (dnode.getType()) {
        case "WebApplication":
            String language = dnode.getLanguage();
            if ("JAVA".equals(language)) {
                artifactName = (needsContainer)? "war" : "jar";
            }
            else {
                artifactName = "file";
            }
            break;
        case "Database":
            artifactName = "db_create";
            break;
        default:
            artifactName = "artifact";
            break;
        }
        return artifactName;
    }

    private boolean isSource(DGraph dgraph, DNode dnode) {
        List<DLink> links = dgraph.getLinksTo(dnode);
        return links.size() == 0;
    }

    private String buildOperationName(DNode dnode) {
        return OPERATION_PREFIX + dnode.getName();
    }

    private boolean isComputeEligible(DNode dnode) {
        return "".equals(dnode.getInfrastructure()) || "compute".equals(dnode.getInfrastructure());
    }

    private boolean isPlatformEligible(DNode dnode) {
        return "".equals(dnode.getInfrastructure()) || "platform".equals(dnode.getInfrastructure());
    }

    private Constraint[] buildVersionConstraints(DNode dnode) {
        Constraint[] constraints = new Constraint[2];
        if (!"".equals(dnode.getMinVersion())) {
            constraints[0] =
                    new Constraint(Constraint.Names.GE, dnode.getMinVersion());
        }
        if (!"".equals(dnode.getMaxVersion())) {
            constraints[1] =
                    new Constraint(Constraint.Names.LE, dnode.getMaxVersion());
        }
        return constraints;
    }

    private Constraint buildGreaterEqualsConstraint(String threshold) {
        Constraint result = new Constraint(Constraint.Names.GE, threshold);

        return result;
    }

    /*
     * Quick & dirty getPrefixItem
     */
    private String getPrefixItem(String requirement, String minVersion, String maxVersion) {

        switch (requirement) {
        case "JAVA": return "java";
        case "PYTHON": return "python";
        case "RUBY": return "ruby";
        case ".NET": return "dotnet";
        case "PHP": return "php";

        case "webapp.jboss.JBoss6Server": return "jboss";
        case "webapp.jboss.JBoss7Server": return "jboss";
        case "webapp.jetty.Jetty6Server": return "jetty";
        case "webapp.tomcat.TomcatServer": return "tomcat";
        case "webapp.tomcat.Tomcat8Server": return "tomcat";

        case "database.mysql.MySqlNode": return "mysql";
        case "database.mariadb.MariaDbNode": return "maria";
        case "database.postgresql.PostgreSqlNode": return "postgresql";
        case "nosql.mongodb.MongoDBServer": return "mongoDB";
        case "nosql.redis.RedisStore": return "redis";

        default:
            return "";
        }
    }

    private Policy.ModuleQoSRequirements buildModuleQoSRequirements(List<Map<String, String>> qos) {

        Policy.ModuleQoSRequirements result = new Policy.ModuleQoSRequirements();
        for (Map<String, String> item : qos) {

            MonitoringMetrics metric = MonitoringMetrics.from(item.get("metric"));
            String metricName = metric.getMetricName();
            String operator = item.get("operator");
            String threshold = item.get("threshold");
            String unit = metric.getUnit();

            try {

                double thresholdValue = Double.parseDouble(threshold);
                result.addConstraint(metricName, operator, thresholdValue, unit);

            } catch (NumberFormatException e) {
                log.warn("Could not parse threshold value ('{}'). This QoS requirement is ignored", threshold);
            }
        }

        return result;
    }

}


text:
import {createPromiseAction} from '../../src/index'

describe('Actions', () => {
  describe('createPromiseAction', () => {

    it('should work with resolved data', () => {
      let action = createPromiseAction(() => {
        return Promise.resolve({
          name: 'Alex'
        })
      }, 'SOME')
      return action()(data => {
        data.should.have.property('type', 'SOME')
        data.should.have.property('name', 'Alex')
        return true
      })
    })

    it('should work with rejected data', () => {
      let action = createPromiseAction(() => {
        return Promise.reject({
          name: 'Alex'
        })
      }, 'SOME')
      return action()(data => {
        data.should.have.property('type', 'SOME_FAIL')
        data.should.have.property('name', 'Alex')
        return true
      })
    })
  })
})


text:
/*
 * put your module comment here
 * formatted with JxBeauty (c) johann.langhofer@nextra.at
 */

package  com.kutsyy.lvspod;

/**
 * Title:        com.kutsyy.lvspod
 * Description:  This library is set of rutins for Laten Variable model for Spatialy dependent Ordinal Data
 * Copyright:    Copyright (c) 2000
 * Company:      The University of Michigan
 * @author Vadim Kutsyy
 * @version 1.0
 */
public class OrdinalSpatialSingleAveregeQL extends OrdinalSpatialAbstract {
    private OrdinalSpatialQL[] T;
    private boolean todefine = true;

    /**
     * put your documentation comment here
     * @param     int[] y
     */
    public OrdinalSpatialSingleAveregeQL (int[] y) {
        super(y);
    }

    /**
     * put your documentation comment here
     * @param     int[] y
     * @param     double[][] z
     */
    public OrdinalSpatialSingleAveregeQL (int[] y, double[][] z) {
        super(y, z);
    }

    /**
     * put your documentation comment here
     * @param     int[] y
     * @param     double phi
     * @param     double[] theta
     * @param     com.kutsyy.lvspod.SpatialPoint[] loc
     * @param     double[] beta
     * @param     double[][] z
     * @param     int[][] neighborDefinition
     */
    protected OrdinalSpatialSingleAveregeQL (int[] y, double phi, double[] theta,
            com.kutsyy.lvspod.SpatialPoint[] loc, double[] beta, double[][] z,
            int[][] neighborDefinition) {
        super(y, phi, theta, loc, beta, z, neighborDefinition);
    }

    /**
     * put your documentation comment here
     */
    protected OrdinalSpatialSingleAveregeQL () {
        super();
    }

    /**
     * put your documentation comment here
     * @param     int[] y
     * @param     int[] xLocation
     * @param     int[] yLocation
     * @param     double[][] z
     */
    protected OrdinalSpatialSingleAveregeQL (int[] y, int[] xLocation, int[] yLocation,
            double[][] z) {
        super(y, xLocation, yLocation, z);
    }

    /**
     * put your documentation comment here
     * @return
     */
    public double lL () {
        double l = 0;
        for (int i = 0; i < T.length; i++) {
            T[i].phi = phi*(double)T.length;
            for (int j = 0; j < L; j++)
                T[i].theta[j] = theta[j];
            for (int j = 0; j < K; j++)
                T[i].beta[j] = beta[j];
            l += T[i].lL();
        }
 return  l;
    }

    /**
     * put your documentation comment here
     */
    protected void define () {
        T = new OrdinalSpatialQL[NeighborDefinition[0].length];
        int[][] thisNeighborDefinition = new int[2][1];
        for (int i = 0; i < NeighborDefinition[0].length; i++) {
            thisNeighborDefinition[0][0] = NeighborDefinition[0][i];
            thisNeighborDefinition[1][0] = NeighborDefinition[1][i];
            T[i] = new OrdinalSpatialQL(Y, xLoc, yLoc, Z, thisNeighborDefinition);
        }
    }

    /**
     * put your documentation comment here
     * @param y
     */
    public void updateY (int[] y) {
        super.updateY(y);
        for (int i = 0; i < NeighborDefinition[0].length; i++)
            T[i].updateY(y);
    }
}