text:
package e2e

import (
	"strconv"
	"time"

	"k8s.io/kubernetes/pkg/api"
	client "k8s.io/kubernetes/pkg/client/unversioned"
	"k8s.io/kubernetes/pkg/util"

	. "github.com/onsi/ginkgo"
)

const (
	consumptionTimeInSeconds = 30
	sleepTime                = 30 * time.Second
	requestSizeInMillicores  = 100
	requestSizeInMegabytes   = 100
	port                     = 80
	targetPort               = 8080
	timeoutRC                = 120 * time.Second
	image                    = "gcr.io/google_containers/resource_consumer:beta"
	rcIsNil                  = "ERROR: replicationController = nil"
)

/*
ResourceConsumer is a tool for testing. It helps create specified usage of CPU or memory (Warnig: memory not supported)
typical use case:
rc.ConsumeCPU(600)
// ... check your assumption here
rc.ConsumeCPU(300)
// ... check your assumption here
*/
type ResourceConsumer struct {
	name      string
	framework *Framework
	cpu       chan int
	mem       chan int
	stopCPU   chan int
	stopMem   chan int
}

/*
NewResourceConsumer creates new ResourceConsumer
initCPU argument is in millicores
initMemory argument is in megabytes
memLimit argument is in megabytes, memLimit is a maximum amount of memory that can be consumed by a single pod
cpuLimit argument is in millicores, cpuLimit is a maximum amount of cpu that can be consumed by a single pod
*/
func NewResourceConsumer(name string, replicas, initCPU, initMemory int, cpuLimit, memLimit int64, framework *Framework) *ResourceConsumer {
	runServiceAndRCForResourceConsumer(framework.Client, framework.Namespace.Name, name, replicas, cpuLimit, memLimit)
	rc := &ResourceConsumer{
		name:      name,
		framework: framework,
		cpu:       make(chan int),
		mem:       make(chan int),
		stopCPU:   make(chan int),
		stopMem:   make(chan int),
	}
	go rc.makeConsumeCPURequests()
	rc.ConsumeCPU(initCPU)
	go rc.makeConsumeMemRequests()
	rc.ConsumeMem(initMemory)
	return rc
}

// ConsumeCPU consumes given number of CPU
func (rc *ResourceConsumer) ConsumeCPU(millicores int) {
	rc.cpu <- millicores
}

// ConsumeMem consumes given number of Mem
func (rc *ResourceConsumer) ConsumeMem(megabytes int) {
	rc.mem <- megabytes
}

func (rc *ResourceConsumer) makeConsumeCPURequests() {
	var count int
	var rest int
	for {
		select {
		case millicores := <-rc.cpu:
			count = millicores / requestSizeInMillicores
			rest = millicores - count*requestSizeInMillicores
		case <-time.After(sleepTime):
			if count > 0 {
				rc.sendConsumeCPURequests(count, requestSizeInMillicores, consumptionTimeInSeconds)
			}
			if rest > 0 {
				go rc.sendOneConsumeCPURequest(rest, consumptionTimeInSeconds)
			}
		case <-rc.stopCPU:
			return
		}
	}
}

func (rc *ResourceConsumer) makeConsumeMemRequests() {
	var count int
	var rest int
	for {
		select {
		case megabytes := <-rc.mem:
			count = megabytes / requestSizeInMegabytes
			rest = megabytes - count*requestSizeInMegabytes
		case <-time.After(sleepTime):
			if count > 0 {
				rc.sendConsumeMemRequests(count, requestSizeInMegabytes, consumptionTimeInSeconds)
			}
			if rest > 0 {
				go rc.sendOneConsumeMemRequest(rest, consumptionTimeInSeconds)
			}
		case <-rc.stopMem:
			return
		}
	}
}

func (rc *ResourceConsumer) sendConsumeCPURequests(requests, millicores, durationSec int) {
	for i := 0; i < requests; i++ {
		go rc.sendOneConsumeCPURequest(millicores, durationSec)
	}
}

func (rc *ResourceConsumer) sendConsumeMemRequests(requests, megabytes, durationSec int) {
	for i := 0; i < requests; i++ {
		go rc.sendOneConsumeMemRequest(megabytes, durationSec)
	}
}

// sendOneConsumeCPURequest sends POST request for cpu consumption
func (rc *ResourceConsumer) sendOneConsumeCPURequest(millicores int, durationSec int) {
	defer GinkgoRecover()
	_, err := rc.framework.Client.Post().
		Prefix("proxy").
		Namespace(rc.framework.Namespace.Name).
		Resource("services").
		Name(rc.name).
		Suffix("ConsumeCPU").
		Param("millicores", strconv.Itoa(millicores)).
		Param("durationSec", strconv.Itoa(durationSec)).
		Do().
		Raw()
	expectNoError(err)
}

// sendOneConsumeMemRequest sends POST request for memory consumption
func (rc *ResourceConsumer) sendOneConsumeMemRequest(megabytes int, durationSec int) {
	defer GinkgoRecover()
	_, err := rc.framework.Client.Post().
		Prefix("proxy").
		Namespace(rc.framework.Namespace.Name).
		Resource("services").
		Name(rc.name).
		Suffix("ConsumeMem").
		Param("megabytes", strconv.Itoa(megabytes)).
		Param("durationSec", strconv.Itoa(durationSec)).
		Do().
		Raw()
	expectNoError(err)
}

func (rc *ResourceConsumer) GetReplicas() int {
	replicationController, err := rc.framework.Client.ReplicationControllers(rc.framework.Namespace.Name).Get(rc.name)
	expectNoError(err)
	if replicationController == nil {
		Failf(rcIsNil)
	}
	return replicationController.Status.Replicas
}

func (rc *ResourceConsumer) WaitForReplicas(desiredReplicas int) {
	timeout := 10 * time.Minute
	for start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) {
		if desiredReplicas == rc.GetReplicas() {
			Logf("Replication Controller current replicas number is equal to desired replicas number: %d", desiredReplicas)
			return
		} else {
			Logf("Replication Controller current replicas number %d waiting to be %d", rc.GetReplicas(), desiredReplicas)
		}
	}
	Failf("timeout waiting %v for pods size to be %d", timeout, desiredReplicas)
}

func (rc *ResourceConsumer) CleanUp() {
	rc.stopCPU <- 0
	rc.stopMem <- 0
	expectNoError(DeleteRC(rc.framework.Client, rc.framework.Namespace.Name, rc.name))
	expectNoError(rc.framework.Client.Services(rc.framework.Namespace.Name).Delete(rc.name))
	expectNoError(rc.framework.Client.Experimental().HorizontalPodAutoscalers(rc.framework.Namespace.Name).Delete(rc.name, api.NewDeleteOptions(0)))
}

func runServiceAndRCForResourceConsumer(c *client.Client, ns, name string, replicas int, cpuLimitMillis, memLimitMb int64) {
	_, err := c.Services(ns).Create(&api.Service{
		ObjectMeta: api.ObjectMeta{
			Name: name,
		},
		Spec: api.ServiceSpec{
			Ports: []api.ServicePort{{
				Port:       port,
				TargetPort: util.NewIntOrStringFromInt(targetPort),
			}},

			Selector: map[string]string{
				"name": name,
			},
		},
	})
	expectNoError(err)
	config := RCConfig{
		Client:    c,
		Image:     image,
		Name:      name,
		Namespace: ns,
		Timeout:   timeoutRC,
		Replicas:  replicas,
		CpuLimit:  cpuLimitMillis,
		MemLimit:  memLimitMb * 1024 * 1024, // MemLimit is in bytes
	}
	expectNoError(RunRC(config))
}


text:
package lex

import (
	"fmt"
	"strings"

	u "github.com/araddon/gou"
)

var _ = u.EMPTY

// A Clause may supply a keyword matcher instead of keyword-token
type KeywordMatcher func(c *Clause, peekWord string, l *Lexer) bool

// Dialect is a Language made up of multiple Statements
//   SQL
//   CQL
//   INFLUXQL   etc
//
type Dialect struct {
	Name       string
	Statements []*Clause
	inited     bool
}

func (m *Dialect) Init() {
	if m.inited {
		return
	}
	m.inited = true
	for _, s := range m.Statements {
		s.init()
	}
}

type Clause struct {
	parent         *Clause
	next           *Clause
	prev           *Clause
	keyword        string    // keyword is firstWord, not full word, "GROUP" portion of "GROUP BY"
	fullWord       string    // In event multi word such as "GROUP BY"
	multiWord      bool      // flag if is multi-word
	Optional       bool      // Is this Clause/Keyword optional?
	Repeat         bool      // Repeatable clause?
	Token          TokenType // Token identifiyng start of clause, optional
	KeywordMatcher KeywordMatcher
	Lexer          StateFn   // Lex Function to lex clause, optional
	Clauses        []*Clause // Children Clauses
	Name           string
}

func (c *Clause) MatchesKeyword(peekWord string, l *Lexer) bool {
	//u.Debugf("%p matcher?%v peek=%q  %s", c, c.KeywordMatcher == nil, peekWord, c)
	if c.KeywordMatcher != nil {
		return c.KeywordMatcher(c, peekWord, l)
	} else if c.keyword == peekWord && !c.multiWord {
		return true
	} else if c.multiWord {
		//u.Infof("multi? %q", l.PeekX(len(c.fullWord)))
		if strings.ToLower(l.PeekX(len(c.fullWord))) == c.fullWord {
			return true
		}
	}
	return false
}
func (c *Clause) init() {
	if c.KeywordMatcher == nil {
		// Find the Keyword, MultiWord options
		c.fullWord = c.Token.String()
		c.keyword = strings.ToLower(c.Token.MatchString())
		c.multiWord = c.Token.MultiWord()
		//u.Infof("multi?%v full:%s  keyword:%s", c.multiWord, c.fullWord, c.keyword)
	}
	for i, clause := range c.Clauses {
		clause.init()
		clause.parent = c
		if i != 0 { // .prev is nil on first clause
			clause.prev = c.Clauses[i-1]
		}
		if i+1 < len(c.Clauses) { // .next is nil on last clause
			clause.next = c.Clauses[i+1]
		}
	}
}
func (c *Clause) String() string {
	if c.parent != nil {
		return fmt.Sprintf(`<clause %p %q kw=%q fullword=%q multiword?%v clausesct=%d parentKw=%q />`, c, c.Name, c.keyword, c.fullWord, c.multiWord, len(c.Clauses), c.parent.keyword)
	}
	return fmt.Sprintf(`<clause %p %q kw=%q full=%q multiword?%v clausesct=%d />`, c, c.Name, c.keyword, c.fullWord, c.multiWord, len(c.Clauses))
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Feb 25, 2014 2:21:25 AM by Hibernate Tools 3.6.0 -->
<hibernate-mapping>
    <class name="com.caribresort.entity.Employee" table="employee" catalog="caribresort">
        <id name="employeeId" type="java.lang.Integer">
            <column name="employeeId" />
            <generator class="identity" />
        </id>
        <many-to-one name="role" class="com.caribresort.entity.Role" fetch="select">
            <column name="roleId" />
        </many-to-one>
        <property name="firstName" type="string">
            <column name="firstName" length="100" />
        </property>
        <property name="lastName" type="string">
            <column name="lastName" length="100" />
        </property>
        <property name="userName" type="string">
            <column name="userName" length="100" />
        </property>
        <property name="password" type="string">
            <column name="password" length="100" />
        </property>
        <property name="email" type="string">
            <column name="email" length="150" unique="true" />
        </property>
        <property name="dateOfBirth" type="timestamp">
            <column name="dateOfBirth" length="19" />
        </property>
        <property name="createdDate" type="timestamp">
            <column name="createdDate" length="19" />
        </property>
        <property name="lastLoginDate" type="timestamp">
            <column name="lastLoginDate" length="19" />
        </property>
        <set name="customerorders" table="customerorder" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="servedby" />
            </key>
            <one-to-many class="com.caribresort.entity.Customerorder" />
        </set>
    </class>
</hibernate-mapping>


text:
set -e

echo "ENVIRONMENT=${ENVIRONMENT}"
echo "REGION=${REGION}"

if [ -z ${REGION} ]; then
  REGION="us-west-2"
fi

IP_ADDRESS=$(curl -s http://checkip.amazonaws.com/)
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo "Version 4.22.0"
echo ""
echo "Executing command: '${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}' in environment: '${ENVIRONMENT}' and region '${REGION}
 with the following external IP address: ${IP_ADDRESS}"
echo ""
echo "-----------------------------------------------------------------------------------------------------------------"
echo ""

cerberus -e ${ENVIRONMENT} -r ${REGION} --no-tty ${COMMAND} ${ADDITIONAL_COMMAND_OPTIONS}

curl -s -X POST \
  https://ingest.signalfx.com/v2/datapoint \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H "X-SF-TOKEN: ${SIGNALFX_TOKEN}" \
  -d "{ \"counter\": [{
       \"metric\": \"cerberus.cli.success\",
       \"dimensions\": { \"command\": \"${COMMAND}\", \"env\": \"${ENVIRONMENT}\" },
       \"value\": 1
  }]}"


