text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Getting · Bootstrap</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="assets/css/bootstrap.css" rel="stylesheet">
    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="assets/css/docs.css" rel="stylesheet">
    <link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">

    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="icon" href="assets/ico/favicon.png">

    <link href="assets/css/todc-bootstrap.css" rel="stylesheet">

          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

          </button>
          Bootstrap

                Home

                Get started

                Scaffolding

                Base CSS

                Components

                JavaScript

Getting started

Overview of the project, its contents, and how to get started with a simple template.

      Heads up! These docs are for v2.3.2, which is no longer officially supported. Check out the latest version of TODC Bootstrap!

 Download

 File structure

 What's included

 HTML template

 Examples

 What next?

1. Download

Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.

Download compiled

Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.

Download TODC Bootstrap

Download source

Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

Download TODC Bootstrap source

Download Bootstrap

Download Bootstrap source

            Heads up! TODC Bootstrap does not currently provide a compiled/zipped package. The
            Download TODC Bootstrap button will download the todc-bootstrap stylesheet.

2. File structure

Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.

Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:

  bootstrap/
  ├── css/
  │   ├── bootstrap.css
  │   ├── bootstrap.min.css
  ├── js/
  │   ├── bootstrap.js
  │   ├── bootstrap.min.js
  └── img/
      ├── glyphicons-halflings.png
      └── glyphicons-halflings-white.png

This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.

Please note that all JavaScript plugins require jQuery to be included.

3. What's included

Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.

Docs sections

Scaffolding

Global styles for the body to reset type and background, link styles, grid system, and two simple layouts.

Base CSS

Styles for common HTML elements like typography, code, tables, forms, and buttons. Also includes Glyphicons, a great little icon set.

Components

Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more.

JavaScript plugins

Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.

List of components

Together, the Components and JavaScript plugins sections provide the following interface elements:

Button groups

Button dropdowns

Navigational tabs, pills, and lists

Navbar

Labels

Badges

Page headers and hero unit

Thumbnails

Alerts

Progress bars

Modals

Dropdowns

Tooltips

Popovers

Accordion

Carousel

Typeahead

In future guides, we may walk through these components individually in more detail. Until then, look for each of these in the documentation for information on how to utilize and customize them.

4. Basic HTML template

With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.

Now, here's a look at a typical HTML file:

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <script src="http://code.jquery.com/jquery.js"></script>
  </body>
</html>

To make this a Bootstrapped template, just include the appropriate CSS and JS files:

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.

5. Examples

Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.

Starter template

A barebones HTML document with all the Bootstrap CSS and JavaScript included.

Basic marketing site

Featuring a hero unit for a primary message and three supporting elements.

Fluid layout

Uses our new responsive, fluid grid system to create a seamless liquid layout.

Narrow marketing

Slim, lightweight marketing template for small projects or teams.

Justified nav

Marketing page with equal-width navigation links in a modified navbar.

Sign in

Barebones sign in form with custom, larger form controls and a flexible layout.

Sticky footer

Pin a fixed-height footer to the bottom of the user's viewport.

Carousel jumbotron

A more interactive riff on the basic marketing site featuring a prominent carousel.

What next?

Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.

          Visit the TODC Bootstrap docs
          Customize Bootstrap

            Heads up! TODC Bootstrap can not be customized using the customizer at this time. The Customize button links to the Bootstrap customizer.

Forked from Twitter Bootstrap and built with all the love in the world by todc.

Updated to support v2.3.0 by acmetech.

Code licensed under Apache License v2.0, documentation under CC BY 3.0.

Glyphicons Free licensed under CC BY 3.0.

Issues

·

Changelog

·

Bootstrap Blog

·

Bootstrap Issues

·

Bootstrap Changelog

redpajama_set_name: RedPajamaGithub


text:
/* -*- mode:CSharp; coding:utf-8-with-signature -*-
 */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UTJ {

public class WaterInputDrawer {
	struct InputInfo {
		public enum Type {
			Circle,
		}
		public Type type_;
		public float x_;
		public float y_;
		public float value_;
		public float size_;
		public InputInfo(Type type, float x, float y, float value, float size) {
			type_ = type;
			x_ = x;
			y_ = y;
			value_ = value;
			size_ = size;
		}
	}
	private List<InputInfo> input_info_list_;

	private Material water_input_material_;
	private float scale_;
	private float scale_half_;
	private Mesh mesh_;
	private List<Vector3>[] vertices_;
	private List<int>[] indices_;
	private List<Vector3> empty_vertices_;
	private List<int> empty_indices_;
	private RenderTexture render_texture_;
	private Camera camera_;

	const int WATER_INPUT_LAYER = 8;
	const int VERTICES_MAX = 256;

	public RenderTexture getRenderTexture() { return render_texture_; }

	public void init(Material water_input_material,
					 float scale)
	{
		input_info_list_ = new List<InputInfo>();
		input_info_list_.Capacity = VERTICES_MAX/4;

		water_input_material_ = water_input_material;
		scale_ = scale;
		scale_half_ = scale*0.5f;
		mesh_ = new Mesh();
		mesh_.MarkDynamic();
		mesh_.name = "input_draw";
		mesh_.bounds = new Bounds(Vector3.zero, Vector3.one * 99999999);
		vertices_ = new List<Vector3>[2];
		vertices_[0] = new List<Vector3>();
		vertices_[0].Capacity = VERTICES_MAX;
		vertices_[1] = new List<Vector3>();
		vertices_[1].Capacity = VERTICES_MAX;
		indices_ = new List<int>[2];
		indices_[0] = new List<int>();
		indices_[0].Capacity = VERTICES_MAX;
		indices_[1] = new List<int>();
		indices_[1].Capacity = VERTICES_MAX;
		empty_vertices_ = new List<Vector3>();
		empty_indices_ = new List<int>();

		render_texture_ = new RenderTexture(128, 128, 0 /* depth */,
											RenderTextureFormat.ARGB32);
		// render_texture_.hideFlags = HideFlags.HideAndDontSave;
		render_texture_.name = "water_input";
		render_texture_.filterMode = FilterMode.Bilinear;
		render_texture_.autoGenerateMips = false;
		render_texture_.wrapMode = TextureWrapMode.Repeat;
		render_texture_.anisoLevel = 0;
		render_texture_.Create();
		Graphics.SetRenderTarget(render_texture_);
		GL.Clear(false /* clearDepth */, true /* clearColor */,
				 new Color(0.5f, 0.5f, 0.5f, 0.5f));

		var camera_go = new GameObject();
		camera_go.name = "water_input";
		// camera_go.hideFlags = HideFlags.HideAndDontSave;
		camera_ = camera_go.AddComponent<Camera>();
		camera_.useOcclusionCulling = false;
		camera_.cullingMask = 1 << WATER_INPUT_LAYER;
		camera_.orthographic = true;
		camera_.orthographicSize = scale_half_;
		camera_.nearClipPlane = -1f;
		camera_.farClipPlane = 1f;
		camera_.clearFlags = CameraClearFlags.SolidColor;
		camera_.backgroundColor = new Color(0.5f, 0.5f, 0.5f, 0.5f);
		camera_.targetTexture = render_texture_;
	}

	public void finalize()
	{
		render_texture_.Release();
		if (camera_ != null) {
			Object.Destroy(camera_.gameObject);
		}
	}

	public void putPoint(float x, float y, float value, float size)
	{
		if (input_info_list_.Count >= input_info_list_.Capacity) {
			Debug.LogError("exceed water input buffer.");
			return;
		}
		input_info_list_.Add(new InputInfo(InputInfo.Type.Circle,
										   Mathf.Repeat(x+scale_half_, scale_)-scale_half_,
										   Mathf.Repeat(y+scale_half_, scale_)-scale_half_,
										   value,
										   size));
	}

	public void renderUpdate(int front)
	{
		foreach (var input_info in input_info_list_) {
			var posx = input_info.x_;
			var posy = input_info.y_;
			var size = input_info.size_;
			var value = input_info.value_;
			vertices_[front].Add(new Vector3(posx-size, posy-size, value));
			vertices_[front].Add(new Vector3(posx+size, posy-size, value));
			vertices_[front].Add(new Vector3(posx-size, posy+size, value));
			vertices_[front].Add(new Vector3(posx+size, posy+size, value));
			int idx = vertices_[front].Count-4;
			indices_[front].Add(idx+0);
			indices_[front].Add(idx+1);
			indices_[front].Add(idx+2);
			indices_[front].Add(idx+2);
			indices_[front].Add(idx+1);
			indices_[front].Add(idx+3);
		}
		input_info_list_.Clear();
	}

	public void render(int front)
	{
		mesh_.SetTriangles(empty_indices_, 0, false); // avoid error
		mesh_.SetVertices(empty_vertices_);		   // avoid error
		mesh_.SetVertices(vertices_[front]);
		mesh_.SetTriangles(indices_[front],
						   0 /* submesh */,
						   false /* calculateBounds */);
		Graphics.DrawMesh(mesh_,
						  Vector3.zero,
						  Quaternion.identity,
						  water_input_material_,
						  WATER_INPUT_LAYER,
						  camera_,
						  0 /* submeshIndex */,
						  null /* properties */,
						  false /* castShadow */,
						  false /* receiveShadow */,
						  false /* useLightProbe */);
		vertices_[front].Clear();
		indices_[front].Clear();
	}
}

} // namespace UTJ {

/*
 * End of WaterInputDrawer.cs
 */


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" bean-discovery-mode="none">
  <scan>
    <exclude name="org.kie.workbench.common.screens.server.management.client.**"/>
  </scan>
</beans>


text:
require 'spec_helper'

feature 'Creating clubs' do
  scenario "can create a club" do
    visit '/'
    click_link "Add new club"
    fill_in 'Name', :with => "Aston Villa"
    fill_in 'League', :with => "EPL"
    click_button "Create Club"
    page.should have_content('Club has been added.')
  end
end


text:
#include "local_vv_store.h"
#include "local_vec_store.h"
#include "mem_vv_store.h"

namespace fm
{

std::vector<off_t> local_vv_store::get_rel_offs(off_t start, size_t len) const
{
	// The last entry shows the end of the last vector.
	std::vector<off_t> new_offs(len + 1);
	off_t start_off = offs[start];
	for (size_t i = 0; i < new_offs.size(); i++)
		new_offs[i] = offs[i + start] - start_off;
	return new_offs;
}

local_vec_store::ptr local_vv_store::get_portion(off_t loc, size_t size)
{
	assert(get_raw_arr());
	assert(loc + size <= get_length());
	off_t start = get_global_start() + loc;
	std::vector<off_t> new_offs = get_rel_offs(loc, size);
	size_t entry_size = get_type().get_size();
	off_t rel_vec_start = offs[loc] / entry_size;
	off_t rel_vec_len = (new_offs.back() - new_offs.front()) / entry_size;
	return local_vec_store::ptr(new local_vv_store(start, new_offs,
				vec->get_portion(rel_vec_start, rel_vec_len)));
}

local_vec_store::const_ptr local_vv_store::get_portion(off_t loc,
		size_t size) const
{
	assert(get_raw_arr());
	assert(loc + size <= get_length());
	off_t start = get_global_start() + loc;
	std::vector<off_t> new_offs = get_rel_offs(loc, size);
	size_t entry_size = get_type().get_size();
	off_t rel_vec_start = offs[loc] / entry_size;
	off_t rel_vec_len = (new_offs.back() - new_offs.front()) / entry_size;
	return local_vec_store::ptr(new local_vv_store(start, new_offs,
				vec->get_portion(rel_vec_start, rel_vec_len)));
}

namespace detail
{

detail::mem_vv_store::ptr apply(const local_vv_store &store,
		const arr_apply_operate &op)
{
	const scalar_type &output_type = op.get_output_type();
	size_t out_size;
	// If the user can predict the number of output elements, we can create
	// a buffer of the expected size.
	if (op.get_num_out_eles() > 0)
		out_size = op.get_num_out_eles();
	else
		// If the user can't, we create a small buffer.
		out_size = 16;
	local_buf_vec_store buf(0, out_size, output_type, -1);

	detail::mem_vv_store::ptr ret = detail::mem_vv_store::create(output_type);
	for (size_t i = 0; i < store.get_num_vecs(); i++) {
		local_cref_vec_store lvec(store.get_raw_arr(i), 0,
				store.get_length(i), store.get_type(), -1);
		op.run(lvec, buf);
		ret->append(buf);
	}
	return ret;
}

}

}


