text:
package org.deeplearning4j.nn.api;

import org.deeplearning4j.nn.conf.CacheMode;
import org.deeplearning4j.nn.gradient.Gradient;
import org.deeplearning4j.optimize.api.IterationListener;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.primitives.Pair;

import java.io.Serializable;
import java.util.Collection;

/**
 * Interface for a layer of a neural network.
 * This has an activation function, an input and output size,
 * weights, and a bias
 *
 * @author Adam Gibson
 */
public interface Layer extends Serializable, Cloneable, Model {

    enum Type {
        FEED_FORWARD, RECURRENT, CONVOLUTIONAL, SUBSAMPLING, RECURSIVE, MULTILAYER, NORMALIZATION
    }

    enum TrainingMode {
        TRAIN, TEST
    }

    /**
     * This method sets given CacheMode for current layer
     *
     * @param mode
     */
    void setCacheMode(CacheMode mode);

    /**Calculate the l2 regularization term

     * 0.0 if regularization is not used. Or 0.5 * l2Coeff * l2Magnitude otherwise.

     * Note that this does not divide by mini-batch size
     * @param backpropOnlyParams If true: calculate L2 based on backprop params only. If false: calculate
     *                           based on all params (including pretrain params, if any)
     * @return the l2 regularization term for this layer.
     */
    double calcL2(boolean backpropOnlyParams);

    /**Calculate the l1 regularization term

     * 0.0 if regularization is not used. Or l1Coeff * l1Magnitude otherwise.

     * Note that this does not divide by mini-batch size
     * @param backpropOnlyParams If true: calculate L1 based on backprop params only. If false: calculate
     *                           based on all params (including pretrain params, if any)
     * @return the l1 regularization term for this layer.
     */
    double calcL1(boolean backpropOnlyParams);

    /**
     * Returns the layer type
     * @return
     */
    Type type();

    /**Calculate the gradient relative to the error in the next layer
     * @param epsilon w^(L+1)*delta^(L+1). Or, equiv: dC/da, i.e., (dC/dz)*(dz/da) = dC/da, where C
     * 	is cost function a=sigma(z) is activation.
     * @return Pair<Gradient,INDArray> where Gradient is gradient for this layer, INDArray is epsilon needed by next
     *  layer, but before element-wise multiply by sigmaPrime(z). So for standard feed-forward layer, if this layer is
     *  L, then return.getSecond() == (w^(L)*(delta^(L))^T)^T
     */
    Pair<Gradient, INDArray> backpropGradient(INDArray epsilon);

    /**
     * Raw activations
     * @param x the input to transform
     * @return the raw activation
     * for this layer
     */
    INDArray preOutput(INDArray x);

    /**
     * Raw activations
     * @param x the input to transform
     * @return the raw activation
     * for this layer
     */
    INDArray preOutput(INDArray x, TrainingMode training);

    /**
     * Trigger an activation with the last specified input
     * @param training  training or test mode
     * @return the activation of the last specified input
     */
    INDArray activate(TrainingMode training);

    /**
     * Initialize the layer with the given input
     * and return the activation for this layer
     * given this input
     * @param input the input to use
     * @param training  train or test mode
     * @return
     */
    INDArray activate(INDArray input, TrainingMode training);

    /**
     * Raw activations
     * @param x the input to transform
     * @return the raw activation
     * for this layer
     */
    INDArray preOutput(INDArray x, boolean training);

    /**
     * Trigger an activation with the last specified input
     * @param training  training or test mode
     * @return the activation of the last specified input
     */
    INDArray activate(boolean training);

    /**
     * Initialize the layer with the given input
     * and return the activation for this layer
     * given this input
     * @param input the input to use
     * @param training  train or test mode
     * @return
     */
    INDArray activate(INDArray input, boolean training);

    /**
     * Trigger an activation with the last specified input
     * @return the activation of the last specified input
     */
    INDArray activate();

    /**
     * Initialize the layer with the given input
     * and return the activation for this layer
     * given this input
     * @param input the input to use
     * @return
     */
    INDArray activate(INDArray input);

    /**
     * Return a transposed copy of the weights/bias
     * (this means reverse the number of inputs and outputs on the weights)
     *
     * @return the transposed layer
     */
    @Deprecated
    Layer transpose();

    /**
     * Clone the layer
     * @return
     */
    Layer clone();

    /**
     * Get the iteration listeners for this layer.
     */
    Collection<IterationListener> getListeners();

    /**
     * Set the iteration listeners for this layer.
     */
    void setListeners(IterationListener... listeners);

    /**
     * Set the iteration listeners for this layer.
     */
    void setListeners(Collection<IterationListener> listeners);

    /**
     * Set the layer index.
     */
    void setIndex(int index);

    /**
     * Get the layer index.
     */
    int getIndex();

    /**
     * @return The current iteration count (number of parameter updates) for the layer/network
     */
    int getIterationCount();

    /**
     * @return The current epoch count (number of training epochs passed) for the layer/network
     */
    int getEpochCount();

    /**
     * Set the current iteration count (number of parameter updates) for the layer/network
     */
    void setIterationCount(int iterationCount);

    /**
     * Set the current epoch count (number of epochs passed ) for the layer/network
     */
    void setEpochCount(int epochCount);

    /**
     * Get the layer input.
     */
    void setInput(INDArray input);

    /** Set current/last input mini-batch size.

     * Used for score and gradient calculations. Mini batch size may be different from
     * getInput().size(0) due to reshaping operations - for example, when using RNNs with
     * DenseLayer and OutputLayer. Called automatically during forward pass.
     */
    void setInputMiniBatchSize(int size);

    /** Get current/last input mini-batch size, as set by setInputMiniBatchSize(int)
     * @see Layer#setInputMiniBatchSize(int)
     */
    int getInputMiniBatchSize();

    /**
     * Set the mask array. Note: In general, {@link #feedForwardMaskArray(INDArray, MaskState, int)} should be used in
     * preference to this.
     * @param maskArray Mask array to set
     */
    void setMaskArray(INDArray maskArray);

    INDArray getMaskArray();

    /**
     * Returns true if the layer can be trained in an unsupervised/pretrain manner (VAE, RBMs etc)
     *
     * @return true if the layer can be pretrained (using fit(INDArray), false otherwise
     */
    boolean isPretrainLayer();

    void clearNoiseWeightParams();

    /**
     * Feed forward the input mask array, setting in in the layer as appropriate. This allows different layers to
     * handle masks differently - for example, bidirectional RNNs and normal RNNs operate differently with masks (the
     * former sets activations to 0 outside of the data present region (and keeps the mask active for future layers like
     * dense layers), whereas normal RNNs don't zero out the activations/errors )instead relying on backpropagated error
     * arrays to handle the variable length case.

     * This is also used for example for networks that contain global pooling layers, arbitrary preprocessors, etc.
     *
     * @param maskArray        Mask array to set
     * @param currentMaskState Current state of the mask - see {@link MaskState}
     * @param minibatchSize    Current minibatch size. Needs to be known as it cannot always be inferred from the activations
     *                         array due to reshaping (such as a DenseLayer within a recurrent neural network)
     * @return                 New mask array after this layer, along with the new mask state.
     */
    Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize);
}

redpajama_set_name: RedPajamaGithub


text:
package datastore

import (
	"fmt"
	"reflect"
	"time"

	"google.golang.org/appengine"
	pb "google.golang.org/appengine/internal/datastore"
)

var (
	typeOfBlobKey    = reflect.TypeOf(appengine.BlobKey(""))
	typeOfByteSlice  = reflect.TypeOf([]byte(nil))
	typeOfByteString = reflect.TypeOf(ByteString(nil))
	typeOfGeoPoint   = reflect.TypeOf(appengine.GeoPoint{})
	typeOfTime       = reflect.TypeOf(time.Time{})
)

// typeMismatchReason returns a string explaining why the property p could not
// be stored in an entity field of type v.Type().
func typeMismatchReason(p Property, v reflect.Value) string {
	entityType := "empty"
	switch p.Value.(type) {
	case int64:
		entityType = "int"
	case bool:
		entityType = "bool"
	case string:
		entityType = "string"
	case float64:
		entityType = "float"
	case *Key:
		entityType = "*datastore.Key"
	case time.Time:
		entityType = "time.Time"
	case appengine.BlobKey:
		entityType = "appengine.BlobKey"
	case appengine.GeoPoint:
		entityType = "appengine.GeoPoint"
	case ByteString:
		entityType = "datastore.ByteString"
	case []byte:
		entityType = "[]byte"
	}
	return fmt.Sprintf("type mismatch: %s versus %v", entityType, v.Type())
}

type propertyLoader struct {
	// m holds the number of times a substruct field like "Foo.Bar.Baz" has
	// been seen so far. The map is constructed lazily.
	m map[string]int
}

func (l *propertyLoader) load(codec *structCodec, structValue reflect.Value, p Property, requireSlice bool) string {
	var v reflect.Value
	// Traverse a struct's struct-typed fields.
	for name := p.Name; ; {
		decoder, ok := codec.byName[name]
		if !ok {
			return "no such struct field"
		}
		v = structValue.Field(decoder.index)
		if !v.IsValid() {
			return "no such struct field"
		}
		if !v.CanSet() {
			return "cannot set struct field"
		}

		if decoder.substructCodec == nil {
			break
		}

		if v.Kind() == reflect.Slice {
			if l.m == nil {
				l.m = make(map[string]int)
			}
			index := l.m[p.Name]
			l.m[p.Name] = index + 1
			for v.Len() <= index {
				v.Set(reflect.Append(v, reflect.New(v.Type().Elem()).Elem()))
			}
			structValue = v.Index(index)
			requireSlice = false
		} else {
			structValue = v
		}
		// Strip the "I." from "I.X".
		name = name[len(codec.byIndex[decoder.index].name):]
		codec = decoder.substructCodec
	}

	var slice reflect.Value
	if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 {
		slice = v
		v = reflect.New(v.Type().Elem()).Elem()
	} else if requireSlice {
		return "multiple-valued property requires a slice field type"
	}

	// Convert indexValues to a Go value with a meaning derived from the
	// destination type.
	pValue := p.Value
	if iv, ok := pValue.(indexValue); ok {
		meaning := pb.Property_NO_MEANING
		switch v.Type() {
		case typeOfBlobKey:
			meaning = pb.Property_BLOBKEY
		case typeOfByteSlice:
			meaning = pb.Property_BLOB
		case typeOfByteString:
			meaning = pb.Property_BYTESTRING
		case typeOfGeoPoint:
			meaning = pb.Property_GEORSS_POINT
		case typeOfTime:
			meaning = pb.Property_GD_WHEN
		}
		var err error
		pValue, err = propValue(iv.value, meaning)
		if err != nil {
			return err.Error()
		}
	}

	switch v.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		x, ok := pValue.(int64)
		if !ok && pValue != nil {
			return typeMismatchReason(p, v)
		}
		if v.OverflowInt(x) {
			return fmt.Sprintf("value %v overflows struct field of type %v", x, v.Type())
		}
		v.SetInt(x)
	case reflect.Bool:
		x, ok := pValue.(bool)
		if !ok && pValue != nil {
			return typeMismatchReason(p, v)
		}
		v.SetBool(x)
	case reflect.String:
		switch x := pValue.(type) {
		case appengine.BlobKey:
			v.SetString(string(x))
		case ByteString:
			v.SetString(string(x))
		case string:
			v.SetString(x)
		default:
			if pValue != nil {
				return typeMismatchReason(p, v)
			}
		}
	case reflect.Float32, reflect.Float64:
		x, ok := pValue.(float64)
		if !ok && pValue != nil {
			return typeMismatchReason(p, v)
		}
		if v.OverflowFloat(x) {
			return fmt.Sprintf("value %v overflows struct field of type %v", x, v.Type())
		}
		v.SetFloat(x)
	case reflect.Ptr:
		x, ok := pValue.(*Key)
		if !ok && pValue != nil {
			return typeMismatchReason(p, v)
		}
		if _, ok := v.Interface().(*Key); !ok {
			return typeMismatchReason(p, v)
		}
		v.Set(reflect.ValueOf(x))
	case reflect.Struct:
		switch v.Type() {
		case typeOfTime:
			x, ok := pValue.(time.Time)
			if !ok && pValue != nil {
				return typeMismatchReason(p, v)
			}
			v.Set(reflect.ValueOf(x))
		case typeOfGeoPoint:
			x, ok := pValue.(appengine.GeoPoint)
			if !ok && pValue != nil {
				return typeMismatchReason(p, v)
			}
			v.Set(reflect.ValueOf(x))
		default:
			return typeMismatchReason(p, v)
		}
	case reflect.Slice:
		x, ok := pValue.([]byte)
		if !ok {
			if y, yok := pValue.(ByteString); yok {
				x, ok = []byte(y), true
			}
		}
		if !ok && pValue != nil {
			return typeMismatchReason(p, v)
		}
		if v.Type().Elem().Kind() != reflect.Uint8 {
			return typeMismatchReason(p, v)
		}
		v.SetBytes(x)
	default:
		return typeMismatchReason(p, v)
	}
	if slice.IsValid() {
		slice.Set(reflect.Append(slice, v))
	}
	return ""
}

