text:
from django.db import models
from .util_classes.connection import *
import json

class DataQualityDimension(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()

    def __str__(self):
        return self.name

class DataType(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()

    def __str__(self):
        return self.name

class DataValidationConstraint(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()
    data_quality_dimension = models.ManyToManyField(DataQualityDimension)
    data_type = models.ManyToManyField(DataType)
    method_to_call = models.CharField(max_length=200)
    arguments_number = models.IntegerField()
    arguments_type = models.ForeignKey(DataType, null=True, related_name='argument_type')

    def __str__(self):
        return self.name

class DataSet(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()
    connection_driver = models.CharField(max_length=200, choices=CONNECTION_DRIVER_CHOICES)
    connection_server = models.CharField(max_length=200)
    connection_port = models.CharField(max_length=200)
    connection_database = models.CharField(max_length=200)
    connection_user = models.CharField(max_length=200)
    connection_password = models.CharField(max_length=200)
    created_at = models.DateTimeField(auto_now_add=True)

    def connection_string(self):
        return '{'+self.connection_driver+'}:'+\
               self.connection_server+':'+\
               self.connection_port+'/'+\
               self.connection_database+\
               ';user=\''+self.connection_user+'\''+\
               ';password=\''+self.connection_password+'\''

    def count_tables(self):
        return self.datatable_set.all().count()

    def count_columns(self):
        count = 0
        for c in self.datatable_set.all():
            count += c.count_columns()
        return count

    def count_constraints(self):
        count = 0
        for c in self.datatable_set.all():
            count += c.count_constraints()
        return count

    def __str__(self):
        return self.name

class DataTable(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()
    data_set = models.ForeignKey(DataSet)
    created_at = models.DateTimeField(auto_now_add=True)
    data_column_identify = models.ForeignKey('DataColumn', null=True)

    def count_columns(self):
        return self.datacolumn_set.all().count()

    def count_constraints(self):
        count = 0
        for c in self.datacolumn_set.all():
            count += c.count_constraints()
        return count

    def __str__(self):
        return self.name

class DataColumn(models.Model):
    name = models.CharField(max_length=200)
    description = models.TextField()
    data_table = models.ForeignKey(DataTable)
    data_type = models.ForeignKey(DataType)
    created_at = models.DateTimeField(auto_now_add=True)

    def count_constraints(self):
        return self.datacolumnconstraint_set.all().count()

    def __str__(self):
        return self.name

class DataColumnConstraint(models.Model):
    data_column = models.ForeignKey(DataColumn)
    data_validation_constraint = models.ForeignKey(DataValidationConstraint)
    created_at = models.DateTimeField(auto_now_add=True)
    argument = models.TextField()

    def __str__(self):
        return self.data_column+'-'+self.data_validation_constraint

class DataRecord(models.Model):
    data_table = models.ForeignKey(DataTable)
    record = models.TextField()

    def get_value(self, column):
        record_json = json.loads(self.record)
        return record_json[column]

    def __str__(self):
        return self.data_table+'('+self.id+')'

class DataSetEvaluation(models.Model):
    data_set = models.ForeignKey(DataSet)
    started_at = models.DateTimeField(auto_now_add=True)
    finished_at = models.DateTimeField(auto_now=True)
    found_problems = models.IntegerField(default=0)

    def __str__(self):
        return 'Evaluation '+self.id+'('+self.data_set+')'

class DataSetEvaluationProblem(models.Model):
    data_set_evaluation = models.ForeignKey(DataSetEvaluation)
    data_column_constraint = models.ForeignKey(DataColumnConstraint)
    data_record = models.ForeignKey(DataRecord, null=True)
    message = models.TextField()

    def __str__(self):
        return 'Problem '+self.id


text:
export class Configuration {
    apiKey: string | undefined;
    username: string | undefined;
    password: string | undefined;
    accessToken: string | (() => string) | undefined;
}

redpajama_set_name: RedPajamaGithub


text:
require 'poise_boiler/helpers/rake'
::PoiseBoiler::Helpers::Rake.install


text: steal('jquery').then('./jquery.ibutton.js');


text:
<?php
namespace PlayPhp\Classes;

require_once '/exceptions/IoExceptions.php';

/**
 * The view object has all methods used for creating views and passing data.
 * @version 0.1
 * @author yuri.blanc
 */
class View {
    private $template = TEMPLATE;
    /**
     *
     * @var array
     */
    private $var = array();
    private $view;

    /**
     * Add data to the View object specifing a name and a value,
     * set variables will be accessible with their $name in the rendered view.
     * @param type $name Description
     */
    public function renderArgs($name, $value){
        $this->var[$name] = $value;
    }
    /**
     * Render the view. Using relative paths you can specify subfolders of view root. (e.g. blog/post = view/blog/post.php)
     * Automatically set .php extension to the view name.
     * @param string $view
     */
    public function render($view) {

        if (strpos($view, "/")!==false) {
        $path = implode("/",array_slice(explode("/", $view), 0,-1));
        }

        $this->page_content = $this->view = APP_ROOT."view/$view.php";
        $this->renderArgs("template", $this->template);
        $this->renderArgs("page_content", $this->page_content);
        extract($this->var);
        try {
            if (!file_exists($this->page_content)) {
                throw new \FileNotFoundException("File not found: ". $this->page_content);
            }
            if (!$path) {
            include APP_ROOT."view/main.php";
            } else {
                include APP_ROOT."view/$path/main.php";
            }

            if (!file_exists(APP_ROOT."template/$this->template/index.php")) {
                 throw new \FileNotFoundException ("File not found: " . APP_ROOT."template/$this->template/index.php");
            }

        } catch (\FileNotFoundException $ex) {

        }
    }
    // good as controller function
    public function renderJson($data,$options=null) {
         echo json_encode($data,$options);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="IdProvider" IDEtalkID="55E555E0499FE5E80338634B7A8502FF" />
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" assert-keyword="false" jdk-15="false" />
</project>


text:
FOLDER=$(cd $(dirname $0); pwd -P)

[ ! -e $HOME/.refactoring-scripts ] && mkdir $HOME/.refactoring-scripts
cp -f $FOLDER/bin/* $HOME/.refactoring-scripts
sudo ln -sf $HOME/.refactoring-scripts/* /usr/local/bin

if [ $? -eq 0 ]; then
    echo "Install with success!"
else
    echo "Install fail!"
fi


text:
using System;
using NUnit.Framework;

namespace SyncAut.Common.Automaton
{
	[TestFixture]
	public class Automaton_Test
	{
		[Test]
		public void CreateEmptyAutomaton_CheckStatesCount()
		{
			var automaton = new Automaton();
			Assert.That(automaton.StatesCount, Is.EqualTo(0));
		}

		[Test]
		public void FindNotExistentState_ShouldReturnNull()
		{
			var automaton = new Automaton(new State("2", new JumpTable(), "state2"));
			Assert.Null(automaton.FindState("1"));
		}

		[Test]
		public void CreateAutomatonWithStates_CheckGetState()
		{
			var automaton = new Automaton(
				new State("1", new JumpTable(new Jump('a', "2")), "state1"),
				new State("2", new JumpTable(new Jump('a', "1")), "state2"));
			Assert.That(automaton.StatesCount, Is.EqualTo(2));

			var state1 = automaton.GetState("1");
			Assert.NotNull(state1);
			Assert.That(state1.Id, Is.EqualTo("1"));
			Assert.That(state1.Title, Is.EqualTo("state1"));

			var state2 = automaton.GetState("2");
			Assert.NotNull(state2);
			Assert.That(state2.Id, Is.EqualTo("2"));
			Assert.That(state2.Title, Is.EqualTo("state2"));
		}

		[Test]
		public void CreateAutomatonWithStates_CheckGetAllStates()
		{
			var automaton = new Automaton(
				new State("1", new JumpTable(new Jump('a', "2")), "state1"),
				new State("2", new JumpTable(new Jump('a', "1")), "state2"));
			Assert.That(automaton.StatesCount, Is.EqualTo(2));
			Assert.That(automaton.GetAllStates().Count, Is.EqualTo(2));
		}

		[Test]
		public void CreateAutomatonWithSameStateId_Error()
		{
			Assert.Throws<InvalidOperationException>(() => new Automaton(
				new State("1", new JumpTable(new Jump('a', "2")), "state1"),
				new State("1", new JumpTable(new Jump('a', "1")), "state2")));
		}

		[Test]
		public void CheckJumps()
		{
			var automaton = new Automaton(
				new State("1", new JumpTable(new Jump('a', "2"), new Jump('b', "1")), "state1"),
				new State("2", new JumpTable(new Jump('a', "1"), new Jump('c', "1")), "state2"));

			Assert.That(automaton.Jump("1", 'a'), Is.EqualTo("2"));
			Assert.That(automaton.Jump("1", 'b'), Is.EqualTo("1"));
			Assert.That(automaton.Jump("2", 'a'), Is.EqualTo("1"));
			Assert.That(automaton.Jump("2", 'c'), Is.EqualTo("1"));
		}

		[Test]
		public void CheckLetters()
		{
			var automaton = new Automaton(
				new State("1", new JumpTable(new Jump('a', "2"), new Jump('b', "1")), "state1"),
				new State("2", new JumpTable(new Jump('a', "1"), new Jump('c', "1")), "state2"));

			Assert.That(automaton.Letters, Is.EquivalentTo(new[] {'a', 'b', 'c'}));
		}

		[Test]
		public void CheckNotExistentJumps()
		{
			var automaton = new Automaton(
				new State("1", new JumpTable(new Jump('a', "2"), new Jump('b', "1")), "state1"),
				new State("2", new JumpTable(new Jump('a', "1"), new Jump('c', "1")), "state2"));

			Assert.That(automaton.TryJump("1", 'a'), Is.EqualTo("2"));
			Assert.That(automaton.TryJump("1", 'b'), Is.EqualTo("1"));
			Assert.That(automaton.TryJump("2", 'a'), Is.EqualTo("1"));
			Assert.That(automaton.TryJump("2", 'c'), Is.EqualTo("1"));
			Assert.Null(automaton.TryJump("1", 'c'));
			Assert.Null(automaton.TryJump("2", 'd'));
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="actionbar_background">#000000</color>
    <color name="background_holo_light">#fff3f3f3</color>
</resources>


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments)).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
    return { next: verb(0), "throw": verb(1), "return": verb(2) };
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [0, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var core_1 = require("@angular/core");
var AjaxService_1 = require("./AjaxService");
var UrlService_1 = require("./UrlService");
var RepositoryService_1 = require("./RepositoryService");
var LoginService = (function () {
    function LoginService($ajaxService, $url, $repo) {
        this.$ajaxService = $ajaxService;
        this.$url = $url;
        this.$repo = $repo;
        this.user = null;
        this.oldValueUser = null;
        this.logged = false;
        this.requesting = false;
        this.waitingCb = [];
        this.timeout = null;
        this.updateCallbacks = [];
    }
    LoginService.prototype.registerUpdateCallback = function (cb) {
        this.updateCallbacks.push(cb);
    };
    LoginService.prototype.fireUpdateCallback = function () {
        if (this.user == this.oldValueUser) {
            return;
        }
        this.oldValueUser = this.user;
        for (var _i = 0, _a = this.updateCallbacks; _i < _a.length; _i++) {
            var cb = _a[_i];
            cb(this.user);
        }
    };
    LoginService.prototype.login = function (mail, pass, stay) {
        return __awaiter(this, void 0, void 0, function () {
            var data, user;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.$ajaxService.post(this.$url.makeApi('Login', 'login'), {
                            mail: mail,
                            password: pass,
                            stay: stay
                        }).toPromise()];
                    case 1:
                        data = _a.sent();
                        if (data.success !== true) {
                            throw 'BAD_LOGIN';
                        }
                        return [4 /*yield*/, this.isLogged(true)];
                    case 2:
                        user = _a.sent();
                        if (user == null) {
                            throw 'UNKNOW_ERROR';
                        }
                        return [2 /*return*/, user];
                }
            });
        });
    };
    LoginService.prototype.logout = function () {
        var _this = this;
        this.$ajaxService.get(this.$url.makeApi('Login', 'logout')).subscribe(function (data) {
            _this.logged = false;
            _this.user = null;
            _this.fireUpdateCallback();
            _this.$url.redirect('user', 'register', null, 'Au revoir', 'success');
        });
    };
    LoginService.prototype.getUser = function (callback) {
        if (callback === void 0) { callback = function (u) { }; }
        return __awaiter(this, void 0, void 0, function () {
            var user;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.isLogged()];
                    case 1:
                        user = _a.sent();
                        callback(user);
                        return [2 /*return*/, user];
                }
            });
        });
    };
    LoginService.prototype.isLogged = function (force) {
        var _this = this;
        if (force === void 0) { force = false; }
        return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
            var _this = this;
            var callback, data;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.waitingCb.push(resolve);
                        if (this.requesting) {
                            return [2 /*return*/];
                        }
                        this.requesting = true;
                        callback = function () {
                            _this.requesting = false;
                            for (var i in _this.waitingCb) {
                                _this.waitingCb[i](_this.user);
                            }
                            _this.fireUpdateCallback();
                            _this.waitingCb = [];
                        };
                        if (this.timeout == null) {
                            this.timeout = new Date();
                        }
                        if (force === false && (new Date()).getTime() - this.timeout.getTime() < 60 * 1000 && this.logged) {
                            callback();
                            return [2 /*return*/];
                        }
                        this.timeout = new Date();
                        return [4 /*yield*/, this.$ajaxService.get(this.$url.makeApi("Login", "getLoginInfo")).toPromise()];
                    case 1:
                        data = _a.sent();
                        this.logged = true;
                        if (data.success === true && typeof (data.user) !== "undefined") {
                            this.user = this.$repo.EntityFromJson(data.user, 'User');
                        }
                        else {
                            this.user = null;
                        }
                        if (callback !== null) {
                            callback();
                        }
                        return [2 /*return*/];
                }
            });
        }); });
    };
    return LoginService;
}());
LoginService = __decorate([
    core_1.Injectable(),
    __metadata("design:paramtypes", [AjaxService_1.AjaxService,
        UrlService_1.UrlService,
        RepositoryService_1.RepositoryService])
], LoginService);
exports.LoginService = LoginService;