text:
param($task = "default")

$scriptPath = $MyInvocation.MyCommand.Path
$scriptDir = Split-Path $scriptPath

get-module psake | remove-module

Tools\NuGet\NuGet.exe install Tools\NuGet\packages.config -OutputDirectory packages
import-module (Get-ChildItem "$scriptDir\packages\psake.*\tools\psake.psm1" | Select-Object -First 1)

invoke-psake "$scriptDir\default.ps1" $task


text:
using JetBrains.Annotations;
using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.Psi.CSharp;
using JetBrains.ReSharper.Psi.CSharp.Tree;

namespace ReCommendedExtension.Analyzers.Region
{
    [RegisterConfigurableSeverity(
        SeverityId,
        null,
        HighlightingGroupIds.DeclarationRedundancy,
        "Region contains a single element" + ZoneMarker.Suffix,
        "",
        Severity.SUGGESTION)]
    [ConfigurableSeverityHighlighting(SeverityId, CSharpLanguage.Name)]
    public sealed class RegionWithSingleElementSuggestion : RegionHighlighting
    {
        const string SeverityId = "RegionWithSingleElement";

        internal RegionWithSingleElementSuggestion([NotNull] string message, [NotNull] IStartRegion startRegion) : base(message, startRegion) { }
    }
}


text:
<?php

namespace Tom32i\Bundle\DemoBundle\Service;

use Symfony\Component\OptionsResolver\OptionsResolver;
use Tom32i\Bundle\DemoBundle\Interfaces\RedisIndexable;

/**
 * Redis indexer
 */
class RedisIndexer
{
    /**
     * Redis client
     *
     * @var Redis
     */
    protected $redis;

    /**
     * Redis configuration
     *
     * @var array
     */
    protected $config;

    /**
     * Is connected
     *
     * @var boolean
     */
    protected $connected = false;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->redis = new \Redis;
    }

    /**
     * Get options resolver
     *
     * @return OptionsResolver
     */
    protected function getResolver()
    {
        $resolver = new OptionsResolver;

        $resolver->setDefaults(
            [
                'host' => '127.0.0.1',
                'port' => 6379,
            ]
        );

        return $resolver;
    }

    /**
     * Set redis configuration
     *
     * @param array $config
     */
    public function setConfig(array $config)
    {
        $this->config = $this->getResolver()->resolve($config);
    }

    /**
     * Connect to redis server
     */
    protected function connect()
    {
        if (!$this->connected) {
            $this->connected = $this->redis->connect($this->config['host'], $this->config['port']);
        }

        return $this->connected;
    }

    /**
     * Disconnect from redis server
     */
    protected function disconnect()
    {
        if ($this->connected) {
            $this->connected = !$this->redis->close();
        }

        return !$this->connected;
    }

    /**
     * Get key value
     *
     * @param string $key
     *
     * @return mixed
     */
    public function get($key)
    {
        $this->connect();

        $result = json_decode($this->redis->get($key), true);

        $this->disconnect();

        return $result;
    }

    /**
     * Set key value
     *
     * @param string $key
     * @param mixed $value
     */
    public function set($key, $value, $ttl = null)
    {
        $this->connect();

        $key   = (string) $key;
        $value = json_encode($value);

        if ($ttl) {
            $this->redis->setex($key, $ttl, $value);
        } else {
            $this->redis->set($key, $value);
        }

        $this->disconnect();
    }

    /**
     * Delete a key from Redis database
     *
     * @param string $key
     */
    public function delete($key)
    {
        $this->connect();

        $this->redis->del($key);

        $this->disconnect();
    }

    /**
     * Get key values
     *
     * @param mixed $keys
     *
     * @return array
     */
    public function getAll($keys)
    {
        $this->connect();

        if (!is_array($keys)) {
            $keys = $this->redis->keys($keys);
        }

        $results = [];
        $datas   = $this->redis->mGet($keys) ?: array();

        foreach ($datas as $data) {
            if ($data) {
                $results[] = json_decode($data, true);
            }
        }

        $this->disconnect();

        return $results;
    }

    /**
     * Flush database
     */
    public function flush()
    {
        $this->connect();

        $this->redis->flushAll();

        $this->disconnect();
    }

    /**
     * Index an object into redis database
     *
     * @param RedisIndexable $object
     */
    public function index(RedisIndexable $object, $ttl = null)
    {
        $this->set($object->getRedisIndex(), $object, $ttl);
    }

    /**
     * Remove an object from redis database
     *
     * @param RedisIndexable $object
     */
    public function remove(RedisIndexable $object)
    {
        $this->delete($object->getRedisIndex());
    }
}


text:
package com.mgmtp.perfload.core.client.web.event;

import com.mgmtp.perfload.core.client.event.LtProcessEvent;
import com.mgmtp.perfload.core.client.event.LtProcessEventListener;
import com.mgmtp.perfload.core.client.event.LtRunnerEvent;
import com.mgmtp.perfload.core.client.event.LtRunnerEventListener;

/**
 * Adapter class with no-op implementations for perfLoad's event listeners.
 *
 * @author rnaegele
 */
public class LtListenerAdapter implements LtProcessEventListener, LtRunnerEventListener, RequestFlowEventListener {

	// LtProcessEventListener

	@Override
	public void processStarted(final LtProcessEvent event) {
		// no-op
	}

	@Override
	public void processFinished(final LtProcessEvent event) {
		// no-op
	}

	// LtRunnerEventListener

	@Override
	public void runStarted(final LtRunnerEvent event) {
		// no-op
	}

	@Override
	public void runFinished(final LtRunnerEvent event) {
		// no-op
	}

	// RequestFlowEventListener

	@Override
	public void beforeRequestFlow(final RequestFlowEvent event) {
		// no-op
	}

	@Override
	public void afterRequestFlow(final RequestFlowEvent event) {
		// no-op
	}

	@Override
	public void beforeRequest(final RequestFlowEvent event) {
		// no-op
	}

	@Override
	public void afterRequest(final RequestFlowEvent event) {
		// no-op
	}
}


text:
import * as React from "react";

export const AuthUserContext = React.createContext(null);


text:
require "active_support/core_ext/string/output_safety"

module ActionView #:nodoc:
  # = Action View Raw Output Helper
  module Helpers #:nodoc:
    module OutputSafetyHelper
      # This method outputs without escaping a string. Since escaping tags is
      # now default, this can be used when you don't want Rails to automatically
      # escape tags. This is not recommended if the data is coming from the user's
      # input.
      #
      # For example:
      #
      #  raw @user.name
      #  # => 'Jimmy <alert>Tables</alert>'
      def raw(stringish)
        stringish.to_s.html_safe
      end

      # This method returns an HTML safe string similar to what <tt>Array#join</tt>
      # would return. The array is flattened, and all items, including
      # the supplied separator, are HTML escaped unless they are HTML
      # safe, and the returned string is marked as HTML safe.
      #
      #   safe_join([raw("
foo
"), "
bar
"], "
")
      #   # => "
foo
<br /><p>bar</p>"
      #
      #   safe_join([raw("
foo
"), raw("
bar
")], raw("
"))
      #   # => "
foo

bar
"
      #
      def safe_join(array, sep = $,)
        sep = ERB::Util.unwrapped_html_escape(sep)

        array.flatten.map! { |i| ERB::Util.unwrapped_html_escape(i) }.join(sep).html_safe
      end

      # Converts the array to a comma-separated sentence where the last element is
      # joined by the connector word. This is the html_safe-aware version of
      # ActiveSupport's {Array#to_sentence}[https://api.rubyonrails.org/classes/Array.html#method-i-to_sentence].
      #
      def to_sentence(array, options = {})
        options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)

        default_connectors = {
          words_connector: ", ",
          two_words_connector: " and ",
          last_word_connector: ", and "
        }
        if defined?(I18n)
          i18n_connectors = I18n.translate(:'support.array', locale: options[:locale], default: {})
          default_connectors.merge!(i18n_connectors)
        end
        options = default_connectors.merge!(options)

        case array.length
        when 0
          "".html_safe
        when 1
          ERB::Util.html_escape(array[0])
        when 2
          safe_join([array[0], array[1]], options[:two_words_connector])
        else
          safe_join([safe_join(array[0...-1], options[:words_connector]), options[:last_word_connector], array[-1]], nil)
        end
      end
    end
  end
end


text:
namespace joedb
{
 ////////////////////////////////////////////////////////////////////////////
 enum class Commit_Level
 ////////////////////////////////////////////////////////////////////////////
 {
  no_commit,
  half_commit,
  full_commit
 };

 ////////////////////////////////////////////////////////////////////////////
 class Writable
 ////////////////////////////////////////////////////////////////////////////
 {
  public:
   virtual void create_table(const std::string &name) {}
   virtual void drop_table(Table_Id table_id) {}
   virtual void rename_table(Table_Id table_id, const std::string &name) {}

   virtual void add_field
   (
    Table_Id table_id,
    const std::string &name,
    Type type
   ) {}
   virtual void drop_field(Table_Id table_id, Field_Id field_id) {}
   virtual void rename_field
   (
    Table_Id table_id,
    Field_Id field_id,
    const std::string &name
   ) {}

   virtual void custom(const std::string &name) {}
   virtual void comment(const std::string &comment) {}
   virtual void timestamp(int64_t timestamp) {}
   virtual void valid_data() {}
   virtual void checkpoint(Commit_Level commit_level) {}

   virtual void insert_into(Table_Id table_id, Record_Id record_id) {}
   virtual void insert_vector
   (
    Table_Id table_id,
    Record_Id record_id,
    Record_Id size
   ) {}
   virtual void delete_from(Table_Id table_id, Record_Id record_id) {}

   #define TYPE_MACRO(type, return_type, type_id, R, W)\
   virtual void update_##type_id\
   (\
    Table_Id table_id,\
    Record_Id record_id,\
    Field_Id field_id,\
    return_type value\
   ) {}\
   virtual void update_vector_##type_id\
   (\
    Table_Id table_id,\
    Record_Id record_id,\
    Field_Id field_id,\
    Record_Id size,\
    const type *value\
   );\
   virtual type *get_own_##type_id##_storage\
   (\
    Table_Id table_id,\
    Record_Id record_id,\
    Field_Id field_id,\
    Record_Id &capacity\
   )\
   {\
    capacity = 0;\
    return nullptr;\
   }\
   const type *get_own_##type_id##_const_storage\
   (\
    Table_Id table_id,\
    Record_Id record_id,\
    Field_Id field_id,\
    Record_Id &capacity\
   ) const\
   {\
    return (const_cast<Writable *>(this))->get_own_##type_id##_storage(table_id, record_id, field_id, capacity);\
   }
   #include "joedb/TYPE_MACRO.h"

   virtual ~Writable() = default;
 };
}