text:
package com.amazonaws.services.frauddetector.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.frauddetector.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * VariableMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class VariableMarshaller {

    private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("name").build();
    private static final MarshallingInfo<String> DATATYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("dataType").build();
    private static final MarshallingInfo<String> DATASOURCE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("dataSource").build();
    private static final MarshallingInfo<String> DEFAULTVALUE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("defaultValue").build();
    private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("description").build();
    private static final MarshallingInfo<String> VARIABLETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("variableType").build();
    private static final MarshallingInfo<String> LASTUPDATEDTIME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("lastUpdatedTime").build();
    private static final MarshallingInfo<String> CREATEDTIME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("createdTime").build();
    private static final MarshallingInfo<String> ARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("arn").build();

    private static final VariableMarshaller instance = new VariableMarshaller();

    public static VariableMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(Variable variable, ProtocolMarshaller protocolMarshaller) {

        if (variable == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(variable.getName(), NAME_BINDING);
            protocolMarshaller.marshall(variable.getDataType(), DATATYPE_BINDING);
            protocolMarshaller.marshall(variable.getDataSource(), DATASOURCE_BINDING);
            protocolMarshaller.marshall(variable.getDefaultValue(), DEFAULTVALUE_BINDING);
            protocolMarshaller.marshall(variable.getDescription(), DESCRIPTION_BINDING);
            protocolMarshaller.marshall(variable.getVariableType(), VARIABLETYPE_BINDING);
            protocolMarshaller.marshall(variable.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);
            protocolMarshaller.marshall(variable.getCreatedTime(), CREATEDTIME_BINDING);
            protocolMarshaller.marshall(variable.getArn(), ARN_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
Article 2006
----
La constitution d'un nouveau mandataire pour la même affaire vaut révocation du
premier, à compter du jour où elle a été notifiée à celui-ci.


text:
angular.module('polliwogApp')
  .config(function ($stateProvider) {
    'use strict';

    $stateProvider
      /*
       * Abstract state that defines the speaker page layout
       */
      .state('audience', {
        abstract: true,
        views: {

          /*
           * The unnamed view "<div ui-view>" of index.html
           * is used to show the speakers layout
           */
          '' : {
            templateUrl: 'app/audience/layout.html'
            //controller: 'AudienceCtrl'
          }
        }
      });

  });


text:
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');

gulp.task('lint', function() {
  return gulp.src('./OOPex.js')
             .pipe(jshint())
             .pipe(jshint.reporter('default'))
             .pipe(jshint.reporter('fail'));
});

gulp.task('test', ['lint'], function() {
  return gulp.src('test/*.js')
             .pipe(mocha());
});


text:
#pragma once

#include "functional/Base.h"
#include "functional/ContainerTraits.h"
#include "functional/FunctionTraits.h"
#include "functional/Map.h"
#include "functional/Filter.h"
#include "functional/Each.h"
#include "functional/Tap.h"
#include "functional/Collection.h"
#include "functional/Functions.h"
#include "functional/Eval.h"


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 500 (1898)

#### Original name
Lophiostoma dumeti Sacc.

### Remarks
null


text:
"""
Lawful, the simple test framework.
"""

import traceback
import textwrap
import sys
import argparse

def report(message=''):
    """Reports a message."""
    print(message)

def report_exc(message, exc):
    """Reports an unexpected Error."""
    report(message)
    report(textwrap.indent(exc, '    > '))

def checker(f):
    """Produces a callable that checks the given function f."""
    def check():
        name = f.__name__
        message = ''
        if f.__doc__:
            message = '\n' + textwrap.indent(f.__doc__, '    """ ')
        try:
            f()
            return True
        except AssertionError as e:
            if e.args:
                message = e.args[0].strip()
            exception_class, exception, trace = sys.exc_info()
            frames = traceback.extract_tb(trace)
            last = frames[len(frames)-1]

            message_hr = textwrap.indent(message, '    ')

            assertion = "{3}".format(*last)
            position = "{0}:{1}".format(*last)

            report("{} ({}):".format(name, position))
            if message_hr:
                report('    --------------------------------')
                report("{}".format(message_hr))
                report('    --------------------------------')
            report("    {}".format(assertion))
            report('')
            return False
        except Exception as e:
            report_exc("{}:{}".format(name, message), traceback.format_exc())
            return False
    check._test_function = f
    return check

checks = []

class Test:
    """Test decorator to collect tests."""
    def __init__(self, category='default'):
        self.category = category

    def __call__(self, f):
        suite = checker(f)
        checks.append((self.category, suite))
        return f

    def __getattr__(self, name):
        return Test(name)

test = Test()

def run_tests():
    """
    Runs the tests and outputs the failures and score tally.
    """
    parser = argparse.ArgumentParser(description='Tests for the project.')
    parser.add_argument('-l', '--list', default=False, action='store_true',
                        help='Lists all categories and tests.')
    parser.add_argument('-c', '--category', default=[], nargs='*',
                        help='The categories to run.')
    parser.add_argument('-t', '--test', default=[], nargs='*',
                        help='The tests to run.')
    options = parser.parse_args()

    # handle list option
    if options.list:
        categories = {c for c,t in checks}
        for cat in sorted(categories):
            report(cat)
            for t in (t for c,t in checks if c==cat):
                report('    '+t._test_function.__name__)
        return

    # actual test run
    categories = options.category
    selected = options.test
    report('=' * 80)
    report()

    selection = []
    if selected:
        selection.append(', '.join(selected))
    if categories:
        selection.append("all {}".format(categories))
    selection_hr = ' and '.join(selection) if selection else 'all'

    report("Running {} tests for {}".format(selection_hr, sys.argv[0]))
    report()
    success = 0
    failure = 0
    tests = []

    if not categories and not selected:
        tests = checks
    else:
        for c, t in checks:
            if c in categories or t._test_function.__name__ in selected:
                tests.append((c,t))

    for category, check in tests:
        if check():
            success += 1
        else:
            failure += 1

    print("{} / {}".format(success, success + failure))
    report()
    if not failure:
        report('+++ SUCCESS')
    else:
        report('--- FAILURE')
    report()
    report('='*80)
    sys.exit(1 if failure > 0 else 0)


text:
package sg.togoparts.json;

public class Feature {
	public String getAid() {
		return aid;
	}
	public void setAid(String aid) {
		this.aid = aid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getPicture() {
		return picture;
	}
	public void setPicture(String picture) {
		this.picture = picture;
	}
	private String aid;
	private String title;
	private String price;
	private String picture;
}


text:
package maze;

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

public class MazeNode {

	private List<MazeNode> neighbors;
	private char drawChar = '-';

	public MazeNode(){
		neighbors = new ArrayList<MazeNode>();
	}

	public void addNeighbor(MazeNode m) {
		if (neighbors.contains(m)) return;
		neighbors.add(m);
	}

	public void setDrawChar(char c) {
		drawChar = c;
	}

	public char getDrawChar() {
		return drawChar;
	}

	public void pair(MazeNode other) {
		if (other!=null) {
			addNeighbor(other);
			other.addNeighbor(this);
		}
	}

	public List<MazeNode> getNeighbors() {
		return neighbors;
	}

}


text:
title: Embedding
description: A guide on how to embed the cwalk path library for C/C++.
---

In order to embed **cwalk**, you will have to download it.
You can do so using git (or download it from [here](https://github.com/likle/cwalk/archive/stable.zip)).

```bash
git clone -b stable git@github.com:likle/cwalk.git
```
**Note**: The *stable* branch points to the latest stable version. You should
always use a stable version in production code.

## Using CMake to embed cwalk
If you are using CMake it is fairly easy to embed **cwalk**.
This only requires two lines, you don't even have to specify the include directories.
The following example shows how to do so:
```cmake
# Some basics you will need in your cmake file.
cmake_minimum_required(VERSION 3.9.2)
project(example C)
add_executable(example_target main.c)

# Replace your_path_to_cwalk with the path to your cwalk copy.
# This could be something like "${CMAKE_CURRENT_SOURCE_DIR}/lib/cwalk".
add_subdirectory(your_path_to_cwalk)

# Replace example_target with the target name which requires cwalk.
# After this, there is no need to specify any include directories.
target_link_libraries(example_target cwalk)
```

After that, you should be able to use cwalk in your source code:
```c
#include <cwalk.h>
```

## Directly embed cwalk in your source
If you don't use CMake and would like to embed **cwalk** directly, you could
just add the two files ``src/cwalk.c`` and ``ìnclude/cwalk.h`` to your project.
The folder containing ``cwalk.h`` has to be in your include directories
([Visual Studio](https://docs.microsoft.com/en-us/cpp/ide/vcpp-directories-property-page?view=vs-2017),
[Eclipse](https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_pns_inc.htm),
[gcc](https://www.rapidtables.com/code/linux/gcc/gcc-i.html),
[clang](https://clang.llvm.org/docs/ClangCommandLineReference.html#include-path-management)).


text:
require('com.foodonthetable.comscore').start({
  appName:'Your App',
  customerC2:'1234567',
  providerSecret:'YOUR_SECRET_PROVIDER_CODE'
});


text:
from __future__ import unicode_literals

import datetime

from django.forms import SplitDateTimeField, ValidationError
from django.forms.widgets import SplitDateTimeWidget
from django.test import SimpleTestCase
from django.utils import six

class SplitDateTimeFieldTest(SimpleTestCase):

    def test_splitdatetimefield_1(self):
        f = SplitDateTimeField()
        self.assertIsInstance(f.widget, SplitDateTimeWidget)
        self.assertEqual(
            datetime.datetime(2006, 1, 10, 7, 30),
            f.clean([datetime.date(2006, 1, 10), datetime.time(7, 30)])
        )
        with self.assertRaisesMessage(ValidationError, "'This field is required.'"):
            f.clean(None)
        with self.assertRaisesMessage(ValidationError, "'This field is required.'"):
            f.clean('')
        with self.assertRaisesMessage(ValidationError, "'Enter a list of values.'"):
            f.clean('hello')
        with six.assertRaisesRegex(self, ValidationError, r"'Enter a valid date\.', u?'Enter a valid time\.'"):
            f.clean(['hello', 'there'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid time.'"):
            f.clean(['2006-01-10', 'there'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"):
            f.clean(['hello', '07:30'])

    def test_splitdatetimefield_2(self):
        f = SplitDateTimeField(required=False)
        self.assertEqual(
            datetime.datetime(2006, 1, 10, 7, 30),
            f.clean([datetime.date(2006, 1, 10), datetime.time(7, 30)])
        )
        self.assertEqual(datetime.datetime(2006, 1, 10, 7, 30), f.clean(['2006-01-10', '07:30']))
        self.assertIsNone(f.clean(None))
        self.assertIsNone(f.clean(''))
        self.assertIsNone(f.clean(['']))
        self.assertIsNone(f.clean(['', '']))
        with self.assertRaisesMessage(ValidationError, "'Enter a list of values.'"):
            f.clean('hello')
        with six.assertRaisesRegex(self, ValidationError, r"'Enter a valid date\.', u?'Enter a valid time\.'"):
            f.clean(['hello', 'there'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid time.'"):
            f.clean(['2006-01-10', 'there'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"):
            f.clean(['hello', '07:30'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid time.'"):
            f.clean(['2006-01-10', ''])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid time.'"):
            f.clean(['2006-01-10'])
        with self.assertRaisesMessage(ValidationError, "'Enter a valid date.'"):
            f.clean(['', '07:30'])

    def test_splitdatetimefield_changed(self):
        f = SplitDateTimeField(input_date_formats=['%d/%m/%Y'])
        self.assertFalse(f.has_changed(['11/01/2012', '09:18:15'], ['11/01/2012', '09:18:15']))
        self.assertTrue(f.has_changed(datetime.datetime(2008, 5, 6, 12, 40, 00), ['2008-05-06', '12:40:00']))
        self.assertFalse(f.has_changed(datetime.datetime(2008, 5, 6, 12, 40, 00), ['06/05/2008', '12:40']))
        self.assertTrue(f.has_changed(datetime.datetime(2008, 5, 6, 12, 40, 00), ['06/05/2008', '12:41']))


text:
import AuthenticatedRoute from 'ghost/routes/authenticated';
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
import styleBody from 'ghost/mixins/style-body';

export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
    titleToken: '设置 - 插入代码',
    classNames: ['settings-view-code'],

    beforeModel() {
        this._super(...arguments);
        return this.get('session.user')
            .then(this.transitionAuthor())
            .then(this.transitionEditor());
    },

    model() {
        return this.store.query('setting', {type: 'blog,theme'}).then((records) => {
            return records.get('firstObject');
        });
    },

    actions: {
        save() {
            this.get('controller').send('save');
        }
    }
});


text:
"""Tests for conversion module."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import gast

from tensorflow.contrib.autograph import utils
from tensorflow.contrib.autograph.core import config
from tensorflow.contrib.autograph.core import converter
from tensorflow.contrib.autograph.impl import api
from tensorflow.contrib.autograph.impl import conversion
from tensorflow.python.framework import constant_op
from tensorflow.python.keras.engine import training
from tensorflow.python.platform import test

class ConversionTest(test.TestCase):

  def _simple_program_ctx(self):
    return converter.ProgramContext(
        recursive=True,
        autograph_decorators=(),
        partial_types=(),
        autograph_module=api,
        uncompiled_modules=config.DEFAULT_UNCOMPILED_MODULES)

  def test_is_whitelisted_for_graph(self):

    def test_fn():
      return constant_op.constant(1)

    self.assertFalse(conversion.is_whitelisted_for_graph(test_fn))
    self.assertTrue(conversion.is_whitelisted_for_graph(utils))
    self.assertTrue(conversion.is_whitelisted_for_graph(constant_op.constant))

  def test_entity_to_graph_unsupported_types(self):
    with self.assertRaises(ValueError):
      program_ctx = self._simple_program_ctx()
      conversion.entity_to_graph('dummy', program_ctx, None, None)

  def test_entity_to_graph_callable(self):
    b = 2
    def f(a):
      return a + b

    program_ctx = self._simple_program_ctx()
    ast, name, ns = conversion.entity_to_graph(f, program_ctx, None, None)
    self.assertTrue(isinstance(ast, gast.FunctionDef), ast)
    self.assertEqual('tf__f', name)
    self.assertTrue(ns['b'] is b)

  def test_entity_to_graph_call_tree(self):

    def g(a):
      return a

    def f(a):
      return g(a)

    program_ctx = self._simple_program_ctx()
    conversion.entity_to_graph(f, program_ctx, None, None)

    self.assertTrue(f in program_ctx.dependency_cache)
    self.assertTrue(g in program_ctx.dependency_cache)
    self.assertEqual('tf__f', program_ctx.dependency_cache[f].name)
    # need the extra .body[0] in order to step past the with tf.name_scope('f')
    # that is added automatically
    self.assertEqual(
        'tf__g', program_ctx.dependency_cache[f].body[0].body[0].value.func.id)
    self.assertEqual('tf__g', program_ctx.dependency_cache[g].name)

  def test_entity_to_graph_class_hierarchy(self):

    class TestBase(object):

      def __init__(self, x='base'):
        self.x = x

      def foo(self):
        return self.x

      def bar(self):
        return self.x

    class TestSubclass(TestBase):

      def __init__(self, y):
        super(TestSubclass, self).__init__('sub')
        self.y = y

      def foo(self):
        return self.y

      def baz(self):
        return self.y

    program_ctx = self._simple_program_ctx()
    conversion.entity_to_graph(TestSubclass, program_ctx, None, None)

    self.assertTrue(TestBase in program_ctx.dependency_cache)
    self.assertTrue(TestSubclass in program_ctx.dependency_cache)
    self.assertEqual('TfTestBase',
                     program_ctx.dependency_cache[TestBase].body[-1].name)
    self.assertEqual('TfTestSubclass',
                     program_ctx.dependency_cache[TestSubclass].body[-1].name)

  def test_entity_to_graph_class_hierarchy_whitelisted(self):

    class TestSubclass(training.Model):

      def __init__(self, y):
        super(TestSubclass, self).__init__()
        self.built = False

      def call(self, x):
        return 3 * x

    program_ctx = self._simple_program_ctx()
    conversion.entity_to_graph(TestSubclass, program_ctx, None, None)

    self.assertTrue(TestSubclass in program_ctx.dependency_cache)
    self.assertFalse(training.Model in program_ctx.dependency_cache)
    self.assertEqual(
        'Model',
        program_ctx.dependency_cache[TestSubclass].body[0].names[0].name)
    self.assertEqual('TfTestSubclass',
                     program_ctx.dependency_cache[TestSubclass].body[-1].name)

  def test_entity_to_graph_lambda(self):
    f = lambda a: a

    with self.assertRaises(NotImplementedError):
      program_ctx = self._simple_program_ctx()
      conversion.entity_to_graph(f, program_ctx, None, None)

  def test_ag_module_cached(self):
    def callee():
      return range(3)

    def caller(a):
      return a()

    program_ctx = self._simple_program_ctx()
    _, _, callee_ns = conversion.entity_to_graph(callee, program_ctx, None,
                                                 None)
    _, _, caller_ns = conversion.entity_to_graph(caller, program_ctx, None,
                                                 None)

    self.assertTrue(callee_ns['ag__'] is caller_ns['ag__'])

if __name__ == '__main__':
  test.main()


text:
/**
 * TODO rewrite, doesn't expose GPD anymore, it's in cachinglayer now
 *
 * This file exposes a get/put/delete interface, accessing data in an IndexedDB.
 *
 * There are multiple parts to this interface:
 *
 *   The RemoteStorage integration:
 *     - IndexedDB._rs_supported() determines if IndexedDB support
 *       is available. If it isn't, RemoteStorage won't initialize the feature.
 *     - IndexedDB._rs_init() initializes the feature. It returns
 *       a promise that is fulfilled as soon as the database has been opened and
 *       migrated.
 *
 *   The storage interface (IndexedDB object):
 *     - Usually this is accessible via "remoteStorage.local"
 *     - #get() takes a path and returns a promise.
 *     - #put() takes a path, body and contentType and also returns a promise.
 *     - #delete() takes a path and also returns a promise.
 *     - #on('change', ...) events, being fired whenever something changes in
 *       the storage. Change events roughly follow the StorageEvent pattern.
 *       They have "oldValue" and "newValue" properties, which can be used to
 *       distinguish create/update/delete operations and analyze changes in
 *       change handlers. In addition they carry a "origin" property, which
 *       is either "window", "local", or "remote". "remote" events are fired
 *       whenever a change comes in from Sync.
 *
 *   The sync interface (also on IndexedDB object):
 *     - #getNodes([paths]) returns the requested nodes in a promise.
 *     - #setNodes(map) stores all the nodes given in the (path -> node) map.
 *
 * @interface
 */
import type { RSNode, RSNodes } from './interfaces/rs_node';
import EventHandling from './eventhandling';
import CachingLayer from './cachinglayer';
declare class IndexedDB extends CachingLayer {
    db: any;
    getsRunning: number;
    putsRunning: number;
    changesQueued: {
        [key: string]: unknown;
    };
    changesRunning: {
        [key: string]: unknown;
    };
    commitSlownessWarning: any;
    constructor(database: any);
    /**
     * TODO: Document
     */
    getNodes(paths: string[]): Promise<RSNodes>;
    /**
     * TODO: Document
     */
    setNodes(nodes: RSNodes): Promise<void>;
    /**
     * TODO: Document
     */
    maybeFlush(): void;
    /**
     * TODO: Document
     */
    flushChangesQueued(): void;
    /**
     * TODO: Document
     */
    getNodesFromDb(paths: string[]): Promise<RSNodes>;
    /**
     * TODO: Document
     */
    setNodesInDb(nodes: {
        [key: string]: unknown;
    }): Promise<void>;
    /**
     * TODO: Document
     */
    reset(callback: (p: unknown) => unknown): void;
    /**
     * TODO: Document
     */
    forAllNodes(cb: (node: RSNode) => void): Promise<void>;
    closeDB(): void;
    /**
     * TODO: Document
     */
    static open(name: string, callback: (p: unknown, p2?: unknown) => unknown): void;
    /**
     * TODO: Document
     */
    static clean(databaseName: string, callback: () => void): void;
    /**
     * Initialize the IndexedDB backend.
     *
     * @param {Object} remoteStorage - RemoteStorage instance
     *
     * @protected
     */
    static _rs_init(remoteStorage: unknown): Promise<void>;
    /**
     * Inform about the availability of the IndexedDB backend.
     *
     * @param {Object} rs - RemoteStorage instance
     * @returns {Boolean}
     *
     * @protected
     */
    static _rs_supported(): Promise<void>;
    /**
     * Remove IndexedDB as a backend.
     *
     * @param {Object} remoteStorage - RemoteStorage instance
     *
     * @protected
     */
    static _rs_cleanup(remoteStorage: any): Promise<unknown>;
    diffHandler(): void;
}
interface IndexedDB extends EventHandling {
}
export = IndexedDB;
//# sourceMappingURL=indexeddb.d.ts.map


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\UserpermissiontypeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'User Permission Types';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a('Create User Permission Type', ['create'], ['class' => 'btn btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'name',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>


text:
* [Installing](docs/INSTALLING.md)
* [Getting Started](docs/GETTING-STARTED.md)
* [Examples](docs/EXAMPLES.md)
* [API Reference](docs/API.md)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>DecisionLayoutBuilder</title>
<meta name="date" content="2013-12-02">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

ca.ualberta.CMPUT301F13T02.chooseyouradventure

Class DecisionLayoutBuilder

java.lang.Object

ca.ualberta.CMPUT301F13T02.chooseyouradventure.DecisionLayoutBuilder

public class DecisionLayoutBuilder
extends java.lang.Object

This class stores all of the layout builders needed for interacting with decisions.
 This prepares data and the view, but does not display anything. Its sister class DecisionView creates the GUI
 From data set in this class

Author:

James Cadek

Constructor Summary

Constructors

Constructor and Description

DecisionLayoutBuilder(StoryController storyController,
                     ViewPageActivity pageActivity)

Method Summary

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DecisionLayoutBuilder

public DecisionLayoutBuilder(StoryController storyController,
                     ViewPageActivity pageActivity)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD


text:
"""Class for running instrumentation tests on a single device."""

import logging
import os
import re
import sys
import time

from pylib import constants
from pylib import flag_changer
from pylib import valgrind_tools
from pylib.base import base_test_result
from pylib.base import base_test_runner
from pylib.device import device_errors
from pylib.instrumentation import instrumentation_test_instance
from pylib.instrumentation import json_perf_parser
from pylib.instrumentation import test_result
from pylib.local.device import local_device_instrumentation_test_run

sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
                             'common'))
import perf_tests_results_helper # pylint: disable=F0401

_PERF_TEST_ANNOTATION = 'PerfTest'

class TestRunner(base_test_runner.BaseTestRunner):
  """Responsible for running a series of tests connected to a single device."""

  _DEVICE_COVERAGE_DIR = 'chrome/test/coverage'
  _HOSTMACHINE_PERF_OUTPUT_FILE = '/tmp/chrome-profile'
  _DEVICE_PERF_OUTPUT_SEARCH_PREFIX = (constants.DEVICE_PERF_OUTPUT_DIR +
                                       '/chrome-profile*')

  def __init__(self, test_options, device, shard_index, test_pkg,
               additional_flags=None):
    """Create a new TestRunner.

    Args:
      test_options: An InstrumentationOptions object.
      device: Attached android device.
      shard_index: Shard index.
      test_pkg: A TestPackage object.
      additional_flags: A list of additional flags to add to the command line.
    """
    super(TestRunner, self).__init__(device, test_options.tool)
    self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index
    self._logcat_monitor = None

    self.coverage_device_file = None
    self.coverage_dir = test_options.coverage_dir
    self.coverage_host_file = None
    self.options = test_options
    self.test_pkg = test_pkg
    # Use the correct command line file for the package under test.
    cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues()
                    if a.test_package == self.test_pkg.GetPackageName()]
    assert len(cmdline_file) < 2, 'Multiple packages have the same test package'
    if len(cmdline_file) and cmdline_file[0]:
      self.flags = flag_changer.FlagChanger(self.device, cmdline_file[0])
      if additional_flags:
        self.flags.AddFlags(additional_flags)
    else:
      self.flags = None

  #override
  def InstallTestPackage(self):
    self.test_pkg.Install(self.device)

  def _GetInstrumentationArgs(self):
    ret = {}
    if self.options.wait_for_debugger:
      ret['debug'] = 'true'
    if self.coverage_dir:
      ret['coverage'] = 'true'
      ret['coverageFile'] = self.coverage_device_file

    return ret

  def _TakeScreenshot(self, test):
    """Takes a screenshot from the device."""
    screenshot_name = os.path.join(constants.SCREENSHOTS_DIR, '%s.png' % test)
    logging.info('Taking screenshot named %s', screenshot_name)
    self.device.TakeScreenshot(screenshot_name)

  def SetUp(self):
    """Sets up the test harness and device before all tests are run."""
    super(TestRunner, self).SetUp()
    if not self.device.HasRoot():
      logging.warning('Unable to enable java asserts for %s, non rooted device',
                      str(self.device))
    else:
      if self.device.SetJavaAsserts(self.options.set_asserts):
        self.device.RunShellCommand('stop')
        self.device.RunShellCommand('start')
        self.device.WaitUntilFullyBooted()

    # We give different default value to launch HTTP server based on shard index
    # because it may have race condition when multiple processes are trying to
    # launch lighttpd with same port at same time.
    self.LaunchTestHttpServer(
        os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port)
    if self.flags:
      self.flags.AddFlags(['--disable-fre', '--enable-test-intents'])
      if self.options.device_flags:
        with open(self.options.device_flags) as device_flags_file:
          stripped_flags = (l.strip() for l in device_flags_file)
          self.flags.AddFlags([flag for flag in stripped_flags if flag])

  def TearDown(self):
    """Cleans up the test harness and saves outstanding data from test run."""
    if self.flags:
      self.flags.Restore()
    super(TestRunner, self).TearDown()

  def TestSetup(self, test):
    """Sets up the test harness for running a particular test.

    Args:
      test: The name of the test that will be run.
    """
    self.SetupPerfMonitoringIfNeeded(test)
    self._SetupIndividualTestTimeoutScale(test)
    self.tool.SetupEnvironment()

    if self.flags and self._IsFreTest(test):
      self.flags.RemoveFlags(['--disable-fre'])

    # Make sure the forwarder is still running.
    self._RestartHttpServerForwarderIfNecessary()

    if self.coverage_dir:
      coverage_basename = '%s.ec' % test
      self.coverage_device_file = '%s/%s/%s' % (
          self.device.GetExternalStoragePath(),
          TestRunner._DEVICE_COVERAGE_DIR, coverage_basename)
      self.coverage_host_file = os.path.join(
          self.coverage_dir, coverage_basename)

  def _IsFreTest(self, test):
    """Determines whether a test is a first run experience test.

    Args:
      test: The name of the test to be checked.

    Returns:
      Whether the feature being tested is FirstRunExperience.
    """
    annotations = self.test_pkg.GetTestAnnotations(test)
    return 'FirstRunExperience' == annotations.get('Feature', None)

  def _IsPerfTest(self, test):
    """Determines whether a test is a performance test.

    Args:
      test: The name of the test to be checked.

    Returns:
      Whether the test is annotated as a performance test.
    """
    return _PERF_TEST_ANNOTATION in self.test_pkg.GetTestAnnotations(test)

  def SetupPerfMonitoringIfNeeded(self, test):
    """Sets up performance monitoring if the specified test requires it.

    Args:
      test: The name of the test to be run.
    """
    if not self._IsPerfTest(test):
      return
    self.device.RunShellCommand(
        ['rm', TestRunner._DEVICE_PERF_OUTPUT_SEARCH_PREFIX])
    self._logcat_monitor = self.device.GetLogcatMonitor()
    self._logcat_monitor.Start()

  def TestTeardown(self, test, result):
    """Cleans up the test harness after running a particular test.

    Depending on the options of this TestRunner this might handle performance
    tracking.  This method will only be called if the test passed.

    Args:
      test: The name of the test that was just run.
      result: result for this test.
    """

    self.tool.CleanUpEnvironment()

    # The logic below relies on the test passing.
    if not result or not result.DidRunPass():
      return

    self.TearDownPerfMonitoring(test)

    if self.flags and self._IsFreTest(test):
      self.flags.AddFlags(['--disable-fre'])

    if self.coverage_dir:
      self.device.PullFile(
          self.coverage_device_file, self.coverage_host_file)
      self.device.RunShellCommand(
          'rm -f %s' % self.coverage_device_file)

  def TearDownPerfMonitoring(self, test):
    """Cleans up performance monitoring if the specified test required it.

    Args:
      test: The name of the test that was just run.
    Raises:
      Exception: if there's anything wrong with the perf data.
    """
    if not self._IsPerfTest(test):
      return
    raw_test_name = test.split('#')[1]

    # Wait and grab annotation data so we can figure out which traces to parse
    regex = self._logcat_monitor.WaitFor(
        re.compile(r'\*\*PERFANNOTATION\(' + raw_test_name + r'\)\:(.*)'))

    # If the test is set to run on a specific device type only (IE: only
    # tablet or phone) and it is being run on the wrong device, the test
    # just quits and does not do anything.  The java test harness will still
    # print the appropriate annotation for us, but will add --NORUN-- for
    # us so we know to ignore the results.
    # The --NORUN-- tag is managed by ChromeTabbedActivityTestBase.java
    if regex.group(1) != '--NORUN--':

      # Obtain the relevant perf data.  The data is dumped to a
      # JSON formatted file.
      json_string = self.device.ReadFile(
          '/data/data/com.google.android.apps.chrome/files/PerfTestData.txt',
          as_root=True)

      if not json_string:
        raise Exception('Perf file is empty')

      if self.options.save_perf_json:
        json_local_file = '/tmp/chromium-android-perf-json-' + raw_test_name
        with open(json_local_file, 'w') as f:
          f.write(json_string)
        logging.info('Saving Perf UI JSON from test ' +
                     test + ' to ' + json_local_file)

      raw_perf_data = regex.group(1).split(';')

      for raw_perf_set in raw_perf_data:
        if raw_perf_set:
          perf_set = raw_perf_set.split(',')
          if len(perf_set) != 3:
            raise Exception('Unexpected number of tokens in perf annotation '
                            'string: ' + raw_perf_set)

          # Process the performance data
          result = json_perf_parser.GetAverageRunInfoFromJSONString(json_string,
                                                                    perf_set[0])
          perf_tests_results_helper.PrintPerfResult(perf_set[1], perf_set[2],
                                                    [result['average']],
                                                    result['units'])

  def _SetupIndividualTestTimeoutScale(self, test):
    timeout_scale = self._GetIndividualTestTimeoutScale(test)
    valgrind_tools.SetChromeTimeoutScale(self.device, timeout_scale)

  def _GetIndividualTestTimeoutScale(self, test):
    """Returns the timeout scale for the given |test|."""
    annotations = self.test_pkg.GetTestAnnotations(test)
    timeout_scale = 1
    if 'TimeoutScale' in annotations:
      try:
        timeout_scale = int(annotations['TimeoutScale'])
      except ValueError:
        logging.warning('Non-integer value of TimeoutScale ignored. (%s)'
                        % annotations['TimeoutScale'])
    if self.options.wait_for_debugger:
      timeout_scale *= 100
    return timeout_scale

  def _GetIndividualTestTimeoutSecs(self, test):
    """Returns the timeout in seconds for the given |test|."""
    annotations = self.test_pkg.GetTestAnnotations(test)
    if 'Manual' in annotations:
      return 10 * 60 * 60
    if 'IntegrationTest' in annotations:
      return 30 * 60
    if 'External' in annotations:
      return 10 * 60
    if 'EnormousTest' in annotations:
      return 10 * 60
    if 'LargeTest' in annotations or _PERF_TEST_ANNOTATION in annotations:
      return 5 * 60
    if 'MediumTest' in annotations:
      return 3 * 60
    if 'SmallTest' in annotations:
      return 1 * 60

    logging.warn(("Test size not found in annotations for test '%s', using " +
                  "1 minute for timeout.") % test)
    return 1 * 60

  def _RunTest(self, test, timeout):
    """Runs a single instrumentation test.

    Args:
      test: Test class/method.
      timeout: Timeout time in seconds.

    Returns:
      The raw output of am instrument as a list of lines.
    """
    extras = self._GetInstrumentationArgs()
    extras['class'] = test
    return self.device.StartInstrumentation(
        '%s/%s' % (self.test_pkg.GetPackageName(), self.options.test_runner),
        raw=True, extras=extras, timeout=timeout, retries=3)

  def _GenerateTestResult(self, test, instr_result_code, instr_result_bundle,
                          statuses, start_ms, duration_ms):
    results = instrumentation_test_instance.GenerateTestResults(
        instr_result_code, instr_result_bundle, statuses, start_ms, duration_ms)
    for r in results:
      if r.GetName() == test:
        return r
    logging.error('Could not find result for test: %s', test)
    return test_result.InstrumentationTestResult(
        test, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)

  #override
  def RunTest(self, test):
    results = base_test_result.TestRunResults()
    timeout = (self._GetIndividualTestTimeoutSecs(test) *
               self._GetIndividualTestTimeoutScale(test) *
               self.tool.GetTimeoutScale())
    if (self.device.build_version_sdk
        < constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN):
      timeout *= 10

    start_ms = 0
    duration_ms = 0
    try:
      self.TestSetup(test)

      try:
        self.device.GoHome()
      except device_errors.CommandTimeoutError:
        logging.exception('Failed to focus the launcher.')

      time_ms = lambda: int(time.time() * 1000)
      start_ms = time_ms()
      raw_output = self._RunTest(test, timeout)
      duration_ms = time_ms() - start_ms

      # Parse the test output
      result_code, result_bundle, statuses = (
          instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
      result = self._GenerateTestResult(
          test, result_code, result_bundle, statuses, start_ms, duration_ms)
      if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
          self.test_pkg.GetPackageName(), self.device):
        result.SetType(base_test_result.ResultType.CRASH)
      results.AddResult(result)
    except device_errors.CommandTimeoutError as e:
      results.AddResult(test_result.InstrumentationTestResult(
          test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms,
          log=str(e) or 'No information'))
    except device_errors.DeviceUnreachableError as e:
      results.AddResult(test_result.InstrumentationTestResult(
          test, base_test_result.ResultType.CRASH, start_ms, duration_ms,
          log=str(e) or 'No information'))
    self.TestTeardown(test, results)
    return (results, None if results.DidRunPass() else test)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>U-Index</title>
<meta name="date" content="2017-03-01">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A C D F G H I L M N P Q R S T U V

U

updateItem(Task, boolean) - Method in class deltadak.LabelCell

called when starting edit with (null, true)
 and when finished edit with (homeworkTask, false)

updateTasksDay(LocalDate, List<Task>) - Method in class deltadak.Controller

See Database.updateTasksDay(LocalDate, List)

updateTasksDay(LocalDate, List<Task>) - Method in enum deltadak.Database

updates a day in the database

A C D F G H I L M N P Q R S T U V

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
// Disk setup and access
//
// Copyright (C) 2008,2009  Kevin O'Connor <kevin@koconnor.net>
// Copyright (C) 2002  MandrakeSoft S.A.
//
// This file may be distributed under the terms of the GNU LGPLv3 license.

#include "disk.h" // struct ata_s
#include "biosvar.h" // GET_GLOBAL
#include "cmos.h" // inb_cmos
#include "util.h" // dprintf
#include "ata.h" // process_ata_op
#include "usb-msc.h" // process_usb_op
#include "virtio-blk.h" // process_virtio_op

struct drives_s Drives VAR16VISIBLE;

struct drive_s *
getDrive(u8 exttype, u8 extdriveoffset)
{
    if (extdriveoffset >= ARRAY_SIZE(Drives.idmap[0]))
        return NULL;
    struct drive_s *drive_gf = GET_GLOBAL(Drives.idmap[exttype][extdriveoffset]);
    if (!drive_gf)
        return NULL;
    return GLOBALFLAT2GLOBAL(drive_gf);
}

/****************************************************************
 * Disk geometry translation
 ****************************************************************/

static u8
get_translation(struct drive_s *drive_g)
{
    u8 type = GET_GLOBAL(drive_g->type);
    if (! CONFIG_COREBOOT && type == DTYPE_ATA) {
        // Emulators pass in the translation info via nvram.
        u8 ataid = GET_GLOBAL(drive_g->cntl_id);
        u8 channel = ataid / 2;
        u8 translation = inb_cmos(CMOS_BIOS_DISKTRANSFLAG + channel/2);
        translation >>= 2 * (ataid % 4);
        translation &= 0x03;
        return translation;
    }

    // Otherwise use a heuristic to determine translation type.
    u16 heads = GET_GLOBAL(drive_g->pchs.heads);
    u16 cylinders = GET_GLOBAL(drive_g->pchs.cylinders);
    u16 spt = GET_GLOBAL(drive_g->pchs.spt);
    u64 sectors = GET_GLOBAL(drive_g->sectors);
    u64 psectors = (u64)heads * cylinders * spt;
    if (!heads || !cylinders || !spt || psectors > sectors)
        // pchs doesn't look valid - use LBA.
        return TRANSLATION_LBA;

    if (cylinders <= 1024 && heads <= 16 && spt <= 63)
        return TRANSLATION_NONE;
    if (cylinders * heads <= 131072)
        return TRANSLATION_LARGE;
    return TRANSLATION_LBA;
}

void
setup_translation(struct drive_s *drive_g)
{
    u8 translation = get_translation(drive_g);
    SET_GLOBAL(drive_g->translation, translation);

    u16 heads = GET_GLOBAL(drive_g->pchs.heads);
    u16 cylinders = GET_GLOBAL(drive_g->pchs.cylinders);
    u16 spt = GET_GLOBAL(drive_g->pchs.spt);
    u64 sectors = GET_GLOBAL(drive_g->sectors);
    const char *desc = NULL;

    switch (translation) {
    default:
    case TRANSLATION_NONE:
        desc = "none";
        break;
    case TRANSLATION_LBA:
        desc = "lba";
        spt = 63;
        if (sectors > 63*255*1024) {
            heads = 255;
            cylinders = 1024;
            break;
        }
        u32 sect = (u32)sectors / 63;
        heads = sect / 1024;
        if (heads>128)
            heads = 255;
        else if (heads>64)
            heads = 128;
        else if (heads>32)
            heads = 64;
        else if (heads>16)
            heads = 32;
        else
            heads = 16;
        cylinders = sect / heads;
        break;
    case TRANSLATION_RECHS:
        desc = "r-echs";
        // Take care not to overflow
        if (heads==16) {
            if (cylinders>61439)
                cylinders=61439;
            heads=15;
            cylinders = (u16)((u32)(cylinders)*16/15);
        }
        // then go through the large bitshift process
    case TRANSLATION_LARGE:
        if (translation == TRANSLATION_LARGE)
            desc = "large";
        while (cylinders > 1024) {
            cylinders >>= 1;
            heads <<= 1;

            // If we max out the head count
            if (heads > 127)
                break;
        }
        break;
    }
    // clip to 1024 cylinders in lchs
    if (cylinders > 1024)
        cylinders = 1024;
    dprintf(1, "drive %p: PCHS=%u/%d/%d translation=%s LCHS=%d/%d/%d s=%d\n"
            , drive_g
            , drive_g->pchs.cylinders, drive_g->pchs.heads, drive_g->pchs.spt
            , desc
            , cylinders, heads, spt
            , (u32)sectors);

    SET_GLOBAL(drive_g->lchs.heads, heads);
    SET_GLOBAL(drive_g->lchs.cylinders, cylinders);
    SET_GLOBAL(drive_g->lchs.spt, spt);
}

/****************************************************************
 * Drive mapping
 ****************************************************************/

// Fill in Fixed Disk Parameter Table (located in ebda).
static void
fill_fdpt(struct drive_s *drive_g, int hdid)
{
    if (hdid > 1)
        return;

    u16 nlc   = GET_GLOBAL(drive_g->lchs.cylinders);
    u16 nlh   = GET_GLOBAL(drive_g->lchs.heads);
    u16 nlspt = GET_GLOBAL(drive_g->lchs.spt);

    u16 npc   = GET_GLOBAL(drive_g->pchs.cylinders);
    u16 nph   = GET_GLOBAL(drive_g->pchs.heads);
    u16 npspt = GET_GLOBAL(drive_g->pchs.spt);

    struct fdpt_s *fdpt = &get_ebda_ptr()->fdpt[hdid];
    fdpt->precompensation = 0xffff;
    fdpt->drive_control_byte = 0xc0 | ((nph > 8) << 3);
    fdpt->landing_zone = npc;
    fdpt->cylinders = nlc;
    fdpt->heads = nlh;
    fdpt->sectors = nlspt;

    if (nlc != npc || nlh != nph || nlspt != npspt) {
        // Logical mapping present - use extended structure.

        // complies with Phoenix style Translated Fixed Disk Parameter
        // Table (FDPT)
        fdpt->phys_cylinders = npc;
        fdpt->phys_heads = nph;
        fdpt->phys_sectors = npspt;
        fdpt->a0h_signature = 0xa0;

        // Checksum structure.
        fdpt->checksum -= checksum(fdpt, sizeof(*fdpt));
    }

    if (hdid == 0)
        SET_IVT(0x41, SEGOFF(get_ebda_seg(), offsetof(
                                 struct extended_bios_data_area_s, fdpt[0])));
    else
        SET_IVT(0x46, SEGOFF(get_ebda_seg(), offsetof(
                                 struct extended_bios_data_area_s, fdpt[1])));
}

// Map a drive (that was registered via add_bcv_hd)
void
map_hd_drive(struct drive_s *drive_g)
{
    // fill hdidmap
    u8 hdcount = GET_BDA(hdcount);
    if (hdcount >= ARRAY_SIZE(Drives.idmap[0])) {
        warn_noalloc();
        return;
    }
    dprintf(3, "Mapping hd drive %p to %d\n", drive_g, hdcount);
    Drives.idmap[EXTTYPE_HD][hdcount] = drive_g;
    SET_BDA(hdcount, hdcount + 1);

    // Fill "fdpt" structure.
    fill_fdpt(drive_g, hdcount);
}

// Find spot to add a drive
static void
add_ordered_drive(struct drive_s **idmap, u8 *count, struct drive_s *drive_g)
{
    if (*count >= ARRAY_SIZE(Drives.idmap[0])) {
        warn_noalloc();
        return;
    }
    struct drive_s **pos = &idmap[*count];
    *count = *count + 1;
    if (CONFIG_THREADS) {
        // Add to idmap with assured drive order.
        struct drive_s **end = pos;
        for (;;) {
            struct drive_s **prev = pos - 1;
            if (prev < idmap)
                break;
            struct drive_s *prevdrive = *prev;
            if (prevdrive->type < drive_g->type
                || (prevdrive->type == drive_g->type
                    && prevdrive->cntl_id < drive_g->cntl_id))
                break;
            pos--;
        }
        if (pos != end)
            memmove(pos+1, pos, (void*)end-(void*)pos);
    }
    *pos = drive_g;
}

// Map a cd
void
map_cd_drive(struct drive_s *drive_g)
{
    dprintf(3, "Mapping cd drive %p\n", drive_g);
    add_ordered_drive(Drives.idmap[EXTTYPE_CD], &Drives.cdcount, drive_g);
}

// Map a floppy
void
map_floppy_drive(struct drive_s *drive_g)
{
    // fill idmap
    dprintf(3, "Mapping floppy drive %p\n", drive_g);
    add_ordered_drive(Drives.idmap[EXTTYPE_FLOPPY], &Drives.floppycount
                      , drive_g);

    // Update equipment word bits for floppy
    if (Drives.floppycount == 1) {
        // 1 drive, ready for boot
        SETBITS_BDA(equipment_list_flags, 0x01);
        SET_BDA(floppy_harddisk_info, 0x07);
    } else if (Drives.floppycount >= 2) {
        // 2 drives, ready for boot
        SETBITS_BDA(equipment_list_flags, 0x41);
        SET_BDA(floppy_harddisk_info, 0x77);
    }
}

/****************************************************************
 * 16bit calling interface
 ****************************************************************/

// Execute a disk_op request.
int
process_op(struct disk_op_s *op)
{
    ASSERT16();
    u8 type = GET_GLOBAL(op->drive_g->type);
    switch (type) {
    case DTYPE_FLOPPY:
        return process_floppy_op(op);
    case DTYPE_ATA:
        return process_ata_op(op);
    case DTYPE_ATAPI:
        return process_atapi_op(op);
    case DTYPE_RAMDISK:
        return process_ramdisk_op(op);
    case DTYPE_CDEMU:
        return process_cdemu_op(op);
    case DTYPE_USB:
        return process_usb_op(op);
    case DTYPE_VIRTIO:
	return process_virtio_op(op);
    default:
        op->count = 0;
        return DISK_RET_EPARAM;
    }
}

// Execute a "disk_op_s" request - this runs on a stack in the ebda.
static int
__send_disk_op(struct disk_op_s *op_far, u16 op_seg)
{
    struct disk_op_s dop;
    memcpy_far(GET_SEG(SS), &dop
               , op_seg, op_far
               , sizeof(dop));

    dprintf(DEBUG_HDL_13, "disk_op d=%p lba=%d buf=%p count=%d cmd=%d\n"
            , dop.drive_g, (u32)dop.lba, dop.buf_fl
            , dop.count, dop.command);

    int status = process_op(&dop);

    // Update count with total sectors transferred.
    SET_FARVAR(op_seg, op_far->count, dop.count);

    return status;
}

// Execute a "disk_op_s" request by jumping to a stack in the ebda.
int
send_disk_op(struct disk_op_s *op)
{
    ASSERT16();
    if (! CONFIG_DRIVES)
        return -1;

    return stack_hop((u32)op, GET_SEG(SS), __send_disk_op);
}

/****************************************************************
 * Setup
 ****************************************************************/

void
drive_setup(void)
{
    memset(&Drives, 0, sizeof(Drives));
}


text:
<?xml version="1.0"?>

<?dlps id="PeaDoor"?>
<?dlps page-images="none" figure-images="no"?>
<?dlps transcription="other"?>

<!DOCTYPE TEI.2 SYSTEM "http://text.lib.virginia.edu/dtd/tei/tei-p4/tei2.dtd" [
<!ENTITY % POSTKB "INCLUDE">
<!ENTITY % TEI.extensions.ent SYSTEM "http://text.lib.virginia.edu/dtd/tei/uva-dl-tei/uva-dl-tei.ent">
<!ENTITY % TEI.extensions.dtd SYSTEM "http://text.lib.virginia.edu/dtd/tei/uva-dl-tei/uva-dl-tei.dtd">
<!ENTITY % ISOpub SYSTEM "http://text.lib.virginia.edu/charent/iso-pub.ent"> %ISOpub;
]>
<TEI.2 id="PeaDoor">
<teiHeader type="migrated" creator="Etext">
<fileDesc>
<titleStmt>
<title type="main">The Door</title>
<title type="sort">door</title>
<author>Peattie, Elia Wilkinson, 1862-1935</author>
<respStmt>
<resp>Creation of machine-readable version:</resp>
<name>Judy Boss</name>
<resp>Conversion to TEI.2-conformant markup:</resp>
<name>University of Virginia Library Electronic Text Center.</name>
</respStmt>
</titleStmt>
<extent>ca. <num type="kilobytes">33</num> kilobytes</extent>
<publicationStmt>
<publisher>University of Virginia Library</publisher>
<pubPlace>Charlottesville, Virginia</pubPlace>
<idno type="ETC">PeaDoor</idno>
<date value="1999">1999</date>
<availability status="public">

Copyright © 1999 by the Rector and Visitors of the University of Virginia

Publicly accessible

</availability>
<idno type="uva-pid">uva-lib:477245</idno>
</publicationStmt>
<seriesStmt>
<title>University of Virginia Library, Text collection</title>
<idno type="uva-set">UVA-LIB-Text</idno>
</seriesStmt>
<sourceDesc>
<biblFull>
<titleStmt>
<title type="main">The Door</title>
<title level="j">Reader</title>
<title type="sort">door</title>
<author>Peattie, Elia Wilkinson, 1862-1935</author>
</titleStmt>
<publicationStmt>
<publisher>Bobbs-Merrill Company</publisher>
<pubPlace>Indianapolis</pubPlace>
<date value="1906">1905-1908</date>
<idno type="callNo">Source copy consulted: UVa Library, S-687</idno>
</publicationStmt>
<notesStmt>
<note>

This story appeared in v. 7 (Jan 1906), p. 168-176.

</note>
</notesStmt>
</biblFull>
</sourceDesc>
</fileDesc>
<encodingDesc>
<projectDesc>

Prepared for the University of Virginia Library Electronic Text Center.

</projectDesc>
<editorialDecl>

All unambiguous end-of-line hyphens have been removed, and the  trailing part of a word has been joined to the preceding line.

Some keywords in the header are a local Electronic Text Center scheme  to aid in establishing analytical groupings.

</editorialDecl>
</encodingDesc>
<profileDesc>
<creation>
<date value="1906">1906</date>
</creation>
<langUsage>
<language id="eng" usage="main">English</language>
</langUsage>
<textClass>
<keywords>
<term>fiction</term>
<term>prose</term>
<term>feminine</term>
<term>Women Writers</term>
</keywords>
</textClass>
</profileDesc>
<revisionDesc>
<change>
<date value="1999-04">April 1999</date>
<respStmt>
<resp>corrector</resp>
<name>June Griffin, Electronic Text Center</name>
</respStmt>
<item>Added TEI header and tags</item>
</change>
<change>
<date value="2005-07">July 2005</date>
<respStmt>
<resp>Corrector</resp>
<name>John Ivor Carlson</name>
</respStmt>
<item>Converted SGML to XML and/or corrected tagging.</item>
</change>
<change>
<date value="2007-09">September 2007</date>
<respStmt>
<resp>Migration</resp>
<name>Ethan Gruber, University of Virginia Library</name>
</respStmt>
<item>Converted XML markup from TEI Lite to uva-dl-tei (TEI P4 with local customizations).</item>
</change>
<change>
<date value="2008-01">January 2008</date>
<respStmt>
<resp>Migration</resp>
<name>Greg Murray, University of Virginia Library</name>
</respStmt>
<item>Programmatically updated TEI header markup (but not header content) for minimal compliance with current QA requirements.</item>
</change>
</revisionDesc>
</teiHeader>
<text id="d1">

<div1 type="story" id="d3">

The Door<lb/>

<hi rend="italic">By Elia W. Peattie</hi><lb/>

AUTHOR OF "THE SHAPE OF FEAR," ETC.

<div2 type="chapter" n="1" id="d4">

"HE'S asleep, isn't he?" asks the man.

"I can't be sure.  I never <hi rend="italic">could</hi> be sure!  With his eyes
always closed as they are, and with that odd habit he has of lying so
still, I can't make out half the time whether he's sleeping or waking."

"You haven't told him anything yet, I suppose?"

"Told him?  No.  Oh, no, I haven't told him!"

The woman shivers perceptibly, and draws closer to the
leaping fire on the hearth.

"Of course," continues the man, speaking cautiously still, "you
may as well explain the situation to him.  He's too young to take it
to heart, and I know you agree with me that it's going to be the best
thing for him in the end.  Those childless people, shut in as they are,
will be perfectly devoted to the child.  His misfortune is going to be
a direct appeal to their sympathies.  He'll be the great factor of their
lives    —    you know that, Madeline?  While in our lives he would be
but an incident, and a disturbing one at that.  It isn't that I dislike the
little fellow.  He couldn't help being born, and he couldn't help
being blind.  He couldn't help having Alexander Cameron for his
father.  But I can help having him in my home, Madeline, to remind
me of things I want to forget.  You understand, don't you?  I'm a
jealous man.  I was made that way.  I'd give ten years of my life to
have had you fresh from your mother's arms    —    to make you see me
and no one else; to live in your heart and in your mind alone.  The
sight of the boy

<pb n="169"/>

would be a perpetual irritation.  I couldn't endure it, Madeline.  It
would make a sort of monster out of me!"

He leans forward to draw her into his arms, but she evades him
and steals to the door of an inner room.

"Donald!  Donald!" she calls softly.

There is no movement in the little bed by the wall.  A child's
slight form is visible there, well-covered with its blue quilt.  The
light catches his reddish-gold curls and displays a portion of a
delicate profile.

The woman comes back to the fire.

"It's wonderful," she says moodily, "how like and unlike his
father he is!"

The man's large jowl gives a grotesque movement as if his
teeth ground hard upon each other.

"But how am I to help all that?" cries the woman, spreading
out her hands.  "There's no use, Henry, in denying my past!  We
can't have things as we want them in this world.  We have to take
them as we find them.  That's the sensible way!"

The man comes close to her.

"But I tell you," he cries, "that I am going to make you forget
it!  The thought of you fills my heart, and I mean to make you forget
everything except the present.  And that's to be made up of love!
Can't you feel as I do, Madeline, that there's nothing else in the
world but that?  Why, it's the beginning and end of my days.  The
thought wakes up with me, walks with me, breathes with me, sleeps
with me!"

The face of the woman flushes deeply.  She leans forward till
the laces droop from her white throat, on which the man fixes his
eyes greedily.

"Well," she whispers, "I think I ought to be forgiven if I go
looking for happiness for a while!  If people knew the whole truth,
they'd forgive me, Henry, wouldn't they?"

"People do as they please, Madeline!  They take joy when they
can get it.  Do you suppose any other man would have waited as I
have; you've been free four years.  I've known for one year, and I've
loved you from the moment my eyes fell on you.  It never occurred
to me then that you were anything but a girl!  I tell you, Madeline,
I'll never forget the torture of that discovery    —    the discovery that
you were a widow and that Donald    —   "

"Oh, Donald!"  There is poignancy in the cry.  "If it were not
for Donald    —   "

"Now that's foolish, Madeline!  Consider a moment.  The boy
is a tyrant in his way    —   "

"He's so helpless!  That's why, Henry    —    so helpless."

"Well, he's been encouraged to be helpless.  And he's a
petulant, ungrateful little fellow.  In the life we will probably lead it
would be out of the question for you to give him personal care.
He'd have to be turned over to servants; and it's a thousand times
better for him, as you can see, to go to the Brandenbergs out there at
the farm.  But, to be perfectly frank, whether it's better for him or
not, it's got to be, Madeline.  If the boy's with you he'll be first    —
sooner or later he'll be first.  And then I'll hate him."

"It comes to this," says the woman, "that I choose between
you?"

The man shows no capitulation.  His eyes are glowing, his lips
parted, and the strong pulse shows in his throat.

"Precisely," he nods.

"Oh!" breathes the woman staring at him.

"Well," he expostulates.  "Be reasonable, Madeline!  Haven't I
seen you look at the boy with positive aversion?  More than once, in
my presence, you've drawn away from him involuntarily when he
came putting his arms about your neck."

"It was in your presence!" she murmurs with a subtle
insinuation.  But he does not observe that, and urges his point.

"He's the picture of his father!  That's the core of the matter.
You shrank from

<pb n="170"/>

the father, and you shrink from the son.  The chances are, as he
grows older, the resemblance will become more marked and your
repugnance will increase.  Nervous, irritable, with a sort of disease
of pride    —    don't you recognize the traits you have told me of in your
   —    in your husband?"

The woman twists her fingers in and out.  There is a silence,
and the two have the effect of combating each other with their
thoughts.  There is at once a repulsion and an attraction between
them, and when by chance their eyes meet, they hold each other
with a look at once ecstatic and apprehensive.

At last the silence is broken.  It is the woman who speaks.

"I began wrong!" she cries.  "I began wrong!  Maybe I'm
destined to go wrong to the end!"

"You are right for me," Stonehurst interrupts.  "You are perfect
for me."

But Madeline does not heed him.

"My childhood was pitiable," she says, as much to herself as to
her companion.  "It was worse    —    it was grotesque.  I had
extravagant dreams, and I was surrounded with the ugliest realities.
There was the boarding-house that poor mother kept, and where she
worked like a slave.  The kitchen was dark and had a moldy smell,
and there were rats in the pantries.  She had brother John and Aunt
Ann and me, all to feed and clothe.  She thought for us all, and hung
over that old burned-out range, with the cross-bars sagging in the
middle.  Her face got as hard as granite, and her eyes    —    lovely eyes
   —    got dim.  I was full of fine dreams, and always trying to pretend
that things were beautiful and that we were happy.  I had a great
deal of belief in myself.  I was always going to do something
wonderful.  But after all, I couldn't get ahead of the mere work of
the house, and my dreams boiled in me!  Nothing could have been
more ridiculous than I was    —    a great gangling girl all choked up
with grief and pride and revolt and passion and love and pity and
hate!"

"Poor child!" murmurs Stonehurst.

"I am trying to excuse myself to you," she explains, drawing
nearer.  "Donald's sleeping now.  Can't you hear his breathing?  We
needn't be so cautious in what we are saying.  Oh, that's one of the
things that has always annoyed me so in him    —    his habit of
listening!  I suppose that, as he couldn't use his eyes, all the
inquisitiveness of childhood has gone into his ears."  She sits staring
at the fire for a moment or two while the man looks at her.

"You never have told me," he says under his breath, "how it
came about that you married Alexander Cameron."

The woman clings to him with her look, her face scarlet with a
curious shame.

"But I feel," she cries, "as if it were a dream!  When you are
here with me it seems as if I must sweep the facts away and cry out
'But I never belonged to any one but you    —    but you, Henry!'  Why,
it's as if I had always held a vision of you in my heart and as if you
had come now to fulfil it in the flesh!"

The man slips from his chair upon his knees and presses her
hands to his lips.  They are silent for a time, and only his deep
breathing is audible.  Then he arises.

"After all," he says with a smile which strangely illuminates
his somber face.  "Facts are of little consequence compared with our
inner knowledge.  Tell me    —    I must know some time    —    tell me
about Cameron."

Suddenly she laughs, and there is a witchery in her glance.

"Silence is a little glass ball!" she cries.  "There is nothing
durable about it.  Sooner or later it has to be broken."  She makes as
though she ground something between her glowing palms.  "See, I
shatter it now!  Stir the fire, Henry.  Thank you.  Well    —    well    —    he
boarded with my mother, don't you see, whenever he stopped in the
village on his way to town to sell his fruit or stock or wheat.  He    —
he saw me.  I always waited on the table.  He    —    brought me presents
from the farm, and

<pb n="171"/>

took me riding now and then.  I thought he was kind, and I was glad
he did not talk.  I liked my own thoughts better than anything he
could say.  One day he drove mother and me out to his farm    —
Cameron Meadows, it is called.  We went in May when everything
was in blossom.  I felt like singing or shouting, and I couldn't see
how he and mother could speak so low.  We saw his woods and
orchards, his pasture lands and hay fields, his wheat lands and his
garden places.  He showed us his sheep, his cattle, his horses, his
very hogs and chickens.  There were order and plenty everywhere.
And in the midst of a hundred beeches stood the old house.  His
grandfather built it, you know.  It is a beautiful house, Henry    —
seven windows in the upper part, looking from the trees with a wise
expression; and below, flanked with windows to the left and right,
the great door."

She pauses for a moment and lifts her hand with a curious
gesture.

"I shall never forget what an impression that door made on me
when I looked at it first!"

"And why, Madeline?"

"Oh, it was such a benignant door!  You may laugh, but
actually, if it had not been for the door, I believe I should never
have consented to be mistress of Cameron Meadows at all!  It was a
single door, but wide, with good brass hinges and cross bands and
locks.  Above it was a fan light, with delicate yellowing old lace
plaited in it.  It was as we were about to enter the door that Mr.
Cameron said to me: 'I want you to cross this threshold as my
promised wife.'  At first I was astonished    —    and afraid.  I hardly had
been thinking of him at all.  I had been wishing I had a companion
that beautiful day while mother and Mr. Cameron talked together.  I
stood for a moment saying nothing, and thoughts went racing
through my head as memories do through the brain of a drowning
man.  And then I happened to look up at the door    —    everything
swimming before me    —    and a curious idea came to me.  The old
door looked so rich in experience, and seemed so fitted to watch the
generations of men and women come and go that I fell into step, so
to speak.  I thought of the brides that had crossed that threshold, and
something irresistible compelled me to make myself one of them.
And I said 'yes.'  At least, they say I said yes.  I know Mr. Cameron
drew me into the house looking more pleased than I had supposed
he knew how to look; but I could hardly see him for a strange vision
that I had of the people who had finished with their lives and been
carried out of that door!  Actually I seemed to see a procession there
with the long black box-like thing with its fringed pall!  But I was
not afraid.  It was majestic    —    the vision    —    I fancied how I would be
carried out of there, too, and I liked even that thought.  I liked
anything that was not poverty-stricken and semi-vagrant and mean!
Mother was there all the time smiling at me in that curious patient
way of hers.  I had never before noticed how terribly thin she
looked.  Perhaps it was partly her trailing black dress, or the little
bonnet on her white hair    —    but anyway, she seemed to be appealing
to me to save her from drudgery in her pathetic old age.  I put out
my hands to her, and it was she    —    not Mr. Cameron    —    into whose
arms I fell.  And I wept there a long, long time."

Stonehurst gnaws his lip and says nothing.

"We were married in a month.  I took mother home with me,
and Aunt Ann was boarded at a farmer's near by and brother John
sent away to school.  Mr. Cameron did everything as he had agreed.
And then mother    —    mother died.  She was tired out, and when she
felt we no longer needed her, she gave up the will to live.  And the
old door had seen a new processional and another recessional, as I
had seen in my vision that first day.  Then I settled down to my life.
There were the

<pb n="172"/>

workpeople to see to; and there were Mr. Cameron's friends to
entertain; and there were church duties and visits to make.
Everything was laid out for me.  Every day was filled up with things
I ought to do.  I was so busy that even my dreams were crowded
out."

"No, no!  Your dreams are the most substantial part of you,
Madeline.  That's what is so marvelous about you.  There they are
always, so familiar and immemorial!  You say they are your
dreams, but I believe they are mine!  Or they are everybody's!  You
got them out of the heart of the ages, or you stole them from poets!
You can't say things as others do.  There is something so moving in
your voice!  I've always felt you to be a mystery!  That's why I
adore you so!  I wonder if you know how everything you say moves
me?"

"I'm a mystery, maybe, because I have never found myself.  I
live in a hermit land, and there is only me to wander about in it."

"Have I not entered it, Madeline, Madeline?"

The woman laughs sadly.

"Have you?  Sometimes I think you have, and other times I think
I have only found your footprints on the sand and that I am
searching for you!  But then real things have always seemed like
shadows and shadows like realities to me.  There at Cameron
Meadows, the work, the house, the people, were like moving
shapes.  The summer passed and a white winter came.  I had hoped
we might go to the city for a while, but Mr. Cameron thought I
ought to be very quiet then.  No one visited us except the farm
neighbors.  Mr. Cameron bought my books for me    —    they were his
choice.  It used to get dark at four o'clock, and there were
interminable twilights, with the clock ticking on the stairs.  After
that came the almost silent dinners and then the long evenings with
Mr. Cameron at his accounts.  Sometimes I laughed out loud and
made Mr. Cameron wonder if I were mad.  I used to go out and rush
through the woods.  I used to beat the tree trunks with my bare fists.
At last I grew torpid.  I was surprised when the Sundays came
around.  And then    —    then Donald came.  That was a fearful
experience, but I wouldn't have missed it.  I was interested at last    —
it was suffering with some significance to it.  I remember three
horrible days passed and I was sunk in strange visions.  I must have
suffered physically almost to the limit of endurance.  But it isn't that
I remember    —    it is the visions.  They were of battlefields and the
dying; I heard the cries of the thirsting and wounded, and the sobs
of men who were homesick.  I was on the sea tossing in the storm
with men who were not afraid to die.  I went to the guillotine
through streets of people who hated me, and I wept with pity for
them.  Then, when it was all over, something had happened to
Donald    —    some paralysis.  He was blind!"

The man gives an inarticulate exclamation, at once pitying and
repugnant.

"We were dismayed, his father and I."  Stonehurst flinches
from the intimacy of the reference.  "We sent to surgeons far and
wide.  We carried the child here and there.  We did everything but
let him be tortured.  We stood guard against that.  But in the end
nothing was done.  We had to give up hope."

The woman's tone deepens and the recital gathers in passion.

"So life grew more and more hateful, you understand.  The
child was peevish, and for two years I didn't know what it was to
have a night's rest.  Mr. Cameron slept in a distant part of the house
that he might not hear the baby cry.  He couldn't endure that.  'Can't
you stop that crying?' he would say to me.  'Can't you find out what
is the matter with that child?'  He would walk the floor and wring
his hands or plunge out of doors."

She drags her fingers down her cheeks, leaving marks upon the
flesh, which make her seem almost gaunt.

"Between the child that could not see

<pb n="173"/>

and that cried day and night, and the man in a frenzy or irritability, I
grew to hate life!  It was like being on the rack.  I used, often and
often, to wish that we were all dead."

Stonehurst starts to speak, but she interrupts him.

"Then Mr. Cameron died.  I think he was
broken-hearted about Donald.  And after that I spent three years
doing my duty.  Three interminable years I lived in solitude, looking
after the dairy and the farm, and nursing Donald.  And all the time I
was struggling to get hold of an idea about the rights of an
individual to select and take for himself.  So one day it came to me
that the old door stood open    —    the door of the house that had
welcomed me, that had imprisoned me and that was going to
liberate me.  It had seen my poor child groping through it on his
hands and knees, then stumbling through in his first steps, and
falling    —    falling so often!  It had seen the master carried forth.  And
I meant that it should see me go out in search of my life.  My life
was there outside, somewhere, awaiting me.  The door stood wide    —
it seemed to give me permission to go."

She turns to the man with one of her swift smiles.

"And so I found my life," she whispers and holds out her
hands.

The room has in it for a time an enchanting silence.  The
October wind stirs without in an air rich with perfumes of decay;
the soft breathing of the child is faintly audible; and the coals fall
now

<pb n="174"/>

and then in the glowing bed on the hearth.  Suddenly the child cries
in his sleep, and Madeline starts to her feet guiltily.  She hastens to
the bedroom, and Stonehurst hears her soothing her boy with
inarticulate sounds and soft pattings.  When she comes back she
stands by the fire, and Stonehurst, arising, looks across the hearth at
her.

"He isn't so well these days," she says, using the pronoun as
mothers will.  I've had such happiness in these rooms, but Donald
has never found his way about and so he hasn't liked it.  He is shut
up too much, and it's the most difficult thing imaginable to find a
toy that will amuse him.  He enjoys himself best at the farm."

"That's the place for him," agrees Stonehurst.  "He'll have pets
in plenty and the right sort of food and exercise.  These
Brandenbergs, from what you tell me, will be devoted to him.  You
said they were mother and son?  The son is a grown man, I
suppose."

"Yes."

"He's looking after your interests for you, isn't he?"

"Carl Brandenberg?  Yes.  He understands the place perfectly."

"Well, don't place too much confidence in him.  Remember it's
a large property you have."

"Carl Brandenberg cheats nobody    —    and <hi rend="italic">never me</hi>."

"No?  But why not you particularly?"

"His father before him managed for the Camerons.  He inherits
loyalty."

"Do you wish me to inquire into the conditions of his adoption
of Donald?  For he would wish to have the adoption according to
law, I suppose."

"Need we think about that just yet?"

"Why, yes.  We are to be married next month    —    the twelfth    —   "

"The fifteenth, if you please."

"The fifteenth!  Aren't you moving the days along?  No?  Well,
the fifteenth.  We shall start for France at once.  It is obvious that
everything must be settled before we go.  These people will, I have
no doubt, send you frequent communications about    —   "

"I don't want them!  I don't want them!  Understand that
clearly, when Donald goes out of my life he goes out utterly."

The man sighs as if with relief.

"Well, that's sensible.  I like your resolution.  It's better for
both of you to drop the relationship.  When is the boy to be taken
out there?"

Madeline is regarding him as if she had never seen him before.
Glancing at her, he draws back almost with apprehension.  Then a
joyful flush suffuses her face and neck.  She gives a cry and leans
toward him, soliciting him with the glory of her eyes, the
lusciousness of her lips.  He can not profane the moment with
words, but after a time she volunteers:

"To-morrow I shall take Donald to the farm.  The
Brandenbergs are impatient for him.  There is a teacher they wish to
engage for him who is awaiting my decision."

"You're not going to change your mind, Madeline?  I have a
curious feeling about you.  You are so inexpressibly    —    illusive."

She does not heed what he is saying.  She seizes his arms in
her grasp.

"I can't lose you," she cries.  "Having known you, love, I can't
lose you!  Ah, I can't!  I can't!"

But presently she is impatient for his departure and interrupts
his half-playful reassurances.

"You must go    —    you must go!  I am inflexible about the hour,
you know!  And it has come.  How I admire my prudence!"

"But if you go to the country to-morrow, shall you be able to
return?  Am I to spend the evening with you as usual?"

"How else?  Good night, good night."

"My love, your impetuosity is too much for me.  At least let
me find my posses-
<pb n="175"/>

sions.  There    —    my hat    —    thank you.  Good night, Madeline.  Sleep
very sweetly    —    and don't change that date again."

"I protest I never changed it."

"I say you must have done so.  Stick fast to your resolution
about the boy.  It's best; believe me, it's best.  You'll rejoice a year
from now    —    and so will he    —    that it was done.  Good night, my
dear."

He is willing to go, but she is possessed with a sorrowful
passion.  She holds him, appealing with her eyes for that
intoxicating gaze of his.  Suddenly she pushes him from her, drives
him with tempestuous laughter from the room, catches his fingers at
the last and lifts them to her lips, then puts the door between them.
He hears the bolt shoot, hears something sounding like a sob, pauses
to rap softly, begging a second's more delirious pain of parting; is
answered with silence, and, touching the bell, summons the
drowsing elevator boy.

</div2>

<div2 type="chapter" n="2" id="d5">"CHAPTER II"

A beech wood in October.  Beyond, down a sheer bluff, West
Water, with the sun low.  In the midst of the wood an old house, and
walking slowly toward it a woman leading a blind child by the
hand.  The soft pelt of the gold-bright leaves makes only the faintest
sound.

"Donald, the place looks as if it were enchanted!  It is gold
everywhere    —    the beeches, the water, the very air, are gold.  Take
off your hat, my son.  Mother wants to see your golden head fit into
the picture."

"It's hard walking through these leaves, isn't it, mother?
They're up to my knees."

"I never saw them lie so thick.  You're tired, no doubt.  Shall
we sit down and rest?  Sink right down on the leaves    —    lie back in
them.  Isn't that good?  It's a mile through the orchard and along the
drive, and you've been up since early morning and not had half
enough to eat!  We ran away home, didn't we?"

"Yes.  What a queer thing it was to do!  What made you do that,
mother?"

"I was afraid of something."

"Were you?  If you had told me I'd have comforted you."

"You do comfort me    —    just as much as if I'd told you."

"Oh, do I?  May I put flowers in your lap?  There is a sweet
smell to your dress    —    like flowers.  And I like you to pat my face
like that.  Your hands aren't any larger than mine    —    not so large!"

"Isn't it still?  There's not a soul in the house!  You ought to
see how peaceful it looks.  The windows are gold    —    those toward
the northwest.  From where I sit, Donald, I can see the door!"

"Can you?  We'll unlock it in a minute, mother."

"It looks as kind as ever."

"What fun it will be to open it!"

"Yes.  And when it is opened this time, I swear it shall never
be locked again.  Not while we live, Donald.  Some one shall be
there to answer if any one knocks.  In your father's time, and your
grand-father's, and your great-grandfather's, it was never locked
against any one who came.  Great men and beggars came to it, and
none of them was turned away."

"I never fall when I go in and out of that door.  It's the best old
door in the world!"

"Yes, it is.  Do you know, I'm going to have teachers come to
help you grow up a wise, good man."

"But then I'm blind.  I can't do the way other boys do."

"Perhaps you'll do better than others.  You will own miles of
good land    —    meadows, pastures, wheatland, orchards, forests.  You
will have cattle and sheep, horses and fowls.  It will take a good
man and one who knows a great deal to look after these things.  I
shall have you taught many things.  Besides, you shall have a great
deal of pleasure.  I have been

<pb n="176"/>

thinking all day of ways in which you and I were to have pleasure
together."

"Mother, I never knew you to be the way you are to-day!"

"Am I different?"

"Yes    —    oh, yes.  I love you, mother."

"Do you, Donald?  Do you, indeed?"

"If you were always like this, I'd never be cross the way I have
been."

"I am going to be with you always like this, my son."

The gold grows delicate in the west.  The glimmerings of the
sun path fade away.  The boy sleeps lightly for a few moments,
while the woman fixes her eyes upon the door, which seems to
invite her to enter.  She reaches out her arms as she might to her
mother.  The tears fall on her cheeks.  She seems to make silent
confession to the door.  Of all she thinks, but one sentence finds
utterance:

"I have been bereft of almost everything, but now I have found
that worth all I lost!"  The soft gloom grows.  The water becomes
shadowy.  Mystery is abroad in the woods.  The woman rouses the
boy with a kiss.

"It is growing dark," she says.  "We must go in."

The boy laughs.  He does not mind the darkness.  He makes his
way up through the leaves to the steps, climbs them gaily and puts
his hand on the knob.

"It is locked," says his mother, "and the leaves are thick all
about the threshold."  The boy still laughs.  She gives him the key
and he puts it in the great lock.  The wide door swings open with a
friendly sound.  The boy makes his way swiftly through the rooms,
touching everything with eager hands.  His laughter comes out
softly, like spring water from the earth.  The woman gropes about in
the gloom, searching for a light.  After a time a lamp is burning.
Madeline throws open the windows to admit the mellow air.  The
darkness has deepened and wraps the old house about like a cloak.

"How curious!" she cries.  "We have orchards and bees and
cattle, and not a mouthful that we may eat or drink!"

But as she speaks there is a knocking at the door, then a hearty
voice crying:

"Welcome!  Welcome!  What a surprise!"

Madeline stops in the middle of the floor and stares at the
farmerlike, capable figure which confronts her.  Her face is flushed,
her eyes shy like those of a child who has done wrong and is now
determined to be good.

"It's Carl!" cries the boy.  "It's that Carl Brandenberg."

He gathers the blind boy in his arms and hugs him with rough
tenderness.  He runs his hands through the boy's hair and pulls at his
ears.

"Wasn't your home-coming very sudden?" he asks.

"Nothing could have been more sudden," says the woman,
half-defensively.  "And we are alone    —    and we've no food."

The man mocks them: "The Camerons of Cameron Meadow
starving!  The bins empty, the cupboards bare!"

He waves his hand and is gone.

"He will bring us our supper," says the boy, nodding his head
sagely.  Madeline begins tidying the house.  She spreads the table
and lays places for three.

"We must have fresh water," she declares, and runs into the
darkness.  The boy throws himself in his chair by the window and
rocks back and forth contentedly.  He can hear the lake muttering its
ancient tale below the cliff; hear the fall of the leaves; hear the soft
wild noises of birds.  Then, after a time, a mingling of voices in the
darkness.  He knows that his mother and the farmer are bringing in
the water cold from the well, the milk warm from the cow, the
bread, the honey and the fruit.  A sweet home-consciousness steals
over him, and a breeze, rich with odors of the wood and the night,
reaches him from the open door.

</div2>
</div1>

</text>
</TEI.2>