text:
susli
=====

JavaScript library for building user interfaces

## Идея
Иметь возможность писать клиентские шаблоны и иметь ссылки на ноды `HTMLElement` без поиска их по `DOM`. Это позволит сократить время инициализации шаблонов и упросит код, путем уменьшения объемов кода, которые ранее требовались на поиск нод в документе.

## Быстрый старт
Код шаблона
```js
function buildButton(name, textContent){
  return susli(
      susli.element('button', {name: name}, [
          susli.text( textContent )
        ])
    );
}

var template = susli(
    susli.element('div', {'class': 'header'}, [
        susli.element('div', {'class': 'header_nav'})
      ], 'header'),
    susli.element('div', {'class': 'content'}, [
        susli.fragment(buildButton('add', 'add a value'), 'addButton'),
        susli.fragment(buildButton('remove', 'remove a value'))
      ], 'contentNode'),
    function (references){
      references.contentNode.style.background = 'green';
      references.addButton[0].addEventListener('click', function(){}, false);
    }
  );

document.body.appendChild(template);
```

В результате на страницу будет добавлены следующие ноды:
```html
<div class="header">
  <div class="header_nav"></div>
</div>
<div class="content">
  <button name="add">add a value</button>
  <button name="remove">remove a value</button>
</div>
```

После чего к стилям `div.content` будет применен зеленый фон. И на кнопку `button[name="add"]` будет навешен обработчик события `click`.
Важно отметить, что `susli.fragment` оперирует `DocumentFragment`, который может состоять из большого количества подряд идущих нод, поэтому ссылка на фрагмент указывает на неживой `NodeList` фрагмента.

Дабы иметь возможность писать на `html` в `js` файлах, как это сделано к примеру, в `ReactJs` доступен [плагин](https://github.com/SancheZz/gulp-susli) для `gulp`.

## Обзор
минималистичная библиотека для отрисовки пользовательского интерфейса на клиенте посредством шаблонов на `js`. Не имеет зависимостей от других библиотек, благодаря чему легко встраивается в имеющуюся инфрастуктуру. Оперирует только нативными HTML элементами, благодаря чему имеет хорошую производительность. И все это менее, чем в 100 строчках кода.

## API

#### DocumentFragment fragment = `susli(required susliElement0, ..., susliElementn, optional func)`
* `susliElement0, ..., susliElementn` [required] - объекты, созданные при помощи `susli.element` и `susli.fragment`
* `func` [optional] - функция, получающая первым аргументом объект всех ссылок на ноды `HTMLElement`

#### Object obj = `susli.element(required string nodeName, optional object attributes, optional array chilren, optional string reference)`
Создает объект `{element: node, references: object}`, пригодный для пробрасывания как аргумент функции `susli`, содержит в себе HTMLElement и объект `references`, в который записываются ссылки на каждый из элементов: как самого элемента, так и его детей.
* `nodeName` [required] - имя ноды, например: `div`, `span` и т.д.
* `attributes` [optional] - объект аттрибутов, например: {'class': 'cssclass', 'name': 'add'} и т.д.
* `children` [optional] - массив дочерних элементов, например:
```js
[
  susli.element('div', {'class': 'header'}),
  susli.element('div', {'class': 'body'})
]
```
* `reference` [optional] - строка, которая может быть использована как ссылка на элемент при вызове функции `susli`.

#### Object obj = `susli.text(required string text)`
Создает объект `{element: textNode}` для пробрасывания в функцию `susli`, где:
* `textNode` - текст, обернутый в текстовую ноду

#### Object obj = `susli.fragment(required DocumentFragment fragment, optional string references)`
Создает объект `{element: documentFragment, references: object}`, пригодный для пробрасывания в функцию `susli`, где:
* `fragment` [required] - `DocumentFragment`
* `reference` [optional] - название ссылки, которая может быть использована при вызове функции `susli`.


text:
package com.compositesw.services.system.admin.archive;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import com.compositesw.services.system.admin.resource.PathTypePair;

/**
 *
Java class for exportResource complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="exportResource">
 *   <complexContent>
 *     <extension base="{http://www.compositesw.com/services/system/admin/resource}pathTypePair">
 *       <sequence>
 *         <element name="includeChildren" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "exportResource", propOrder = {
    "includeChildren"
})
public class ExportResource
    extends PathTypePair
{

    protected Boolean includeChildren;

    /**
     * Gets the value of the includeChildren property.
     *
     * @return
     *     possible object is
     *     {@link Boolean }
     *
     */
    public Boolean isIncludeChildren() {
        return includeChildren;
    }

    /**
     * Sets the value of the includeChildren property.
     *
     * @param value
     *     allowed object is
     *     {@link Boolean }
     *
     */
    public void setIncludeChildren(Boolean value) {
        this.includeChildren = value;
    }

}


text:
from office365.runtime.client_value import ClientValue

class SPSiteCreationResponse(ClientValue):

    def __init__(self):
        super(SPSiteCreationResponse, self).__init__()
        self.SiteId = None
        self.SiteStatus = None
        self.SiteUrl = None


text:
'use strict'

