text:
package org.cactoos.io;

import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.cactoos.scalar.LengthOf;
import org.cactoos.text.TextOf;
import org.hamcrest.core.AllOf;
import org.hamcrest.core.IsNot;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.HasString;

/**
 * Test case for {@link LoggingInput}.
 *
 * @since 0.29
 * @checkstyle JavadocMethodCheck (500 lines)
 */
@SuppressWarnings(
    {
        "PMD.MoreThanOneLogger",
        "PMD.AvoidDuplicateLiterals"
    }
)
final class LoggingInputTest {

    @Test
    void logReadFromDeadInput() throws Exception {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new DeadInput(),
                "dead input",
                logger
            )
        ).value();
        new Assertion<>(
            "Must log zero byte read from dead input",
            new TextOf(logger.toString()),
            new HasString("Read 0 byte(s) from dead input in")
        ).affirm();
    }

    @Test
    void logReadFromOneByte() throws Exception {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new InputOf("a"),
                "memory",
                logger
            )
        ).value();
        new Assertion<>(
            "Must log one byte read from memory",
            new TextOf(logger.toString()),
            new HasString("Read 1 byte(s) from memory in")
        ).affirm();
    }

    @Test
    void logReadFromText() throws Exception {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new InputOf("Hello, товарищ!"),
                "memory",
                logger
            )
        ).value();
        new Assertion<>(
            "Must log 22 bytes read from memory",
            new TextOf(logger.toString()),
            new HasString("Read 22 byte(s) from memory in")
        ).affirm();
    }

    @Test
    @SuppressWarnings("unchecked")
    void logReadFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger();
        new LengthOf(
            new LoggingInput(
                new ResourceOf("org/cactoos/large-text.txt"),
                "text file",
                logger
            )
        ).value();
        new Assertion<>(
            "Must log 74536 bytes read from text file",
            new TextOf(logger.toString()),
            new AllOf<>(
                new IsNot<>(
                    new HasString("Read 16384 byte(s) from text file")
                ),
                new HasString("Read 74536 byte(s) from text file in"),
                new HasString("Closed input stream from text file")
            )
        ).affirm();
    }

    @Test
    @SuppressWarnings("unchecked")
    void logAllFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger(Level.WARNING);
        new LengthOf(
            new LoggingInput(
                new ResourceOf("org/cactoos/large-text.txt"),
                "text file",
                logger
            )
        ).value();
        new Assertion<>(
            "Must log all read and close operations from text file",
            new TextOf(logger.toString()),
            new AllOf<>(
                new HasString("Read 16384 byte(s) from text file"),
                new HasString("Read 32768 byte(s) from text file"),
                new HasString("Read 49152 byte(s) from text file"),
                new HasString("Read 65536 byte(s) from text file"),
                new HasString("Read 74536 byte(s) from text file"),
                new HasString("Closed input stream from text file")
            )
        ).affirm();
    }

    @Test
    void logSkipFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream().skip(100);
        new Assertion<>(
            "Must log skip from text file",
            new TextOf(logger.toString()),
            new HasString("Skipped 100 byte(s) from text file.")
        ).affirm();
    }

    @Test
    void logAvailableFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream().available();
        new Assertion<>(
            "Must log avaliable byte(s) from text file",
            new TextOf(logger.toString()),
            new HasString(
                "There is(are) 74536 byte(s) available from text file"
            )
        ).affirm();
    }

    @Test
    @SuppressWarnings("unchecked")
    void logResetFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger();
        final InputStream input = new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream();
        input.mark(150);
        input.reset();
        new Assertion<>(
            "Must log mark and reset from text file",
            new TextOf(logger.toString()),
            new AllOf<>(
                new HasString("Marked position 150 from text file"),
                new HasString("Reset input stream from text file")
            )
        ).affirm();
    }

    @Test
    void logMarkSupportedFromLargeTextFile() throws Exception {
        final Logger logger = new FakeLogger();
        new LoggingInput(
            new ResourceOf("org/cactoos/large-text.txt"),
            "text file",
            logger
        ).stream().markSupported();
        new Assertion<>(
            "Must log mark and reset are not supported from text file",
            new TextOf(logger.toString()),
            new HasString(
                "Mark and reset are supported from text file"
            )
        ).affirm();
    }

    @Test
    void logIntoCreatedLogger() throws Exception {
        final FakeHandler handler = new FakeHandler();
        final String src = "my source";
        final Logger logger = Logger.getLogger(src);
        logger.addHandler(handler);
        try {
            new LengthOf(
                new LoggingInput(
                    new InputOf("Hi there"),
                    src
                )
            ).value();
            new Assertion<>(
                "",
                new TextOf(handler.toString()),
                new HasString("Read 8 byte(s)")
            ).affirm();
        } finally {
            logger.removeHandler(handler);
        }
    }

}