// loadEntity loads an EntityProto into PropertyLoadSaver or struct pointer.
func loadEntity(dst interface{}, src *pb.EntityProto) (err error) {
	props, err := protoToProperties(src)
	if err != nil {
		return err
	}
	if e, ok := dst.(PropertyLoadSaver); ok {
		return e.Load(props)
	}
	return LoadStruct(dst, props)
}

func (s structPLS) Load(props []Property) error {
	var fieldName, reason string
	var l propertyLoader
	for _, p := range props {
		if errStr := l.load(s.codec, s.v, p, p.Multiple); errStr != "" {
			// We don't return early, as we try to load as many properties as possible.
			// It is valid to load an entity into a struct that cannot fully represent it.
			// That case returns an error, but the caller is free to ignore it.
			fieldName, reason = p.Name, errStr
		}
	}
	if reason != "" {
		return &ErrFieldMismatch{
			StructType: s.v.Type(),
			FieldName:  fieldName,
			Reason:     reason,
		}
	}
	return nil
}

func protoToProperties(src *pb.EntityProto) ([]Property, error) {
	props, rawProps := src.Property, src.RawProperty
	out := make([]Property, 0, len(props)+len(rawProps))
	for {
		var (
			x       *pb.Property
			noIndex bool
		)
		if len(props) > 0 {
			x, props = props[0], props[1:]
		} else if len(rawProps) > 0 {
			x, rawProps = rawProps[0], rawProps[1:]
			noIndex = true
		} else {
			break
		}

		var value interface{}
		if x.Meaning != nil && *x.Meaning == pb.Property_INDEX_VALUE {
			value = indexValue{x.Value}
		} else {
			var err error
			value, err = propValue(x.Value, x.GetMeaning())
			if err != nil {
				return nil, err
			}
		}
		out = append(out, Property{
			Name:     x.GetName(),
			Value:    value,
			NoIndex:  noIndex,
			Multiple: x.GetMultiple(),
		})
	}
	return out, nil
}

// propValue returns a Go value that combines the raw PropertyValue with a
// meaning. For example, an Int64Value with GD_WHEN becomes a time.Time.
func propValue(v *pb.PropertyValue, m pb.Property_Meaning) (interface{}, error) {
	switch {
	case v.Int64Value != nil:
		if m == pb.Property_GD_WHEN {
			return fromUnixMicro(*v.Int64Value), nil
		} else {
			return *v.Int64Value, nil
		}
	case v.BooleanValue != nil:
		return *v.BooleanValue, nil
	case v.StringValue != nil:
		if m == pb.Property_BLOB {
			return []byte(*v.StringValue), nil
		} else if m == pb.Property_BLOBKEY {
			return appengine.BlobKey(*v.StringValue), nil
		} else if m == pb.Property_BYTESTRING {
			return ByteString(*v.StringValue), nil
		} else {
			return *v.StringValue, nil
		}
	case v.DoubleValue != nil:
		return *v.DoubleValue, nil
	case v.Referencevalue != nil:
		key, err := referenceValueToKey(v.Referencevalue)
		if err != nil {
			return nil, err
		}
		return key, nil
	case v.Pointvalue != nil:
		// NOTE: Strangely, latitude maps to X, longitude to Y.
		return appengine.GeoPoint{Lat: v.Pointvalue.GetX(), Lng: v.Pointvalue.GetY()}, nil
	}
	return nil, nil
}

// indexValue is a Property value that is created when entities are loaded from
// an index, such as from a projection query.
//
// Such Property values do not contain all of the metadata required to be
// faithfully represented as a Go value, and are instead represented as an
// opaque indexValue. Load the properties into a concrete struct type (e.g. by
// passing a struct pointer to Iterator.Next) to reconstruct actual Go values
// of type int, string, time.Time, etc.
type indexValue struct {
	value *pb.PropertyValue
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.KeyVault.Core;

namespace Microsoft.Azure.KeyVault
{
    /// <summary>
    /// A simple caching Key Resolver using a LRU cache
    /// </summary>
    public class CachingKeyResolver : IKeyResolver, IDisposable
    {
        private LRUCache<string, IKey> _cache;
        private IKeyResolver           _inner;
        private bool                   _isDisposed;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="capacity">The maximim capacity for the cache</param>
        /// <param name="inner">The IKeyResolver to wrap</param>
        public CachingKeyResolver( int capacity, IKeyResolver inner )
        {
            if ( inner == null )
                throw new ArgumentNullException( "inner" );

            _cache = new LRUCache<string, IKey>( capacity );
            _inner = inner;
        }

        #region IKeyResolver

        /// <summary>
        /// Resolve a key indicated by its ID to the corresponding <see cref="IKey"/>
        /// </summary>
        /// <param name="kid"> the key identifier </param>
        /// <param name="token"> the cancellation token </param>
        /// <returns> task result of the <see cref="IKey"/></returns>
        public async Task<IKey> ResolveKeyAsync( string kid, CancellationToken token )
        {
            if ( _isDisposed )
                throw new ObjectDisposedException( "CachingKeyResolver" );

            if ( string.IsNullOrWhiteSpace( kid ) )
                throw new ArgumentNullException( "kid" );

            IKey result = _cache.Get( kid );

            if ( result == null )
            {
                result = await _inner.ResolveKeyAsync( kid, token ).ConfigureAwait( false );
                if ( result != null )
                {
                    // Cache the resolved key using the result's Kid.
                    // This is especially for the case when the resolved key contains information about the key version
                    var cacheKid = string.IsNullOrWhiteSpace( result.Kid ) ? kid : result.Kid;

                    var cachedKey = new CacheKey(result);
                    _cache.Add( cacheKid, cachedKey );
                    return cachedKey;
                }
            }

            return result;
        }

        #endregion

        /// <summary>
        /// Disposes the object
        /// </summary>
        public void Dispose()
        {
            Dispose( true );
            GC.SuppressFinalize( this );
        }

        protected virtual void Dispose( bool disposing )
        {
            if ( disposing )
            {
                if ( !_isDisposed )
                {
                   _isDisposed = true;

                    foreach (var cacheKey in _cache.OfType<CacheKey>())
                    {
                        cacheKey.Dispose(true);
                    }

                    _cache.Dispose();
                    _cache = null;
                }
            }
        }

        # region CacheKey class

        /// <summary>
        /// This class wraps the key that is cached using <see cref="CachingKeyResolver"/>
        /// The main purpose of <see cref="CacheKey"/> is to evict disposing cached key from the cache.
        /// </summary>
        class CacheKey : IKey
        {
            private readonly IKey _key;

            public CacheKey(IKey key)
            {
                _key = key;
            }

            public string Kid
            {
                get { return _key.Kid; }
            }

            public string DefaultEncryptionAlgorithm
            {
                get { return _key.DefaultEncryptionAlgorithm; }
            }

            public string DefaultKeyWrapAlgorithm
            {
                get { return _key.DefaultKeyWrapAlgorithm; }
            }

            public string DefaultSignatureAlgorithm
            {
                get { return _key.DefaultSignatureAlgorithm; }
            }

            public Task<byte[]> DecryptAsync(byte[] ciphertext, byte[] iv, byte[] authenticationData = null, byte[] authenticationTag = null, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.DecryptAsync(ciphertext, iv, authenticationData, authenticationTag, algorithm, token);
            }

            public Task<Tuple<byte[], byte[], string>> EncryptAsync(byte[] plaintext, byte[] iv, byte[] authenticationData = null, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.EncryptAsync(plaintext, iv, authenticationData, algorithm, token);
            }

            public Task<Tuple<byte[], string>> WrapKeyAsync(byte[] key, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.WrapKeyAsync(key, algorithm, token);
            }

            public Task<byte[]> UnwrapKeyAsync(byte[] encryptedKey, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.UnwrapKeyAsync(encryptedKey, algorithm, token);
            }

            public Task<Tuple<byte[], string>> SignAsync(byte[] digest, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.SignAsync(digest, algorithm, token);
            }

            public Task<bool> VerifyAsync(byte[] digest, byte[] signature, string algorithm = null, CancellationToken token = default(CancellationToken))
            {
                return _key.VerifyAsync(digest, signature, algorithm, token);
            }

            public void Dispose()
            {
                // do not dispose because there may be multiple references to the cached object
            }

            /// <summary>
            /// Disposes the cached key only when cache is disposing
            /// </summary>
            /// <param name="force"> whether to force dispose </param>
            internal void Dispose(bool force)
            {
                Dispose(true, force);
                GC.SuppressFinalize(this);
            }

            private void Dispose(bool disposing, bool force)
            {
                if (disposing & force)
                {
                    _key.Dispose();
                }
            }
        }

        # endregion CacheKey class
    }
}


text:
<!DOCTYPE html>

<title>OffscreenCanvas test: 2d.imageData.get.range</title>

2d.imageData.get.range

getImageData() returns values in the range [0, 255]


text:
package org.chocosolver.solver.explanations.store;

import org.chocosolver.memory.IEnvironment;
import org.chocosolver.memory.IStateInt;
import org.chocosolver.solver.ICause;
import org.chocosolver.solver.variables.IntVar;
import org.chocosolver.solver.variables.events.IEventType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by cprudhom on 13/11/14.
 * Project: choco.
 */
public class ArrayEventStore implements IEventStore {

    private static final int SIZE = 128;
    private static final Logger LOGGER = LoggerFactory.getLogger(ArrayEventStore.class);

    //*****************************************//
    // STRUCTURES DEDICATED TO EVENT RECORDING //
    //*****************************************//
    IntVar[] varChunks;   // to store variables, in chronological order
    ICause[] cauChunks;   // to store causes, in chronological order
    IEventType[] masChunks;// to store masks, in chronological order
    int[] val1Chunks;     // to store values, in chronological order
    int[] val2Chunks;     // to store values, in chronological order
    int[] val3Chunks;     // to store values, in chronological order

    IStateInt size;

    public ArrayEventStore(IEnvironment env) {
        size = env.makeInt(0);
        size._set(0, 0); // to force history manually -- required when created during the search

        varChunks = new IntVar[SIZE];
        cauChunks = new ICause[SIZE];
        masChunks = new IEventType[SIZE];
        val1Chunks = new int[SIZE];
        val2Chunks = new int[SIZE];
        val3Chunks = new int[SIZE];
    }

    public void pushEvent(IntVar var, ICause cause, IEventType mask, int one, int two, int three) {
        //        assert cause != Cause.Null : "cause null";
        int idx = size.get();
        if (idx >= varChunks.length) {
            increase();
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("WRITE in {} ({}): < {} / {} / {} / {} / {} >", idx, size.getEnvironment().getWorldIndex(), var, cause, mask, one, two, three);
        }

        varChunks[idx] = var;
        cauChunks[idx] = cause;
        masChunks[idx] = mask;
        val1Chunks[idx] = one;
        val2Chunks[idx] = two;
        val3Chunks[idx] = three;
        size.add(1);
    }

    private void increase() {
        int _size = varChunks.length;
        IntVar[] varBigger = new IntVar[_size + SIZE];
        System.arraycopy(varChunks, 0, varBigger, 0, _size);
        varChunks = varBigger;

        ICause[] cauBigger = new ICause[_size + SIZE];
        System.arraycopy(cauChunks, 0, cauBigger, 0, _size);
        cauChunks = cauBigger;

        IEventType[] masBigger = new IEventType[_size + SIZE];
        System.arraycopy(masChunks, 0, masBigger, 0, _size);
        masChunks = masBigger;

        int[] valBigger = new int[_size + SIZE];
        System.arraycopy(val1Chunks, 0, valBigger, 0, _size);
        val1Chunks = valBigger;

        valBigger = new int[_size + SIZE];
        System.arraycopy(val2Chunks, 0, valBigger, 0, _size);
        val2Chunks = valBigger;

        valBigger = new int[_size + SIZE];
        System.arraycopy(val3Chunks, 0, valBigger, 0, _size);
        val3Chunks = valBigger;
    }

    public int getSize() {
        return size.get();
    }

    public IntVar getVariable(int evt) {
        return varChunks[evt];
    }

    public IEventType getEventType(int evt) {
        return masChunks[evt];
    }

    public ICause getCause(int evt) {
        return cauChunks[evt];
    }

    public int getFirstValue(int evt) {
        return val1Chunks[evt];
    }

    public int getSecondValue(int evt) {
        return val2Chunks[evt];
    }

    public int getThirdValue(int evt) {
        return val3Chunks[evt];
    }

}


text:
#include "sdlfile.h"

const char *sdlfile_ptty_identifier  = "";

file_error sdl_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize)
{
	return FILERR_ACCESS_DENIED;
}