angular.module('coordinatorentoolControllers').controller("CreateOpdrachtController",['$uibModalInstance', "updateMode", "opdracht",
function($uibModalInstance, updateMode, opdracht){

    if ((opdracht != null || opdracht != undefined) && updateMode == true) {
        this.opdracht = opdracht;
    } else {
        this.opdracht = {
            locatie: undefined,
            tarief: undefined,
            accountManager: undefined,
            strartDatum: undefined,
            klant: undefined,
            deadline: undefined,
            info: undefined
        };
    }

    this.updateMode = updateMode;

    this.cancel=() => {
        $uibModalInstance.dismiss();
    };

    this.ok=() => {
        $uibModalInstance.close(this.opdracht)
    };
}]);


text:
package com.bxf.hradmin.common.exception;

/**
 * ModuleInfo
 *
 * @since 2017-03-17
 * @author Bo-Xuan Fan
 */
public enum ModuleInfo {

    TestGenMgr("試卷管理模組"),
    HeadCountMgr("員額管理模組"),
    Others("Others");

    /** enum value */
    private String value;

    ModuleInfo(final String value) {
        this.value = value;
    }

    /**
     * enum value as string
     * @return value value
     */
    @Override
    public String toString() {
        return value;
    }
}


text:
package org.kanyec.ast

abstract class StatementNode extends AstNode


text:
#ifndef ViewportDescription_h
#define ViewportDescription_h

#include "core/CoreExport.h"
#include "core/frame/PageScaleConstraints.h"
#include "platform/Length.h"
#include "platform/geometry/FloatSize.h"
#include "wtf/Allocator.h"

namespace blink {

class LocalFrame;

struct CORE_EXPORT ViewportDescription {
    DISALLOW_NEW();

    enum Type {
        // These are ordered in increasing importance.
        UserAgentStyleSheet,
        HandheldFriendlyMeta,
        MobileOptimizedMeta,
        ViewportMeta,
        AuthorStyleSheet
    } type;

    enum {
        ValueAuto = -1,
        ValueDeviceWidth = -2,
        ValueDeviceHeight = -3,
        ValuePortrait = -4,
        ValueLandscape = -5,
        ValueDeviceDPI = -6,
        ValueLowDPI = -7,
        ValueMediumDPI = -8,
        ValueHighDPI = -9,
        ValueExtendToZoom = -10
    };

    ViewportDescription(Type type = UserAgentStyleSheet)
        : type(type)
        , zoom(ValueAuto)
        , minZoom(ValueAuto)
        , maxZoom(ValueAuto)
        , userZoom(true)
        , orientation(ValueAuto)
        , deprecatedTargetDensityDPI(ValueAuto)
        , zoomIsExplicit(false)
        , minZoomIsExplicit(false)
        , maxZoomIsExplicit(false)
        , userZoomIsExplicit(false)
    {
    }

    // All arguments are in CSS units.
    PageScaleConstraints resolve(const FloatSize& initialViewportSize, Length legacyFallbackWidth) const;

    Length minWidth;
    Length maxWidth;
    Length minHeight;
    Length maxHeight;
    float zoom;
    float minZoom;
    float maxZoom;
    bool userZoom;
    float orientation;
    float deprecatedTargetDensityDPI; // Only used for Android WebView

    // Whether the computed value was explicitly specified rather than being
    // inferred.
    bool zoomIsExplicit;
    bool minZoomIsExplicit;
    bool maxZoomIsExplicit;
    bool userZoomIsExplicit;

    bool operator==(const ViewportDescription& other) const
    {
        // Used for figuring out whether to reset the viewport or not,
        // thus we are not taking type into account.
        return minWidth == other.minWidth
            && maxWidth == other.maxWidth
            && minHeight == other.minHeight
            && maxHeight == other.maxHeight
            && zoom == other.zoom
            && minZoom == other.minZoom
            && maxZoom == other.maxZoom
            && userZoom == other.userZoom
            && orientation == other.orientation
            && deprecatedTargetDensityDPI == other.deprecatedTargetDensityDPI
            && zoomIsExplicit == other.zoomIsExplicit
            && minZoomIsExplicit == other.minZoomIsExplicit
            && maxZoomIsExplicit == other.maxZoomIsExplicit
            && userZoomIsExplicit == other.userZoomIsExplicit;
    }

    bool operator!=(const ViewportDescription& other) const
    {
        return !(*this == other);
    }

    bool isLegacyViewportType() const { return type >= HandheldFriendlyMeta && type <= ViewportMeta; }
    bool isMetaViewportType() const { return type == ViewportMeta; }
    bool isSpecifiedByAuthor() const { return type != UserAgentStyleSheet; }
    bool matchesHeuristicsForGpuRasterization() const;

    // Reports UMA stat on whether the page is considered mobile or desktop and what kind of
    // mobile it is. Applies only to Android, must only be called once per page load.
    void reportMobilePageStats(const LocalFrame*) const;

private:
    enum Direction { Horizontal, Vertical };
    static float resolveViewportLength(const Length&, const FloatSize& initialViewportSize, Direction);
};

} // namespace blink

#endif // ViewportDescription_h


text:
namespace research_scann {

class VariableLengthDocidCollection final : public DocidCollectionInterface {
 public:
  VariableLengthDocidCollection() {}
  ~VariableLengthDocidCollection() final {}

  VariableLengthDocidCollection(const VariableLengthDocidCollection& rhs);
  VariableLengthDocidCollection& operator=(
      const VariableLengthDocidCollection& rhs);

  static VariableLengthDocidCollection CreateWithEmptyDocids(
      DatapointIndex n_elements) {
    VariableLengthDocidCollection result;
    result.size_ = n_elements;
    return result;
  }

  VariableLengthDocidCollection(VariableLengthDocidCollection&& rhs) = default;
  VariableLengthDocidCollection& operator=(
      VariableLengthDocidCollection&& rhs) = default;

  Status Append(string_view docid) final;
  size_t size() const final { return size_; }
  bool empty() const final { return size_ == 0; }
  void ShrinkToFit() final;
  void Clear() final;

  unique_ptr<DocidCollectionInterface> Copy() const final {
    return unique_ptr<DocidCollectionInterface>(
        new VariableLengthDocidCollection(*this));
  }

  bool all_empty() const { return !impl_ && size_ > 0; }

  string_view Get(size_t i) const final {
    DCHECK_LT(i, size_);
    return (all_empty()) ? "" : impl_->Get(i);
  }

  size_t capacity() const final { return impl_ ? impl_->capacity() : 0; }

  size_t MemoryUsage() const final {
    return sizeof(this) + (impl_ ? (impl_->MemoryUsage()) : 0);
  }

  void Reserve(DatapointIndex n_elements) final;

  class Mutator : public DocidCollectionInterface::Mutator {
   public:
    static StatusOr<unique_ptr<Mutator>> Create(
        VariableLengthDocidCollection* docids);
    Mutator(const Mutator&) = delete;
    Mutator& operator=(const Mutator&) = delete;

    ~Mutator() final {}
    Status AddDatapoint(string_view docid) final;
    bool LookupDatapointIndex(string_view docid,
                              DatapointIndex* index) const final;
    Status RemoveDatapoint(string_view docid) final;
    Status RemoveDatapoint(DatapointIndex index) final;
    void Reserve(size_t size) final;

   private:
    explicit Mutator(VariableLengthDocidCollection* docids) : docids_(docids) {}
    VariableLengthDocidCollection* docids_ = nullptr;
    absl::flat_hash_map<string_view, DatapointIndex, absl::Hash<string_view>>
        docid_lookup_;
  };

  StatusOr<DocidCollectionInterface::Mutator*> GetMutator() const final;

 private:
  Status AppendImpl(string_view docid);

  void InstantiateImpl();

  DatapointIndex size_ = 0;

  DatapointIndex expected_docid_size_ = 0;

  unique_ptr<DocidCollectionInterface> impl_ = nullptr;
  mutable unique_ptr<VariableLengthDocidCollection::Mutator> mutator_ = nullptr;
};

class FixedLengthDocidCollection final : public DocidCollectionInterface {
 public:
  FixedLengthDocidCollection(const FixedLengthDocidCollection& rhs);
  FixedLengthDocidCollection& operator=(const FixedLengthDocidCollection& rhs);

  FixedLengthDocidCollection(FixedLengthDocidCollection&& rhs) = default;
  FixedLengthDocidCollection& operator=(FixedLengthDocidCollection&& rhs) =
      default;

  explicit FixedLengthDocidCollection(size_t length) : docid_length_(length) {}
  ~FixedLengthDocidCollection() final {}

  static StatusOr<FixedLengthDocidCollection> Iota(uint32_t length) {
    FixedLengthDocidCollection docids(sizeof(uint32_t));
    docids.Reserve(length);
    for (uint32_t i = 0; i < length; ++i) {
      std::string encoded;
      strings::KeyFromUint32(i, &encoded);
      SCANN_RETURN_IF_ERROR(docids.Append(encoded));
    }
    return docids;
  }

  Status Append(string_view docid) final;

  size_t size() const final { return size_; }
  bool empty() const final { return size_ == 0; }
  void ShrinkToFit() final { arr_.shrink_to_fit(); }

  unique_ptr<DocidCollectionInterface> Copy() const final {
    return unique_ptr<DocidCollectionInterface>(
        new FixedLengthDocidCollection(*this));
  }

  void Clear() final {
    size_ = 0;
    arr_.clear();
    mutator_ = nullptr;
  }

  string_view Get(size_t i) const final {
    DCHECK_LT(i, size_);
    return string_view(&arr_[i * docid_length_], docid_length_);
  }

  size_t capacity() const final { return arr_.capacity() / docid_length_; }

  size_t MemoryUsage() const final { return arr_.capacity() + sizeof(*this); }

  void Reserve(DatapointIndex n_elements) final;