#endif


text:
package ru.appliedtech.application.resources;

import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLStreamHandler;

import ru.appliedtech.application.AppException;
import ru.appliedtech.application.ApplicationStatus;

public class RelativeURLResolver extends Resolver {

	private final URL root;
	private final URLStreamHandler handler;

	public RelativeURLResolver(String name, URL root, URLStreamHandler handler) {
		super(name);
		this.root = root;
		this.handler = handler;
	}

	@Override
	public URL getURL(String path) throws AppException {
		try {
			return new URL(root, path, handler);
		} catch (MalformedURLException e) {
			throw new AppException(e, ApplicationStatus.FAILURE_UNKNOWN_REASON);
		}
	}
}


text:
package eus.ixa.ixa.pipe.ml.document;

import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;

import eus.ixa.ixa.pipe.ml.document.features.BagOfWordsFeatureGenerator;
import opennlp.tools.ml.EventTrainer;
import opennlp.tools.ml.TrainerFactory;
import opennlp.tools.ml.model.Event;
import opennlp.tools.ml.model.MaxentModel;
import opennlp.tools.util.ObjectStream;
import opennlp.tools.util.TrainingParameters;

/**
 * Statistical implementation of {@link DocumentClassifier}.
 */
public class DocumentClassifierME implements DocumentClassifier {

  private MaxentModel model;
  private DocumentClassifierContextGenerator contextGenerator;

  /**
   * Initializes the current instance with a DocumentClassifier model. Default feature
   * generation is used.
   *
   * @param model the document classifier model
   */
  public DocumentClassifierME(DocumentClassifierModel model) {
    final DocumentClassifierFactory factory = model.getFactory();
    this.model = model.getDocumentClassifierModel();
    this.contextGenerator = factory.createContextGenerator();
    // TODO: We should deprecate this. And come up with a better solution!
    this.contextGenerator.addFeatureGenerator(new BagOfWordsFeatureGenerator());
  }

  public String classify(String[] text) {
    double[] outcome = classifyProb(text);
    return model.getBestOutcome(outcome);
  }

  /**
   * Classify the given text provided as tokens.
   *
   * @param text text tokens to classify
   */
  @Override
  public double[] classifyProb(String[] text) {
    return model.eval(
        contextGenerator.getContext(text));
  }

  public String getBestLabel(double[] outcome) {
    return model.getBestOutcome(outcome);
  }

  /**
   * Returns a map in which the key is the label name and the value is the score.
   *
   * @param text the input text to classify
   * @return the score map
   */
  @Override
  public Map<String, Double> scoreMap(String[] text) {
    Map<String, Double> probDist = new HashMap<>();

    double[] categorize = classifyProb(text);
    int catSize = getNumberOfLabels();
    for (int i = 0; i < catSize; i++) {
      String category = getLabel(i);
      probDist.put(category, categorize[getIndex(category)]);
    }
    return probDist;
  }

  /**
   * Returns a map with the score as a key in ascending order.
   * The value is a Set of categories with the score.
   * Many labels can have the same score, hence the Set as value.
   *
   * @param text the input text to classify
   * @return the sorted score map
   */
  @Override
  public SortedMap<Double, Set<String>> sortedScoreMap(String[] text) {
    SortedMap<Double, Set<String>> descendingMap = new TreeMap<>();
    double[] categorize = classifyProb(text);
    int catSize = getNumberOfLabels();
    for (int i = 0; i < catSize; i++) {
      String category = getLabel(i);
      double score = categorize[getIndex(category)];
      if (descendingMap.containsKey(score)) {
        descendingMap.get(score).add(category);
      } else {
        Set<String> newset = new HashSet<>();
        newset.add(category);
        descendingMap.put(score, newset);
      }
    }
    return descendingMap;
  }

  public int getIndex(String category) {
    return model.getIndex(category);
  }

  public String getLabel(int index) {
    return model.getOutcome(index);
  }

  public int getNumberOfLabels() {
    return model.getNumOutcomes();
  }

  public String getAllLabels(double[] results) {
    return model.getAllOutcomes(results);
  }

  /**
   * Forgets all adaptive data which was collected during previous calls to one
   * of the find methods.
   *
   * This method is typical called at the end of a document.
   */
  @Override
  public void clearFeatureData() {
    this.contextGenerator.clearFeatureData();
  }

  public static DocumentClassifierModel train(String languageCode, ObjectStream<DocSample> samples,
      TrainingParameters mlParams, DocumentClassifierFactory factory)
          throws IOException {

    Map<String, String> manifestInfoEntries = new HashMap<>();
    EventTrainer trainer = TrainerFactory.getEventTrainer(
        mlParams.getSettings(), manifestInfoEntries);
    final ObjectStream<Event> eventStream =  new DocumentClassifierEventStream(samples, factory.createContextGenerator());
    MaxentModel model = trainer.train(eventStream);
    return new DocumentClassifierModel(languageCode, model, factory.getFeatureGenerator(), factory.getResources(), manifestInfoEntries, factory);
  }
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using Org.Apache.REEF.Tang.Types;
using Org.Apache.REEF.Utilities.Logging;

namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan
{
    // contains the data for injecting a Node such as which Constructor to use, what are the arguments
    public abstract class InjectionPlan : ITraversable<InjectionPlan>
    {
        protected INode node;

        private static readonly Logger LOGGER = Logger.GetLogger(typeof(InjectionPlan));

        public InjectionPlan(INode node)
        {
            this.node = node;
        }

        public INode GetNode()
        {
            return node;
        }

        /// <summary>
        /// Get child elements of the injection plan tree. By default, returns an empty list.
        /// </summary>
        /// <returns>An empty list</returns>
        public ICollection<InjectionPlan> GetChildren()
        {
            return new List<InjectionPlan>();
        }

        public abstract int GetNumAlternatives();

        public bool IsFeasible()
        {
            return GetNumAlternatives() > 0;
        }

        abstract public bool IsAmbiguous();

        abstract public bool IsInjectable();

        // abstract public bool HasFutureDependency();

        protected void pad(StringBuilder sb, int n)
        {
            for (int i = 0; i < n; i++)
            {
                sb.Append("  ");
            }
        }

        private static void Newline(StringBuilder pretty, int indent)
        {
            pretty.Append('\n');
            for (int j = 0; j < indent * 2; j++)
            {
                pretty.Append(' ');
            }
        }

        public String ToPrettyString()
        {
            String ugly = node.GetFullName() + ":\n" + ToString();
            StringBuilder pretty = new StringBuilder();
            int currentIndent = 1;
            for (int i = 0; i < ugly.Length; i++)
            {
                char c = ugly[i];
                if (c == '(')
                {
                    if (ugly[i + 1] == ')')
                    {
                        pretty.Append("()");
                        i++;
                    }
                    else
                    {
                        Newline(pretty, currentIndent);
                        currentIndent++;
                        pretty.Append(c);
                        pretty.Append(' ');
                    }
                }
                else if (c == '[')
                {
                    if (ugly[i + 1] == ']')
                    {
                        pretty.Append("[]");
                        i++;
                    }
                    else
                    {
                        Newline(pretty, currentIndent);
                        currentIndent++;
                        pretty.Append(c);
                        pretty.Append(' ');
                    }
                }
                else if (c == ')' || c == ']')
                {
                    currentIndent--;
                    Newline(pretty, currentIndent);
                    pretty.Append(c);
                }
                else if (c == '|')
                {
                    Newline(pretty, currentIndent);
                    pretty.Append(c);
                }
                else if (c == ',')
                {
                    currentIndent--;
                    Newline(pretty, currentIndent);
                    pretty.Append(c);
                    currentIndent++;
                }
                else
                {
                    pretty.Append(c);
                }
            }
            return pretty.ToString();
        }

        public string ToCantInjectString()
        {
            if (!IsFeasible())
            {
                return ToInfeasibleInjectString();
            }
            if (IsAmbiguous())
            {
                return ToAmbiguousInjectString();
            }
            var ex = new ArgumentException(
                "toCantInjectString() called on injectable constructor:"
                + this.ToPrettyString());
            Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER);
            return null;
        }

        public abstract string ToAmbiguousInjectString();

        public abstract string ToInfeasibleInjectString();

        public abstract bool IsInfeasibleLeaf();

        public abstract string ToShallowString();

    }

    public class BuildingInjectionPlan : InjectionPlan
    {

        public BuildingInjectionPlan(INode node)
            : base(node)
        {
        }

        public override int GetNumAlternatives()
        {
            throw new NotSupportedException();
        }

        public override bool IsAmbiguous()
        {
            throw new NotSupportedException();
        }

        public override bool IsInjectable()
        {
            throw new NotSupportedException();
        }

        ////public override bool HasFutureDependency()
        ////{
        ////    throw new NotSupportedException();
        ////}

        public override string ToAmbiguousInjectString()
        {
            throw new NotSupportedException();
        }

        public override string ToInfeasibleInjectString()
        {
            throw new NotSupportedException();
        }

        public override bool IsInfeasibleLeaf()
        {
            throw new NotSupportedException();
        }

        public override string ToShallowString()
        {
            throw new NotSupportedException();
        }
    }
}


text:
package com.frdfsnlght.transporter.api.event;

import com.frdfsnlght.transporter.api.RemoteServer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

/**
 * Fired when a server connects.
 *
 * @author frdfsnlght <frdfsnlght@gmail.com>
 */
public final class RemoteServerConnectEvent extends Event {

    private static final HandlerList handlers = new HandlerList();

    /**
     * Returns the list of event handlers for this event.
     *
     * @return the list of event handlers for this event
     */
    public static HandlerList getHandlerList() {
        return handlers;
    }

    private RemoteServer server;

    /**
     * Creates the event.
     *
     * @param server    the server that connected
     */
    public RemoteServerConnectEvent(RemoteServer server) {
        this.server = server;
    }

    /**
     * Returns the server that connected.
     *
     * @return the server that connected
     */
    public RemoteServer getRemoteServer() {
        return server;
    }

    /**
     * Returns the list of event handlers for this event.
     *
     * @return the list of event handlers for this event
     */
    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

}


text:
using System.Collections.Generic;
using Azure.Core;
using Azure.ResourceManager.EdgeOrder;

namespace Azure.ResourceManager.EdgeOrder.Models
{
    /// <summary> List of orders. </summary>
    internal partial class OrderResourceList
    {
        /// <summary> Initializes a new instance of OrderResourceList. </summary>
        internal OrderResourceList()
        {
            Value = new ChangeTrackingList<EdgeOrderData>();
        }

        /// <summary> Initializes a new instance of OrderResourceList. </summary>
        /// <param name="value"> List of order resources. </param>
        /// <param name="nextLink"> Link for the next set of order resources. </param>
        internal OrderResourceList(IReadOnlyList<EdgeOrderData> value, string nextLink)
        {
            Value = value;
            NextLink = nextLink;
        }

        /// <summary> List of order resources. </summary>
        public IReadOnlyList<EdgeOrderData> Value { get; }
        /// <summary> Link for the next set of order resources. </summary>
        public string NextLink { get; }
    }
}


text:
package com.google.gerrit.server.schema;

import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.inject.Inject;

import org.eclipse.jgit.lib.Config;

class JDBC extends BaseDataSourceType {

  protected final Config cfg;

  @Inject
  JDBC(@GerritServerConfig final Config cfg) {
    super(ConfigUtil.getRequired(cfg, "database", "driver"));
    this.cfg = cfg;
  }