file_error sdl_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
{
	return FILERR_ACCESS_DENIED;
}

file_error sdl_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
{
	return FILERR_ACCESS_DENIED;
}

file_error sdl_close_ptty(osd_file *file)
{
	return FILERR_ACCESS_DENIED;
}


text:
"""Trains and exports a simple linear classifier that reads from a CSV file.

The true model is language == 'english'.

Note that this model only has standard metrics (no custom metrics), in contrast
to linear_classifier.py.

"""

import tensorflow as tf
from tensorflow import estimator as tf_estimator
from tensorflow_model_analysis.eval_saved_model import export
from tensorflow_model_analysis.eval_saved_model.example_trainers import util

def simple_csv_linear_classifier(export_path, eval_export_path):
  """Trains and exports a simple linear classifier."""

  def parse_csv(rows_string_tensor):
    """Takes the string input tensor and returns a dict of rank-2 tensors."""

    csv_columns = ['age', 'language', 'label']
    csv_column_defaults = [[0.0], ['unknown'], [0.0]]

    # Takes a rank-1 tensor and converts it into rank-2 tensor
    # Example if the data is ['csv,line,1', 'csv,line,2', ..] to
    # [['csv,line,1'], ['csv,line,2']] which after parsing will result in a
    # tuple of tensors: [['csv'], ['csv']], [['line'], ['line']], [[1], [2]]
    row_columns = tf.expand_dims(rows_string_tensor, -1)
    columns = tf.io.decode_csv(
        records=row_columns, record_defaults=csv_column_defaults)
    features = dict(zip(csv_columns, columns))
    return features

  def eval_input_receiver_fn():
    """Eval input receiver function."""
    csv_row = tf.compat.v1.placeholder(
        dtype=tf.string, shape=[None], name='input_csv_row')
    features = parse_csv(csv_row)
    receiver_tensors = {'examples': csv_row}

    return export.EvalInputReceiver(
        features=features,
        labels=features['label'],
        receiver_tensors=receiver_tensors)

  def input_fn():
    """Train input function."""
    return {
        'age':
            tf.constant([[1], [2], [3], [4]]),
        'language':
            tf.SparseTensor(
                values=['english', 'english', 'chinese', 'chinese'],
                indices=[[0, 0], [1, 0], [2, 0], [3, 0]],
                dense_shape=[4, 1])
    }, tf.constant([[1], [1], [0], [0]])

  language = tf.feature_column.categorical_column_with_vocabulary_list(
      'language', ['english', 'chinese'])
  age = tf.feature_column.numeric_column('age')
  all_features = [age, language]
  feature_spec = tf.feature_column.make_parse_example_spec(all_features)

  classifier = tf_estimator.LinearClassifier(
      feature_columns=all_features, loss_reduction=tf.losses.Reduction.SUM)
  classifier.train(input_fn=input_fn, steps=1000)

  return util.export_model_and_eval_model(
      estimator=classifier,
      serving_input_receiver_fn=(
          tf_estimator.export.build_parsing_serving_input_receiver_fn(
              feature_spec)),
      eval_input_receiver_fn=eval_input_receiver_fn,
      export_path=export_path,
      eval_export_path=eval_export_path)


text:
<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:spotigoo="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity" >

    <item
        android:id="@+id/action_settings"
        android:title="@string/action_settings"
        android:orderInCategory="100"
        spotigoo:showAsAction="never" />
</menu>


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

<title>com.qualcomm.robotcore.eventloop.opmode</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

com.qualcomm.robotcore.eventloop.opmode

Interfaces

AnnotatedOpModeManager

OpModeManager

OpModeManagerNotifier

OpModeManagerNotifier.Notifications

OpModeRegister

Classes

AnnotatedOpModeRegistrar

LinearOpMode

OpMode

OpModeAndMeta

OpModeManagerImpl

OpModeManagerImpl.DefaultOpMode

OpModeManagerImpl.OpModeObjectAndMeta

OpModeMeta

Enums

OpModeManagerImpl.OpModeState

OpModeMeta.Flavor

Annotation Types

Autonomous

Disabled

OpModeRegistrar

TeleOp


text:
	<title>Tom Courtenay's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Tom Courtenay's panel show appearances

Tom Courtenay (born 1937-02-25[ref]) has appeared in 1 episodes between 2016-2016.  Tom Courtenay on IMDB. Tom Courtenay on Wikipedia.

2016

2016-12-25 / Would I Lie To You?


text:
package com.hypefiend.blackart2.server;

import com.hypefiend.blackart2.common.*;
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import org.apache.log4j.Logger;

/**
 * EventWriter.java
 *
 * todo: wouldn't it be more efficient to hust have one thread
 * todo: that loops through all the events in the queue and sends as many bytes for each as it can?
 *
 * @author bret barker
 * @version 1.0
 */
public class EventWriter extends Wrap {
    /** reference to the GameServer */
    private static GameServer gameServer;

    /**
     * contructor.
     */
    public EventWriter(GameServer gameServer, int numWorkers) {
        this.gameServer = gameServer;
        initWrap(numWorkers);
    }

    /**
     * note we override the Wrap's run method here
     * doing essentially the same thing, but
     * first we allocate a ByteBuffer for this
     * thread to use
     */
    public void run() {
        ByteBuffer writeBuffer = ByteBuffer.allocateDirect(Globals.MAX_EVENT_SIZE);

        GameEvent event;
        running = true;
        while (running) {
            try {
                if ((event = eventQueue.deQueue()) != null) {
                    processEvent(event, writeBuffer);
                }
            }
            catch(InterruptedException e) {
            }
        }
    }

    /** unused */
    protected void processEvent(GameEvent event) {
    }

    /**
     * our own version of processEvent that takes
     * the additional parameter of the writeBuffer
     */
    protected void processEvent(GameEvent event, ByteBuffer writeBuffer) {
        NIOUtils.prepBuffer(event, writeBuffer);

        String[] recipients = event.getRecipients();
        if (recipients == null) {
            log.info("writeEvent: type=" + event.getType() + ", id=" +
                     event.getPlayerId() + ", msg=" + event.getMessage());

            String playerId = event.getPlayerId();

            write(playerId, writeBuffer);
        }
        else {
            // TODO: note this method of handlign broadcast events is inefficent because
            // TODO: if one client gets stuck, all the others will be waiting for this event
            // TODO: other events will get processed by other threads, but not this one
            // TODO: better way would be to use a custom channelWrite() method
            // TODO: that takes a list of channels to write to and iterates through them all
            // TOOD: with each pass of it's internal write loop
            for (int i = 0; i < recipients.length; i++) {
                if (recipients[i] != null) {
                    log.info("writeEvent(B): type=" + event.getType() + ", id=" +
                             recipients[i] + ", msg=" + event.getMessage());
                    write(recipients[i], writeBuffer);
                }
            }
        }

    }

    /**
     * write the event to the given playerId's channel
     */
    private void write( String playerId, ByteBuffer writeBuffer) {
        Player player = gameServer.getPlayerById(playerId);
        SocketChannel channel = player.getChannel();

        if (channel == null || !channel.isConnected()) {
            log.error("writeEvent: client channel null or not connected");
            return;
        }

        NIOUtils.channelWrite(channel, writeBuffer);
    }

}// EventWriter


text:
/*
 * ============================================================================
 *
 *  File:     TakeFromSpace.java
 *----------------------------------------------------------------------------
 *
 * No copying allowed without explicit permission.
 *
 *  All rights reserved.
 *
 *  Description:  See javadoc below
 *
 *  Created:      27. jan.. 2008
 * ============================================================================
 */

package org.semispace.space.tutorial;

import org.semispace.SemiSpace;
import org.semispace.SemiSpaceInterface;

public class TakeFromSpace {
    public static void main( String[] args) {
        if ( args.length < 1 ) {
            System.out.println("Please supply 1 arguments, which");
            System.out.println("is the name for which to take (the ");
            System.out.println("first element of).");
        } else {

            try {
                Element searchFor = new Element();
                searchFor.setName(args[0]);
                // START SNIPPET: retrieveSpace
                SemiSpaceInterface space = SemiSpace.retrieveSpace();
                // END SNIPPET: retrieveSpace
                // does not really need a timeout, but supply it nevertheless
                // START SNIPPET: takeFromSpace
                Element read = space.take(searchFor, 60000);
                // END SNIPPET: takeFromSpace
                if ( read == null ) {
                    System.out.println("Could not find an element with name "+searchFor.getName());
                } else {
                    System.out.println("Element found: "+read.getName()+"="+read.getValue());
                }
            } catch (RuntimeException e) {
                e.printStackTrace();
            }

        }
    }

}


text:
    npm install react-touchable

## Use

    var Touchable = require('react-touchable')

    var SampleComponent = React.createClass({
      render: function () {
        return (
          <Touchable onTap={this.handleClick}>
            <div>
              This element can be tapped or clicked
            </div>
          </Touchable>
        )
      }
    })

# Props

Touchable takes a single prop `onTap` and it is required.
onTap fires once a person taps on your element, it is called back with the event.

    onTap: React.PropTypes.func.isRequired