  class Mutator : public DocidCollectionInterface::Mutator {
   public:
    static StatusOr<unique_ptr<Mutator>> Create(
        FixedLengthDocidCollection* docids);
    Mutator(const Mutator&) = delete;
    Mutator& operator=(const Mutator&) = delete;

    ~Mutator() final {}
    Status AddDatapoint(string_view docid) final;
    bool LookupDatapointIndex(string_view docid,
                              DatapointIndex* index) const final;
    Status RemoveDatapoint(string_view docid) final;
    Status RemoveDatapoint(DatapointIndex index) final;
    void Reserve(size_t size) final;

   private:
    static constexpr int kGrowthFactor = 2;
    explicit Mutator(FixedLengthDocidCollection* docids) : docids_(docids) {}

    FixedLengthDocidCollection* docids_ = nullptr;
    absl::flat_hash_map<string_view, DatapointIndex, absl::Hash<string_view>>
        docid_lookup_;
  };

  StatusOr<DocidCollectionInterface::Mutator*> GetMutator() const final;

 private:
  Status AppendImpl(string_view docid);
  void ReserveImpl(DatapointIndex n_elements);

  std::vector<char> arr_ = {};

  size_t docid_length_;

  size_t size_ = 0;

  mutable unique_ptr<FixedLengthDocidCollection::Mutator> mutator_ = nullptr;
};

}  // namespace research_scann

#endif


text:
title: MEU Lisbon 2018
slug: meu-lisbon-2018
partner-slug: beta-portugal
conference: meu-lisbon
year: 2018
begin: 2018-09-09
end: 2018-09-14
mail: betaportugal.official@gmail.com
website: 'https://www.facebook.com/MEULisbon/'
country: Portugal
town: Lisbon
location: Portuguese Parliament - Assembleia da República
participants: '150'
geo: '38.7253,-9.15'
excerpt: 'Copyright Reform, European Labour Authority'
header:
  image: ''
---
.


text:
- infos = Information about the yambi plugin is in keys below
- infos/author = René Schwaiger <sanssecours@me.com>
- infos/licence = BSD
- infos/needs = directoryvalue yamlsmith
- infos/provides = storage/yaml
- infos/recommends =
- infos/placements = getstorage
- infos/status = maintained unittest preview experimental unfinished nodoc concept discouraged
- infos/metadata =
- infos/description = This storage plugin use a parser generated by Bison to read YAML files

# YAMBi

## Introduction