text:
<?php

namespace Andrew\Exception;

/**
 * @author  Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
 * @license http://opensource.org/licenses/MIT MIT
 * @package Andrew
 */
class PropertyException extends \LogicException
{
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of Person in UD_Greek-GDT</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Greek-GDT: Features: Person

This feature is universal.
It occurs with 3 different values: 1, 2, 3.

9363 tokens (15%) have a non-empty value of Person.
2857 types (25%) occur at least once with a non-empty value of Person.
909 lemmas (14%) occur at least once with a non-empty value of Person.
The feature is used with 3 part-of-speech tags: <tt>VERB</tt> (5400; 9% instances), <tt>PRON</tt> (2899; 5% instances), <tt>AUX</tt> (1064; 2% instances).

VERB

5400 <tt>VERB</tt> tokens (92% of all VERB tokens) have a non-empty value of Person.

The most frequent other feature values with which VERB and Person co-occurred: <tt>VerbForm</tt><tt>=Fin</tt> (5400; 100%), <tt>Mood</tt><tt>=Ind</tt> (5380; 100%), <tt>Voice</tt><tt>=Act</tt> (3841; 71%), <tt>Number</tt><tt>=Sing</tt> (3243; 60%), <tt>Aspect</tt><tt>=Imp</tt> (2795; 52%).

VERB tokens may have the following values of Person:

1 (1004; 19% of non-empty Person): ήθελα, πιστεύω, έχουμε, θέλω, θεωρώ, μπορούμε, ελπίζω, πω, κάνουμε, θέλουμε

2 (119; 2% of non-empty Person): είπατε, επιτρέψτε, Δώστε, έχετε, αναφερθήκατε, επισκεφθείτε, κάνετε, μπορείτε, Αφήστε, βρεθείτε

3 (4277; 79% of non-empty Person): μπορεί, αφορά, έχει, αποτελεί, έχουν, δήλωσε, υπάρχει, βρίσκεται, πρόκειται, μπορούν

EMPTY (467): λέγοντας, γίνει, λάβει, προκαλώντας, χτισμένη, έχοντας, ακολουθώντας, δημιουργήσει, επιτύχει, πει

Paradigm μπορώ	<tt>1</tt>	<tt>2</tt>	<tt>3</tt>

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			μπορούσε

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Pres</tt></tt>	μπορώ		μπορεί

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Past</tt></tt>	μπορούσαμε		μπορούσαν

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Pres</tt></tt>	μπορούμε	μπορείτε	μπορούν

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			μπόρεσε

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Sing</tt></tt>			μπορέσει

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			μπόρεσαν

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Plur</tt></tt>	μπορέσουμε	μπορέσετε	μπορέσουν

PRON

2899 <tt>PRON</tt> tokens (100% of all PRON tokens) have a non-empty value of Person.

The most frequent other feature values with which PRON and Person co-occurred: <tt>Poss</tt><tt>=EMPTY</tt> (2263; 78%), <tt>Number</tt><tt>=Sing</tt> (1715; 59%).

PRON tokens may have the following values of Person:

1 (290; 10% of non-empty Person): μας, μου, εμείς, εγώ, εμάς, με, μένα, του

2 (88; 3% of non-empty Person): σας, εσείς, εσάς

3 (2521; 87% of non-empty Person): που, τους, αυτό, του, αυτή, οποία, της, οποίο, αυτά, το

Paradigm μου	<tt>1</tt>	<tt>2</tt>	<tt>3</tt>

<tt><tt>Gender</tt><tt>=Masc</tt>|<tt>Number</tt><tt>=Sing</tt></tt>	μου, του		του

<tt><tt>Gender</tt><tt>=Masc</tt>|<tt>Number</tt><tt>=Plur</tt></tt>	μας	σας	τους

<tt><tt>Gender</tt><tt>=Fem</tt>|<tt>Number</tt><tt>=Sing</tt></tt>			της

<tt><tt>Gender</tt><tt>=Fem</tt>|<tt>Number</tt><tt>=Plur</tt></tt>			τους

<tt><tt>Gender</tt><tt>=Neut</tt>|<tt>Number</tt><tt>=Sing</tt></tt>			του, σου

<tt><tt>Gender</tt><tt>=Neut</tt>|<tt>Number</tt><tt>=Plur</tt></tt>			τους

Person seems to be lexical feature of PRON. 93% lemmas (28) occur only with one value of Person.

AUX

1064 <tt>AUX</tt> tokens (35% of all AUX tokens) have a non-empty value of Person.

The most frequent other feature values with which AUX and Person co-occurred: <tt>Mood</tt><tt>=Ind</tt> (1064; 100%), <tt>VerbForm</tt><tt>=Fin</tt> (1064; 100%), <tt>Aspect</tt><tt>=Imp</tt> (1050; 99%), <tt>Tense</tt><tt>=Pres</tt> (848; 80%), <tt>Number</tt><tt>=Sing</tt> (823; 77%), <tt>Voice</tt><tt>=Pass</tt> (599; 56%).

AUX tokens may have the following values of Person:

1 (48; 5% of non-empty Person): είμαστε, έχουμε, είμαι, έχω, ήμασταν, είχαμε

2 (6; 1% of non-empty Person): έχετε, είσαστε, είχατε

3 (1010; 95% of non-empty Person): είναι, πρέπει, ήταν, έχει, έχουν, είχε, είχαν, έπρεπε, ήσαν

EMPTY (1955): να, θα, ας, ν', έχοντας

Paradigm είμαι	<tt>1</tt>	<tt>2</tt>	<tt>3</tt>

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			ήταν

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Pres</tt></tt>	είμαι		είναι

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Past</tt></tt>	ήμασταν		ήταν, ήσαν

<tt><tt>Aspect</tt><tt>=Imp</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Pres</tt></tt>	είμαστε	είσαστε	είναι

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Sing</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			ήταν

<tt><tt>Aspect</tt><tt>=Perf</tt>|<tt>Number</tt><tt>=Plur</tt>|<tt>Tense</tt><tt>=Past</tt></tt>			ήταν

Relations with Agreement in Person

The 10 most frequent relations where parent and child node agree in Person:
<tt>VERB –[<tt>nsubj</tt>]–> PRON</tt> (513; 94%),
<tt>VERB –[<tt>conj</tt>]–> VERB</tt> (432; 85%),
<tt>VERB –[<tt>advcl</tt>]–> VERB</tt> (406; 63%),
<tt>VERB –[<tt>xcomp</tt>]–> VERB</tt> (342; 89%),
<tt>VERB –[<tt>ccomp</tt>]–> VERB</tt> (337; 62%),
<tt>VERB –[<tt>obj</tt>]–> PRON</tt> (189; 51%),
<tt>VERB –[<tt>nsubj:pass</tt>]–> PRON</tt> (165; 88%),
<tt>VERB –[<tt>obl</tt>]–> PRON</tt> (127; 61%),
<tt>VERB –[<tt>csubj</tt>]–> VERB</tt> (55; 72%),
<tt>PRON –[<tt>acl:relcl</tt>]–> VERB</tt> (50; 68%).

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
module Nanoc::Helpers
  module Sprockets