Touchable works both on mobile web as well as desktop web.

# License

MIT


text:
package org.sagebionetworks.repo.model.dbo;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.sagebionetworks.repo.model.DatastoreException;
import org.sagebionetworks.repo.model.dbo.DBOAnnotatedExample.ExampleEnum;
import org.sagebionetworks.repo.web.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.google.common.collect.Lists;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:dboExample-test-context.xml" })
public class DBOAnnotatedExampleTest {

	@Autowired
	DBOBasicDao dboBasicDao;

	List<Long> toDelete;

	@Before
	public void before(){
		assertNotNull(dboBasicDao);
		toDelete = new LinkedList<Long>();
	}

	@After
	public void after(){
		if(dboBasicDao != null && toDelete != null){
			for(Long id: toDelete){
				try {
					MapSqlParameterSource params = new MapSqlParameterSource();
					params.addValue("id", id);
					dboBasicDao.deleteObjectByPrimaryKey(DBOAnnotatedExample.class, params);
				} catch (DatastoreException e) {}
			}
		}
	}

	@Test
	public void ddlTheSame() throws Exception{
		String annotatedDll = ((AutoTableMapping<DBOAnnotatedExample>)new DBOAnnotatedExample().getTableMapping()).getDDL();
		String fileDll = DDLUtilsImpl.loadSQLFromClasspath("AnnotatedExample.sql");
		assertEquals(fileDll.trim().replace("\r\n", "\n"), annotatedDll.trim());
	}

	@Test (expected=IllegalArgumentException.class)
	public void testInsertMissingValues() throws DatastoreException{
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setModifiedOn(new Date());
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testInsertMissingValuesNullPointerException() throws DatastoreException {
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
	}

	@Test
	public void testInsert() throws Exception {
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setNumber(new Long(45));
		example.setNumberOrNull(new Long(46));
		example.setModifiedBy("you");
		// dates don't compare because of rounding
		example.setModifiedOn(new Date());
		example.setBlob("This string converts to a blob".getBytes("UTF-8"));
		example.setComment("no comment");
		example.setName("the name");
		example.setExampleEnum(ExampleEnum.bbb);
		example.setSerialized(Lists.newArrayList("aa", "bb"));
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
		// This class is auto-increment so it should have an id now
		assertNotNull(example.getId());

		DBOAnnotatedExample clone = dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, new SinglePrimaryKeySqlParameterSource(
				example.getId()));
		assertEquals(example.toString(), clone.toString());
	}

	@Test
	public void testInsertNull() throws DatastoreException, UnsupportedEncodingException {
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setNumber(new Long(45));
		example.setNumberOrNull(null);
		example.setModifiedBy("you");
		// dates don't compare because of rounding
		example.setModifiedOn(new Date());
		example.setBlob("This string converts to a blob".getBytes("UTF-8"));
		example.setComment("no comment");
		example.setName("the name");
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
		// This class is auto-increment so it should have an id now
		assertNotNull(example.getId());
	}

	@Test
	public void testInsertBatch() throws DatastoreException, UnsupportedEncodingException, NotFoundException{
		int batchSize = 6;
		List<DBOAnnotatedExample> batch = new ArrayList<DBOAnnotatedExample>();
		for(int i=0; i<batchSize; i++){
			DBOAnnotatedExample example = new DBOAnnotatedExample();
			example.setNumber(new Long(i));
			example.setModifiedBy("name"+i);
			// dates don't compare because of rounding
			example.setModifiedOn(new Date());
			example.setBlob("This string converts to a blob".getBytes("UTF-8"));
			batch.add(example);
		}

		batch = dboBasicDao.createBatch(batch);
		// Make sure each has an id
		for (DBOAnnotatedExample created : batch) {
			assertNotNull(created.getId());
			toDelete.add(created.getId());
			// Check the results
			MapSqlParameterSource params = new MapSqlParameterSource();
			params.addValue("id", created.getId());
			DBOAnnotatedExample clone = dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, params);
			assertNotNull(clone);
			assertEquals(created, clone);
		}
	}

	@Test
	public void testGetById() throws Exception{
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setNumber(new Long(103));
		example.setModifiedBy("nobodyKnows");
		// dates don't compare because of rounding
		example.setModifiedOn(new Date());
		example.setBlob("This string converts to a blob".getBytes("UTF-8"));
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
		toDelete.add(example.getId());
		// This class is auto-increment so it should have an id now
		assertNotNull(example.getId());
		// Make sure we can get a clone
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", example.getId());
		DBOAnnotatedExample clone = dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, params);
		assertNotNull(clone);
		assertEquals(example, clone);
	}

	@Test (expected=NotFoundException.class)
	public void testGetByDoesNotExist() throws Exception{
		// This should fail with NotFoundException
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", new Long(33344));
		dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, params);
	}

	@Test
	public void testDeleteId() throws DatastoreException, UnsupportedEncodingException{
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setNumber(new Long(133));
		example.setModifiedBy("nobodyKnows");
		// dates don't compare because of rounding
		example.setModifiedOn(new Date());
		example.setBlob("This string converts to a blob".getBytes("UTF-8"));
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
		toDelete.add(example.getId());
		// This class is auto-increment so it should have an id now
		assertNotNull(example.getId());
		// delete it
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", example.getId());
		boolean result = dboBasicDao.deleteObjectByPrimaryKey(DBOAnnotatedExample.class, params);
		assertTrue(result);
	}

	@Test
	public void testUpdate() throws Exception{
		// First create the object.
		DBOAnnotatedExample example = new DBOAnnotatedExample();
		example.setNumber(new Long(456));
		example.setModifiedBy("snoopy");
		// dates don't compare because of rounding
		example.setModifiedOn(new Date());
		example.setBlob("This is the starting string".getBytes("UTF-8"));
		example = dboBasicDao.createNew(example);
		assertNotNull(example);
		toDelete.add(example.getId());
		// Get it back from the DB
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", example.getId());
		DBOAnnotatedExample fetched = dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, params);
		assertEquals(example, fetched);
		// Now change the value
		fetched.setBlob("I am the new string for the blob!".getBytes("UTF-8"));
		fetched.setModifiedOn(new Date(fetched.getModifiedOn().getTime() + 10));
		fetched.setModifiedBy("Sombody else");
		// Now update it.
		boolean result = dboBasicDao.update(fetched);
		assertTrue(result);
		// Fetch it back
		DBOAnnotatedExample clone = dboBasicDao.getObjectByPrimaryKey(DBOAnnotatedExample.class, params);
		assertEquals(fetched, clone);

	}

	@Test
	public void testSelfForeignKey() throws Exception {
		// First create the object.
		DBOAnnotatedExample example = new DBOAnnotatedExample();

		TableMapping<DBOAnnotatedExample> tm = example.getTableMapping();
		FieldColumn[] columns = tm.getFieldColumns();

		// PARENT_ID column should have isSelfForeignKey annotation set to true
		// and rest should be set to false
		for (FieldColumn column : columns) {
			if (column.getColumnName().equals("PARENT_ID")) {
				assertTrue(column.isSelfForeignKey());
			} else {
				assertFalse(column.isSelfForeignKey());
			}
		}
	}

	@Test
	public void testHasFileHandleRef() throws Exception {
		// First create the object.
		DBOAnnotatedExample example = new DBOAnnotatedExample();

		TableMapping<DBOAnnotatedExample> tm = example.getTableMapping();
		FieldColumn[] columns = tm.getFieldColumns();

		for (FieldColumn column : columns) {
			if (column.getColumnName().equals("FILE_HANDLE")) {
				assertTrue(column.hasFileHandleRef());
			} else {
				assertFalse(column.hasFileHandleRef());
			}
		}
	}

}


text:
from sqlalchemy import Column, Integer, Unicode, ForeignKey, Text, Boolean, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine

Base = declarative_base()

# If the user uses oauth salt and password are null.
class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True, nullable=False)
    avatar = Column(Text, nullable=False)
    username = Column(Unicode(50), nullable=False)
    fullname = Column(Unicode(100), nullable=True)
    email = Column(Unicode(255), nullable=False)
    password = Column(Text, nullable=True)
    valid = Column(Boolean, nullable=False)

    stories = relationship("Story", backref="user")
    accounts = relationship("OAuthAccount", back_populates="user", lazy='dynamic')
    notifications = relationship("Notification")

class OAuthAccount(Base):
    __tablename__ = 'oauth_account'

    id = Column(Integer, primary_key=True, nullable=False)
    oauth_id = Column(Unicode(100), nullable=True)  # Provider provided ID.
    provider = Column(Unicode(30), nullable=False)  # facebook, github, etc...
    user_id = Column(Integer, ForeignKey('users.id'))

    user = relationship("User", back_populates="accounts")

class UserActivation(Base):
    __tablename__ = 'user_activation'

    id = Column(Integer, primary_key=True, nullable=False)
    user_id = Column(Integer, ForeignKey('users.id'))
    code = Column(Text, nullable=False)

    user = relationship("User")

class PasswordChange(Base):
    __tablename__ = 'password_change_requests'

    id = Column(Integer, primary_key=True, nullable=False)
    token = Column('reset_token', Text, nullable=False)
    time = Column('time', DateTime)
    user_id = Column('user_id', Integer, ForeignKey('users.id'), nullable=False)

    user = relationship("User")

class Story(Base):
    __tablename__ = 'stories'

    id = Column(Integer, primary_key=True, nullable=False)
    title = Column(Unicode(100), nullable=False)
    tags = Column(Text, nullable=True)
    content = Column(Text, nullable=False)
    user_id = Column(Integer, ForeignKey('users.id'))
    category_id = Column(Integer, ForeignKey('categories.id'))

    author = relationship("User")
    category = relationship("Category", backref="stories")
    comments = relationship("Comment", backref="story")

    def __repr__(self):
        return '<%s %s %s %s>' % (self.id, self.title, self.content, self.author)

class Category(Base):
    __tablename__ = 'categories'

    id = Column(Integer, primary_key=True, nullable=False)
    name = Column(Unicode(50), nullable=False)

    def __repr__(self):
        return '<%s %s>' % (self.id, self.name)

class Comment(Base):
    __tablename__ = 'comments'

    id = Column(Integer, primary_key=True, nullable=False)
    author = Column(Unicode(100), nullable=True)
    content = Column(Text, nullable=False)
    avatar = Column(Text, nullable=False)
    url = Column(Text, nullable=False)
    story_id = Column(Integer, ForeignKey('stories.id'))

class Notification(Base):
    __tablename__ = 'notifications'

    id = Column(Integer, primary_key=True, nullable=False)
    user_id = Column(Integer, ForeignKey('users.id'))
    type = Column(Text, nullable=False)
    text = Column(Text, nullable=False)
    link = Column(Text, nullable=False)
    read = Column(Boolean, nullable=False)

def create_from_scratch(connection_string):
    engine = create_engine(connection_string)
    Base.metadata.create_all(engine)


text:
 /// <summary>
///
/// </summary>

using UnityEngine;
using System;
using System.Collections;

[RequireComponent(typeof(Animator))]

//Name of class must be name of file as well

public class Responsive : MonoBehaviour {

    protected Animator animator;

    private Locomotion locomotion = null;

	// Use this for initialization
	void Start ()
	{
        animator = GetComponent<Animator>();
        locomotion = new Locomotion(animator);
	}

	void Update ()
	{
        if (animator)
		{
            float h = Input.GetAxis("Horizontal");
            float v = Input.GetAxis("Vertical");

            float speed = (h * h + v * v) * 6;
            float direction = Mathf.Atan2(h, v) * 180.0f / 3.14159f;

            locomotion.Do(speed, direction);
		}
	}
}