This plugin uses [Bison](https://www.gnu.org/software/bison) to generate a parser for the [YAML](http://yaml.org) serialization format.

## Dependencies

The plugin requires [Bison](https://repology.org/metapackage/bison/versions) (version 3.0 or later).

## Examples

### Mappings

```sh
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

kdb set user/tests/yambi 'Mount Point'
kdb get user/tests/yambi
#> Mount Point

kdb set user/tests/yambi/bambi 'Mule Deer'
kdb get user/tests/yambi/bambi
#> Mule Deer

kdb set user/tests/yambi/thumper 'Rabbit'
kdb get user/tests/yambi/thumper
#> Rabbit

kdb set user/tests/yambi/bambi/baby 'Bobby Stewart'
kdb set user/tests/yambi/bambi/young 'Donnie Dunagan'
kdb set user/tests/yambi/bambi/adolescent 'Hardie Albright'
kdb set user/tests/yambi/bambi/adult 'John Sutherland'

kdb get user/tests/yambi/bambi/baby
#> Bobby Stewart

kdb ls user/tests/yambi
#> user/tests/yambi
#> user/tests/yambi/bambi
#> user/tests/yambi/bambi/adolescent
#> user/tests/yambi/bambi/adult
#> user/tests/yambi/bambi/baby
#> user/tests/yambi/bambi/young
#> user/tests/yambi/thumper

# Undo modifications
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
```

### Arrays

```sh
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

kdb set user/tests/yambi/friends
kdb set user/tests/yambi/friends/#0 Thumper
kdb set user/tests/yambi/friends/#1 Flower

# Retrieve last array index
kdb meta-get user/tests/yambi/friends array
#> #1

kdb get user/tests/yambi/friends/#0
#> Thumper
kdb get user/tests/yambi/friends/#1
#> Flower

# Undo modifications
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
```

### Boolean Values

```sh
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

# Manually add a boolean value to the database
printf 'boolean: false' > `kdb file user/tests/yambi`

# Elektra stores boolean values as `0` and `1`
kdb get user/tests/yambi/boolean
#> 0

# Undo modifications to the key database
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
```

### Error Messages

```sh
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

# Manually add data containing syntax errors
printf -- 'Thumper: - Eating greens is a special treat.\n'      >  `kdb file user/tests/yambi`
printf -- '         - It makes long ears and great big feet.\n' >> `kdb file user/tests/yambi`
printf -- '- But it sure is awful stuff to eat.\n'              >> `kdb file user/tests/yambi`
printf -- '         - I made that last part up myself\n.'       >> `kdb file user/tests/yambi`
printf -- 'Stephen King:\n'                                     >> `kdb file user/tests/yambi`
printf -- ' The first movie I ever saw was a horror movie.\n'   >> `kdb file user/tests/yambi`
printf -- ' - It was Bambi.\n'                                  >> `kdb file user/tests/yambi`

# Try to retrieve data
kdb get user/tests/yambi/Thumper/#2
# RET: 5
# STDERR: .*config.yaml:3:1: syntax error, unexpected element, expecting end of map or key.*

# Let us look at the error message more closely.
# Since the location of `config.yaml` depends on the current user and OS,
# we store the text before `config.yaml` as `user/tests/error/prefix`.
kdb set user/tests/error "$(2>&1 kdb ls user/tests/yambi)"
kdb set user/tests/error/prefix "$(kdb get user/tests/error | grep 'config.yaml' | head -1 | sed -E 's/(.*)config.yaml.*/\1/')"
kdb get user/tests/error/prefix
# We also store the length of the prefix, so we can remove it from every
# line of the error message.
kdb set user/tests/error/prefix/length "$(kdb get user/tests/error/prefix | wc -c | sed 's/[ ]*//g')"

# Since we only want to look at the "reason" of the error, we
# remove the other part of the error message with `head` and `tail`.
kdb get user/tests/error | tail -n6 | cut -c"$(kdb get user/tests/error/prefix/length | tr -d '\n')"-
#> config.yaml:3:1: syntax error, unexpected element, expecting end of map or key
#>                  - But it sure is awful stuff to eat.
#>                  ^
#> config.yaml:7:2: syntax error, unexpected start of sequence, expecting end of map or key
#>                   - It was Bambi.
#>                   ^

# Fix syntax errors
printf -- 'Thumper: - Eating greens is a special treat.\n'      >  `kdb file user/tests/yambi`
printf -- '         - It makes long ears and great big feet.\n' >> `kdb file user/tests/yambi`
printf -- '         - But it sure is awful stuff to eat.\n'     >> `kdb file user/tests/yambi`
printf -- '         - I made that last part up myself\n.'       >> `kdb file user/tests/yambi`
printf -- 'Stephen King:\n'                                     >> `kdb file user/tests/yambi`
printf -- ' - The first movie I ever saw was a horror movie.\n' >> `kdb file user/tests/yambi`
printf -- ' - It was Bambi.\n'                                  >> `kdb file user/tests/yambi`

# Retrieve data
kdb get user/tests/yambi/Thumper/#2
#> But it sure is awful stuff to eat.

# Undo modifications
kdb rm -r user/tests/error
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
```

## Limitations

The plugin supports the same limited YAML syntax as [Yan LR](../yanlr/).

- The plugin always assumes **UTF-8** encoded data.


text:
class CreateBubblesMessages < ActiveRecord::Migration
  def change
    create_table :bubbles_messages do |t|
      t.belongs_to :conversation
      t.integer :sender_id
      t.text :body

      t.timestamps
    end
  end
end


text:
<?php

namespace Icap\PadBundle\Entity;

use Claroline\CoreBundle\Entity\Resource\AbstractResource;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="icap_pad_aggregate")
 */
class PadAggregate extends AbstractResource
{
    /**
     * @ORM\OneToMany(
     *     targetEntity="Icap\PadBundle\Entity\Pad",
     *     mappedBy="aggregate"
     * )
     */
    protected $pads;

    public function getPads()
    {
        return $this->pads;
    }
}


text:
using gaxgrpc = Google.Api.Gax.Grpc;
using lro = Google.LongRunning;
using grpccore = Grpc.Core;
using moq = Moq;
using st = System.Threading;
using stt = System.Threading.Tasks;
using xunit = Xunit;

namespace Google.Cloud.Compute.V1.Tests
{
    /// <summary>Generated unit tests.</summary>
    public sealed class GeneratedVpnTunnelsClientTest
    {
        [xunit::FactAttribute]
        public void GetRequestObject()
        {
            moq::Mock<VpnTunnels.VpnTunnelsClient> mockGrpcClient = new moq::Mock<VpnTunnels.VpnTunnelsClient>(moq::MockBehavior.Strict);
            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
            GetVpnTunnelRequest request = new GetVpnTunnelRequest
            {
                Region = "regionedb20d96",
                VpnTunnel = "vpn_tunnelfa4123fd",
                Project = "projectaa6ff846",
            };
            VpnTunnel expectedResponse = new VpnTunnel
            {
                Id = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                VpnGatewayInterface = 1166485993,
                Region = "regionedb20d96",
                Router = "routerd55c39f3",
                Status = "status5444cb9a",
                IkeVersion = 485306612,
                PeerGcpGateway = "peer_gcp_gateway613039db",
                LocalTrafficSelector =
                {
                    "local_traffic_selector09bfbb68",
                },
                DetailedStatus = "detailed_status4e3163c7",
                RemoteTrafficSelector =
                {
                    "remote_traffic_selector8463a07f",
                },
                SharedSecret = "shared_secret3a48b317",
                PeerIp = "peer_ip5b148b8e",
                PeerExternalGateway = "peer_external_gatewaye60baaef",
                SharedSecretHash = "shared_secret_hash3ba18c3b",
                VpnGateway = "vpn_gatewayaa15de14",
                Description = "description2cf9da67",
                PeerExternalGatewayInterface = -994715857,
                SelfLink = "self_link7e87f12d",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
            VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null, null);
            VpnTunnel response = client.Get(request);
            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }

        [xunit::FactAttribute]
        public async stt::Task GetRequestObjectAsync()
        {
            moq::Mock<VpnTunnels.VpnTunnelsClient> mockGrpcClient = new moq::Mock<VpnTunnels.VpnTunnelsClient>(moq::MockBehavior.Strict);
            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
            GetVpnTunnelRequest request = new GetVpnTunnelRequest
            {
                Region = "regionedb20d96",
                VpnTunnel = "vpn_tunnelfa4123fd",
                Project = "projectaa6ff846",
            };
            VpnTunnel expectedResponse = new VpnTunnel
            {
                Id = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                VpnGatewayInterface = 1166485993,
                Region = "regionedb20d96",
                Router = "routerd55c39f3",
                Status = "status5444cb9a",
                IkeVersion = 485306612,
                PeerGcpGateway = "peer_gcp_gateway613039db",
                LocalTrafficSelector =
                {
                    "local_traffic_selector09bfbb68",
                },
                DetailedStatus = "detailed_status4e3163c7",
                RemoteTrafficSelector =
                {
                    "remote_traffic_selector8463a07f",
                },
                SharedSecret = "shared_secret3a48b317",
                PeerIp = "peer_ip5b148b8e",
                PeerExternalGateway = "peer_external_gatewaye60baaef",
                SharedSecretHash = "shared_secret_hash3ba18c3b",
                VpnGateway = "vpn_gatewayaa15de14",
                Description = "description2cf9da67",
                PeerExternalGatewayInterface = -994715857,
                SelfLink = "self_link7e87f12d",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<VpnTunnel>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null, null);
            VpnTunnel responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
            xunit::Assert.Same(expectedResponse, responseCallSettings);
            VpnTunnel responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None);
            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }

        [xunit::FactAttribute]
        public void Get()
        {
            moq::Mock<VpnTunnels.VpnTunnelsClient> mockGrpcClient = new moq::Mock<VpnTunnels.VpnTunnelsClient>(moq::MockBehavior.Strict);
            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
            GetVpnTunnelRequest request = new GetVpnTunnelRequest
            {
                Region = "regionedb20d96",
                VpnTunnel = "vpn_tunnelfa4123fd",
                Project = "projectaa6ff846",
            };
            VpnTunnel expectedResponse = new VpnTunnel
            {
                Id = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                VpnGatewayInterface = 1166485993,
                Region = "regionedb20d96",
                Router = "routerd55c39f3",
                Status = "status5444cb9a",
                IkeVersion = 485306612,
                PeerGcpGateway = "peer_gcp_gateway613039db",
                LocalTrafficSelector =
                {
                    "local_traffic_selector09bfbb68",
                },
                DetailedStatus = "detailed_status4e3163c7",
                RemoteTrafficSelector =
                {
                    "remote_traffic_selector8463a07f",
                },
                SharedSecret = "shared_secret3a48b317",
                PeerIp = "peer_ip5b148b8e",
                PeerExternalGateway = "peer_external_gatewaye60baaef",
                SharedSecretHash = "shared_secret_hash3ba18c3b",
                VpnGateway = "vpn_gatewayaa15de14",
                Description = "description2cf9da67",
                PeerExternalGatewayInterface = -994715857,
                SelfLink = "self_link7e87f12d",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
            VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null, null);
            VpnTunnel response = client.Get(request.Project, request.Region, request.VpnTunnel);
            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }

        [xunit::FactAttribute]
        public async stt::Task GetAsync()
        {
            moq::Mock<VpnTunnels.VpnTunnelsClient> mockGrpcClient = new moq::Mock<VpnTunnels.VpnTunnelsClient>(moq::MockBehavior.Strict);
            mockGrpcClient.Setup(x => x.CreateOperationsClientForRegionOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
            GetVpnTunnelRequest request = new GetVpnTunnelRequest
            {
                Region = "regionedb20d96",
                VpnTunnel = "vpn_tunnelfa4123fd",
                Project = "projectaa6ff846",
            };
            VpnTunnel expectedResponse = new VpnTunnel
            {
                Id = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp = "creation_timestamp235e59a1",
                VpnGatewayInterface = 1166485993,
                Region = "regionedb20d96",
                Router = "routerd55c39f3",
                Status = "status5444cb9a",
                IkeVersion = 485306612,
                PeerGcpGateway = "peer_gcp_gateway613039db",
                LocalTrafficSelector =
                {
                    "local_traffic_selector09bfbb68",
                },
                DetailedStatus = "detailed_status4e3163c7",
                RemoteTrafficSelector =
                {
                    "remote_traffic_selector8463a07f",
                },
                SharedSecret = "shared_secret3a48b317",
                PeerIp = "peer_ip5b148b8e",
                PeerExternalGateway = "peer_external_gatewaye60baaef",
                SharedSecretHash = "shared_secret_hash3ba18c3b",
                VpnGateway = "vpn_gatewayaa15de14",
                Description = "description2cf9da67",
                PeerExternalGatewayInterface = -994715857,
                SelfLink = "self_link7e87f12d",
                TargetVpnGateway = "target_vpn_gateway6c481371",
            };
            mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<VpnTunnel>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            VpnTunnelsClient client = new VpnTunnelsClientImpl(mockGrpcClient.Object, null, null);
            VpnTunnel responseCallSettings = await client.GetAsync(request.Project, request.Region, request.VpnTunnel, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
            xunit::Assert.Same(expectedResponse, responseCallSettings);
            VpnTunnel responseCancellationToken = await client.GetAsync(request.Project, request.Region, request.VpnTunnel, st::CancellationToken.None);
            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
    }
}


text:
/*
 * Module Name: vdcupgrade
 *
 * Filename: parseargs.c
 *
 * Abstract:
 *
 * vdcupgrade argument parsing functions
 *
 */

#include "includes.h"

DWORD
VmDirParseArgs(
    int     argc,
    char*   argv[],
    PSTR*   ppszServerName,
    PSTR*   ppszAdminUPN,
    PSTR*   ppszPassword,
    PSTR*   ppszPasswordFile,
    PBOOLEAN pbAclOnly
    )
{
    DWORD   dwError = ERROR_SUCCESS;
#ifndef _WIN32
    int     opt = 0;
#else
    int i = 1;
    PSTR optarg = NULL;
#endif
    PSTR    pszServerName = NULL;
    PSTR    pszAdminUPN = NULL;
    PSTR    pszPassword = NULL;
    PSTR    pszPasswordFile = NULL;
    PSTR    pszServerNameAlloc = NULL;
    PSTR    pszAdminUPNAlloc = NULL;
    PSTR    pszPasswordAlloc = NULL;
    PSTR    pszPasswordFileAlloc = NULL;
    BOOLEAN bAclOnly = FALSE;

    if (ppszServerName == NULL ||
        ppszAdminUPN == NULL  ||
        ppszPassword == NULL ||
        ppszPasswordFile == NULL ||
        pbAclOnly == NULL )
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMDIR_ERROR(dwError);
    }

#ifndef _WIN32
    while ( (opt = getopt( argc, argv, VMDIR_OPTIONS_VALID)) != EOF )
    {
        switch ( opt )
        {
            case VMDIR_OPTION_SERVER_NAME:
                pszServerName = optarg;
                break;

            case VMDIR_OPTION_ADMIN_UPN:
                pszAdminUPN = optarg;
                break;

            case VMDIR_OPTION_PASSWORD:
                pszPassword = optarg;
                break;

            case VMDIR_OPTION_PASSWORD_FILE:
                pszPasswordFile = optarg;
                break;
            case VMDIR_OPTION_ACLONLY:
                bAclOnly = TRUE;
                break;
            default:
                dwError = ERROR_INVALID_PARAMETER;
                BAIL_ON_VMDIR_ERROR(dwError);
                break;
        }
    }
#else
    while (i < argc)
    {
        if (VmDirIsCmdLineOption(argv[i]) != FALSE)
        {
            if (VmDirStringCompareA(VMDIR_OPTION_SERVER_NAME, argv[i], TRUE) == 0)
            {
                VmDirGetCmdLineOption(argc, argv, &i, &pszServerName);
            }
            else if (VmDirStringCompareA(VMDIR_OPTION_ADMIN_UPN, argv[i], TRUE) == 0)
            {
                VmDirGetCmdLineOption(argc, argv, &i, &pszAdminUPN);
            }
            else if (VmDirStringCompareA(VMDIR_OPTION_PASSWORD, argv[i], TRUE) == 0)
            {
                VmDirGetCmdLineOption(argc, argv, &i, &pszPassword);
            }
            else if (VmDirStringCompareA(VMDIR_OPTION_PASSWORD_FILE, argv[i], TRUE) == 0)
            {
                VmDirGetCmdLineOption(argc, argv, &i, &pszPasswordFile);
            }
            else if (VmDirStringCompareA(VMDIR_OPTION_ACLONLY, argv[i], TRUE) == 0)
            {
                bAclOnly = TRUE;
            }
        }
        i++;
    }
#endif

    dwError = VmDirAllocateStringA(pszServerName, &pszServerNameAlloc);
    BAIL_ON_VMDIR_ERROR(dwError);

    dwError = VmDirAllocateStringA(pszAdminUPN, &pszAdminUPNAlloc);
    BAIL_ON_VMDIR_ERROR(dwError);

    if (pszPassword)
    {
        dwError = VmDirAllocateStringA(pszPassword, &pszPasswordAlloc);
        BAIL_ON_VMDIR_ERROR(dwError);
    } else if (pszPasswordFile)
    {
        dwError = VmDirAllocateStringA(pszPasswordFile, &pszPasswordFileAlloc);
        BAIL_ON_VMDIR_ERROR(dwError);
    }

    *ppszServerName = pszServerNameAlloc;
    *ppszAdminUPN = pszAdminUPNAlloc;
    *ppszPassword = pszPasswordAlloc;
    *ppszPasswordFile = pszPasswordFileAlloc;
    *pbAclOnly = bAclOnly;

cleanup:
    return dwError;

error:
    VMDIR_SAFE_FREE_STRINGA(pszServerNameAlloc);
    VMDIR_SAFE_FREE_STRINGA(pszAdminUPNAlloc);
    VMDIR_SAFE_FREE_STRINGA(pszPasswordAlloc);
    VMDIR_SAFE_FREE_STRINGA(pszPasswordFileAlloc);
    goto cleanup;
}

VOID
ShowUsage(
    VOID
    )
{
    printf(
      "Usage: vdcupgrade -H <host> -D <AdminUPN> [-W <password>|-x <password-file>] -a\n"
      "Note: -a for ACL upgrade only.\n");
}


text:
import optparse
import os
import os.path
import subprocess
import sys
import tarfile
import urllib2

XERCES_SOURCE_URL = "http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.gz"
XERCES_SOURCE_DIR = "xerces-c-3.1.2"

def num_cpus():
    # Use multiprocessing module, available in Python 2.6+
    try:
        import multiprocessing
        return multiprocessing.cpu_count()
    except (ImportError, NotImplementedError):
        pass

    # Get POSIX system config value for number of processors.
    posix_num_cpus = os.sysconf("SC_NPROCESSORS_ONLN")
    if posix_num_cpus != -1:
        return posix_num_cpus

    # Guess
    return 2

def get_xerces_source():
    remote_src = urllib2.urlopen(XERCES_SOURCE_URL)
    local_src = open("xerces_src.tar.gz", "w")
    local_src.write(remote_src.read())
    local_src.close()
    tarball = tarfile.open("xerces_src.tar.gz", "r:gz")
    for item in tarball:
        tarball.extract(item, ".")
    tarball.close()
    patchfile = open("xerces_patch/patches/xerces-c-gpdb.patch", "r")
    return subprocess.call(
        ["patch", "-p1"],
        stdin = patchfile,
        cwd = XERCES_SOURCE_DIR)

def configure(cxx_compiler, cxxflags, cflags, output_dir):
    os.mkdir("build")
    environment = os.environ.copy()
    if cxx_compiler:
        environment["CXX"] = cxx_compiler
    if cxxflags:
        environment["CXXFLAGS"] = cxxflags
    if cflags:
        environment["CFLAGS"] = cflags
    return subprocess.call(
        [os.path.abspath(XERCES_SOURCE_DIR + "/configure"), "--prefix=" + os.path.abspath(output_dir)],
        env = environment,
        cwd = "build")

def make():
    return subprocess.call(["make", "-j" + str(num_cpus())], cwd="build")

def install():
    return subprocess.call(["make", "install"], cwd="build")

def main():
    parser = optparse.OptionParser()
    parser.add_option("--compiler", dest="compiler")
    parser.add_option("--cxxflags", dest="cxxflags")
    parser.add_option("--cflags", dest="cflags")
    parser.add_option("--output_dir", dest="output_dir", default="install")
    (options, args) = parser.parse_args()
    if len(args) > 0:
        print "Unknown arguments"
        return 1
    status = get_xerces_source()
    if status:
        return status
    status = configure(options.compiler, options.cxxflags, options.cflags, options.output_dir)
    if status:
        return status
    status = make()
    if status:
        return status
    status = install()
    if status:
        return status
    return 0

if __name__ == "__main__":
    sys.exit(main())


text:
// .NAME vtkCalcCentroid - compute centre of gravity of vtkImageData
// .SECTION Description
// vtkCalcCentroid computes the centre of gravity of vtkImageData.

#ifndef __vtkCalcCentroid_h
#define __vtkCalcCentroid_h

#include "vtkSystemIncludes.h"
#ifndef vtkFloatingPointType
#define vtkFloatingPointType vtkFloatingPointType
typedef float vtkFloatingPointType;
#endif

#include "vtkObject.h"
#include "vtkImageData.h"

class VTK_EXPORT vtkCalcCentroid : public vtkObject
{
public:
  vtkTypeMacro(vtkCalcCentroid, vtkObject);
  static vtkCalcCentroid *New();

  void PrintSelf(ostream& os, vtkIndent indent);

  vtkSetObjectMacro(Input, vtkImageData);
  vtkGetObjectMacro(Input, vtkImageData);

  double *GetCentroid();
  double *GetCovarianceMatrix();

protected:
  vtkCalcCentroid();
  ~vtkCalcCentroid();

  void ComputeCentroid();
  void ComputeCovarianceMatrix();

  double Centroid[3];
  double CovarianceMatrix[9];
  vtkImageData *Input;

private:
  vtkCalcCentroid(const vtkCalcCentroid&); // Not implemented.
  void operator=(const vtkCalcCentroid&); // Not implemented.
};

#endif


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');
include_once 'application/data/chunks/heading.php';
?>

  <?php echo $query;   ?>

<?php include_once 'application/data/chunks/footing.php'; ?>


text:
@interface ZRView : UIView
-(instancetype)initWithName:(NSString *)name;
@end


text:
<?php
namespace Kitpages\CmsBundle\Event;

use Symfony\Component\EventDispatcher\Event;

abstract class AbstractEvent extends Event
{
    protected $data = array();
    protected $isDefaultPrevented = false;

    public function preventDefault()
    {
        $this->isDefaultPrevented = true;
    }

    public function isDefaultPrevented()
    {
        return $this->isDefaultPrevented;
    }

    public function set($key, $val)
    {
        $this->data[$key] = $val;
    }

    public function get($key)
    {
        if (!array_key_exists($key, $this->data)) {
            return null;
        }
        return $this->data[$key];
    }

}


text:
> **New 2017-Oct-16**: master is now webtreemap v2, a complete rewrite with
> bug fixes, more features, and a different (simpler) API. If you're looking
> for the old webtreemap, see the [v1] branch.

[v1]: https://github.com/evmar/webtreemap/tree/v1

A simple treemap implementation using web technologies (DOM nodes, CSS styling
and transitions) rather than a big canvas/svg/plugin. It's usable as a library
as part of a larger web app, but it also includes a command-line app that dumps
a self-contained HTML file that displays a map.

Play with a [demo].

[demo]: http://evmar.github.io/webtreemap/

## Usage

### Web

The data format is a tree of `Node`, where each node is an object in the shape
described at the top of [tree.ts].

[tree.ts]: https://github.com/evmar/webtreemap/blob/master/src/tree.ts

```html
<script src='webtreemap.js'></script>
<script>
// Container must have its own width/height.
const container = document.getElementById('myContainer');
// See typings for full API definition.
webtreemap.render(container, data, options);
```

### Command line

Install with

```sh
$ npm i webtreemap
```

Then run with:

```sh
$ webtreemap -o output_file < my_data
```

Input data format is space-separated lines of "size path", where size
is a number and path is a '/'-delimited path. For example:

```$ cat my_data
100 all
50 all/thing1
25 all/thing2
```

This is exactly the output produced by `du`, so this works:

```sh
$ du -ab some_path | webtreemap -o out.html
```

But note that there's nothing file-system-specific about the data format -- it
just uses slash as a nesting delimiter.

## Development

The modules of webtreemap can be used both from the web and from the command
line, so the build has two layers. The command line app embeds the output
of the build into its output so it's a bit confusing.

To build everything, run `yarn run build`.

### Build layout

To hack on webtreemap, the pieces of the build are:

1.  `yarn run tsc` builds all the `.ts` files;
2.  `yarn run webpack` builds the UMD web version from JS of the above.

Because command line embeds the web version in its output, you need to
run step 2 before running the output of step 1. Also note we
intentionally don't use webpack's ts-loader because we want the
TypeScript output for the command-line app.

### Command line app

Use `yarn run tsc -w` to keep the npm-compatible JS up to date, then run e.g.:

```
$ du -ab node_modules/ | node build/src/cli.js --title 'node_modules usage' -o demo.html
```

## License

webtreemap is licensed under the Apache License v2.0. See `LICENSE.txt` for the
complete license text.


text:
import vector2 from 'objects/math/Vector2';
import RenderUtils from 'objects/core/RenderUtils';
import SpaceCraftBase from 'objects/spaceCraft/SpaceCraftBase';
import Merlin1DVac from 'objects/engines/Merlin1DVac';

class Falcon9S2 extends SpaceCraftBase {

	constructor(game, position, gravitationalParent) {

		let sprite = game.add.sprite(-9999, -9999, 'falcon9S2');
		sprite.anchor.setTo(.5, .5);

		//Width: 3.706 meters Height 14.0018 meters
		super(game, position, sprite, 3.706, 14.0018, new vector2(0, 11.2), gravitationalParent, 0, 103500);

		this.aeroDynamicProperties = "ExtendsFineness";

		this.engines.push(new Merlin1DVac(this, new vector2(0, this.height * 0.3)));
	}

	formDragCoefficient() {
		let baseCD = this.getBaseCd(0.5);
		let alpha = this.getAlpha();

		return Math.abs(baseCD * Math.cos(alpha));
	}

	formLiftCoefficient() {
		let baseCD = this.getBaseCd(0.6);
		let alpha = this.getAlpha();

		return baseCD * Math.sin(alpha * 2.0);
	}

	exposedSurfaceArea() {

		return 2 * Math.PI * (this.width / 2) * this.height + this.frontalArea();
	}

	frontalArea() {
		return Math.PI * Math.pow(this.width / 2, 2);
	}

	liftingSurfaceArea() {
		return this.width * this.height;
	}

	dryMass() {
		return 4000;
	}

	name(){
		return "Falcon9S2";
	}

}

export default Falcon9S2;


text:
package mergedoc.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.LinkedList;
import java.util.List;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;

import mergedoc.MergeDocException;
import mergedoc.core.FastStringUtils;
import mergedoc.core.Preference;
import mergedoc.xml.ConfigManager;
import mergedoc.xml.Persister;
import mergedoc.xml.ReplaceEntry;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

/**
 * 設定パネルです。
 *
 * @author Shinji Kashihara
 */
public class PreferencePanel extends JPanel {

	/** ロガー */
	private static final Logger logger = LogManager.getLogger(PreferencePanel.class);

	/** 基本設定パネル:API ドキュメントディレクトリ ファイル選択フィールド */
	private FileChooserField docField = new FileChooserField();

	/** 基本設定パネル:入力ソースアーカイブファイル ファイル選択フィールド */
	private FileChooserField srcField = new FileChooserField();

	/** 基本設定パネル:出力ソースアーカイブファイル ファイル選択フィールド */
	private FileChooserField outField = new FileChooserField();

	/** 基本設定パネル:API ドキュメントのダウンロード可否 */
	private JCheckBox apiDownload = new JCheckBox();

	/** 詳細設定パネル:スプリットペイン */
	private JSplitPane splitPane = new JSplitPane();

	/** 詳細設定パネル:置換エントリのチェックリスト */
	private List<EntryCheckBox> entryCheckList = new LinkedList<EntryCheckBox>();

	/** 詳細設定パネル:プレビュー スクロールペイン */
	private PreviewScrollPane previewScrollPane;

	/**
	 * コンストラクタです。
	 *
	 * @throws MergeDocException
	 *             設定ファイルが取得できない場合
	 */
	public PreferencePanel() throws MergeDocException {

		// レイアウト設定
		setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		setMaximumSize(ComponentFactory.createMaxDimension());

		// 上下パネルをこのコンテナに追加
		add(createUpperPanel());
		add(ComponentFactory.createSpacer(0, 7));
		add(createLowerPanel());
	}

	/**
	 * 上部の基本設定パネルを作成します。
	 *
	 * @return 上部の基本設定パネル
	 * @throws MergeDocException
	 *             設定ファイルが取得できない場合
	 */
	private JComponent createUpperPanel() throws MergeDocException {

		// ラベル設定
		JLabel docLabel = docField.getLabel();
		JLabel srcLabel = srcField.getLabel();
		JLabel outLabel = outField.getLabel();
		docLabel.setText("API ドキュメントディレクトリ");
		srcLabel.setText("入力ソースアーカイブファイル");
		outLabel.setText("出力ソースアーカイブファイル");
		JLabel[] labels = { docLabel, srcLabel, outLabel };
		ComponentFactory.ensureMaxFontWidth(labels);

		// コンボ設定
		JComboBox<Object> docCombo = docField.getComboBox();
		JComboBox<Object> srcCombo = srcField.getComboBox();
		JComboBox<Object> outCombo = outField.getComboBox();
		docCombo.addItem(FileChooserField.ENCODING_AUTO);
		srcCombo.addItem(FileChooserField.ENCODING_AUTO);
		docCombo.setSelectedItem(FileChooserField.ENCODING_DEFAULT);
		srcCombo.setSelectedItem(FileChooserField.ENCODING_DEFAULT);
		outCombo.setSelectedItem(FileChooserField.ENCODING_DEFAULT);
		@SuppressWarnings("rawtypes")
		JComboBox[] combos = { docCombo, srcCombo, outCombo };
		ComponentFactory.ensureMaxFontWidth(combos);

		// ファイルチューザの設定
		docField.setSelectionMode(FileChooserField.DIRECTORIES);
		srcField.setSelectionMode(FileChooserField.ZIP_TGZ_FILES);
		outField.setSelectionMode(FileChooserField.ZIP_FILES);
		docField.setChooseListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				resolveArchivePath(docField.getFile());
			}
		});

		// チェックボックスを作成
		apiDownload = new JCheckBox("API ドキュメントの上書きダウンロードを行う");

		// 上部パネル作成
		JPanel panel = new TitledPanel("基本設定");
		panel.add(docField);
		panel.add(srcField);
		panel.add(outField);
		panel.add(apiDownload);

		// 起動オプションのターゲットディレクトリ取得
		final String OPTION_KEY = "target.directory";
		String targetStr = System.getProperty(OPTION_KEY);
		if (targetStr != null) {
			File targetDir = new File(targetStr);
			if (!targetDir.exists() || targetDir.isFile()) {
				throw new MergeDocException(
						"オプション " + OPTION_KEY + " に指定された値 " + targetStr + " は\n存在しないかディレクトリではありません。");
			}
			File docDir = searchDocDirectory(targetDir);
			if (docDir != null) {
				docField.setFile(docDir);
			}
			srcField.setFile(new File(""));
			outField.setFile(new File(""));
			resolveArchivePath(targetDir);
		}

		// 設定ファイル読み込み
		loadPersister(docField, Persister.DOC_DIR, Persister.DOC_ENC);
		loadPersister(srcField, Persister.IN_FILE, Persister.IN_ENC);
		loadPersister(outField, Persister.OUT_FILE, Persister.OUT_ENC);
		String param = Persister.getInstance().getString(Persister.API_DONWLOAD, "");
		if (param.equals("") || !param.equals("true")) {
			apiDownload.setSelected(false);
		} else {
			apiDownload.setSelected(true);
		}

		// 未設定時のデフォルト設定
		String docPath = docField.getFile().getPath();
		if (docPath.equals("")) {

			File home = new File(System.getProperty("java.home"));
			if (home.getName().equals("jre")) {
				home = home.getParentFile();
			}
			File docDir = new File(home, "docs/ja/api");
			if (docDir.exists()) {
				docField.setFile(docDir);
				resolveArchivePath(home);
			}
		}

		return panel;
	}

	/**
	 * 下部の詳細設定パネルを作成します。
	 *
	 * @return 下部の詳細設定パネル
	 * @throws MergeDocException
	 *             設定ファイルが取得できない場合
	 */
	private JComponent createLowerPanel() throws MergeDocException {

		// チェックボックス配置ペインを作成
		JPanel checkPanel = new JPanel();
		checkPanel.setLayout(new BoxLayout(checkPanel, BoxLayout.Y_AXIS));
		List<ReplaceEntry> list = ConfigManager.getInstance().getGlobalEntries();
		for (ReplaceEntry entry : list) {
			EntryCheckBox cb = new EntryCheckBox(entry);
			cb.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					previewScrollPane.updatePreview(entryCheckList);
				}
			});
			checkPanel.add(cb);
			entryCheckList.add(cb);
		}
		JScrollPane checkScrollPane = ComponentFactory.createScrollPane(checkPanel);
		checkScrollPane.getVerticalScrollBar().setUnitIncrement(10);

		// プレビューペインを作成
		previewScrollPane = new PreviewScrollPane();

		// スプリットペインに配置
		splitPane.setBorder(BorderFactory.createEmptyBorder());
		splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
		splitPane.setContinuousLayout(true);
		splitPane.setTopComponent(checkScrollPane);
		splitPane.setBottomComponent(previewScrollPane);
		JPanel splitPanel = new JPanel();
		splitPanel.setLayout(new BoxLayout(splitPanel, BoxLayout.X_AXIS));
		splitPanel.add(splitPane);

		// 下部パネル作成
		JPanel panel = new TitledPanel("詳細設定");
		panel.setMaximumSize(ComponentFactory.createMaxDimension());
		panel.add(splitPanel);

		// 設定ファイルからスプリットペイン分割位置を取得
		Persister psst = Persister.getInstance();
		int loc = psst.getInt(Persister.DETAIL_PANEL_HEIGHT, 88);
		splitPane.setDividerLocation(loc);

		// 設定ファイルからチェック有無を取得
		String[] pDescs = psst.getStrings(Persister.REPLACE_DESCRIPTION_ARRAY);
		for (EntryCheckBox ecb : entryCheckList) {
			ReplaceEntry entry = ecb.getReplaceEntry();
			String desc = entry.getDescription();
			for (String pDesc : pDescs) {
				if (desc.equals(pDesc)) {
					ecb.setSelected(true);
					break;
				}
			}
		}
		previewScrollPane.updatePreview(entryCheckList);

		return panel;
	}

	/**
	 * 指定したベースディレクトリを遡り、予想される入出力ソースアーカイブファイルを 設定します。入出力ソースアーカイブファイルのどちらか 1
	 * つでも値が設定 されている場合は何も行いません。
	 *
	 * @param baseDir
	 *            ベースディレクトリ
	 */
	private void resolveArchivePath(File baseDir) {

		String src = srcField.getFile().getPath();
		String out = outField.getFile().getPath();
		if (!src.equals("") || !out.equals("")) {
			return;
		}
		for (File dir = baseDir; dir != null; dir = dir.getParentFile()) {
			File zip = new File(dir, "src.zip");
			if (zip.exists()) {
				srcField.setFile(zip);
				break;
			}
			File jar = new File(dir, "src.jar");
			if (jar.exists()) {
				srcField.setFile(jar);
				break;
			}
		}
		src = srcField.getFile().getPath();
		if (!src.equals("")) {
			String outName = FastStringUtils.replaceFirst(src, "\\.(zip|jar)$", "ja.zip");
			outField.setFile(new File(outName));
		}
	}

	/**
	 * 指定したベースディレクトリを下り、API ドキュメントディレクトリを探します。
	 *
	 * @param baseDir
	 *            ベースディレクトリ
	 * @return API ドキュメントディレクトリ
	 */
	private File searchDocDirectory(File baseDir) {

		File dir = null;

		for (File file : baseDir.listFiles()) {
			if (file.isFile()) {
				if (file.getName().equals("allclasses-frame.html")) {
					dir = baseDir;
				}
			} else {
				dir = searchDocDirectory(file); // 再帰
			}
			if (dir != null) {
				break;
			}
		}
		return dir;
	}

	/**
	 * ファイル選択フィールドに設定ファイルから取得した値をセットします。
	 *
	 * @param field
	 *            ファイル選択フィールド
	 * @param pathKey
	 *            パスを示す設定ファイルのキー
	 * @param charKey
	 *            文字セットを示す設定ファイルのキー
	 * @throws MergeDocException
	 *             設定ファイルが取得できない場合
	 */
	private void loadPersister(FileChooserField field, Persister.Key pathKey, Persister.Key charKey)
			throws MergeDocException {
		Persister psst = Persister.getInstance();
		if (field.getFile().getPath().equals("")) {
			String path = psst.getString(pathKey, "");
			if (path.length() > 0) {
				field.setFile(new File(path));
			}
		}
		try {
			String enc = psst.getString(charKey);
			field.getComboBox().setSelectedItem(enc);
		} catch (IllegalArgumentException e) {
		}
	}

	/**
	 * 選択された置換エントリの配列を取得します。
	 *
	 * @return 選択された置換エントリの配列
	 */
	public ReplaceEntry[] getSelectedEntries() {

		List<ReplaceEntry> enables = new LinkedList<ReplaceEntry>();
		for (EntryCheckBox cb : entryCheckList) {
			if (cb.isSelected()) {
				ReplaceEntry entry = cb.getReplaceEntry();
				enables.add(entry);
			}
		}
		ReplaceEntry[] entries = enables.toArray(new ReplaceEntry[enables.size()]);
		return entries;
	}

	/**
	 * マージ設定を取得します。
	 *
	 * @return マージ設定
	 */
	public Preference getPreference() {

		return new Preference() {

			File docDir = docField.getFile();
			File srcFile = srcField.getFile();
			File outFile = outField.getFile();
			String docEnc = docField.getComboBox().getSelectedItem().toString();
			String srcEnc = srcField.getComboBox().getSelectedItem().toString();
			String outEnc = outField.getComboBox().getSelectedItem().toString();
			boolean apiDown = apiDownload.isSelected();
			ReplaceEntry[] entries = getSelectedEntries();

			public File getDocDirectory() {
				return docDir;
			}

			public File getInputArchive() {
				return srcFile;
			}

			public File getOutputArchive() {
				return outFile;
			}

			public String getDocEncoding() {
				return docEnc;
			}

			public String getInputEncoding() {
				return srcEnc;
			}

			public String getOutputEncoding() {
				return outEnc;
			}

			public String getApiDownload() {
				if (apiDown) {
					return "true";
				} else {
					return "false";
				}
			}

			public ReplaceEntry[] getGlobalEntries() {
				return entries;
			}
		};
	}

	/**
	 * このパネルの設定内容を Persister にセットします。
	 *
	 * @throws Persister
	 *             にセット出来なかった場合
	 */
	public void persistent() throws MergeDocException {

		Preference pref = getPreference();
		Persister psst = Persister.getInstance();

		psst.setString(Persister.DOC_DIR, pref.getDocDirectory().getPath());
		psst.setString(Persister.IN_FILE, pref.getInputArchive().getPath());
		psst.setString(Persister.OUT_FILE, pref.getOutputArchive().getPath());
		psst.setString(Persister.DOC_ENC, pref.getDocEncoding());
		psst.setString(Persister.IN_ENC, pref.getInputEncoding());
		psst.setString(Persister.OUT_ENC, pref.getOutputEncoding());
		psst.setString(Persister.API_DONWLOAD, pref.getApiDownload());
		psst.setInt(Persister.DETAIL_PANEL_HEIGHT, splitPane.getDividerLocation());

		List<String> descList = new LinkedList<String>();
		for (ReplaceEntry entry : pref.getGlobalEntries()) {
			descList.add(entry.getDescription());
		}
		String[] descs = descList.toArray(new String[descList.size()]);
		psst.setStrings(Persister.REPLACE_DESCRIPTION_ARRAY, descs);
	}
}