    def javascript_include_tag(*sources)
      options = sprockets_extract_options!(sources)
      debug   = options.delete(:debug) { sprockets_config.debug }
      body    = options.delete(:body) { false }
      digest  = options.delete(:digest) { sprockets_config.digest }

      sources.collect do |source|
        if debug && asset = asset_paths.asset_for(source, 'js')
          asset.to_a.map do |dep|
            src = asset_path(dep, :ext => 'js', :body => true, :digest => digest)
            "<script src='#{src}' type='text/javascript'></script>"
          end
        else
          src = asset_path(source, :ext => 'js', :body => body, :digest => digest)
          "<script src='#{src}' type='text/javascript'></script>"
        end
      end.uniq.join("\n")
    end

    def stylesheet_link_tag(*sources)
      options = sprockets_extract_options!(sources)
      debug   = options.delete(:debug) { sprockets_config.debug }
      body    = options.delete(:body) { false }
      digest  = options.delete(:digest) { sprockets_config.digest }

      sources.collect do |source|
        if debug && asset = asset_paths.asset_for(source, 'css')
          asset.to_a.map do |dep|
            href = asset_path(dep, :ext => 'css', :body => true, :protocol => :request, :digest => digest)
            "<link href='#{href}' media='screen' rel='stylesheet' type='text/css' />"
          end
        else
          href = asset_path(source, :ext => 'css', :body => body, :protocol => :request, :digest => digest)
          "<link href='#{href}' media='screen' rel='stylesheet' type='text/css' />"
        end
      end.uniq.join("\n")
    end