text:
declare namespace javax {
  namespace xml {
    namespace transform {

      interface SourceLocator {
        getPublicId(): java.lang.String
        getSystemId(): java.lang.String
        getLineNumber(): number
        getColumnNumber(): number
      }

    }
  }
}


text:
package mss.common.utils;

/**
 *
 * @author Juan Aguilar Guisado
 *
 * @param <T1>
 * @param <T2>
 * @param <T3>
 * @param <T4>
 */
public class Cuarter<T1, T2, T3, T4> {
	private T1 first;
	private T2 second;
	private T3 third;
	private T4 fourth;

	public Cuarter(T1 first, T2 second, T3 third, T4 fourth) {
		this.first = first;
		this.second = second;
		this.third = third;
		this.fourth = fourth;
	}

	public void setFirst(T1 first) {
		this.first = first;
	}

	public void setSecond(T2 second) {
		this.second = second;
	}

	public T1 getFirst() {
		return first;
	}

	public T2 getSecond() {
		return second;
	}

	public T3 getThird() {
		return third;
	}

	public void setThird(T3 third) {
		this.third = third;
	}

	public T4 getFourth() {
		return fourth;
	}

	public void setFourth(T4 fourth) {
		this.fourth = fourth;
	}

	public String toString() {
		return "(" + getFirst() + "," + getSecond() + "," + getThird() + "," + getFourth() + ")";
	}

}


text:
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo apt-get update
sudo apt-get -y install mysql-server
sudo sed -i "s/^bind-address/#bind-address/" /etc/mysql/my.cnf
mysql -u root -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; FLUSH PRIVILEGES;"
mysql -u root -proot -e "CREATE DATABASE medicaid;"
sudo /etc/init.d/mysql restart
echo "
[client]
user=root
password=root
database=medicaid
local-infile=1
" > /home/vagrant/.my.cnf

sudo apt-get install unzip

shopt -s nocaseglob
mkdir -p /home/vagrant/medicaid
wget --quiet 'https://data.medicare.gov/views/bg9k-emty/files/Nqcy71p9Ss2RSBWDmP77H1DQXcyacr2khotGbDHHW_s?content_type=application%2Fzip%3B%20charset%3Dbinary&filename=Hospital_Revised_Flatfiles.zip' -O /home/vagrant/medicaid/medicaid.zip
unzip /home/vagrant/medicaid/medicaid.zip -d /home/vagrant/medicaid
rename 's/[ -]+/_/g' /home/vagrant/medicaid/*
mkdir -p /home/vagrant/medicaid/hospital
mv /home/vagrant/medicaid/*hospital* /home/vagrant/medicaid/hospital > /dev/null 2>&1
mv /home/vagrant/medicaid/hospital* /home/vagrant/medicaid/hospital > /dev/null 2>&1

chown -R vagrant:vagrant medicaid/
chown -R vagrant:vagrant .my.cnf

sudo apt-get install -y python-pip

sudo pip install mycli


text:
import { SortPipe } from "./../shared/sort.pipe";
import { Component, OnInit } from "angular2/core";
import { FirebaseService } from "../shared/firebase.service";
import { ArcItem } from "./arc-item.model";
import { Observable } from "rxjs/Observable";
import { KeysPipe } from "../shared/keys.pipe";
import { NgClass } from "angular2/common";
import { SearchPipe } from "../shared/search.pipe";

@Component({
    selector: "arc-list",
    template: `

      <input type="text" class="form-control search-input" placeholder="search ..." #filter (keyup)="0">

{{ item.name }} {{ item.tag }}

        Go
        {{ item.id | date }}

{{ item.description }}

    `,
    pipes: [KeysPipe, SortPipe, SearchPipe],
    directives: [NgClass]
})

export class ArcListComponent implements OnInit {
  listItems: Observable<any[]>;

  constructor(private _firebaseService: FirebaseService) {}

  ngOnInit(): any {
    this.listItems = this._firebaseService.getResources();
  }

}


text:
package com.buer.javadesignpatterns.mediator;

import java.util.ArrayList;

/**
 * Created by TrampBoy on 2015/2/24.
 */
public class ConcreteMediator {
    ArrayList<Lender> lenders;
    ArrayList<Lessor> lessors;

    public ConcreteMediator() {
        lenders = new ArrayList<Lender>();
        lessors = new ArrayList<Lessor>();
    }

    public void registerLender(Lender lender){
        lenders.add(lender);
    }

    public void registerLessor(Lessor lessor){
        lessors.add(lessor);
    }

    public void deliverMess(User user, String mess){
        if (user instanceof Lender) {
            lessorReceiverMess(mess);
        } else if (user instanceof Lessor) {
            lenderReceiverMess(mess);
        }
    }

    private void lenderReceiverMess(String mess) {
        for (Lender lender : lenders) {
            lender.receiverMess(mess);
        }
    }

    private void lessorReceiverMess(String mess) {
        for (Lessor lessor : lessors ) {
            lessor.receiverMess(mess);
        }
    }

}


text:
package stroom.pipeline.refdata;

import stroom.util.logging.LambdaLogger;
import stroom.util.logging.LambdaLoggerFactory;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.IOException;

class TestReferenceDataLmdbConfig {

    private static final LambdaLogger LOGGER = LambdaLoggerFactory.getLogger(TestReferenceDataLmdbConfig.class);

    @Test
    void testJsonSerialisation() throws JsonProcessingException {

        ObjectMapper objectMapper = new ObjectMapper();
        ReferenceDataLmdbConfig lmdbConfig = new ReferenceDataLmdbConfig();

        final String json = objectMapper.writeValueAsString(lmdbConfig);

        LOGGER.info("json:\n{}", json);

        Assertions.assertThat(json)
                .contains("localDir");
        Assertions.assertThat(json)
                .contains("readerBlockedByWriter");
    }

    @Test
    void testJsonDeserialisation() throws IOException {

        ObjectMapper objectMapper = new ObjectMapper()
                .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);

        final String json = """
                {
                    "localDir":"my_dir",
                    "maxReaders":99,
                    "maxStoreSize":"10G",
                    "readAheadEnabled":true,
                    "readerBlockedByWriter": false
                }
                 """;

        final ReferenceDataLmdbConfig lmdbConfig = objectMapper.readValue(json, ReferenceDataLmdbConfig.class);

        Assertions.assertThat(lmdbConfig.isReaderBlockedByWriter())
                .isFalse();

        Assertions.assertThat(lmdbConfig.getLocalDir())
                .isEqualTo("my_dir");
    }

//    @Test
//    void testJsonDeserialisation_sparse() throws IOException {
//
//        ObjectMapper objectMapper = new ObjectMapper()
//                .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
//
//        final String json = """
//                {
//                    "localDir":"my_dir"
//                }
//                 """;
//
//        final ReferenceDataLmdbConfig lmdbConfig = objectMapper.readValue(json, ReferenceDataLmdbConfig.class);
//
//        Assertions.assertThat(lmdbConfig.getLocalDir())
//                .isEqualTo("my_dir");
//        Assertions.assertThat(lmdbConfig.getMaxReaders())
//                .isEqualTo(ReferenceDataLmdbConfig.DEFAULT_MAX_READERS);
//        Assertions.assertThat(lmdbConfig.getMaxStoreSize())
//                .isEqualTo(ReferenceDataLmdbConfig.DEFAULT_MAX_STORE_SIZE);
//        Assertions.assertThat(lmdbConfig.isReadAheadEnabled())
//                .isEqualTo(ReferenceDataLmdbConfig.DEFAULT_IS_READ_AHEAD_ENABLED);
//        Assertions.assertThat(lmdbConfig.isReaderBlockedByWriter())
//                .isEqualTo(ReferenceDataLmdbConfig.DEFAULT_IS_READER_BLOCKED_BY_WRITER);
//
//    }
}


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.validator.test.cfg;

/**
 * @author Hardy Ferentschik
 */
public class Runner {

	private String name;

	private boolean paidEntryFee;

	private int age;

	public boolean isPaidEntryFee() {
		return paidEntryFee;
	}