  @Override
  public String getUrl() {
    return ConfigUtil.getRequired(cfg, "database", "url");
  }
}


text:
/* ================================================================
 * About NPOI
 * Author: Tony Qu
 * Author's email: tonyqus (at) gmail.com
 * Author's Blog: tonyqus.wordpress.com.cn (wp.tonyqus.cn)
 * HomePage: http://www.codeplex.com/npoi
 * Contributors:
 *
 * ==============================================================*/

using System;
using System.Collections;
using System.IO;

using NPOI.POIFS.FileSystem;

namespace NPOI.POIFS.Dev
{
    internal class POIFSLister
    {
        public static void ViewFile(String filename)
        {
            using (Stream stream = new FileStream(filename, FileMode.Open))
            {
                POIFSFileSystem fs = new POIFSFileSystem(stream);
                DisplayDirectory(fs.Root, "");
            }
        }

        public static void DisplayDirectory(DirectoryNode dir, String indent)
        {
            Console.WriteLine(indent + dir.Name + " -");
            String newIndent = indent + "  ";

            IEnumerator it = dir.Entries;
            while (it.MoveNext())
            {
                Object entry = it.Current;
                if (entry is DirectoryNode)
                {
                    DisplayDirectory((DirectoryNode)entry, newIndent);
                }
                else
                {
                    DocumentNode doc = (DocumentNode)entry;
                    String name = doc.Name;
                    if (name[0] < 10)
                    {
                        String altname = "(0x0" + (int)name[0] + ")" + name.Substring(1);
                        name = name.Substring(1) + " <" + altname + ">";
                    }
                    Console.WriteLine(newIndent + name);
                }
            }
        }
    }
}


text:
#include "../../idlib/precompiled.h"
#pragma hdrstop

#include "GEApp.h"

rvGEStatusBar::rvGEStatusBar ( )
{
	mSimple = true;
	mZoom   = 0;
	mTriangles = 0;
}

/*
================
rvGEStatusBar::Create

Creates a new status bar
================
*/
bool rvGEStatusBar::Create ( HWND parent, UINT id, bool visible )
{
	mWnd = CreateStatusWindow ( WS_CHILD|WS_VISIBLE|WS_BORDER, "", parent, id );

	if ( !mWnd )
	{
		return false;
	}

	Show ( visible );

	return true;
}

/*
================
rvGEStatusBar::Resize

Resizes the status bar and updates the content
================
*/
void rvGEStatusBar::Resize ( int width, int height )
{
	SendMessage ( mWnd, WM_SIZE, 0, MAKELONG(width,height) );

	Update ( );
}

/*
================
rvGEStatusBar::Update

Updates the status bar by setting up each part's width and text
================
*/
void rvGEStatusBar::Update ( void )
{
	RECT	rStatus;
	SIZE	zoomSize;
	SIZE	trisSize;
	int		parts[5];

	GetWindowRect ( mWnd, &rStatus );

	if ( mSimple )
	{
		parts[0] = -1;

		SendMessage ( mWnd, SB_SETPARTS, 1, (LONG)parts );
		SendMessage ( mWnd, SB_SETTEXT, 1, (LPARAM) "" );
	}
	else
	{
		zoomSize.cx = 85;
		trisSize.cx = 65;

		parts[0] = (rStatus.right - rStatus.left) - zoomSize.cx - trisSize.cx - 40;
		parts[1] = parts[0] + trisSize.cx;
		parts[2] = parts[1] + zoomSize.cx;
		parts[3] = parts[2] + 40;
		parts[4] = -1;

		SendMessage ( mWnd, SB_SETPARTS, 5, (LONG)parts );
		SendMessage ( mWnd, SB_SETTEXT, 0, (LPARAM) "" );
		SendMessage ( mWnd, SB_SETTEXT, 1, (LPARAM) va(" Tris: %d", mTriangles ) );
		SendMessage ( mWnd, SB_SETTEXT, 2, (LPARAM) va(" Zoom: %d%%", mZoom ) );
	}
}

/*
================
rvGEStatusBar::Show

Shows and hides the status bar
================
*/
void rvGEStatusBar::Show ( bool visible )
{
	gApp.GetOptions().SetStatusBarVisible ( visible );
	ShowWindow ( mWnd, visible?SW_SHOW:SW_HIDE );
}


text:
set -ex

if [ "$#" -ne 4 ]; then
    echo "$0 <build_info> <deb_dir> <python-dir> <overlay-dir>"
    exit 1
fi

readonly BUILD_INFO="$1"
readonly DEB_DIR="$2"
readonly PYTHON_DIR="$3"
readonly OVERLAY_DIR="$4"

readonly APT_NONINTERACTIVE="-y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold"
export readonly DEBIAN_FRONTEND="noninteractive"
export readonly APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=yes

function install_package {
  local deb_file="$1"
  local package=$(dpkg-deb -f "${deb_file}" Package)
  local sha256=$(sha256sum "${deb_file}" | awk '{print $1}')
  local sha256_file="/tmp/${package}.sha256"

  if ! dpkg -l "${package}" ; then
    echo "Package ${package} is not installed."
    dpkg -i "${deb_file}"
    echo "${sha256}" > "${sha256_file}"
  else
    echo "Package ${package} is already installed."
    local installed_sha256="$(cat "${sha256_file}" 2>/dev/null || echo '')"
    if [[ "${installed_sha256}" != "${sha256}" ]]; then
      echo "Checksums do not ${package} match."
      dpkg --purge --force-all "${package}"
      dpkg -i "${deb_file}"
      echo "${sha256}" > "${sha256_file}"
    else
      echo "Checksums for ${package} match."
    fi
  fi
}

################################################################################
################################### root user ##################################
################################################################################

# Install python packages:
#   inotify                  (needed by aiy-io-mcu-firmware)
#   google-assistant-grpc    (needed by aiy-projects-python)
#   google-assistant-library (needed by aiy-projects-python)
#   google-cloud-speech      (needed by aiy-projects-python)
#   google-auth-oauthlib     (needed by aiy-projects-python)
#
# List needed packages excluding:
#   google-assistant-library (installed from aiy-python-wheels)
#   protobuf                 (installed from aiy-python-wheels)
#   argparse                 (part of python3 standard library)
#
# pip3 list --user --format=freeze | grep -v google-assistant-library | grep -v protobuf | grep -v argparse
time pip3 install --retries 10 --default-timeout=60 \
                  --no-deps --no-cache-dir --disable-pip-version-check \
                  -r /dev/stdin <<EOF
cachetools==4.1.1
enum34==1.1.10
google-api-core==1.23.0
google-assistant-grpc==0.3.0
google-auth==1.23.0
google-auth-oauthlib==0.4.2
google-cloud-speech==2.0.0
googleapis-common-protos==1.52.0
grpcio==1.33.2
inotify==0.2.10
libcst==0.3.13
nose==1.3.7
pathlib2==2.3.5
proto-plus==1.11.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pytz==2020.4
PyYAML==5.3.1
rsa==4.6
six==1.15.0
typing-extensions==3.7.4.3
typing-inspect==0.6.0
EOF