text:
<TITLE>Review for Fourth Protocol, The (1987)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Fourth Protocol, The (1987)

reviewed by
Mark R. Leeper

                             THE FOURTH PROTOCOL
                       A film review by Mark R. Leeper
                        Copyright 1987 Mark R. Leeper

          Capsule review:  Pierce Brosnan is a Soviet agent and
     Michael Caine is a British agent trying to track him down.
     This is a good "spy-procedure" sort of thriller that is just
     a bit too much like Frederick Forsyth's previous DAY OF THE
     JACKAL.

     Frederick Forsyth writes good suspense stories about political
intrigue.  He is best known for THE DAY OF THE JACKAL and THE ODESSA FILE.
They are clearly written and tense thrillers, though if the truth be known,
there is a certain sameness about them.  While there are major consequences
to what is happening, his stories really come down to a sort of chessgame
between two men, one good and one evil.  Nobody else is really important in
the story.  Just about everyone else is a prop.  THE FOURTH PROTOCOL is a
new film based on a novel of the same name by Frederick Forsyth.

     THE DAY OF THE JACKAL dealt with a lone assassin in the pay of
political extremists whose mission is to kill Charles DeGaulle.  We see how
the assassin works and thinks.  We also see a police investigator, one who
is not altogether popular with his superiors, and we see how he is able to
discover an amazing amount of information about the assassin.  And that
information, together with a modicum of dumb luck, are sufficient to avert
the assassination.  With minor substitutions, we have the same story here.
Instead of a political extremist group, we have a rogue general in Soviet
intelligence.  The general sends a sort of assassin, Petrofsky (played by
Pierce Brosnan), to head up an operation in Britain.  Trying to uncover the
operation is John Preston, played by an aging Michael Caine.  Preston takes
his orders these days from an officious supervisor played by Julian Glover,
who seems to make a career of playing unlikeable officials (including Breen
in FIVE MILLION YEARS TO EARTH).  Only this time, the assassin's mission is
not to kill a single man.

     THE FOURTH PROTOCOL is solidly acted with Caine a likeable if