	public void setPaidEntryFee(boolean paidEntryFee) {
		this.paidEntryFee = paidEntryFee;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="Validate-OAuth-v2-Token">
    <DisplayName>Validate OAuth v2 Token</DisplayName>
    <FaultRules/>
    <Properties/>
    <Attributes/>
    <ExternalAuthorization>false</ExternalAuthorization>
    <Operation>VerifyAccessToken</Operation>
    <SupportedGrantTypes/>
    <GenerateResponse enabled="true"/>
    <Tokens/>
</OAuthV2>


text:
/**
 * By Tapia Mujica Fernando 10/07/15
 */
angular.module('ControlEscuela').factory('Classroom', function ($resource) {
    return $resource('classroom/:id', {id: '@id'}, {
        get: {
            method: 'GET',
            url: 'classroom/show/:id'
        },
        update: {
            method: 'PUT',
            url: 'classroom/update/'
        },
        delete: {
            method: 'DELETE',
            url: 'classroom/delete/:id'
        },
        create: {
            method: 'GET',
            url: 'classroom/create/'
        },
        save: {
            method: 'POST',
            url: 'classroom/save'
        },
        getClassroomByOffice: {
            method: 'GET',
            isArray: true,
            url: 'classroom/getClassroomByOffice/:id'
        },
        getNumberClassRoom: {
            method: 'GET',
            url: 'classroom/getNumberClassRoom/'
        },
        getUsersByClassroom: {
            method: 'GET',
            isArray: true,
            url: 'classroom/getUsersByClassroom/:id'
        },
        getUsersInClassroom: {
            method: 'GET',
            isArray: true,
            url: 'classroom/getUsersInClassroom/:id'
        }
    });
});


text:
package com.google.gerrit.client.changes;

import com.google.gwt.i18n.client.Messages;

public interface ChangeMessages extends Messages {
  String accountDashboardTitle(String fullName);
  String changesOpenInProject(String string);
  String changesMergedInProject(String string);
  String changesAbandonedInProject(String string);

  String revertChangeDefaultMessage(String commitMsg, String commitId);

  String cherryPickedChangeDefaultMessage(String commitMsg, String commitId);
  String changeScreenTitleId(String changeId);
  String outdatedHeader(int outdated);
  String patchSetHeader(int id);
  String loadingPatchSet(int id);
  String submitPatchSet(int id);

  String patchTableComments(@PluralCount int count);
  String patchTableDrafts(@PluralCount int count);
  String patchTableSize_Modify(int insertions, int deletions);
  String patchTableSize_LongModify(int insertions, int deletions);
  String patchTableSize_Lines(@PluralCount int insertions);

  String removeReviewer(String fullName);
  String messageWrittenOn(String date);

  String renamedFrom(String sourcePath);
  String copiedFrom(String sourcePath);
  String otherFrom(String sourcePath);

  String needApproval(String labelName);
  String publishComments(String changeId, int ps);
  String lineHeader(int line);

  String changeQueryWindowTitle(String query);
  String changeQueryPageTitle(String query);

  String reviewerNotFound(String who);
  String accountInactive(String who);
  String changeNotVisibleTo(String who);
  String groupIsEmpty(String group);
  String groupIsNotAllowed(String group);
  String groupHasTooManyMembers(String group);
  String groupManyMembersConfirmation(String group, int memberCount);

  String secondsAgo(long seconds);
  String minutesAgo(long minutes);
  String hoursAgo(long hours);
  String daysAgo(long days);
  String weeksAgo(long weeks);
  String monthsAgo(long months);
  String yearsAgo(long years);
  String years0MonthsAgo(long years, String yearLabel);
  String yearsMonthsAgo(long years, String yearLabel, long months,
      String monthLabel);
}


text:
$:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'simplecov'
require 'eager'
require 'rspec'


text:
// This file contains platform-specific typedefs and defines.

#ifndef WEBRTC_TYPEDEFS_H_
#define WEBRTC_TYPEDEFS_H_

// Reserved words definitions
// TODO(andrew): Look at removing these.
#define WEBRTC_EXTERN extern
#define G_CONST const
#define WEBRTC_INLINE extern __inline

// Derived from Chromium's build/build_config.h
// Processor architecture detection.  For more info on what's defined, see:
//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
//   http://www.agner.org/optimize/calling_conventions.pdf
//   or with gcc, run: "echo | gcc -E -dM -"
// TODO(andrew): replace WEBRTC_LITTLE_ENDIAN with WEBRTC_ARCH_LITTLE_ENDIAN.
#if defined(_M_X64) || defined(__x86_64__)
#define WEBRTC_ARCH_X86_FAMILY
#define WEBRTC_ARCH_X86_64
#define WEBRTC_ARCH_64_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#elif defined(_M_IX86) || defined(__i386__)
#define WEBRTC_ARCH_X86_FAMILY
#define WEBRTC_ARCH_X86
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#elif defined(__ARMEL__)
// TODO(andrew): We'd prefer to control platform defines here, but this is
// currently provided by the Android makefiles. Commented to avoid duplicate
// definition warnings.
//#define WEBRTC_ARCH_ARM
// TODO(andrew): Chromium uses the following two defines. Should we switch?
//#define WEBRTC_ARCH_ARM_FAMILY
//#define WEBRTC_ARCH_ARMEL
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#elif defined(__MIPSEL__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#define WEBRTC_LITTLE_ENDIAN
#else
//#error Please add support for your architecture in typedefs.h
#endif

#if defined(__SSE2__) || defined(_MSC_VER)
#define WEBRTC_USE_SSE2
#endif

#if !defined(_MSC_VER)
#include <stdint.h>
#else
// Define C99 equivalent types, since MSVC doesn't provide stdint.h.
typedef signed char         int8_t;
typedef signed short        int16_t;
typedef signed int          int32_t;
typedef __int64             int64_t;
typedef unsigned char       uint8_t;
typedef unsigned short      uint16_t;
typedef unsigned int        uint32_t;
typedef unsigned __int64    uint64_t;
#endif

// TODO(andrew): remove WebRtc_ types:
// http://code.google.com/p/webrtc/issues/detail?id=314
typedef int8_t              WebRtc_Word8;
typedef int16_t             WebRtc_Word16;
typedef int32_t             WebRtc_Word32;
typedef int64_t             WebRtc_Word64;
typedef uint8_t             WebRtc_UWord8;
typedef uint16_t            WebRtc_UWord16;
typedef uint32_t            WebRtc_UWord32;
typedef uint64_t            WebRtc_UWord64;

#endif  // WEBRTC_TYPEDEFS_H_


text:
var express = require('express');
var app = express();

var port = 1337;

app.listen(port, function(){
	console.log("Server Running on Port " + port);
});

//This tells express that the moment I visit the server, it should look into the ./public folder for a index.html and send it to me.

app.use(express.static(__dirname + '/public'));;

//---------------------------------------------------
//Responses to different endpoints(URLs)

app.get('/endpoint1', function(request,response){
	response.send("You Hit Endpoint 1!");
});

app.get('/endpoint2', function(request,response){
	response.send("You Hit Endpoint 2");
});

app.get('/api/endpoint', function(request,response){
	response.send("You Hit Endpoint /api/endpoint");
})

//---------------------------------------------------
// Responses to the different access methods.

app.get('/api/singleendpoint', function(request,response){
	response.send("You're GET-ing!");
});

app.post('/api/singleendpoint', function(request,response){
	response.send("You're POST-ing!");
});

//---------------------------------------------------


text:
require 'digest/sha1'

Rails.application.config.middleware.use Warden::Manager do |manager|
  manager.failure_app = proc { |_env| ['401', { 'Content-Type' => 'application/json' }, { error: 'Unauthorized', code: 401 }] }
end

Warden::Manager.serialize_into_session do |user|
  # convert to warden_session_obj
  serialized = user.slice("id", "role")
  # extra field to improve security
  serialized["salt_hash"] = Digest::SHA1.hexdigest(user.salt || "")
  serialized
end

Warden::Manager.serialize_from_session do |warden_session_obj|
  return nil unless warden_session_obj.instance_of?(Hash)

  id, role, salt_hash = warden_session_obj.values_at("id", "role", "salt_hash")
  user = User.find_by(id: id, role: role)
  if user && salt_hash == Digest::SHA1.hexdigest(user.salt || "")
    user
  end
end

# This code provides routing mapper to authenticate routes
# ex:
# -- routes.rb --
#   authenticate :user, ->(u) { u.admin? } do
#     mount RESQUE_SERVER, at: "/resque"
#   end
module ActionDispatch::Routing
  class Mapper
    def authenticate(scope = nil, block = nil)
      constraint = lambda do |request|
        request.env['warden'].authenticated?(scope) && (block.nil? || block.call(request.env['warden'].user(scope)))
      end
      constraints(constraint) do
        yield
      end
    end
  end
end

Rails.application.config.middleware.use OmniAuth::Builder do
  provider(
    :auth0,
    ENV["AUTH0_CLIENT_ID"],
    ENV["AUTH0_CLIENT_SECRET"],
    ENV["AUTH0_DOMAIN"],
    callback_path: '/auth/auth0/callback',
    authorize_params: {
      scope: 'openid email',
    }
  )
end

OmniAuth.config.failure_raise_out_environments = []

OmniAuth.config.on_failure = proc do |env|
  Auth0Controller.action(:omniauth_failure).call(env)
end


text:
package types

// DO NOT EDIT. THIS FILE WAS AUTOMATICALLY GENERATED

// SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions - no documentation
type SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions struct {

	// ImmediateApprovalOnlyFlag - When explicitly set to true, createObject(s) will fail unless the order
	// is started automatically. This can be used by automated systems to fail an order that might
	// otherwise require manual approval. For multi-guest orders via
	// [[SoftLayer_Virtual_Guest/createObjects|createObjects]], this value must be the exact same for every
	// item.
	ImmediateApprovalOnlyFlag bool `json:"immediateApprovalOnlyFlag,omitempty"`

	// PostInstallScriptUri - URI of the script to be downloaded and executed after installation is
	// complete. This can be different for each virtual guest when multiple are sent to
	// [[SoftLayer_Virtual_Guest/createObjects|createObjects]].
	PostInstallScriptUri string `json:"postInstallScriptUri,omitempty"`
}

func (softlayer_virtual_guest_supplementalcreateobjectoptions *SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions) String() string {
	return "SoftLayer_Virtual_Guest_SupplementalCreateObjectOptions"
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Nidularia byssiseda Jungh.

### Remarks
null


text:
class TokyoMetro::Static::Fundamental::TopLevel::UsingMultipleYamls
  include ::TokyoMetro::Modules::ToFactory::Static::Generate::Group::MultipleYamls
end


text:
using System;
using Xamarin.Forms.Maps;
using Xamarin.Forms;
using System.Collections.Generic;

namespace FrillyToothpicksMap
{
    public class BetterMap : Map
    {
        List<MapCircle> circles = new List<MapCircle>();
        List<MapLine> lines = new List<MapLine>();
        List<MapPolygon> polygons = new List<MapPolygon>();

        public BetterMap()
        {
            ReSend = false;
        }

        public void AddCircle(MapCircle circle)
        {
            if (circle != null)
            {
                circles.Add(circle);
                if (MapDataAdedEvent == null)
                    ReSend = true;
                else
                    MapDataAdedEvent(circle);
            }
        }

        public void ClearCircles()
        {
            if (MapDataRemovedEvent != null)
            {
                foreach (var circle in circles)
                {
                    MapDataRemovedEvent(circle);
                }
                circles.Clear();
            }
        }

        public void AddLine(MapLine line)
        {
            if (line != null)
            {
                lines.Add(line);
                if (MapDataAdedEvent == null)
                    ReSend = true;
                else
                    MapDataAdedEvent(line);
            }
        }

        public void ClearLines()
        {
            if (MapDataRemovedEvent != null)
            {
                foreach (var line in lines)
                {
                    MapDataRemovedEvent(line);
                }
                lines.Clear();
            }
        }

        public void AddPolygon(MapPolygon polygon)
        {
            if (polygon != null)
            {
                polygons.Add(polygon);
                if (MapDataAdedEvent == null)
                    ReSend = true;
                else
                    MapDataAdedEvent(polygon);
            }
        }

        public void ClearPolygons()
        {
            if (MapDataRemovedEvent != null)
            {
                foreach (var poly in polygons)
                {
                    MapDataRemovedEvent(poly);
                }
                polygons.Clear();
            }
        }

        public delegate void MapDataAdded(BetterMapDrawing drawing);

        public delegate void MapDataRemoved(BetterMapDrawing drawing);

        public event MapDataAdded MapDataAdedEvent;
        public event MapDataRemoved MapDataRemovedEvent;

        public bool ReSend { get; set; }

        public MapCircle[] Circles { get { return circles.ToArray(); } }

        public MapLine[] Lines { get { return lines.ToArray(); } }

        public MapPolygon[] Polygons { get { return polygons.ToArray(); } }
    }

    public abstract class BetterMapDrawing
    {
        public long Handle { get; set; }
    }

    public class MapCircle : BetterMapDrawing
    {
        public Position Position { get; private set; }

        public Color Color { get; private set; }

        public double Radius { get; private set; }

        public MapCircle(Position position, Color color, double radius)
        {
            Position = position;
            Color = color;
            Radius = radius;
        }
    }

    public class MapLine : BetterMapDrawing
    {
        public Position[] Positions { get; private set; }

        public Color Color { get; private set; }

        public MapLine(Position[] positions, Color color)
        {
            Positions = positions;
            Color = color;
        }
    }

    public class MapPolygon : BetterMapDrawing
    {
        public Position[] Positions { get; private set; }

        public Color Color { get; private set; }

        public MapPolygon(Position[] positions, Color color)
        {
            Positions = positions;
            Color = color;
        }
    }
}


text:
.content,
.twitter-widget {
  box-sizing: content-box;
  max-width: 1114px;
  max-width: 69.625rem;
  margin: auto;
  padding-left: 4%;
  padding-right: 4%;
}

/* Special symbol font */
.ambra-symbols-font {
  font-family: 'ambraSymbols', sans-serif;
}

@font-face {
  font-family: 'ambraSymbols';
  src: url('../fonts/ambraSymbols.eot');
  src: url('../fonts/ambraSymbols.eot?#iefix') format('embedded-opentype'), url('../fonts/ambraSymbols.woff') format('woff'), url('../fonts/ambraSymbols.ttf') format('truetype'), url('../fonts/ambraSymbols.svg#plos') format('svg');
  font-weight: 400;
  font-style: normal;
}

/* Reusable Styles */
.float-left {
  float: left;
}

.float-right {
  float: right;
}

.hide-overflow-and-text {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
}

.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}

.clearfix:after {
  clear: both;
}

.clearfix {
  zoom: 1;
}

.bold {
  font-weight: 600;
}

.blue-link {
  color: #369;
}

.grey-on-gold {
  background: #666;
  color: #fff;
}

.header-style {
  font-weight: 400;
}

.pad-below {
  margin-bottom: 20px;
}

.content a {
  color: #369;
}

.content .coloration-white-on-color,
.content .btn-lg {
  color: #fff;
}

#container-main.inactive {
  position: fixed;
  overflow: hidden;
}

#container-main-overlay {
  z-index: 1001;
  position: absolute;
  height: 100%;
  width: 100%;
  display: none;
  left: 0;
  top: 50px;
}