# Install debian packages
if ! ls /tmp/libttspico-utils_*.deb; then
  (cd /tmp && wget http://archive.raspberrypi.org/debian/pool/main/s/svox/libttspico-utils_1.0+git20130326-3+rpi1_armhf.deb)
fi

if ! ls /tmp/libttspico0_*.deb; then
  (cd /tmp && wget http://archive.raspberrypi.org/debian/pool/main/s/svox/libttspico0_1.0+git20130326-3+rpi1_armhf.deb)
fi

time apt-get ${APT_NONINTERACTIVE} install --fix-broken --no-upgrade raspberrypi-kernel-headers

time apt-get ${APT_NONINTERACTIVE} update --allow-releaseinfo-change && \
     apt-get ${APT_NONINTERACTIVE} install --fix-broken --no-upgrade \
  alsa-utils \
  avahi-utils \
  dkms \
  dnsmasq \
  pavucontrol \
  pulseaudio \
  python3-aiohttp \
  python3-bluez \
  python3-dbus \
  /tmp/libttspico-utils_*.deb \
  /tmp/libttspico0_*.deb

time apt-get ${APT_NONINTERACTIVE} remove \
  lxplug-volume

time apt-get ${APT_NONINTERACTIVE} autoremove

# Install general packages.
install_package $(ls ${DEB_DIR}/aiy-python-wheels_*.deb)
install_package $(ls ${DEB_DIR}/aiy-board-info_*_all.deb)
install_package $(ls ${DEB_DIR}/aiy-usb-gadget_*_all.deb)
install_package $(ls ${DEB_DIR}/aiy-io-mcu-firmware_*_all.deb)
install_package $(ls ${DEB_DIR}/aiy-bt-prov-server_*_all.deb)
install_package $(ls ${DEB_DIR}/aiy-cwc-server_*_all.deb)

# Install vision-specific packages.
install_package $(ls ${DEB_DIR}/aiy-models_*_all.deb)
install_package $(ls ${DEB_DIR}/aiy-vision-firmware_*_all.deb)

# Install kernel drivers.
install_package $(ls ${DEB_DIR}/leds-ktd202x-dkms_*.deb)
install_package $(ls ${DEB_DIR}/pwm-soft-dkms_*.deb)
install_package $(ls ${DEB_DIR}/aiy-dkms_*.deb)
install_package $(ls ${DEB_DIR}/aiy-vision-dkms_*.deb)
install_package $(ls ${DEB_DIR}/aiy-voicebonnet-soundcard-dkms_*.deb)
install_package $(ls ${DEB_DIR}/aiy-voice-services_*_all.deb)

# Install device tree overlays (in addition to EEPROM on the board).
install_package $(ls ${DEB_DIR}/aiy-overlay-vision_*.deb)
install_package $(ls ${DEB_DIR}/aiy-overlay-voice_*.deb)

# Setup aiyprojects apt repo.
echo "deb https://packages.cloud.google.com/apt aiyprojects-stable main" > /etc/apt/sources.list.d/aiyprojects.list
if ! apt-key list | grep "Google Cloud"; then
  curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
fi

# Create build info.
echo "${BUILD_INFO}" > /etc/motd
echo "${BUILD_INFO}" > /etc/aiyprojects.info

# Enable SSH.
touch /boot/ssh

# Update boot configuration (/boot/config.txt).
sed -i -e "s/^dtparam=audio=on/#\0/" /boot/config.txt
sed -i -e "s/^dtparam=spi=on/#\0/" /boot/config.txt
grep -q "start_x=1" /boot/config.txt || echo "start_x=1" >> /boot/config.txt
grep -q "gpu_mem=128" /boot/config.txt || echo "gpu_mem=128" >> /boot/config.txt
grep -q "dtoverlay=spi0-1cs,cs0_pin=7" /boot/config.txt || echo "dtoverlay=spi0-1cs,cs0_pin=7" >> /boot/config.txt

# Update keyboard layout.
sed -i -e 's/"gb"/"us"/' /etc/default/keyboard

# Disable screen reader prompt
mv /usr/share/piwiz/srprompt.wav /usr/share/piwiz/srprompt.wav.bak

# Update PulseAudio config.
mkdir -p /etc/pulse/daemon.conf.d/
echo "default-sample-rate = 48000" > /etc/pulse/daemon.conf.d/aiy.conf

################################################################################
#################################### pi user ###################################
################################################################################

# Copy overlay.
tar -cf - -C "${OVERLAY_DIR}" --owner=pi --group=pi . | tar -xf - -C /

# Update desktop wallpaper.
mkdir -p /home/pi/.config/pcmanfm/LXDE-pi
sed "s:wallpaper=.*:wallpaper=/home/pi/.local/share/AIY-wallpaper.png:" \
               /etc/xdg/pcmanfm/LXDE-pi/desktop-items-0.conf > \
               /home/pi/.config/pcmanfm/LXDE-pi/desktop-items-0.conf
chown -R pi:pi /home/pi/.config

# Clone AIY python library.
readonly LOCAL_PYTHON_DIR=/home/pi/AIY-projects-python
rm -rf "${LOCAL_PYTHON_DIR}"
git clone "${PYTHON_DIR}" "${LOCAL_PYTHON_DIR}"
pushd "${LOCAL_PYTHON_DIR}"
git remote remove origin
git checkout -B aiyprojects
git remote add origin https://github.com/google/aiyprojects-raspbian
git config branch.aiyprojects.remote origin
git config branch.aiyprojects.merge refs/heads/aiyprojects
popd
chown -R pi:pi "${LOCAL_PYTHON_DIR}"

# Create symlinks.
ln -sf "${LOCAL_PYTHON_DIR}" /home/pi/AIY-voice-kit-python
chown -R pi:pi /home/pi/AIY-voice-kit-python
ln -sf /opt/aiy/models /home/pi/models
chown -R pi:pi /home/pi/models

# Setup joy detection demo service.
"${LOCAL_PYTHON_DIR}/src/examples/vision/joy/install-services.sh"

# Install AIY python library *globally*.
pip3 install --no-deps -e "${LOCAL_PYTHON_DIR}"


text:
<!doctype html>

  <meta charset="utf-8">

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>BoardHood</title>
  <meta name="description" content="">

  <meta name="viewport" content="width=device-width">

  <link rel="Shortcut Icon" type="image/x-icon" href="favicon.ico" />

  <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/style.css">

Engage into conversations about things that matter to you.

About

Api


text:
/*!
 * V4Fire Client Core
 * https://github.com/V4Fire/Client
 *
 * Released under the MIT license
 * https://github.com/V4Fire/Client/blob/master/LICENSE
 */

import { test as base } from '@playwright/test';

import DemoPage from 'pages/p-v4-components-demo/test/api/page';

export interface Fixtures {
	demoPage: DemoPage;
}

const test = base.extend<Fixtures>({
	/**
	 * Returns an instance of the demo page
	 *
	 * @param obj
	 * @param fixture
	 */
	demoPage: ({page, baseURL}, fixture) => fixture(new DemoPage(page, <string>baseURL))
});

export default test;


text:
namespace extensions {

ManifestPermission::ManifestPermission() {}

ManifestPermission::~ManifestPermission() { }

}  // namespace extensions


text:
import {Component} from 'angular2/core';
import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common';
import {Rating} from '../../../ng2-bootstrap';

// webpack html imports
let template = require('./rating-demo.html');

@Component({
  selector: 'rating-demo',
  directives: [Rating, FORM_DIRECTIVES, CORE_DIRECTIVES],
  template: template
})
export class RatingDemo {
  public x:number = 5;
  public y:number = 2;
  public max:number = 10;
  public rate:number = 7;
  public isReadonly:boolean = false;

  public overStar:number;
  public percent:number;

  public ratingStates:any = [
    {stateOn: 'glyphicon-ok-sign', stateOff: 'glyphicon-ok-circle'},
    {stateOn: 'glyphicon-star', stateOff: 'glyphicon-star-empty'},
    {stateOn: 'glyphicon-heart', stateOff: 'glyphicon-ban-circle'},
    {stateOn: 'glyphicon-heart'},
    {stateOff: 'glyphicon-off'}
  ];

  public hoveringOver(value:number):void {
    this.overStar = value;
    this.percent = 100 * (value / this.max);
  };

  public resetStar():void {
    this.overStar = void 0;
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Elasticsearch.Net;
using FluentAssertions;
using Nest.Tests.MockData;
using Nest.Tests.MockData.Domain;
using NUnit.Framework;

namespace Nest.Tests.Integration.Core
{
	[TestFixture]
	public class DeleteTests : IntegrationTests
	{
		[Test]
		public void ShouldNotThrowOnIdOverload()
		{
			Assert.Throws<ArgumentNullException>(() =>
			{
				this.Client.Delete("id", d=>d.Index("someindex").Type("sometype"));
			});
		}

		[Test]
		public void ShouldThowOnNullId()
		{
			Assert.Throws<ArgumentNullException>(() =>
			{
				this.Client.Delete<object>(d=>d.Index("someindex").Type("sometype").Id(null));
			});
		}

		[Test]
		public void GetDocumentById()
		{

			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var firstName = NestTestData.Data.First().Followers.First().FirstName.ToLowerInvariant();
			var queryResults = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q=>
					q.Fuzzy(fq=>fq.OnField(p=>p.Followers.First().FirstName).Value(firstName + "x"))
				)
			);

			Assert.Greater(queryResults.Total, 0);

			var hit = queryResults.HitsMetaData.Hits.First();
			var documentToFind = hit.Source;

			//act
			//attempt to grab the same document using the document's id
			var foundDocument = this.Client.Source<ElasticsearchProject>(hit.Id, newIndex);

			//assert
			//make sure that these are in fact the same documents
			Assert.AreEqual(documentToFind.Country, foundDocument.Country);
			Assert.AreEqual(documentToFind.Followers.Count, foundDocument.Followers.Count);
			Assert.AreEqual(documentToFind.Id, foundDocument.Id);
			Assert.AreEqual(documentToFind.Name, foundDocument.Name);
		}

		[Test]
		public void IndexThanDeleteDocumentById()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var newDocument = new ElasticsearchProject
			{
				Country = "Mozambique",
				Followers = new List<Person>(),
				Id = DateTime.Now.Millisecond + 1500,
				Name = "Test Document for 'IndexDocument' test"
			};

			this.Client.Index<ElasticsearchProject>(newDocument, i=>i.Index(newIndex).Refresh());

			var foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);

			Assert.AreEqual(newDocument.Followers.Count, foundDocument.Followers.Count);
			Assert.AreEqual(newDocument.Id, foundDocument.Id);
			Assert.AreEqual(newDocument.Name, foundDocument.Name);

			var response = this.Client.Delete<ElasticsearchProject>(f=>f.Id(newDocument.Id).Index(newIndex).Refresh());

			foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);
			Assert.Null(foundDocument);
		}
		[Test]
		public void IndexThanDeleteDocumentByObject()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var newDocument = new ElasticsearchProject
			{
				Country = "Mozambique",
				Followers = new List<Person>(),
				Id = DateTime.Now.Millisecond + 1500, //try to get this example out of the way of existing test data
				Name = "Test Document for 'IndexDocument' test"
			};

			//act
			//index the new item
			this.Client.Index(newDocument, i=>i.Refresh().Index(newIndex));

			//assert
			//grab document back from the index and make sure it is the same document
			var foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);

			//Assert.Equal(newDocument.Country, foundDocument.Country);
			Assert.AreEqual(newDocument.Followers.Count, foundDocument.Followers.Count);
			Assert.AreEqual(newDocument.Id, foundDocument.Id);
			Assert.AreEqual(newDocument.Name, foundDocument.Name);

			//act
			//now remove the item that was added
			this.Client.Delete<ElasticsearchProject>(f=>f.IdFrom(newDocument).Refresh().Index(newIndex));

			//assert
			//make sure getting by id returns nothing
			foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);
			Assert.Null(foundDocument);
		}

		[Test]
		public void IndexThenDeleteUsingRefresh()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var newDocument = new ElasticsearchProject
			{
				Country = "Mozambique",
				Followers = new List<Person>(),
				Id = DateTime.Now.Millisecond + 1500,
				Name = "Test Document for 'IndexDocument' test"
			};

			this.Client.Index(newDocument, i=>i.Refresh().Index(newIndex));

			//grab document back from the index and make sure it is the same document
			var foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);

			Assert.AreEqual(newDocument.Followers.Count, foundDocument.Followers.Count);
			Assert.AreEqual(newDocument.Id, foundDocument.Id);
			Assert.AreEqual(newDocument.Name, foundDocument.Name);

			//now remove the item that was added
			this.Client.Delete<ElasticsearchProject>(d=>d.IdFrom(newDocument).Refresh().Index(newIndex));

			//make sure getting by id returns nothing
			foundDocument = this.Client.Source<ElasticsearchProject>(newDocument.Id, newIndex);
			Assert.Null(foundDocument);
		}
		[Test]
		public void RemoveAllByPassingAsIEnumerable()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var result = this.Client.Search<ElasticsearchProject>(q => q
				.Index(newIndex)
				.From(0)
				.Take(5)
				.MatchAll()
			);
			Assert.IsNotEmpty(result.Documents);

			var totalSet = result.Documents.Count();
			var totalResults = result.Total;
			Assert.Greater(totalSet, 0);

			var deleteResult = this.Client.Bulk(b => b
				.FixedPath(newIndex)
				.DeleteMany(result.Documents).Refresh()
			);
			Assert.True(deleteResult.IsValid, deleteResult.ConnectionStatus.ResponseRaw.Utf8String());
			Assert.False(deleteResult.Errors, deleteResult.ConnectionStatus.ResponseRaw.Utf8String());

			Assert.IsNotEmpty(deleteResult.Items);

			result = this.Client.Search<ElasticsearchProject>(q => q.Index(newIndex).MatchAll());
			Assert.IsNotEmpty(result.Documents);
			Assert.AreEqual(result.Total, totalResults - totalSet);

		}
		[Test]
		public void RemoveAllByPassingAsIEnumerableOfBulkParameters()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.MatchAll()
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			var totalSet = result.Documents.Count();
			Assert.Greater(totalSet, 0);
			var totalResults = result.Total;

			var deleteResult = this.Client.Bulk(b=>b
				.FixedPath(newIndex)
				.DeleteMany(result.Documents, (p, o) => p.VersionType(VersionType.Internal))
				.Refresh()
			);
			Assert.True(deleteResult.IsValid, deleteResult.ConnectionStatus.ResponseRaw.Utf8String());
			Assert.False(deleteResult.Errors, deleteResult.ConnectionStatus.ResponseRaw.Utf8String());

			Assert.IsNotEmpty(deleteResult.Items);

			result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.MatchAll()
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			Assert.AreEqual(result.Total, totalResults - totalSet);
		}
		[Test]
		public void RemoveAllByQuery()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			var totalSet = result.Documents.Count();
			Assert.Greater(totalSet, 0);
			var totalResults = result.Total;
			var deleteResult = this.Client.DeleteByQuery<ElasticsearchProject>(d => d
				.Index(newIndex)
				.Query(q=>q
					.Term(f => f.Name, "elasticsearch.pm")
				)
			);

			deleteResult.IsValid.Should().BeTrue();

			result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			Assert.True(result.Total == 0);

			//make sure we did not delete all.
			var countResult = this.Client.Count(c=>c
				.Index(newIndex)
				.Query(q => q.MatchAll())
			);
			Assert.True(countResult.IsValid);
			Assert.Greater(countResult.Count, 0);

		}
		[Test]
		public void RemoveAllByTermQuery()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);

			var result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			var totalSet = result.Documents.Count();
			Assert.Greater(totalSet, 0);
			var totalResults = result.Total;
			var deleteResult = this.Client.DeleteByQuery<ElasticsearchProject>(d => d
				.Index(newIndex)
				.Query(q=>q
					.Term(f => f.Name, "elasticsearch.pm")
				)
			);

			deleteResult.IsValid.Should().BeTrue();

			result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			Assert.True(result.Total == 0);

			//make sure we did not delete all.
			var countResult = this.Client.Count<ElasticsearchProject>(c=>c
				.Index(newIndex)
				.Query(q => q.MatchAll())
			);
			Assert.True(countResult.IsValid);
			Assert.Greater(countResult.Count, 0);
		}
		[Test]
		public void RemoveAllByQueryOverIndices()
		{
			var newIndex = IntegrationSetup.CreateNewIndexWithData(this.Client);
			var result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			var totalSet = result.Documents.Count();
			Assert.Greater(totalSet, 0);
			var totalResults = result.Total;
			this.Client.DeleteByQuery<ElasticsearchProject>(d => d
				.Indices(new[]
				{
					newIndex
				})
				.Query(q=>q
					.Term(f => f.Name, "elasticsearch.pm")
				)
			);

			result = this.Client.Search<ElasticsearchProject>(s => s
				.Index(newIndex)
				.Query(q => q.Term(f => f.Name, "elasticsearch.pm"))
			);
			Assert.IsNotNull(result);
			Assert.IsNotNull(result.Documents);
			Assert.True(result.Total == 0);

			//make sure we did not delete all.
			var countResult = this.Client.Count<ElasticsearchProject>(c=>c
				.Index(newIndex)
				.Query(q => q.MatchAll())
			);
			Assert.True(countResult.IsValid);
			Assert.Greater(countResult.Count, 0);

		}

		[Test]
		public void DeleteByQuery()
		{
			var response = this.Client.DeleteByQuery<ElasticsearchProject>(d => d
				.Query(q => q
					.Match(m => m
						.OnField(p => p.Name)
						.Query("elasticsearch")
					)
				)
			);

			response.IsValid.Should().BeTrue();
			response.Indices.Should().NotBeNull();
			response.Indices.Should().ContainKey(ElasticsearchConfiguration.DefaultIndex);

			var indexDetails = response.Indices[ElasticsearchConfiguration.DefaultIndex];
			indexDetails.Should().NotBeNull();
			indexDetails.Shards.Successful.Should().BeGreaterThan(0);
			indexDetails.Shards.Failed.Should().Be(0);
		}
	}
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for C:\projects\OpenTribes\Core/vendor/silex/silex/src/Silex/Route.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