    def asset_path(source, options = {})
      source = source.logical_path if source.respond_to?(:logical_path)
      path = asset_paths.compute_public_path(source, sprockets_config.prefix, options.merge(:body => true))
      options[:body] ? "#{path}?body=1" : path
    end

    def image_path(source, options = {})
      asset_path source, options
    end

    def javascript_path(source, options = {})
      asset_path source, { ext: 'js' }.merge(options)
    end

    def stylesheet_path(source, options = {})
      asset_path source, { ext: 'css' }.merge(options)
    end

    def asset_paths
      sprockets_context.asset_paths
    end

  private

    def sprockets_context
      @sprockets_context ||= ::Nanoc::Sprockets.context(site)
    end

    def sprockets_config
      sprockets_context.config
    end

    def sprockets_extract_options!(array)
      array.last.is_a?(::Hash) ? array.pop : {}
    end

  end
end


text:
// Copyright 2019 SmugMug, Inc.
// Licensed under the terms of the New-BSD license. Please see LICENSE file in the project root for terms.

/* eslint-env mocha */

var justifiedLayout = require('..');
var expect = require('expect');
var fourSquares = require(__dirname + '/fixtures/four-squares');
var fourSquares400 = require(__dirname + '/fixtures/four-squares-400');

var testLayoutsForCenteredWidows = [
	[1, 1, 1, 1], // 1 widow
	[1, 1, 1, 1, 1], // 2 widows
	[1.6, 1, 2.3, 1.2, 0.1] // 1 widow
];

// Used for testing centered widows
function isThisWidowRowCentered(layout) {

	var containerWidth = 1060;
	var boxSpacing = 10;
	var geometryCenteredWidows;

	var n = 0;
	var totalBoxCount = 0;
	var widowRowWidth = 0;
	var centeredRowOffset = 0;
	var leftOfFirstWidow = 0;

	geometryCenteredWidows = justifiedLayout(layout, {
		containerWidth: containerWidth,
		boxSpacing: boxSpacing,
		widowLayoutStyle: 'center'
	});

	widowRowWidth = 0;
	totalBoxCount = geometryCenteredWidows.boxes.length;

	// Determine width of widow row
	for (n = totalBoxCount - 1; n >= totalBoxCount - geometryCenteredWidows.widowCount; n--) {
		widowRowWidth += geometryCenteredWidows.boxes[n].width + boxSpacing;
	}

	// Account for right amount of spacing in there, one less than the number of widows
	widowRowWidth -= boxSpacing;

	// "Left" of the widowed row based on the width of the container and number of widows
	centeredRowOffset = (containerWidth / 2) - (widowRowWidth / 2);
	leftOfFirstWidow = geometryCenteredWidows.boxes[geometryCenteredWidows.boxes.length - geometryCenteredWidows.widowCount].left;

	return centeredRowOffset === leftOfFirstWidow;

}

describe('justified-layout', function () {

	it('should create additional rows if it won\'t fit within constraints', function () {

		var geometry = justifiedLayout([1, 2], {
			containerWidth: 200,
			targetRowHeight: 100
		});

		expect(geometry.boxes[0].top).toEqual(10);
		expect(geometry.boxes[1].top).toEqual(200);

	});

	it('should not add the row if we are limiting it with maxNumRows', function () {

		var geometry = justifiedLayout([1, 2, 1], {
			containerWidth: 200,
			targetRowHeight: 100,
			maxNumRows: 2
		});

		expect(geometry.boxes.length).toEqual(2);

	});

	it('should handle a panorama as only row item', function () {

		var geometry = justifiedLayout([5]);

		expect(geometry.boxes.length).toEqual(1);

	});

	it('should allow new item added to the row to get closer to the targetRowHeight', function () {

		var geometry = justifiedLayout([1, 4, 1.1], {
			containerWidth: 1000,
			targetRowHeight: 250
		});

		expect(geometry.boxes[0].height).toEqual(194);
		expect(geometry.boxes[1].height).toEqual(194);
		expect(geometry.boxes[2].height).toEqual(194);

	});

	describe('input', function () {

		it('should handle width and height objects as input', function () {
			expect(justifiedLayout([{
				width: 400,
				height: 400
			}, {
				width: 500,
				height: 500
			}, {
				width: 600,
				height: 600
			}, {
				width: 700,
				height: 700
			}])).toEqual(fourSquares);
		});

		it('should handle an array of aspect ratios as input', function () {
			expect(justifiedLayout([1, 1, 1, 1])).toEqual(fourSquares);
		});

		it('should error if box height not passed in', function () {

			try {
				justifiedLayout([
					{ width: 10 }
				]);
			} catch (e) {
				expect(e.message, "Item 0 has an invalid aspect ratio");
			}

		});

		it('should error if box height not passed in', function () {

			try {
				justifiedLayout([
					{ height: 10 }
				]);
			} catch (e) {
				expect(e.message, "Item 0 has an invalid aspect ratio");
			}

		});

		it('should error if aspect ratio is not a number', function () {

			try {
				justifiedLayout(['NaN']);
			} catch (e) {
				expect(e.message, "Item 0 has an invalid aspect ratio");
			}

		});

	});

	describe('config', function () {

		it('should return a layout without passing in a config', function () {
			expect(justifiedLayout([1, 1, 1, 1])).toEqual(fourSquares);
		});

		it('should allow overriding of containerWidth', function () {
			expect(justifiedLayout([1, 1, 1, 1], {
				containerWidth: 400
			})).toEqual(fourSquares400);
		});

		it('should allow overriding of containerPadding', function () {

			var geometry = justifiedLayout([1], {
				containerPadding: 20
			});

			expect(geometry.boxes[0].top).toEqual(20);
			expect(geometry.boxes[0].left).toEqual(20);

		});

		it('should allow overriding of containerPadding with multiple dimensions', function () {

			var geometry = justifiedLayout([1], {
				containerPadding: {
					top: 50,
					left: 5,
					bottom: 10,
					right: 10
				}
			});

			expect(geometry.boxes[0].top).toEqual(50);
			expect(geometry.boxes[0].left).toEqual(5);

		});

		it('should allow overriding of boxSpacing', function () {

			var geometry = justifiedLayout([1, 1, 1, 1], {
				boxSpacing: 40
			});

			// 10 + 320 + 40 = 370
			expect(geometry.boxes[1].left).toEqual(370);
			expect(geometry.boxes[3].top).toEqual(370);

		});

		it('should allow overriding of boxSpacing with multiple dimensions', function () {

			var geometry = justifiedLayout([1, 1, 1, 1], {
				boxSpacing: {
					horizontal: 40,
					vertical: 5
				}
			});

			// 10 + 320 + 40 = 370
			expect(geometry.boxes[1].left).toEqual(370);
			// 10 + 320 + 5 = 335
			expect(geometry.boxes[3].top).toEqual(335);

		});

		it('should allow overriding of targetRowHeight', function () {

			var geometry = justifiedLayout([1, 1, 1, 1], {
				targetRowHeight: 255,
				targetRowHeightTolerance: 0
			});

			expect(geometry.boxes[0].height).toEqual(255);

		});

		it('should allow overriding of targetRowHeightTolerance', function () {

			var geometry = justifiedLayout([1, 1, 1], {
				targetRowHeightTolerance: 0
			});

			expect(geometry.boxes[0].height).toEqual(320);

		});

		it('should allow overriding of maxNumRows', function () {

			var geometry = justifiedLayout([1, 1, 1, 1, 1], {
				maxNumRows: 1
			});

			expect(geometry.boxes.length).toEqual(3);

		});

		it('should allow overriding of forceAspectRatio', function () {

			var geometry = justifiedLayout([2, 2, 2, 2], {
				forceAspectRatio: 1
			});

			expect(geometry.boxes[0].width).toEqual(340);
			expect(geometry.boxes[0].height).toEqual(340);
			expect(geometry.boxes[0].forcedAspectRatio).toEqual(true);

		});

		it('should allow overriding of showWidows', function () {

			var geometry = justifiedLayout([1, 1, 1, 1], {
				showWidows: false
			});

			expect(geometry.boxes.length).toEqual(3);

		});

		it('should allow overriding of fullWidthBreakoutRowCadence', function () {

			var geometry = justifiedLayout([1, 1, 1, 1, 2, 2, 2, 2], {
				fullWidthBreakoutRowCadence: 3
			});

			expect(geometry.boxes[5].width).toEqual(1040);
			expect(geometry.boxes[6].top).toEqual(geometry.boxes[5].top + geometry.boxes[5].height + 10);

		});

	});

	describe('widows', function () {

		it('should set them at the same height as previous rows which looks nicer', function () {

			var geometry = justifiedLayout([1, 1, 1, 1]);

			expect(geometry.boxes[0].height).toEqual(geometry.boxes[3].height);

		});

		it('should set them at the same height as previous non-breakout row', function () {

			var geometry = justifiedLayout([1, 1, 1, 1, 1, 1, 1, 1], {
				fullWidthBreakoutRowCadence: 3
			});

			expect(geometry.boxes[geometry.boxes.length - 1].height).toEqual(320);

		});

		it('should return 0 value widowCount property if there are not any', function () {

			var geometryNoWidows = justifiedLayout([1, 1, 1]);

			expect(geometryNoWidows.widowCount).toEqual(0);

		});

		it('should return the number of widowCount in widows property if there are widows', function () {

			var geometry1Widow = justifiedLayout([1, 1, 1, 1]);
			var geometry2Widow = justifiedLayout([1, 1, 1, 1, 0.5]);

			expect(geometry1Widow.widowCount).toEqual(1);
			expect(geometry2Widow.widowCount).toEqual(2);

		});

		it('should return widows with a left layout through the default', function () {

			var geometry1LeftWidow = justifiedLayout([1, 1, 1, 1]);

			expect(geometry1LeftWidow.boxes[0].left).toEqual(geometry1LeftWidow.boxes[3].left);

		});

		it('should return widows with a specified left layout', function () {

			var geometry1LeftWidow = justifiedLayout([1, 1, 1, 1], {
				widowLayoutStyle: 'left'
			});

			expect(geometry1LeftWidow.boxes[0].left).toEqual(geometry1LeftWidow.boxes[3].left);

		});

		testLayoutsForCenteredWidows.forEach(function (layout) {

			it('should return widows with a centered layout for [' + layout.toString() + ']', function () {
				expect(isThisWidowRowCentered(layout));
			});

		}, this);

		it('should return single widow with justified layout', function () {

			var containerWidth = 880;
			var boxSpacing = 10;
			var geometryJustfiedWidows = justifiedLayout([1, 1, 1, 2.5], {
				containerWidth: containerWidth,
				boxSpacing: boxSpacing,
				widowLayoutStyle: 'justify'
			});

			var widthOfFinalJustifiedItem = geometryJustfiedWidows.boxes[geometryJustfiedWidows.boxes.length - 1].width;

			// Final item (one widow) should be the width of the container minus the padding on each side
			expect(widthOfFinalJustifiedItem).toEqual(containerWidth - (boxSpacing * 2));

		});

		it('should return widows left aligned if a nonsense value is provided', function () {

			var boxSpacing = 10;
			var geometry = justifiedLayout([1, 1, 1, 1, 2, 1], {
				widowLayoutStyle: 'porkchop sandwiches',
				boxSpacing: boxSpacing
			});

			var firstWidow;

			if (geometry.widowCount > 0) {
				firstWidow = geometry.boxes[geometry.boxes.length - geometry.widowCount];

				// The first widow's left should be the same as the first box in the entire layout
				expect(firstWidow.left).toEqual(geometry.boxes[0].left);
			}

		});

	});

	describe('containerPadding', function () {

		it('should add padding to the bottom of the container too', function () {

			var geometry = justifiedLayout([1], {
				containerPadding: 100
			});

			// 100 + 320 + 100
			expect(geometry.containerHeight).toEqual(520);

		});

		it('should handle 0 padding', function () {

			var geometry = justifiedLayout([1, 1, 1], {
				containerPadding: 0,
				targetRowHeightTolerance: 0
			});

			expect(geometry.containerHeight).toEqual(320);

		});

	});

});


text:
package hu.akarnokd.rxjava2.operators;

import static org.junit.Assert.*;

import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import org.junit.Test;

import hu.akarnokd.rxjava2.test.*;
import io.reactivex.*;
import io.reactivex.disposables.Disposables;
import io.reactivex.functions.*;
import io.reactivex.observers.TestObserver;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject;

public class ObservableFilterAsyncTest {