independent-minded agent.  Pierce Brosnan is not very good at showing
emotion, but as emotionless killers he is just fine.  There are a host of
other familiar faces including, I think (and someone can correct me if I am
wrong), the same actor who plays Max Headroom, in this film playing an
obnoxious American.  As suspense films go, THE FOURTH PROTOCOL is not the
most cerebral, but it is several cuts about American suspense films like
BEVERLY HILLS COP.  Give it a low +2 on the -4 to +4 scale.

                                        Mark R. Leeper
                                        ihnp4!mtgzz!leeper
                                        mtgzz!leeper@rutgers.rutgers.edu

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
var Cell = require("./propagator-cell.js")
var probe = require("./probe.js")
var assert = require("assert")

function coerceToArray(object) {
    if (!(object instanceof Array)) return [object];
    else return object;
}

function mergeByUpdate(prev,update) {
    return update;
}

function Propagator(func,input,output,mergeStrategy) {
      var self = this

      assert(func && input && output, "You need to call the propagator constructor with all three of a function, input cell and output cell")
      assert(func instanceof Function, "You need to call a propagator with a function as the first argument")
      assert(input instanceof Cell || input instanceof Array,  "Propagators read from cells or lists of cells, not " + typeof input)
      assert(output instanceof Cell, "Propagators output to single cells, not " + typeof output)
      assert(input !== output, "Propagators shouldn't write out to the same cell they read from.")
      if (input instanceof Array) input.forEach( (cell) => assert(cell instanceof Cell,"All inputs need to be cells, not " + typeof cell ) );
      if (typeof mergeStrategy != "undefined") {
          assert(mergeStrategy instanceof Function, "your merge callback "+ mergeStrategy.toString() + " must be a function not a " + typeof mergeStrategy)
      }

      this.input = coerceToArray(input);
      this.output = output;

      function applyFuncToInputs() {
          var inputs = self.input.map((cell) => cell.getContents())
          var output = {"value" : undefined, "usable" : false}

          inputs.fullyPopulated = inputs.every((value) => typeof value !== "undefined")

          if(inputs.fullyPopulated) {
              output.value = func.apply(null,inputs);
              output.usable = true;
          }

          return output;
      }

      this.merge = mergeStrategy || mergeByUpdate

      this.propagate = function propagate() {

          var outputValues = applyFuncToInputs();
          if (outputValues.usable) self.output.update(outputValues.value, self)
      }

      this.input.forEach( (cell) => cell.addListener(self.propagate) )
}

Propagator.makeCell = function makeCell() {return new Cell};
Propagator.prototype.makeCell = Propagator.makeCell;

Propagator.addProbe = probe
Propagator.prototype.addProbe = Propagator.addProbe

module.exports = Propagator


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
  ~ Copyright 2015 Open Networking Laboratory
  ~
  ~ 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.
  -->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="onos-app-vtnrsc-1.3.0">
    <repository>mvn:org.onosproject/onos-app-vtnrsc/1.3.0/xml/features</repository>
    <feature name="onos-app-vtnrsc" version="1.3.0"
             description="ONOS sample applications">
        <feature>onos-api</feature>
        <bundle>mvn:org.onosproject/onos-app-vtnrsc/1.3.0</bundle>
    </feature>
</features>