C:\projects\OpenTribes\Core /

vendor /

silex /

silex /

src /

Silex /

Route.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

0.00%

0 / 1

54.55%

6 / 11

      CRAP

57.14%

16 / 28

      Route

0.00%

0 / 1

54.55%

6 / 11

      20.52

57.14%

16 / 28

       __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())

100.00%

1 / 1

      1

100.00%

2 / 2

       run($to)

0.00%

0 / 1

      2

0.00%

0 / 2

       assert($variable, $regexp)

100.00%

1 / 1

      1

100.00%

2 / 2

       value($variable, $default)

100.00%

1 / 1

      1

100.00%

2 / 2

       convert($variable, $callback)

0.00%

0 / 1

      2

0.00%

0 / 4

       method($method)

100.00%

1 / 1

      1

100.00%

2 / 2

       host($host)

0.00%

0 / 1

      2

0.00%

0 / 2

       requireHttp()

0.00%

0 / 1

      2

0.00%

0 / 2

       requireHttps()

0.00%

0 / 1

      2

0.00%

0 / 2

       before($callback)

100.00%

1 / 1

      1

100.00%

4 / 4

       after($callback)

100.00%

1 / 1

      1

100.00%

4 / 4

1
	<?php

2

3

11

12
	namespace Silex;

13

14
	use Symfony\Component\Routing\Route as BaseRoute;

15

16
	/**

17
	 * A wrapper for a controller, mapped to a route.

18
	 *

19
	 * @author Fabien Potencier <fabien@symfony.com>

20
	 */

21
	class Route extends BaseRoute