#container-main-overlay.active {
  display: block;
}

.item-title {
  font-size: .8em;
  font-weight: 400;
  text-transform: uppercase;
}

/* Header */
#site-header-container {
  border-top-width: 4px;
  border-top-style: solid;
  background-color: #efefef;
  height: 50px;
}

#site-menu-button {
  float: left;
  background-position: -112px 0;
  width: 27px;
  height: 21px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  box-sizing: content-box;
  text-indent: -1000px;
  display: block;
  margin: 13px 0 0 12px;
  border-right: 20px solid #efefef;
}

.site-search-button {
  line-height: 44px;
  display: block;
  width: 45px;
  float: right;
}

.site-search-button .icon,
.editors-search-button .icon {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
  background-position: -187px 0;
  width: 23px;
  height: 18px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  margin: 15px auto 0 auto;
  padding: 2rem 0 0;
}

.editors-search-button .icon {
  margin: 0 auto;
  padding: 0 0 0 0;
}

/* Lists */
.std {
  list-style: disc inside none;
}

.bulleted {
  list-style: disc inside;
}

.bulleted li {
  line-height: 1.45rem;
  margin-bottom: 1.25em;
}
/* Results */
.results li {
  background-color: #f9f9f9;
  border-bottom: 1px solid #ddd;
  padding: 1rem .5rem;
}

.results li a,
.results li .error {
  display: block;
  padding-right: 2.5em;
}

.results li a {
  color: #333;
  background: url('../img/bg/arrow-right.png') no-repeat right center;
}

.results li .error {
  color: #800;
}

.results li:first-child {
  border-top: 1px solid #ddd;
}

.results li:nth-child(even) {
  background: none;
}

.results li:last-child {
  border-bottom: 1px solid #ddd;
}

/* Footer */
.footer {
  background: #333;
  padding: 2rem 1rem 4rem;
}

.footer .footer-credits {
  color: #fff;
  text-align: center;
  line-height: 1.4em;
  margin-top: 6px;
}

.footer .footer-credits a {
  color: #fff;
}

/* Alerts */
.red-alert,
.amendment.amendment-retraction,
.amendment.amendment-eoc,
.amendment.amendment-uncorrected-proof {
  background: #fce2e5;
}

.red-alert h3,
.amendment-uncorrected-proof h2 {
  color: #e53350;
}

.amendment-uncorrected-proof {
  padding: 12px;
  margin-top: 1em;
}

.amendment-uncorrected-proof h2 {
  margin-top: 0 !important;
}

.amendment.amendment-correction {
  background-color: #efefef;
}

/* Buttons */

.btn-lg,
.two-btn-container a,
.rounded {
  -webkit-border-top-right-radius: 3px;
  -webkit-border-bottom-right-radius: 3px;
  -webkit-border-bottom-left-radius: 3px;
  -webkit-border-top-left-radius: 3px;
  -moz-border-radius-topright: 3px;
  -moz-border-radius-bottomright: 3px;
  -moz-border-radius-bottomleft: 3px;
  -moz-border-radius-topleft: 3px;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  border-top-left-radius: 3px;
  -moz-background-clip: padding-box;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  text-align: center;
}

.btn-lg {
  padding: .5em 1em;
  line-height: 44px;
  background: #333;
  width: 100%;
  color: #fff;
  display: block;
}

.btn-lg.med {
  background: #525252;
}

.two-btn-container a {
  width: 100%;
  color: #fff;
}

.rounded {
  display: inline-block;
  padding: 12px 20px;
  background: #333;
  color: #fff;
}

.button-pair a.rounded {
  float: left;
}

.close {
  font-size: 1.266em;
  height: 1.266em;
  width: 1.266em;
  display: block;
  font-family: 'ambraSymbols', sans-serif;
  cursor: pointer;
}

.square-full {
  height: 40px;
  width: 100%;
  font-weight: 600;
  text-align: center;
  display: block;
  line-height: 40px;
}

.buttongroup {
  margin: 0 auto;
  display: table;
}

.buttongroup > button {
  padding: 0 12px;
  height: 44px;
  line-height: 44px;
  background: #333;
  color: #fff;
  display: table-cell;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  -moz-background-clip: padding-box;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}