    @Test
    public void normal() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return v % 2 == 0 ? Observable.just(true) : Observable.<Boolean>empty();
            }
        }))
        .test()
        .assertResult(2, 4, 6, 8, 10);
    }

    @Test
    public void normal2() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return v % 2 == 0 ? Observable.just(true) : Observable.just(false);
            }
        }))
        .test()
        .assertResult(2, 4, 6, 8, 10);
    }

    @Test
    public void normalMultiInner() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return v % 2 == 0 ? Observable.fromArray(true, true) : Observable.<Boolean>empty();
            }
        }))
        .test()
        .assertResult(2, 4, 6, 8, 10);
    }

    @Test
    public void normalAsync() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                Observable<Boolean> r = v % 2 == 0 ? Observable.just(true) : Observable.<Boolean>empty();
                return r.subscribeOn(Schedulers.computation());
            }
        }))
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(2, 4, 6, 8, 10);
    }

    @Test
    public void mainError() {
        Observable.<Integer>error(new TestException())
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return v % 2 == 0 ? Observable.just(true) : Observable.<Boolean>empty();
            }
        }))
        .test()
        .assertFailure(TestException.class);
    }

    @Test
    public void mainErrorDisposesInner() {
        PublishSubject<Integer> ps1 = PublishSubject.create();
        final PublishSubject<Boolean> ps2 = PublishSubject.create();

        TestObserver<Integer> to = ps1
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return ps2;
            }
        }))
        .test();

        assertFalse(ps2.hasObservers());

        ps1.onNext(1);

        assertTrue(ps2.hasObservers());

        ps1.onError(new TestException());

        assertFalse(ps2.hasObservers());

        to.assertFailure(TestException.class);
    }

    @Test
    public void innerError() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return v % 2 == 0
                        ? Observable.<Boolean>error(new TestException())
                                : Observable.just(true);
            }
        }))
        .test()
        .assertFailure(TestException.class, 1);
    }

    @Test
    public void innerErrorDisposesInner() {
        PublishSubject<Integer> ps1 = PublishSubject.create();
        final PublishSubject<Boolean> ps2 = PublishSubject.create();

        TestObserver<Integer> to = ps1
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return ps2;
            }
        }))
        .test();

        assertFalse(ps2.hasObservers());

        ps1.onNext(1);

        assertTrue(ps2.hasObservers());

        ps2.onError(new TestException());

        assertFalse(ps1.hasObservers());

        to.assertFailure(TestException.class);
    }

    @Test
    public void dispose() {
        PublishSubject<Integer> ps1 = PublishSubject.create();
        final PublishSubject<Boolean> ps2 = PublishSubject.create();

        TestObserver<Integer> to = ps1
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                return ps2;
            }
        }))
        .test();

        ps1.onNext(1);

        to.dispose();

        assertFalse(ps1.hasObservers());
        assertFalse(ps2.hasObservers());

        to.assertEmpty();
    }

    @Test
    public void isDisposed() {
        PublishSubject<Integer> ps1 = PublishSubject.create();
        final PublishSubject<Boolean> ps2 = PublishSubject.create();

        TestHelper.checkDisposed(ps1
                .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
                    @Override
                    public ObservableSource<Boolean> apply(Integer v)
                            throws Exception {
                        return ps2;
                    }
                })));
    }

    @Test
    public void doubleOnSubscribe() {
        TestHelper.checkDoubleOnSubscribeObservable(new Function<Observable<Integer>, ObservableSource<Integer>>() {
            @Override
            public ObservableSource<Integer> apply(Observable<Integer> o)
                    throws Exception {
                return o.compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
                            @Override
                            public ObservableSource<Boolean> apply(Integer v)
                                    throws Exception {
                                return Observable.just(true);
                            }
                        }));
            }
        });
    }

    @Test
    public void mapperCrash() {
        Observable.range(1, 10)
        .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
            @Override
            public ObservableSource<Boolean> apply(Integer v)
                    throws Exception {
                throw new TestException();
            }
        }))
        .test()
        .assertFailure(TestException.class);
    }

    @Test
    public void innerIgnoresDispose() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            Observable.just(1)
            .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
                @Override
                public ObservableSource<Boolean> apply(Integer v)
                        throws Exception {
                    return new Observable<Boolean>() {
                        @Override
                        protected void subscribeActual(
                                Observer<? super Boolean> observer) {
                            observer.onSubscribe(Disposables.empty());
                            observer.onNext(true);
                            observer.onNext(false);
                            observer.onError(new TestException());
                            observer.onComplete();
                        }
                    };
                }
            }))
            .test()
            .assertResult(1);

            TestHelper.assertUndeliverable(errors, 0, TestException.class);
        } finally {
            RxJavaPlugins.reset();
        }
    }

    @Test
    public void mainErrorsAfterInnerErrors() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            new Observable<Integer>() {
                @Override
                protected void subscribeActual(
                        Observer<? super Integer> observer) {
                    observer.onSubscribe(Disposables.empty());
                    observer.onNext(1);
                    observer.onError(new TestException("outer"));
                }
            }
            .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
                @Override
                public ObservableSource<Boolean> apply(Integer v)
                        throws Exception {
                    throw new TestException("inner");
                }
            }))
            .test()
            .assertFailureAndMessage(TestException.class, "inner");

            TestHelper.assertUndeliverable(errors, 0, TestException.class, "outer");
        } finally {
            RxJavaPlugins.reset();
        }
    }

    @Test
    public void innerErrorsAfterMainErrors() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            final AtomicReference<Observer<? super Boolean>> refInner = new AtomicReference<Observer<? super Boolean>>();

            new Observable<Integer>() {
                @Override
                protected void subscribeActual(
                        Observer<? super Integer> observer) {
                    observer.onSubscribe(Disposables.empty());
                    observer.onNext(1);
                    observer.onError(new TestException("outer"));
                    refInner.get().onError(new TestException("inner"));
                }
            }
            .compose(ObservableTransformers.filterAsync(new Function<Integer, ObservableSource<Boolean>>() {
                @Override
                public ObservableSource<Boolean> apply(Integer v)
                        throws Exception {
                    return new Observable<Boolean>() {
                        @Override
                        protected void subscribeActual(
                                Observer<? super Boolean> observer) {
                            observer.onSubscribe(Disposables.empty());
                            refInner.set(observer);
                        }
                    };
                }
            }, 10))
            .test()
            .assertFailureAndMessage(TestException.class, "outer");

            TestHelper.assertUndeliverable(errors, 0, TestException.class, "inner");
        } finally {
            RxJavaPlugins.reset();
        }
    }
}