22
	{

23
	    /**

24
	     * Constructor.

25
	     *

26
	     * Available options:

27
	     *

28
	     *  * compiler_class: A class name able to compile this route instance (RouteCompiler by default)

29
	     *

30
	     * @param string       $path         The path pattern to match

31
	     * @param array        $defaults     An array of default parameter values

32
	     * @param array        $requirements An array of requirements for parameters (regexes)

33
	     * @param array        $options      An array of options

34
	     * @param string       $host         The host pattern to match

35
	     * @param string|array $schemes      A required URI scheme or an array of restricted schemes

36
	     * @param string|array $methods      A required HTTP method or an array of restricted methods

37
	     */

38
	    public function __construct($path = '/', array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array())

39
	    {

40
	        // overridden constructor to make $path optional

41
	        parent::__construct($path, $defaults, $requirements, $options, $host, $schemes, $methods);

42
	    }

43

44
	    /**

45
	     * Sets the route code that should be executed when matched.

46
	     *

47
	     * @param callable $to PHP callback that returns the response when matched

48
	     *

49
	     * @return Route $this The current Route instance

50
	     */

51
	    public function run($to)

52
	    {

53
	        $this->setDefault('_controller', $to);

54

55
	        return $this;

56
	    }

57

58
	    /**

59
	     * Sets the requirement for a route variable.

60
	     *

61
	     * @param string $variable The variable name

62
	     * @param string $regexp   The regexp to apply

63
	     *

64
	     * @return Route $this The current route instance

65
	     */

66
	    public function assert($variable, $regexp)

67
	    {

68
	        $this->setRequirement($variable, $regexp);

69

70
	        return $this;

71
	    }

72

73
	    /**

74
	     * Sets the default value for a route variable.

75
	     *

76
	     * @param string $variable The variable name

77
	     * @param mixed  $default  The default value

78
	     *

79
	     * @return Route $this The current Route instance

80
	     */

81
	    public function value($variable, $default)

82
	    {

83
	        $this->setDefault($variable, $default);

84

85
	        return $this;

86
	    }

87

88
	    /**

89
	     * Sets a converter for a route variable.

90
	     *

91
	     * @param string $variable The variable name

92
	     * @param mixed  $callback A PHP callback that converts the original value

93
	     *

94
	     * @return Route $this The current Route instance

95
	     */

96
	    public function convert($variable, $callback)

97
	    {

98
	        $converters = $this->getOption('_converters');

99
	        $converters[$variable] = $callback;

100
	        $this->setOption('_converters', $converters);

101

102
	        return $this;

103
	    }

104

105
	    /**

106
	     * Sets the requirement for the HTTP method.

107
	     *

108
	     * @param string $method The HTTP method name. Multiple methods can be supplied, delimited by a pipe character '|', eg. 'GET|POST'

109
	     *

110
	     * @return Route $this The current Route instance

111
	     */

112
	    public function method($method)

113
	    {

114
	        $this->setMethods(explode('|', $method));

115

116
	        return $this;

117
	    }

118

119
	    /**

120
	     * Sets the requirement of host on this Route.

121
	     *

122
	     * @param string $host The host for which this route should be enabled

123
	     *

124
	     * @return Route $this The current Route instance

125
	     */

126
	    public function host($host)

127
	    {

128
	        $this->setHost($host);

129

130
	        return $this;

131
	    }

132

133
	    /**

134
	     * Sets the requirement of HTTP (no HTTPS) on this Route.

135
	     *

136
	     * @return Route $this The current Route instance

137
	     */

138
	    public function requireHttp()

139
	    {

140
	        $this->setSchemes('http');

141

142
	        return $this;

143
	    }

144

145
	    /**

146
	     * Sets the requirement of HTTPS on this Route.

147
	     *

148
	     * @return Route $this The current Route instance

149
	     */

150
	    public function requireHttps()

151
	    {

152
	        $this->setSchemes('https');

153

154
	        return $this;

155
	    }

156

157
	    /**

158
	     * Sets a callback to handle before triggering the route callback.

159
	     *

160
	     * @param mixed $callback A PHP callback to be triggered when the Route is matched, just before the route callback

161
	     *

162
	     * @return Route $this The current Route instance

163
	     */

164
	    public function before($callback)

165
	    {

166
	        $callbacks = $this->getOption('_before_middlewares');

167
	        $callbacks[] = $callback;

168
	        $this->setOption('_before_middlewares', $callbacks);

169

170
	        return $this;

171
	    }

172

173
	    /**

174
	     * Sets a callback to handle after the route callback.

175
	     *

176
	     * @param mixed $callback A PHP callback to be triggered after the route callback

177
	     *

178
	     * @return Route $this The current Route instance

179
	     */

180
	    public function after($callback)

181
	    {

182
	        $callbacks = $this->getOption('_after_middlewares');

183
	        $callbacks[] = $callback;

184
	        $this->setOption('_after_middlewares', $callbacks);

185

186
	        return $this;

187
	    }

188
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.17 using PHP 5.5.6 and PHPUnit 3.7.34 at Sat Apr 5 13:10:46 CEST 2014.


text:
\documentclass[a2,landscape]{a0poster}
\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage{postercols}
\usepackage{flowfram}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{tikz}

%\usepackage[top=0.5in, bottom=0.5in, left=0.5in, right=0.5in]{geometry}
\usepackage[top=0.5in, bottom=0.5in, left=0.25in, right=0.25in]{geometry}

\setlength{\vcolumnsep}{\baselineskip}
%\setlength{\columnsep}{\vcolumnsep}
\setlength{\columnsep}{1.25in}
\Ncolumntop{static}{3}{1.75in}
\setstaticframe{1}{label={title}}
\newlength\offset
\setlength{\offset}{5in}
\addtolength{\offset}{\vcolumnsep}

%\computeflowframearea{2,3}
%\addtolength{\ffareaheight}{-\offset}
%\setflowframe{2,3}{y=\offset,height=\ffareaheight}
%\newstaticframe{\ffareawidth}{5in}{\ffareax}{0in}[table]

\newcommand{\redborder}[1]{\tikz \node[draw,rectangle,blue] {#1};}

%\setstaticframe{2}{clear}
%]{hwidthi}{hheighti}{hxi}{hyi}[hlabeli]

%\setallflowframes{border=plain, bordercolor=blue}
%\setallstaticframes{border=plain, bordercolor=blue}
%\setallflowframes{border=redborder}
\title{Locy: Energy-efficient sensing with Android smartphones.}
\author{Martin Kukla (Supervisor: Dr Tristan Henderson)}
\date{}
\begin{document}
\begin{staticcontents*}{title}
\maketitle
\end{staticcontents*}
\thispagestyle{empty}

\setlength{\tabcolsep}{3pt}

\begin{center}
\section*{Introduction}
\end{center}

\begin{itemize}
   \item Phone sensing may be utilized by mobile applications to provide \textbf{advanced services} such as navigation systems.

\begin{center}
	\includegraphics[scale=0.078]{plots/logo_yelp}
	\includegraphics[scale=0.36]{plots/logo_apple_maps}
   \includegraphics[scale=0.34]{plots/logo_google_maps}
	\includegraphics[scale=0.3]{plots/logo_facebook}
	\includegraphics[scale=0.4]{plots/logo_mhealth}\\
	\includegraphics[scale=0.4]{plots/logo_foursquare}
	\includegraphics[scale=1.2]{plots/logo_google_now}
\end{center}

   \item \textbf{Phone sensing} fetches raw sensor data\ (e.g. from an accelerometer) and tries to extract high-level information from it\ (e.g. a user is walking).
   \item Phone sensing has \textbf{high energy demands}, which is crucially important to mobile phone users.
   \item To solve the problem:
	   \begin{itemize}
   			\item investigate three different devices.
   			\item establish the energy efficiency of their sensors.
   			\item leverage results for energy-efficient sensing.
   			\item build \textbf{Locy}, an energy efficient sensing library.
   			\item evaluate its energy efficiency in real-life scenarios.
	   \end{itemize}
  \end{itemize}

\vspace{0.9cm}
\begin{center}
\includegraphics[scale=0.7]{plots/low_battery}
\includegraphics[scale=0.7]{plots/sad_face}
\end{center}

\mbox{}\framebreak
\begin{center}
\section*{Solution}
\end{center}
\begin{itemize}
   \item Energy efficiency of sensors are \textbf{different among the three devices}.\\
   \includegraphics[width=16cm, height=7.5cm]{plots/shared}

\vspace{0.35cm}
 \begin{tabular}[t]{p{8.0cm} p{9.0cm}}
       \vspace{0cm} However, \textbf{accelerometer is always more energy-efficient} than the standard localization sensors. & \vspace{0cm}\includegraphics[width=8cm, height=5.75cm]{plots/acc_vs_loc}
      \end{tabular}

   \item \textbf{Locy} leverages an efficient \textbf{accelerometer}:
  	   \begin{itemize}
  	   \item if a user is not moving, it \textbf{switches off GPS}.
  	   \item \textbf{movement detection} based on "peaks"\ (steps):
  	   %based on the standard deviation of the total magnitude over accelerometer data).\\

  	   \hspace{0.75cm}\includegraphics[scale=0.4]{plots/walking}
	   \includegraphics[scale=0.4]{plots/no_walking}
  	   \item Locy uses \textbf{duty-cycling sampling}\ (sleeping periods interleaves sampling), whose ratio\ (sampling over sleeping periods) is \textbf{adaptive according to current battery life}.
    \end{itemize}
  \end{itemize}

\mbox{}\framebreak
\begin{center}
\section*{Evaluation}
\end{center}
\begin{itemize}
   \item \textbf{scenario one}:

\begin{tabular}[t]{p{8.0cm} p{8.0cm}}
       \vspace{0cm}\includegraphics[scale=0.65]{plots/locy_eval_inplace} &  \vspace{0cm}While a user is staying in one place, Locy is more energy-efficient than the naive GPS localization.
      \end{tabular}
\vspace{0.3cm}
   \item \textbf{scenario two}:

\begin{tabular}[t]{p{8.0cm} p{8.0cm}}
	\vspace{0cm}\includegraphics[scale=0.65]{plots/locy_eval_other} &  \vspace{0cm}While a user is half of the time moving and the rest of the time he is staying in one place, Locy is more energy-efficient than the naive GPS localization.
\end{tabular}
  \end{itemize}

\begin{center}
\section*{Conclusions}
\end{center}

\textbf{Locy} is more energy-efficient than the standard Android implementation.
\vspace{2.6cm}
\begin{center}
\includegraphics[scale=0.7]{plots/full_battery}
\includegraphics[scale=0.7]{plots/happy_face}
\end{center}

\end{document}


text:
{% load thumbnail %}
{% load i18n %}
{% if recent_products %}

{% trans 'Recently Viewed' %}

{% for item in recent_products %}

    {% thumbnail item.main_image.picture 85x85 as image %}

    {{ item.translated_name }}

{% endfor %}

{% endif %}


text:
var client = new AnalyticsClient().init(null, null, "https://"+location.hostname +":"+ location.port +"/admin-dashboard/modules/la/log-analyzer-proxy.jag");
var canvasDiv = "#canvas";
var table, chart;
var fromTime = gadgetUtil.timeFrom();
var toTime = gadgetUtil.timeTo();
var async_tasks = gadgetConfig.status.length;
var receivedData = [];
var initState = true;
var recordCount = 0;

var meta = {
    "names": ["Status", "Count", "StatusId"],
    "types": ["ordinal", "linear", "ordinal"]
};

var configChart = {
    colorScale: ["#438CAD", "#5CB85C", "#EECA5A", "#95A5A6"],
    type: "bar",
    x: "Status",
    color: "Status",
    charts: [{y: "Count"}],
    width: $('body').width(),
    height: $('body').height(),
    padding: {"top": 10, "left": 80, "bottom": 70, "right": 200}
};

function initialize() {
    fetch();
    $(canvasDiv).html(gadgetUtil.getDefaultText());
}

$(document).ready(function () {
    initialize();
});

function fetch(statusType) {
    if (!statusType) {
        receivedData.length = 0;
        statusType = 0;
    }
    var queryInfo = {
        tableName: "LOGANALYZER_APIKEY_STATUS",
        searchParams: {
            query: "status:" + gadgetConfig.status[statusType] + " AND  _timestamp: [" + fromTime + " TO " + toTime + "]"
        }
    };

    client.searchCount(queryInfo, function (d) {
        if (d["status"] === "success") {
            recordCount = recordCount + parseInt(d["message"]);
            receivedData.push([gadgetConfig.statusDescription[statusType], parseInt(d["message"]), gadgetConfig.status[statusType]]);
            async_tasks--;
            if (async_tasks == 0) {
                if (!initState) {
                    redrawApiKeyStatus();
                    recordCount = 0;
                } else {
                    drawApiKeyStatus();
                    initState = false;
                    recordCount = 0;
                }
            } else {
                fetch(++statusType);
            }
        }
    }, function (error) {
        if(error === undefined){
            onErrorCustom("Analytics server not found.", "Please troubleshoot connection problems.");
            console.log("Analytics server not found : Please troubleshoot connection problems.");
        }else{
            error.message = "Internal server error while data indexing.";
            onError(error);
            console.log(error);
        }
    });

}

function drawApiKeyStatus() {
    try {
        $(canvasDiv).empty();
        if(recordCount>0){
            chart = new vizg(
                [
                    {
                        "metadata": this.meta,
                        "data": receivedData
                    }
                ],
                configChart
            );
            chart.draw(canvasDiv, [
                {
                    type: "click",
                    callback: onclick
                }
            ]);
        }else{
            $(canvasDiv).html(gadgetUtil.getEmptyRecordsText());
        }
    } catch (error) {
        error.message = "Error while drawing log event chart.";
        error.status = "";
        onError(error);
    }
}

function redrawApiKeyStatus() {
    try {
        if(recordCount>0){
            for (var i in receivedData) {
                chart.insert([receivedData[i]]);
            }
        }else{
            $(canvasDiv).html(gadgetUtil.getEmptyRecordsText());
        }
    } catch (error) {
        console.log(error);
        error.message = "Error while drawing log event chart.";
        error.status = "";
        onError(error);
    }
}

function publish(data) {
    gadgets.Hub.publish("publisher", data);
};

var onclick = function (event, item) {
    if (item != null) {
        publish(
            {
                "selected": item.datum.StatusId,
                "fromTime": fromTime,
                "toTime":toTime,
                "count": item.datum.Count
            }
        );
    }
};

function subscribe(callback) {
    gadgets.HubSettings.onConnect = function () {
        gadgets.Hub.subscribe("subscriber", function (topic, data, subscriber) {
            callback(topic, data, subscriber)
        });
    };
}

subscribe(function (topic, data, subscriber) {
    fromTime = parseInt(data["timeFrom"]);
    toTime = parseInt(data["timeTo"]);
    async_tasks = gadgetConfig.status.length;
    fetch();
});

function onError(msg) {
    $(canvasDiv).html(gadgetUtil.getErrorText(msg));
}

function onErrorCustom(title, message) {
    $(canvasDiv).html(gadgetUtil.getCustemText(title, message));
}


text:
struct my_json_data make_data();
struct my_json_container make_container();
struct my_json_basic_container make_basic_container();
struct json_object *make_json_obj();
struct json_object *make_json_container_obj();
struct json_object *make_json_basic_container_obj();
void test_data(struct my_json_data data, struct json_object *obj);
void test_container(struct my_json_container, struct json_object *obj);

#endif


text:
package com.capitalone.dashboard.evaluator;

import com.capitalone.dashboard.common.CommonCodeReview;
import com.capitalone.dashboard.misc.HygieiaException;
import com.capitalone.dashboard.model.AuditException;
import com.capitalone.dashboard.model.Build;
import com.capitalone.dashboard.model.CollectorItem;
import com.capitalone.dashboard.model.CollectorItemConfigHistory;
import com.capitalone.dashboard.model.CollectorType;
import com.capitalone.dashboard.model.Dashboard;
import com.capitalone.dashboard.model.RepoBranch;
import com.capitalone.dashboard.repository.BuildRepository;
import com.capitalone.dashboard.repository.CollItemConfigHistoryRepository;
import com.capitalone.dashboard.repository.CommitRepository;
import com.capitalone.dashboard.response.BuildAuditResponse;
import com.capitalone.dashboard.status.BuildAuditStatus;
import com.capitalone.dashboard.util.GitHubParsedUrl;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

@Component
public class BuildEvaluator extends Evaluator<BuildAuditResponse> {

    private final BuildRepository buildRepository;
    private final CollItemConfigHistoryRepository collItemConfigHistoryRepository;
    private final CommitRepository commitRepository;

    @Autowired
    public BuildEvaluator(BuildRepository buildRepository, CollItemConfigHistoryRepository collItemConfigHistoryRepository, CommitRepository commitRepository) {
        this.buildRepository = buildRepository;
        this.collItemConfigHistoryRepository = collItemConfigHistoryRepository;
        this.commitRepository = commitRepository;
    }

    @Override
    public Collection<BuildAuditResponse> evaluate(Dashboard dashboard, long beginDate, long endDate, Map<?, ?> data) throws AuditException {
        List<CollectorItem> buildItems = getCollectorItems(dashboard, "build", CollectorType.Build);
        List<CollectorItem> repoItems = getCollectorItems(dashboard, "repo", CollectorType.SCM);

        if (CollectionUtils.isEmpty(buildItems)) {
            throw new AuditException("No code repository configured", AuditException.NO_COLLECTOR_ITEM_CONFIGURED);
        }

        Map<String, List<CollectorItem>> repoData = new HashMap<>();
        repoData.put("repos", repoItems);
        return buildItems.stream().map(item -> evaluate(item, beginDate, endDate, repoData)).collect(Collectors.toList());
    }

    @Override
    public BuildAuditResponse evaluate(CollectorItem collectorItem, long beginDate, long endDate, Map<?, ?> data) {
        List<CollectorItem> repoItems = (List<CollectorItem>) data.get("repos");
        return getBuildJobAuditResponse(collectorItem, beginDate, endDate, repoItems);
    }

    private class ParsedRepo {
        String url;
        String branch;

        ParsedRepo(String url, String branch) {
            this.url = new GitHubParsedUrl(url).getUrl();
            this.branch = branch;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        String getBranch() {
            return branch;
        }

        public void setBranch(String branch) {
            this.branch = branch;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            ParsedRepo that = (ParsedRepo) o;
            return Objects.equals(getUrl(), that.getUrl()) &&
                    Objects.equals(getBranch(), that.getBranch());
        }

        @Override
        public int hashCode() {

            return Objects.hash(getUrl(), getBranch());
        }
    }
    /**
     * Calculates Audit Response for a given dashboard
     *
     * @param beginDate
     * @param endDate
     * @return BuildAuditResponse for the build job for a given dashboard, begin and end date
     */
    private BuildAuditResponse getBuildJobAuditResponse(CollectorItem buildItem, long beginDate, long endDate, List<CollectorItem> repoItems) {

        BuildAuditResponse buildAuditResponse = new BuildAuditResponse();
        List<CollectorItemConfigHistory> jobConfigHists = collItemConfigHistoryRepository.findByCollectorItemIdAndTimestampIsBetweenOrderByTimestampDesc(buildItem.getId(), beginDate - 1, endDate + 1);

        //Check Jenkins Job config log to validate pr author is not modifying the Prod Job
        //since beginDate and endDate are the same column and between is excluding the edge values, we need to subtract/add a millisec
        buildAuditResponse.setConfigHistory(jobConfigHists);

        if (!CollectionUtils.isEmpty(repoItems)) {
            Build build = buildRepository.findTop1ByCollectorItemIdOrderByTimestampDesc(buildItem.getId());
            if (build != null) {
                List<RepoBranch> repoBranches = build.getCodeRepos();

                List<ParsedRepo> codeRepos = repoItems.stream().map(r -> new ParsedRepo((String)r.getOptions().get("url"), (String)r.getOptions().get("branch"))).collect(Collectors.toList());
                List<ParsedRepo> buildRepos = repoBranches.stream().map(b -> new ParsedRepo(b.getUrl(), b.getBranch())).collect(Collectors.toList());

                List<ParsedRepo> intersection =  codeRepos.stream().filter(buildRepos::contains).collect(Collectors.toList());

                buildAuditResponse.addAuditStatus(CollectionUtils.isEmpty(intersection) ? BuildAuditStatus.BUILD_REPO_MISMATCH : BuildAuditStatus.BUILD_MATCHES_REPO);
            } else {
                buildAuditResponse.addAuditStatus(BuildAuditStatus.NO_BUILD_FOUND);
            }
        }
        Set<String> codeAuthors = CommonCodeReview.getCodeAuthors(repoItems, beginDate, endDate, commitRepository);
        List<String> overlap = jobConfigHists.stream().map(CollectorItemConfigHistory::getUserID).filter(codeAuthors::contains).collect(Collectors.toList());
        buildAuditResponse.addAuditStatus(!CollectionUtils.isEmpty(overlap) ? BuildAuditStatus.BUILD_AUTHOR_EQ_REPO_AUTHOR : BuildAuditStatus.BUILD_AUTHOR_NE_REPO_AUTHOR);
        return buildAuditResponse;
    }

}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Sportify</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
	<link rel="stylesheet" href="stylesheets/SportifyTheme.css" />

Sportify

Find sports events and players in your area

			<button type="button" class="btn-lg btn-default" data-toggle="modal" data-target="#demoModal">Watch demo</button>

Demo

						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

					Sportify 2016

<span class="glyphicon glyphicon-home"


text:
"""Inverse Cloze Task model."""
import functools

from bert import optimization
from language.common.utils import tensor_utils
from language.common.utils import tpu_utils
from language.orqa.datasets import ict_dataset
import tensorflow.compat.v1 as tf
from tensorflow.compat.v1 import estimator as tf_estimator
import tensorflow_hub as hub

def module_fn(is_training, params):
  """Module function."""
  input_ids = tf.placeholder(tf.int32, [None, None], "input_ids")
  input_mask = tf.placeholder(tf.int32, [None, None], "input_mask")
  segment_ids = tf.placeholder(tf.int32, [None, None], "segment_ids")

  bert_module = hub.Module(
      params["bert_hub_module_path"],
      tags={"train"} if is_training else {},
      trainable=True)

  output_layer = bert_module(
      inputs=dict(
          input_ids=input_ids,
          input_mask=input_mask,
          segment_ids=segment_ids),
      signature="tokens",
      as_dict=True)["pooled_output"]
  projected_emb = tf.layers.dense(output_layer, params["projection_size"])
  projected_emb = tf.keras.layers.LayerNormalization(axis=-1)(projected_emb)
  if is_training:
    projected_emb = tf.nn.dropout(projected_emb, rate=0.1)

  hub.add_signature(
      name="projected",
      inputs=dict(
          input_ids=input_ids,
          input_mask=input_mask,
          segment_ids=segment_ids),
      outputs=projected_emb)

  hub.add_signature(
      name="tokenization_info",
      inputs={},
      outputs=bert_module(signature="tokenization_info", as_dict=True))

def create_ict_module(params, mode):
  """Create hub module."""
  tags_and_args = []
  for is_training in (True, False):
    tags = set()
    if is_training:
      tags.add("train")
    tags_and_args.append((tags, dict(is_training=is_training)))
  ict_module_spec = hub.create_module_spec(
      functools.partial(module_fn, params=params),
      tags_and_args=tags_and_args)
  ict_module = hub.Module(
      ict_module_spec,
      tags={"train"} if mode == tf_estimator.ModeKeys.TRAIN else {},
      trainable=True)
  hub.register_module_for_export(ict_module, "ict")
  return ict_module

def model_fn(features, labels, mode, params):
  """Model function."""
  del labels

  # [local_batch_size, block_seq_len]
  block_ids = features["block_ids"]
  block_mask = features["block_mask"]
  block_segment_ids = features["block_segment_ids"]

  # [local_batch_size, query_seq_len]
  query_ids = features["query_ids"]
  query_mask = features["query_mask"]

  local_batch_size = tensor_utils.shape(block_ids, 0)
  tf.logging.info("Model batch size: %d", local_batch_size)

  ict_module = create_ict_module(params, mode)

  query_emb = ict_module(
      inputs=dict(
          input_ids=query_ids,
          input_mask=query_mask,
          segment_ids=tf.zeros_like(query_ids)),
      signature="projected")
  block_emb = ict_module(
      inputs=dict(
          input_ids=block_ids,
          input_mask=block_mask,
          segment_ids=block_segment_ids),
      signature="projected")

  if params["use_tpu"]:
    # [global_batch_size, hidden_size]
    block_emb = tpu_utils.cross_shard_concat(block_emb)

    # [global_batch_size, local_batch_size]
    labels = tpu_utils.cross_shard_pad(tf.eye(local_batch_size))

    # [local_batch_size]
    labels = tf.argmax(labels, 0)
  else:
    # [local_batch_size]
    labels = tf.range(local_batch_size)

  tf.logging.info("Global batch size: %s", tensor_utils.shape(block_emb, 0))

  # [batch_size, global_batch_size]
  logits = tf.matmul(query_emb, block_emb, transpose_b=True)

  # []
  loss = tf.losses.sparse_softmax_cross_entropy(labels=labels, logits=logits)

  train_op = optimization.create_optimizer(
      loss=loss,
      init_lr=params["learning_rate"],
      num_train_steps=params["num_train_steps"],
      num_warmup_steps=min(10000, max(100, int(params["num_train_steps"]/10))),
      use_tpu=params["use_tpu"] if "use_tpu" in params else False)

  predictions = tf.argmax(logits, -1)

  metric_args = [query_mask, block_mask, labels, predictions,
                 features["mask_query"]]
  def metric_fn(query_mask, block_mask, labels, predictions, mask_query):
    masked_accuracy = tf.metrics.accuracy(
        labels=labels,
        predictions=predictions,
        weights=mask_query)
    unmasked_accuracy = tf.metrics.accuracy(
        labels=labels,
        predictions=predictions,
        weights=tf.logical_not(mask_query))
    return dict(
        query_non_padding=tf.metrics.mean(query_mask),
        block_non_padding=tf.metrics.mean(block_mask),
        actual_mask_ratio=tf.metrics.mean(mask_query),
        masked_accuracy=masked_accuracy,
        unmasked_accuracy=unmasked_accuracy)

  if params["use_tpu"]:
    return tf_estimator.tpu.TPUEstimatorSpec(
        mode=mode,
        loss=loss,
        train_op=train_op,
        eval_metrics=(metric_fn, metric_args))
  else:
    return tf_estimator.EstimatorSpec(
        mode=mode,
        loss=loss,
        train_op=train_op,
        eval_metric_ops=metric_fn(*metric_args),
        predictions=predictions)

def input_fn(params, is_train):
  """An input function satisfying the tf.estimator API."""
  dataset = ict_dataset.get_dataset(
      examples_path=params["examples_path"],
      mask_rate=params["mask_rate"],
      bert_hub_module_path=params["bert_hub_module_path"],
      query_seq_len=params["query_seq_len"],
      block_seq_len=params["block_seq_len"],
      num_block_records=params["num_block_records"],
      num_input_threads=params["num_input_threads"])
  batch_size = params["batch_size"] if is_train else params["eval_batch_size"]
  dataset = dataset.batch(batch_size, drop_remainder=True)
  return dataset

def exporter():
  """Create exporters."""
  serving_input_fn = tf_estimator.export.build_raw_serving_input_receiver_fn(
      features=dict(
          block_ids=tf.placeholder(tf.int32, [None, None]),
          block_mask=tf.placeholder(tf.int32, [None, None]),
          block_segment_ids=tf.placeholder(tf.int32, [None, None]),
          query_ids=tf.placeholder(tf.int32, [None, None]),
          query_mask=tf.placeholder(tf.int32, [None, None]),
          mask_query=tf.placeholder(tf.bool, [None])),
      default_batch_size=8)
  return hub.LatestModuleExporter("tf_hub", serving_input_fn, exports_to_keep=1)


text:
package com.github.tonivade.claudb.data;

import static com.github.tonivade.claudb.data.DatabaseKey.safeKey;
import static com.github.tonivade.claudb.data.DatabaseValue.string;
import static com.github.tonivade.resp.protocol.SafeString.safeString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import com.github.tonivade.purefun.Tuple2;
import com.github.tonivade.purefun.data.Sequence;

public class OnHeapDatabaseTest {

  private final Database database = new OnHeapDatabaseFactory().create("test");

  @Test
  public void testDatabase()  {
    database.put(safeKey("a"), string("value"));

    assertThat(database.get(safeKey("a")).getString(), is(safeString("value")));
    assertThat(database.containsKey(safeKey("a")), is(true));
    assertThat(database.containsKey(safeKey("b")), is(false));
    assertThat(database.isEmpty(), is(false));
    assertThat(database.size(), is(1));

    Sequence<DatabaseValue> values = database.values();

    assertThat(values.size(), is(1));
    assertThat(values.contains(string("value")), is(true));

    Sequence<DatabaseKey> keySet = database.keySet();

    assertThat(keySet.size(), is(1));
    assertThat(keySet.contains(safeKey("a")), is(true));

    Sequence<Tuple2<DatabaseKey, DatabaseValue>> entrySet = database.entrySet();

    assertThat(entrySet.size(), is(1));

    Tuple2<DatabaseKey, DatabaseValue> entry = entrySet.iterator().next();

    assertThat(entry.get1(), is(safeKey("a")));
    assertThat(entry.get2(), is(string("value")));
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
	<CommonModule uuid="19bc0dd8-9e6b-4855-bc42-b4e98443163f">
		<Properties>
			<Name>НастройкаРазрешенийНаИспользованиеВнешнихРесурсовГлобальный</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Настройка разрешений на использование внешних ресурсов глобальный</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<Global>true</Global>
			<ClientManagedApplication>true</ClientManagedApplication>
			<Server>false</Server>
			<ExternalConnection>false</ExternalConnection>
			<ClientOrdinaryApplication>true</ClientOrdinaryApplication>
			<ServerCall>false</ServerCall>
			<Privileged>false</Privileged>
			<ReturnValuesReuse>DontUse</ReturnValuesReuse>
		</Properties>
	</CommonModule>
</MetaDataObject>