.buttongroup > button:first-child {
  -webkit-border-top-right-radius: 0;
  -webkit-border-bottom-right-radius: 0;
  -moz-border-radius-topright: 0;
  -moz-border-radius-bottomright: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.buttongroup > button:last-child {
  -webkit-border-bottom-left-radius: 0;
  -webkit-border-top-left-radius: 0;
  -moz-border-radius-bottomleft: 0;
  -moz-border-radius-topleft: 0;
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}

.buttongroup > button.active {
  background: #737373;
}

.filter-button {
  font-weight: 600;
  padding: 0 12px;
  height: 44px;
  line-height: 44px;
}

.filter-button span {
  display: inline-block;
}

.filter-button .arrow {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
  background-position: -290px 0;
  width: 9px;
  height: 6px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  display: inline-block;
  margin-left: 12px;
}

.filter-button.active {
  background: #333;
  color: #fff;
}

.filter-button.active .arrow {
  background-position: -291px -10px;
}

/* Menus */
.full-menu-container {
  display: none;
  width: 80%;
  background: #000;
  border-top-width: 4px;
  border-top-style: solid;
  position: absolute;
  top: 0;
  left: 0;
  min-height: 100%;
  z-index: 1;
  color: #fff;
  padding-bottom: 20px;
}

.full-menu-container .expander {
  padding: 0 .5em;
  font-weight: 600;
  font-size: .8em;
}

.full-menu-container .full-menu .primary .accordion-item {
  border-bottom: 1px solid #333;
}

.full-menu-container .full-menu .primary .accordion-item > a {
  position: relative;
  display: block;
  color: #fff;
  line-height: 44px;
}

.full-menu-container .full-menu .primary .accordion-item > a .arrow {
  margin-top: -4px;
  position: absolute;
  top: 50%;
  right: 12px;
  overflow: hidden;
  text-indent: -1000px;
  display: block;
  background-position: -275px -10px;
  width: 7px;
  height: 8px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
}

.full-menu-container .full-menu .primary .accordion-item .secondary {
  display: none;
  overflow: hidden;
}

.full-menu-container .full-menu .primary .accordion-item.expanded .arrow {
  background-position: -276px 0;
  width: 7px;
  height: 6px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
}

.full-menu-container .full-menu .secondary .btn-lg {
  margin-bottom: 1em;
  text-align: left;
  background: #333;
}

.full-menu-container .full-menu-tout {
  padding: 0 12px;
}

.full-menu-container .full-menu-tout h4 {
  color: #4A1010;
  padding-bottom: 12px;
}

.full-menu-container .full-menu-tout .std li {
  line-height: 1.3em;
}

.full-menu-container .full-menu-tout .std li:last-child {
  margin-bottom: 20px;
}

.full-menu-container .full-menu-tout a.rounded.coloration-white-on-color {
  font-weight: 600;
}

.menu-bar {
  border-top: 1px solid #737373;
}

.menu-bar ul {
  width: 100%;
  display: table;
  text-align: center;
}

.menu-bar li,
.menu-rounded li,
.menu-rounded td {
  -webkit-transition: background-color 100ms linear;
  -moz-transition: background-color 100ms linear;
  -o-transition: background-color 100ms linear;
  -ms-transition: background-color 100ms linear;
  transition: background-color 100ms linear;
  display: table-cell;
  background: #333;
}

.menu-bar li {
  border-right: 1px solid #737373;
}
.menu-bar li a {
  color: #fff;
  line-height: 40px;
  display: block;
}

.menu-bar li.active {
  background: #4A1010;
}

.menu-bar li.active a {
  color: #333;
}

.menu-bar li:last-child {
  border-right: 0;
}

.menu-rounded ul,
.menu-rounded table {
  text-align: center;
  display: table;
  margin: 0 auto;
  border-spacing: 12px 14px;
}

.menu-rounded li,
.menu-rounded td {
  font-weight: 600;
  display: table-cell;
  padding: 12px 5px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  -moz-background-clip: padding-box;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  background: #333;
  color: #fff;
}

.menu-rounded .active.coloration-white-on-color {
  background: #4A1010;
  color: #333;
}

.menu-rounded table {
  border-collapse: separate;
}

.menu-rounded .row {
  display: table-row;
}

.article-menu-bottom {
  margin-top: 20px;
  padding: 12px;
}

.article-menu-bottom .btn-lg {
  margin-top: 12px;
}

.article-menu-bottom .btn-top-container {
  margin-top: 20px;
  text-align: center;
}

.article-menu-bottom .btn-top-container .btn-text {
  font-style: italic;
}

.article-menu-bottom .btn-top-container .btn {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
  background-position: -225px 0;
  width: 40px;
  height: 39px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  margin: 5px auto 0 auto;
}

.footer-menu ul,
.footer-secondary-menu ul {
  text-align: center;
  margin: 0 auto;
}

.footer-menu li,
.footer-secondary-menu li {
  display: block;
  height: 44px;
  line-height: 44px;
}

.footer-menu a,
.footer-secondary-menu a {
  color: #fff;
}

.footer-non-profit-statement {
  width: 100%;
  color: white;
  text-align: center;
  margin: 2rem auto 4rem;
}

.logo-footer {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

/* Search */
.search-expanded {
  position: absolute;
  z-index: 10;
  margin-top: 50px;
  width: 100%;
  display: none;
  text-align: center;
}

.search-expanded .search-button-container {
  position: relative;
  height: 50px;
  width: 100%;
}

.search-expanded .search-form-container {
  background: #4A1010;
  padding: 1rem 4%;
}

.search-expanded .search-form-container .search-field {
  color: #333;
  padding: 4px;
  height: 44px;
  line-height: 44px;
  display: inline;
  margin: 0 auto;
  border: 1px solid #333;
  width: 100%;
}

.search-expanded .search-form-container .search-buttons {
  margin: 4%;
  text-align: right;
}

.search-expanded .search-form-container .search-buttons button {
  margin-left: 15px;
}

.search-expanded.active {
  display: block;
}

.form-group label {
  display: block;
  text-align: left;
  font-weight: 600;
}

/* Article Item*/

.lead-in,
.small-caps {
  text-transform: uppercase;
  font-weight: 400;
}

.lead-in {
  letter-spacing: .15em;
  color: #999;
  margin-top: 1.25rem;
  display: block;
  font-weight: 600;
}

.author-list a {
  color: #369;
}

.author-list .more-authors-list,
.author-list .author-less {
  display: none;
}

.content .article-title {
  color: #222;
  text-decoration: none;
}

.article-item .citation > a {
  text-decoration: none;
  color: #000;
  display: block;
}

.article-options-menu {
  margin-top: 1.25em;
}

.article-option {
  font-weight: 600;
  display: inline-block;
  float: left;
  height: 44px;
  padding: 0 15px;
  line-height: 44px;
  text-align: center;
}

.article-option:first-child {
  padding-left: 0;
  border-left: 0;
}

/* Filter Box */
.filter-box {
  background: #eee;
  color: #333;
  padding: 1rem;
  width: 100%;
}

#filter-results-container,
.filter-button {
  background: #ddd;
}

.filter-option {
  margin-bottom: 24px;
}

.filter-label {
  font-weight: 600;
  color: #000;
}

.filter-option select {
  background: #fff;
  margin-top: 12px;
  line-height: 44px;
  height: 44px;
  padding: 4px;
  width: 100%;
}

.filter-box .filter-application {
  text-align: right;
}

.apply {
  margin-left: 2%;
}

/* Browser */
.browse-level[data-level="1"] li a {
  background: #222121;
}

.browse-level[data-level="2"] li a {
  background: #373737;
}

.browse-level[data-level="3"] li a {
  background: #525252;
}

.browse-level[data-level="4"] li a {
  background: #666;
}

.browse-level[data-level="5"] li a {
  background: #777676;
}

.browse-level[data-level="6"] li a {
  background: #8b8a8a;
}

.browse-level[data-level="7"] li a {
  background: #a1a1a1;
}

.browse-level[data-level="8"] li a {
  background: #bfbdbd;
}

.browse-list > li {
  position: relative;
  margin-bottom: 12px;
  display: table;
  width: 100%;
}

.browse-list > li:first-child {
  margin-top: 2px;
}

.browse-list > li:last-child {
  margin-bottom: 20px;
}

.browse-list > li a {
  color: #fff;
  display: table-cell;
  vertical-align: middle;
  height: 44px;
  line-height: 44px;
  background: #000;
}

.browse-left,
.browse-right {
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  -moz-background-clip: padding-box;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  width: 100%;
  padding: 0 40px 0 20px;
}

.browse-right {
  position: absolute;
  right: 0;
  top: 0;
  width: 35px;
  overflow: hidden;
  text-indent: -1000px;
  display: block;
}

.browse-list .browse-right .arrow {
  background-position: -275px -10px;
  width: 6px;
  height: 9px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -5px;
  margin-left: -3px;
}

.browse-list .browse-right.inactive {
  background: #d3d3d3;
  cursor: default;
}

/* Accordions */
.main-accordion .accordion-item {
  border-bottom: 1px solid #eee;
}

.main-accordion .accordion-item > a {
  min-height: 40px;
  display: block;
  padding: 1rem 0 1rem 2rem;
  margin: 0 -1em;
  color: #222;
  font-weight: 600;
}

.main-accordion .accordion-item .arrow {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
  background-position: -187px -37px;
  width: 13px;
  height: 8px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  margin-top: 8px;
  float: right;
}

.main-accordion .accordion-item:first-child {
  border-top: 1px solid #eee;
}

.main-accordion .accordion-item.expanded > a {
  background: #4A1010;
  color: #fff;
  -webkit-transition: background-color 100ms linear;
  -moz-transition: background-color 100ms linear;
  -o-transition: background-color 100ms linear;
  -ms-transition: background-color 100ms linear;
  transition: background-color 100ms linear;
}

.main-accordion .accordion-item.expanded > a .arrow {
  background-position: -275px -25px;
}

.accordion-content {
  display: none;
  padding: 1.25rem 0;
}

.accordion-item {
  margin: 0;
}

.section {
  margin: 1rem auto;
  padding: 1rem 0;
  border-top: 1px solid #eee;
}

/* Headers */
.back-header {
  background-color: #fff !important;
  border-bottom: 1px solid #d3d3d3;
}

.back {
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  height: 44px;
  line-height: 44px;
  margin: 1rem;
  font-size: 80%;
}

.back-header #topic-name {
  text-transform: uppercase;
}

.section-header {
  padding: 0 15px;
  display: block;
  border-bottom: 1px solid #eee;
}

.section-header.oneline {
  height: 55px;
  line-height: 55px;
}

/* Modals
.modal-info-window {
  position: fixed;
  z-index: 1000;
  background: #333;
  height: 270px;
  width: 100%;
  bottom: -270px;
  display: none;
}

.modal-header {
    background-size: 100% 9px;
    padding: 10px;
    height: 50px;
    position: absolute;
    width: 100%;
}

.modal-info-window .modal-header .close {
    width: 20px;
    height: 20px;
    display: block;
    float: right;
    font-size: 20px;
    font-family: "ambraSymbols",sans-serif;
    cursor: pointer;
}

.modal-content {
  height: 190px;
  padding: 0 1rem;
  color: #fff;
  position: relative;
  top: 0;
  overflow-y: scroll;
  -webkit-transition: opacity 300ms ease-in-out;
  -moz-transition: opacity 300ms ease-in-out;
  -ms-transition: opacity 300ms ease-in-out;
  -o-transition: opacity 300ms ease-in-out;
  transition: opacity 300ms ease-in-out;
  -moz-opacity: 0;
  -khtml-opacity: 0;
  -webkit-opacity: 0;
  opacity: 0;
  filter: alpha(opacity=0);
  -webkit-overflow-scrolling: touch;
}

/* Hiding author search button for now, as the functionality is broken
.modal-info-window .modal-search {
  display: none;
}

.modal-info-window.active .modal-content {
  -moz-opacity: 1;
  -khtml-opacity: 1;
  -webkit-opacity: 1;
  opacity: 1;
  filter: alpha(opacity=100);
}
/* Modals */
.modal-info-window {
  position: fixed;
  z-index: 1000;
  background: #333;
  height: 270px;
  width: 100%;
  bottom: -270px;
  display: none;
}

.modal-info-window .modal-header {
  padding: 1rem;
  height: 50px;
  position: absolute;
  width: 100%;
}

.modal-info-window .modal-header .close {
  float: right;
}

.modal-info-window .modal-content {
  height: 190px;
  padding: 0 1rem;
  color: #fff;
  position: relative;
  top: 40px;
  overflow-y: scroll;
  -webkit-transition: opacity 300ms ease-in-out;
  -moz-transition: opacity 300ms ease-in-out;
  -ms-transition: opacity 300ms ease-in-out;
  -o-transition: opacity 300ms ease-in-out;
  transition: opacity 300ms ease-in-out;
  -moz-opacity: 0;
  -khtml-opacity: 0;
  -webkit-opacity: 0;
  opacity: 0;
  /*-ms-filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); TODO Syntax error? */
  filter: alpha(opacity=0);
  -webkit-overflow-scrolling: touch;
}

.modal-info-window .modal-search {
  position: absolute;
  bottom: 0;
}

.modal-info-window.active .modal-content {
  -moz-opacity: 1;
  -khtml-opacity: 1;
  -webkit-opacity: 1;
  opacity: 1;
  /*-ms-filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); TODO Syntax error? */
  filter: alpha(opacity=100);
}

/* Top Modal */
.modal-info-window.top {
  height: 100%;
  bottom: -100%;
  overflow-y: hidden;
}

.modal-info-window.top .modal-content {
  padding: 1rem;
  height: 100%;
  color: #ccc;
}

.modal-info-window.top .modal-content a {
  color: #fff;
  font-weight: bold;
}

.modal-info-window.tab {
  height: 100%;
  bottom: -100%;
  margin-bottom: 10px;
  display: block;
}

.modal-info-window.tab .modal-content {
  height: 100%;
  padding-bottom: 80px;
}

/* Hiding author search button for now, as the functionality is broken */
.modal-info-window .modal-search {
  display: none;
}

/* ================================================ */

/* Top Modal */
.modal-info-window.top {
  height: 100%;
  bottom: -100%;
  overflow-y: hidden;
}

.modal-info-window.top .modal-content {
  padding: 20px 20px 60px 20px;
  height: 100%;
  color: #ccc;
}

.modal-info-window.top .modal-content h3 {
  color: #fff;
}

.modal-content a {
  color: #fff;
  font-weight: 600;
}

.modal-info-window.top .modal-content ol {
  margin: 0 0 20px 15px;
}

.modal-info-window.top .modal-content textarea {
  height: 70px;
  margin-bottom: 15px;
}

.modal-info-window.top .modal-content .radio-group {
  color: #fff;
}

.modal-info-window.top .modal-content .radio-group .radio-option {
  margin-bottom: 12px;
}

#form-cancel {
  background: #666;
}

#form-post {
  color: #333;
}

.modal-info-window.tab {
  height: 100%;
  bottom: -100%;
  margin-bottom: 12px;
  display: block;
}

.modal-info-window.tab .modal-content {
  height: 100%;
  padding-bottom: 80px;
}

/* Saved Articles */
.save-article.circular {
  float: right;
  width: 30px;
  height: 30px;
  margin: 0 0 5px 5px;
  font-family: 'ambraSymbols', sans-serif;
}

.save-article.full.saved {
  background: #d7df23;
  color: #333;
}

/* Forms */
.standard-form label,
.standard-form input,
.standard-form textarea,
.standard-form p {
  margin-bottom: 2rem;
}

.standard-form input {
  border: 1px solid #333;
  line-height: 44px;
  height: 44px;
}

.standard-form label {
  font-weight: 600;
}

.standard-form label,
.standard-form input,
.standard-form textarea {
  display: block;
  width: 96%;
}

.standard-form textarea {
  height: 85px;
}

#article-items {
  margin-bottom: 2rem;
}

/* Pagination */
.nav-pagination {
  text-align: center;
  margin: 1rem auto 2rem;
}

.nav-pagination .previous,
.nav-pagination .next {
  overflow: hidden;
  text-indent: -1000px;
  display: block;
}

.nav-pagination .previous {
  background-position: -187px -55px;
  width: 7px;
  height: 44px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  margin-left: 0;
  margin-right: 15px; /* 25px minus the 12px on '.nav-pagination > a' */
}

.nav-pagination .next {
  background-position: -200px -55px;
  width: 7px;
  height: 13px;
  background-repeat: no-repeat;
  background-image: url('../img/sprites/structure.png');
  background-size: 300px 75px;
  margin-left: 25px;
}

.nav-pagination > a,
.nav-pagination .previous,
.nav-pagination .next {
  display: inline-block;
}

.nav-pagination > a,
.nav-pagination .skip {
  font-weight: 600;
  margin-left: 12px;
}

.content.from-modal textarea {
  width: 100%;
  height: 80px;
}

.content.from-modal input:not([type='radio']) {
  width: 100%;
}

#response-form-content #comment-response #response-subject {
  margin-bottom: 12px;
  border: 1px solid #d3d3d3;
}

#reference-panel {
  position: fixed;
  z-index: 1000; /* same as modal */
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 2em;
  background: #333;
  color: #fff;
  padding: 12px;
  box-shadow: 0 0 12px 5px #666;
}

#reference-panel li {
  display: inline;
}

#reference-panel li:after {
  content: " • ";
}

#reference-panel li:last-child:after {
  content: none;
}

#ref-panel-content a {
  color: #8AA1CF;
  font-weight: 600;
}

#reference-panel .close {
  float: right;
  margin: -5px 0 12px 12px;
  width: auto;
}

@media all and (orientation: landscape) {
  .modal-info-window {
    height: 100%;
  }
  .modal-info-window .modal-content {
    height: 100%;
  }/* corrections for iOS zoom on orientation landscape */
  .modal-info-window #share-methods {
    padding-bottom: 60px; /* necessary for inconsistencies in iOS zoom behavior among versions */
  }
  .modal-info-window #remove-article {
    margin-bottom: 60px;
  }
}

.error {
  padding: 30px 30px 30px 12px;
}

.error h1 {
  padding: 18px 20px 18px 0;
}

.error p {
  margin-bottom: 1em;
}

.collapsible-title {
  cursor: pointer;
}

.collapsible-title div {
  padding-top: 5px;
  padding-left: 12px;
}

.collapsible-content {
  padding: 12px;
}

/* * The next two classes are a small subset of JQuery UI.  It's only being used
 * on the custom 500 page, so I didn't think it was worth including all of JQuery
 * UI.  If we ever do, though, remove these two. */

.ui-widget-header {
  border: 1px solid #aaa;
  background: #ccc;
  color: #222;
  font-weight: 600;
}

.about-author {
  padding: 12px;
}

.table-basic tr td {
  width: 100%;
  display: inline-block;
}