text:
@interface VectorActorView : UIView {

}
@property (nonatomic, retain) Actor* actor;
@property (nonatomic, retain) NSObject<VectorRepresentationDelegate>* delegate;

@end


text:
![One-to-One example](imgs/one-to-one-example.png "One-to-One example")

I used an a musician's discography as an example of a one-to-one relationship.  This is one-to-one because a musician will generally have albums that only come out once (I'm not counting re-releases, only initial releases.)  Now, there may be many versions of this album (different formats, record lables, etc.) but that particular album was only initially released once by that one artist/group.

## Release 3

![Many-to-Many example](imgs/many-to-many-example.png "Many-to-Many example")

## Release 6:  Reflect

## What is a one-to-one database?

A one-to-one database is a database in which one piece of information in a table is directly related to exactly one other piece of information in a different table (i.e. ID numbers, etc.)

## When would you use a one-to-one database? (Think generally, not in terms of the example you created).

According to the example video, you would want to use one-to-one databases when you may have information in a table that is not necessarily needed on a day to day basis.  That information can be split into a different table with a one-to-one relationship with the main table for the times that you need to recall that information.

## What is a many-to-many database?

Many-to-many databases are databases that contain multiple tables with multiple relationships between them all.  You generally have a join table in between these tables in order to monitor the relationships between the tables.  This join table uses ID numbers or other common information that is shared between the tables in question to accomplish this task.

## When would you use a many-to-many database? (Think generally, not in terms of the example you created).

Many-to-many databases could be used when you are dealing with tables that contain multiple pieces of information where each could belong to multiple different groups (as in the state data example we've dealt with before.)  By splitting this info into many different tables, it can help to keep things a bit more organized and take up less memory when accessing them but can easily get rather confusing if you are dealing with a great number of relationships.

## What is confusing about database schemas? What makes sense?

What is most confusing for me is trying to visualize the schemas as tables.  The schemas are laid out as "rows" of information (in tables) whereas when they are translated into the actual database, these "rows" actually represent the columns in the databases.  The primary/foreign key relationships make a lot of sense to me.  This idea is rather straightforward and I think by understanding that it is helping understand the concepts of one-to-one and many-to-many relationships a bit better.