text:
'use strict';

/*!
 * Module dependencies.
 */

const SchemaType = require('../schematype');
const MongooseError = require('../error/index');
const SchemaStringOptions = require('../options/SchemaStringOptions');
const castString = require('../cast/string');
const utils = require('../utils');

const populateModelSymbol = require('../helpers/symbols').populateModelSymbol;

const CastError = SchemaType.CastError;
let Document;

/**
 * String SchemaType constructor.
 *
 * @param {String} key
 * @param {Object} options
 * @inherits SchemaType
 * @api public
 */

function SchemaString(key, options) {
  this.enumValues = [];
  this.regExp = null;
  SchemaType.call(this, key, options, 'String');
}

/**
 * This schema type's name, to defend against minifiers that mangle
 * function names.
 *
 * @api public
 */
SchemaString.schemaName = 'String';

/*!
 * Inherits from SchemaType.
 */
SchemaString.prototype = Object.create(SchemaType.prototype);
SchemaString.prototype.constructor = SchemaString;
SchemaString.prototype.OptionsConstructor = SchemaStringOptions;

/*!
 * ignore
 */

SchemaString._cast = castString;

/**
 * Get/set the function used to cast arbitrary values to strings.
 *
 * ####Example:
 *
 *     // Throw an error if you pass in an object. Normally, Mongoose allows
 *     // objects with custom `toString()` functions.
 *     const original = mongoose.Schema.Types.String.cast();
 *     mongoose.Schema.Types.String.cast(v => {
 *       assert.ok(v == null || typeof v !== 'object');
 *       return original(v);
 *     });
 *
 *     // Or disable casting entirely
 *     mongoose.Schema.Types.String.cast(false);
 *
 * @param {Function} caster
 * @return {Function}
 * @function get
 * @static
 * @api public
 */

SchemaString.cast = function cast(caster) {
  if (arguments.length === 0) {
    return this._cast;
  }
  if (caster === false) {
    caster = v => {
      if (v != null && typeof v !== 'string') {
        throw new Error();
      }
      return v;
    };
  }
  this._cast = caster;

  return this._cast;
};

/**
 * Attaches a getter for all String instances.
 *
 * ####Example:
 *
 *     // Make all numbers round down
 *     mongoose.Schema.String.get(v => v.toLowerCase());
 *
 *     const Model = mongoose.model('Test', new Schema({ test: String }));
 *     new Model({ test: 'FOO' }).test; // 'foo'
 *
 * @param {Function} getter
 * @return {this}
 * @function get
 * @static
 * @api public
 */

SchemaString.get = SchemaType.get;

/*!
 * ignore
 */

SchemaString._checkRequired = v => (v instanceof String || typeof v === 'string') && v.length;

/**
 * Override the function the required validator uses to check whether a string
 * passes the `required` check.
 *
 * ####Example:
 *
 *     // Allow empty strings to pass `required` check
 *     mongoose.Schema.Types.String.checkRequired(v => v != null);
 *
 *     const M = mongoose.model({ str: { type: String, required: true } });
 *     new M({ str: '' }).validateSync(); // `null`, validation passes!
 *
 * @param {Function} fn
 * @return {Function}
 * @function checkRequired
 * @static
 * @api public
 */

SchemaString.checkRequired = SchemaType.checkRequired;

/**
 * Adds an enum validator
 *
 * ####Example:
 *
 *     var states = ['opening', 'open', 'closing', 'closed']
 *     var s = new Schema({ state: { type: String, enum: states }})
 *     var M = db.model('M', s)
 *     var m = new M({ state: 'invalid' })
 *     m.save(function (err) {
 *       console.error(String(err)) // ValidationError: `invalid` is not a valid enum value for path `state`.
 *       m.state = 'open'
 *       m.save(callback) // success
 *     })
 *
 *     // or with custom error messages
 *     var enum = {
 *       values: ['opening', 'open', 'closing', 'closed'],
 *       message: 'enum validator failed for path `{PATH}` with value `{VALUE}`'
 *     }
 *     var s = new Schema({ state: { type: String, enum: enum })
 *     var M = db.model('M', s)
 *     var m = new M({ state: 'invalid' })
 *     m.save(function (err) {
 *       console.error(String(err)) // ValidationError: enum validator failed for path `state` with value `invalid`
 *       m.state = 'open'
 *       m.save(callback) // success
 *     })
 *
 * @param {String|Object} [args...] enumeration values
 * @return {SchemaType} this
 * @see Customized Error Messages #error_messages_MongooseError-messages
 * @api public
 */

SchemaString.prototype.enum = function() {
  if (this.enumValidator) {
    this.validators = this.validators.filter(function(v) {
      return v.validator !== this.enumValidator;
    }, this);
    this.enumValidator = false;
  }

  if (arguments[0] === void 0 || arguments[0] === false) {
    return this;
  }

  let values;
  let errorMessage;

  if (utils.isObject(arguments[0])) {
    values = arguments[0].values;
    errorMessage = arguments[0].message;
  } else {
    values = arguments;
    errorMessage = MongooseError.messages.String.enum;
  }

  for (let i = 0; i < values.length; i++) {
    if (undefined !== values[i]) {
      this.enumValues.push(this.cast(values[i]));
    }
  }

  const vals = this.enumValues;
  this.enumValidator = function(v) {
    return undefined === v || ~vals.indexOf(v);
  };
  this.validators.push({
    validator: this.enumValidator,
    message: errorMessage,
    type: 'enum',
    enumValues: vals
  });

  return this;
};

/**
 * Adds a lowercase [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set).
 *
 * ####Example:
 *
 *     var s = new Schema({ email: { type: String, lowercase: true }})
 *     var M = db.model('M', s);
 *     var m = new M({ email: 'SomeEmail@example.COM' });
 *     console.log(m.email) // someemail@example.com
 *     M.find({ email: 'SomeEmail@example.com' }); // Queries by 'someemail@example.com'
 *
 * @api public
 * @return {SchemaType} this
 */

SchemaString.prototype.lowercase = function(shouldApply) {
  if (arguments.length > 0 && !shouldApply) {
    return this;
  }
  return this.set(function(v, self) {
    if (typeof v !== 'string') {
      v = self.cast(v);
    }
    if (v) {
      return v.toLowerCase();
    }
    return v;
  });
};

/**
 * Adds an uppercase [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set).
 *
 * ####Example:
 *
 *     var s = new Schema({ caps: { type: String, uppercase: true }})
 *     var M = db.model('M', s);
 *     var m = new M({ caps: 'an example' });
 *     console.log(m.caps) // AN EXAMPLE
 *     M.find({ caps: 'an example' }) // Matches documents where caps = 'AN EXAMPLE'
 *
 * @api public
 * @return {SchemaType} this
 */

SchemaString.prototype.uppercase = function(shouldApply) {
  if (arguments.length > 0 && !shouldApply) {
    return this;
  }
  return this.set(function(v, self) {
    if (typeof v !== 'string') {
      v = self.cast(v);
    }
    if (v) {
      return v.toUpperCase();
    }
    return v;
  });
};

/**
 * Adds a trim [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set).
 *
 * The string value will be trimmed when set.
 *
 * ####Example:
 *
 *     var s = new Schema({ name: { type: String, trim: true }})
 *     var M = db.model('M', s)
 *     var string = ' some name '
 *     console.log(string.length) // 11
 *     var m = new M({ name: string })
 *     console.log(m.name.length) // 9
 *
 * @api public
 * @return {SchemaType} this
 */

SchemaString.prototype.trim = function(shouldTrim) {
  if (arguments.length > 0 && !shouldTrim) {
    return this;
  }
  return this.set(function(v, self) {
    if (typeof v !== 'string') {
      v = self.cast(v);
    }
    if (v) {
      return v.trim();
    }
    return v;
  });
};

/**
 * Sets a minimum length validator.
 *
 * ####Example:
 *
 *     var schema = new Schema({ postalCode: { type: String, minlength: 5 })
 *     var Address = db.model('Address', schema)
 *     var address = new Address({ postalCode: '9512' })
 *     address.save(function (err) {
 *       console.error(err) // validator error
 *       address.postalCode = '95125';
 *       address.save() // success
 *     })
 *
 *     // custom error messages
 *     // We can also use the special {MINLENGTH} token which will be replaced with the minimum allowed length
 *     var minlength = [5, 'The value of path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).'];
 *     var schema = new Schema({ postalCode: { type: String, minlength: minlength })
 *     var Address = mongoose.model('Address', schema);
 *     var address = new Address({ postalCode: '9512' });
 *     address.validate(function (err) {
 *       console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512`) is shorter than the minimum length (5).
 *     })
 *
 * @param {Number} value minimum string length
 * @param {String} [message] optional custom error message
 * @return {SchemaType} this
 * @see Customized Error Messages #error_messages_MongooseError-messages
 * @api public
 */

SchemaString.prototype.minlength = function(value, message) {
  if (this.minlengthValidator) {
    this.validators = this.validators.filter(function(v) {
      return v.validator !== this.minlengthValidator;
    }, this);
  }

  if (value !== null && value !== undefined) {
    let msg = message || MongooseError.messages.String.minlength;
    msg = msg.replace(/{MINLENGTH}/, value);
    this.validators.push({
      validator: this.minlengthValidator = function(v) {
        return v === null || v.length >= value;
      },
      message: msg,
      type: 'minlength',
      minlength: value
    });
  }

  return this;
};

/**
 * Sets a maximum length validator.
 *
 * ####Example:
 *
 *     var schema = new Schema({ postalCode: { type: String, maxlength: 9 })
 *     var Address = db.model('Address', schema)
 *     var address = new Address({ postalCode: '9512512345' })
 *     address.save(function (err) {
 *       console.error(err) // validator error
 *       address.postalCode = '95125';
 *       address.save() // success
 *     })
 *
 *     // custom error messages
 *     // We can also use the special {MAXLENGTH} token which will be replaced with the maximum allowed length
 *     var maxlength = [9, 'The value of path `{PATH}` (`{VALUE}`) exceeds the maximum allowed length ({MAXLENGTH}).'];
 *     var schema = new Schema({ postalCode: { type: String, maxlength: maxlength })
 *     var Address = mongoose.model('Address', schema);
 *     var address = new Address({ postalCode: '9512512345' });
 *     address.validate(function (err) {
 *       console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512512345`) exceeds the maximum allowed length (9).
 *     })
 *
 * @param {Number} value maximum string length
 * @param {String} [message] optional custom error message
 * @return {SchemaType} this
 * @see Customized Error Messages #error_messages_MongooseError-messages
 * @api public
 */

SchemaString.prototype.maxlength = function(value, message) {
  if (this.maxlengthValidator) {
    this.validators = this.validators.filter(function(v) {
      return v.validator !== this.maxlengthValidator;
    }, this);
  }

  if (value !== null && value !== undefined) {
    let msg = message || MongooseError.messages.String.maxlength;
    msg = msg.replace(/{MAXLENGTH}/, value);
    this.validators.push({
      validator: this.maxlengthValidator = function(v) {
        return v === null || v.length <= value;
      },
      message: msg,
      type: 'maxlength',
      maxlength: value
    });
  }

  return this;
};

/**
 * Sets a regexp validator.
 *
 * Any value that does not pass `regExp`.test(val) will fail validation.
 *
 * ####Example:
 *
 *     var s = new Schema({ name: { type: String, match: /^a/ }})
 *     var M = db.model('M', s)
 *     var m = new M({ name: 'I am invalid' })
 *     m.validate(function (err) {
 *       console.error(String(err)) // "ValidationError: Path `name` is invalid (I am invalid)."
 *       m.name = 'apples'
 *       m.validate(function (err) {
 *         assert.ok(err) // success
 *       })
 *     })
 *
 *     // using a custom error message
 *     var match = [ /\.html$/, "That file doesn't end in .html ({VALUE})" ];
 *     var s = new Schema({ file: { type: String, match: match }})
 *     var M = db.model('M', s);
 *     var m = new M({ file: 'invalid' });
 *     m.validate(function (err) {
 *       console.log(String(err)) // "ValidationError: That file doesn't end in .html (invalid)"
 *     })
 *
 * Empty strings, `undefined`, and `null` values always pass the match validator. If you require these values, enable the `required` validator also.
 *
 *     var s = new Schema({ name: { type: String, match: /^a/, required: true }})
 *
 * @param {RegExp} regExp regular expression to test against
 * @param {String} [message] optional custom error message
 * @return {SchemaType} this
 * @see Customized Error Messages #error_messages_MongooseError-messages
 * @api public
 */

SchemaString.prototype.match = function match(regExp, message) {
  // yes, we allow multiple match validators

  const msg = message || MongooseError.messages.String.match;

  const matchValidator = function(v) {
    if (!regExp) {
      return false;
    }

    const ret = ((v != null && v !== '')
      ? regExp.test(v)
      : true);
    return ret;
  };

  this.validators.push({
    validator: matchValidator,
    message: msg,
    type: 'regexp',
    regexp: regExp
  });
  return this;
};

/**
 * Check if the given value satisfies the `required` validator. The value is
 * considered valid if it is a string (that is, not `null` or `undefined`) and
 * has positive length. The `required` validator **will** fail for empty
 * strings.
 *
 * @param {Any} value
 * @param {Document} doc
 * @return {Boolean}
 * @api public
 */

SchemaString.prototype.checkRequired = function checkRequired(value, doc) {
  if (SchemaType._isRef(this, value, doc, true)) {
    return !!value;
  }

  // `require('util').inherits()` does **not** copy static properties, and
  // plugins like mongoose-float use `inherits()` for pre-ES6.
  const _checkRequired = typeof this.constructor.checkRequired == 'function' ?
    this.constructor.checkRequired() :
    SchemaString.checkRequired();

  return _checkRequired(value);
};

/**
 * Casts to String
 *
 * @api private
 */

SchemaString.prototype.cast = function(value, doc, init) {
  if (SchemaType._isRef(this, value, doc, init)) {
    // wait! we may need to cast this to a document

    if (value === null || value === undefined) {
      return value;
    }

    // lazy load
    Document || (Document = require('./../document'));

    if (value instanceof Document) {
      value.$__.wasPopulated = true;
      return value;
    }

    // setting a populated path
    if (typeof value === 'string') {
      return value;
    } else if (Buffer.isBuffer(value) || !utils.isObject(value)) {
      throw new CastError('string', value, this.path);
    }

    // Handle the case where user directly sets a populated
    // path to a plain object; cast to the Model used in
    // the population query.
    const path = doc.$__fullPath(this.path);
    const owner = doc.ownerDocument ? doc.ownerDocument() : doc;
    const pop = owner.populated(path, true);
    const ret = new pop.options[populateModelSymbol](value);
    ret.$__.wasPopulated = true;
    return ret;
  }

  const castString = typeof this.constructor.cast === 'function' ?
    this.constructor.cast() :
    SchemaString.cast();
  try {
    return castString(value);
  } catch (error) {
    throw new CastError('string', value, this.path);
  }
};

/*!
 * ignore
 */

function handleSingle(val) {
  return this.castForQuery(val);
}

function handleArray(val) {
  const _this = this;
  if (!Array.isArray(val)) {
    return [this.castForQuery(val)];
  }
  return val.map(function(m) {
    return _this.castForQuery(m);
  });
}

SchemaString.prototype.$conditionalHandlers =
    utils.options(SchemaType.prototype.$conditionalHandlers, {
      $all: handleArray,
      $gt: handleSingle,
      $gte: handleSingle,
      $lt: handleSingle,
      $lte: handleSingle,
      $options: String,
      $regex: handleSingle,
      $not: handleSingle
    });

/**
 * Casts contents for queries.
 *
 * @param {String} $conditional
 * @param {any} [val]
 * @api private
 */

SchemaString.prototype.castForQuery = function($conditional, val) {
  let handler;
  if (arguments.length === 2) {
    handler = this.$conditionalHandlers[$conditional];
    if (!handler) {
      throw new Error('Can\'t use ' + $conditional + ' with String.');
    }
    return handler.call(this, val);
  }
  val = $conditional;
  if (Object.prototype.toString.call(val) === '[object RegExp]') {
    return val;
  }

  return this._castForQuery(val);
};

/*!
 * Module exports.
 */

module.exports = SchemaString;


text:
#import "NSObject.h"

@class NSArray, NSString;

@interface SUCompletionsResponse : NSObject
{
    NSArray *_completionItems;
    NSString *_title;
}

@property(readonly, nonatomic) NSString *title; // @synthesize title=_title;
@property(readonly, nonatomic) NSArray *completionItems; // @synthesize completionItems=_completionItems;
- (void)dealloc;
- (id)initWithPropertyList:(id)arg1;
- (id)init;

@end

redpajama_set_name: RedPajamaGithub


text:
package ru.maksimov.andrey.golos4j.util;

import java.io.ByteArrayOutputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bitcoinj.core.VarInt;

import ru.maksimov.andrey.golos4j.exception.BusinessException;

/**
 * Вспомогаткельный класс для транзакций
 *
 * @author amaksimov
 */
public class TransactionUtil {

	private static final Logger LOG = LogManager
			.getLogger(TransactionUtil.class);

	/**
	 * Получить число из двух последних байт long'a.
	 *
	 * @param value
	 *            число типа long
	 * @return число типа char
	 */
	public static int long2Last2Byte(long value) {
		int last2Byte = ((int) value) & 0xFFFF;
		return last2Byte;
	}

	/**
	 * Конвертировать hex строку в число с перестановкой(реверс) байт
	 *
	 * @param hexString
	 *            hex строка
	 * @param offset
	 *            отступ в байтах
	 * @return положительное число
	 */
	public static long hexString2Long(String hexString, int offset) {
		int beginIndex = Character.BYTES * offset;
		int endIndex = beginIndex + Long.BYTES;
		String subString = hexString.substring(beginIndex, endIndex);
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < Long.BYTES; i = i + Character.BYTES) {
			builder.append(subString.substring(Long.BYTES - Character.BYTES - i,
					Long.BYTES - i));
		}
		long hexLong = Long.parseLong(builder.toString(), 16);
		return hexLong;
	}

	/**
	 * Конвертировать числа в список байт с перестановкой(реверс байт)
	 *
	 * @param number
	 *            число
	 * @param length
	 *            количество байт в списке
	 * @return число в виде списка байт
	 */
	public static List<Byte> int2ByteList(int number, int length) {
		List<Byte> byteList = new ArrayList<Byte>();
		ByteBuffer byteBuffer = ByteBuffer.allocate(4);
		byteBuffer.putInt(number);
		byte[] byteArray = byteBuffer.array();
		length = length > byteArray.length ? byteArray.length : length;
		for (int index = 0; index < length; index++) {
			byteList.add(byteArray[byteArray.length - index - 1]);
		}
		return byteList;
	}

	/**
	 * Конвертировать long value в массив байт.
	 *
	 * @param longValue
	 *            число.
	 * @return число в виде списка байт.
	 * @throws BusinessException
	 *             бизнес иключение
	 */
	public static byte[] long2VarIntByteArray(long longValue)
			throws BusinessException {
		try {
			long value = longValue;
			ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
			DataOutput out = new DataOutputStream(byteArrayOutputStream);
			while ((value & 0xFFFFFFFFFFFFFF80L) != 0L) {
				out.writeByte(((int) value & 0x7F) | 0x80);
				value >>>= 7;
			}
			out.writeByte((int) value & 0x7F);
			return byteArrayOutputStream.toByteArray();
		} catch (IOException e) {
			LOG.warn(
					"Unable transform long value to VarInt . This could cause problems for values > 127."
							+ e);
			return (new VarInt(longValue)).encode();
		}
	}
}


text:
package com.ianhanniballake.localstorage.inappbilling;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Represents an in-app product's listing details.
 */
@SuppressWarnings("javadoc")
public class SkuDetails {
    String mDescription;
    String mItemType;
    String mJson;
    String mPrice;
    String mSku;
    String mTitle;
    String mType;

    public SkuDetails(final String itemType, final String jsonSkuDetails) throws JSONException {
        mItemType = itemType;
        mJson = jsonSkuDetails;
        final JSONObject o = new JSONObject(mJson);
        mSku = o.optString("productId");
        mType = o.optString("type");
        mPrice = o.optString("price");
        mTitle = o.optString("title");
        mDescription = o.optString("description");
    }

    public String getDescription() {
        return mDescription;
    }

    public String getPrice() {
        return mPrice;
    }

    public String getSku() {
        return mSku;
    }

    public String getTitle() {
        return mTitle;
    }

    public String getType() {
        return mType;
    }

    @Override
    public String toString() {
        return "SkuDetails:" + mJson;
    }
}


text:
using CK.Auth;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CK.DB.AspNet.Auth.Tests
{
    class RefreshResponse
    {
        public IAuthenticationInfo Info { get; set; }

        public string Token { get; set; }

        public bool Refreshable { get; set; }

        public string[] Schemes { get; set; }

        public static RefreshResponse Parse( IAuthenticationTypeSystem t, string json )
        {
            JObject o = JObject.Parse( json );
            var r = new RefreshResponse();
            if( o["info"].Type == JTokenType.Object )
            {
                r.Info = t.AuthenticationInfo.FromJObject( (JObject)o["info"] );
            }
            r.Token = (string)o["token"];
            r.Refreshable = (bool)o["refreshable"];
            r.Schemes = o["schemes"]?.Values<string>().ToArray();
            return r;
        }
    }

}


text:
import { User } from '../util/db.js'

const list = function*() {
  let users = yield User.find();

  yield this.render('list', { users: users });
}

const register = function*() {
  this.body = 'register page'
}

export { list, register }


text:
package org.kie.workbench.common.widgets.client.datamodel;

import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;

import org.guvnor.test.WeldJUnitRunner;
import org.jboss.errai.common.client.api.Caller;
import org.jboss.errai.validation.client.dynamic.DynamicValidator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle;
import org.kie.soup.project.datamodel.oracle.PackageDataModelOracle;
import org.kie.workbench.common.services.datamodel.backend.server.service.DataModelService;
import org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload;
import org.kie.workbench.common.services.datamodel.service.IncrementalDataModelService;
import org.uberfire.backend.server.util.Paths;
import org.uberfire.backend.vfs.Path;
import org.uberfire.client.callbacks.Callback;
import org.uberfire.java.nio.fs.file.SimpleFileSystemProvider;

import static org.junit.Assert.*;
import static org.kie.workbench.common.widgets.client.datamodel.PackageDataModelOracleTestUtils.assertContains;
import static org.mockito.Mockito.*;

@RunWith(WeldJUnitRunner.class)
public class PackageDataModelSuperTypesTest {

    private final SimpleFileSystemProvider fs = new SimpleFileSystemProvider();

    @Inject
    private BeanManager beanManager;

    @Inject
    private Paths paths;

    @Inject
    private DataModelService dataModelService;

    @Inject
    private Instance<DynamicValidator> validatorInstance;

    @Before
    public void setUp() throws Exception {
        //Ensure URLs use the default:// scheme
        fs.forceAsDefault();
    }

    @Test
    public void testPackageSuperTypes() throws Exception {
        final URL packageUrl = this.getClass().getResource("/DataModelBackendSuperTypesTest1/src/main/java/t2p1");
        final org.uberfire.java.nio.file.Path nioPackagePath = fs.getPath(packageUrl.toURI());
        final Path packagePath = paths.convert(nioPackagePath);

        final PackageDataModelOracle packageLoader = dataModelService.getDataModel(packagePath);

        //Emulate server-to-client conversions
        final Caller<IncrementalDataModelService> service = new MockIncrementalDataModelServiceCaller(packageLoader);
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl(service,
                                                                                validatorInstance);

        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setPackageName("t2p1");
        dataModel.setModelFields(packageLoader.getModuleModelFields());
        dataModel.setSuperTypes(new HashMap<String, List<String>>() {{
            put("t2p1.Bean1",
                null);
            put("t2p1.Bean2",
                new ArrayList<String>() {{
                    add("t2p1.Bean1");
                }});
            put("t2p2.Bean3",
                new ArrayList<String>() {{
                    add("t2p1.Bean1");
                }});
            put("t2p1.Bean4",
                new ArrayList<String>() {{
                    add("t2p2.Bean3");
                }});
        }});
        PackageDataModelOracleTestUtils.populateDataModelOracle(mock(Path.class),
                                                                new MockHasImports(),
                                                                oracle,
                                                                dataModel);

        assertNotNull(oracle);

        assertEquals(3,
                     oracle.getFactTypes().length);
        assertContains("Bean1",
                       oracle.getFactTypes());
        assertContains("Bean2",
                       oracle.getFactTypes());
        assertContains("Bean4",
                       oracle.getFactTypes());

        oracle.getSuperType("Bean1",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("java.lang.Object",
                                                 result);
                                }
                            });
        oracle.getSuperType("Bean2",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("Bean1",
                                                 result);
                                }
                            });
        oracle.getSuperType("Bean4",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("t2p2.Bean3",
                                                 result);
                                }
                            });
    }

    @Test
    public void testModuleSuperTypes() throws Exception {
        final URL packageUrl = this.getClass().getResource("/DataModelBackendSuperTypesTest1/src/main/java/t2p1");
        final org.uberfire.java.nio.file.Path nioPackagePath = fs.getPath(packageUrl.toURI());
        final Path packagePath = paths.convert(nioPackagePath);

        final PackageDataModelOracle packageLoader = dataModelService.getDataModel(packagePath);
        final ModuleDataModelOracle moduleLoader = dataModelService.getModuleDataModel(packagePath);

        //Emulate server-to-client conversions
        final Caller<IncrementalDataModelService> service = new MockIncrementalDataModelServiceCaller(packageLoader);
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl(service,
                                                                                validatorInstance);

        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setPackageName("t2p1");
        dataModel.setModelFields(moduleLoader.getModuleModelFields());
        dataModel.setSuperTypes(new HashMap<String, List<String>>() {{
            put("t2p1.Bean1",
                null);
            put("t2p1.Bean2",
                new ArrayList<String>() {{
                    add("t2p1.Bean1");
                }});
            put("t2p2.Bean3",
                new ArrayList<String>() {{
                    add("t2p1.Bean1");
                }});
            put("t2p1.Bean4",
                new ArrayList<String>() {{
                    add("t2p2.Bean3");
                }});
        }});
        PackageDataModelOracleTestUtils.populateDataModelOracle(mock(Path.class),
                                                                new MockHasImports(),
                                                                oracle,
                                                                dataModel);

        assertNotNull(oracle);

        assertEquals(5,
                     oracle.getAllFactTypes().length);
        assertContains("t2p1.Bean1",
                       oracle.getAllFactTypes());
        assertContains("t2p1.Bean2",
                       oracle.getAllFactTypes());
        assertContains("t2p2.Bean3",
                       oracle.getAllFactTypes());
        assertContains("t2p1.Bean4",
                       oracle.getAllFactTypes());
        assertContains("java.lang.String",
                       oracle.getAllFactTypes());

        oracle.getSuperType("Bean1",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("java.lang.Object",
                                                 result);
                                }
                            });
        oracle.getSuperType("Bean2",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("Bean1",
                                                 result);
                                }
                            });
        oracle.getSuperType("Bean4",
                            new Callback<String>() {
                                @Override
                                public void callback(final String result) {
                                    assertEquals("t2p2.Bean3",
                                                 result);
                                }
                            });
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->

<!-- id can be anything. type is either "single-objective", "multi-objective"
or "many-objective" -->
<optimization-problem id="zdt3-02-30" type="mutli-objective">
    <!-- a seed has to be in the range ]0,1[ -->
    <seed>
        0.5
    </seed>
    <!-- All the variables along with their types (either real or binary) -->
    <variables>
        <variable type="real" min="0" max="1">x0</variable>
        <variable type="real" min="0" max="1">x1</variable>
        <variable type="real" min="0" max="1">x2</variable>
        <variable type="real" min="0" max="1">x3</variable>
        <variable type="real" min="0" max="1">x4</variable>
        <variable type="real" min="0" max="1">x5</variable>
        <variable type="real" min="0" max="1">x6</variable>
        <variable type="real" min="0" max="1">x7</variable>
        <variable type="real" min="0" max="1">x8</variable>
        <variable type="real" min="0" max="1">x9</variable>
        <variable type="real" min="0" max="1">x10</variable>
        <variable type="real" min="0" max="1">x11</variable>
        <variable type="real" min="0" max="1">x12</variable>
        <variable type="real" min="0" max="1">x13</variable>
        <variable type="real" min="0" max="1">x14</variable>
        <variable type="real" min="0" max="1">x15</variable>
        <variable type="real" min="0" max="1">x16</variable>
        <variable type="real" min="0" max="1">x17</variable>
        <variable type="real" min="0" max="1">x18</variable>
        <variable type="real" min="0" max="1">x19</variable>
        <variable type="real" min="0" max="1">x20</variable>
        <variable type="real" min="0" max="1">x21</variable>
        <variable type="real" min="0" max="1">x22</variable>
        <variable type="real" min="0" max="1">x23</variable>
        <variable type="real" min="0" max="1">x24</variable>
        <variable type="real" min="0" max="1">x25</variable>
        <variable type="real" min="0" max="1">x26</variable>
        <variable type="real" min="0" max="1">x27</variable>
        <variable type="real" min="0" max="1">x28</variable>
        <variable type="real" min="0" max="1">x29</variable>
    </variables>
    <!-- Objective functions. Only the variables defined above can be used in
    any of these function -->
    <objectives>
        <objective type="min">x0</objective>
        <objective type="min">
            (9.0 * (x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29) / 29.0 + 1) *
            (1 - sqrt(x0 / (9.0 * (x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29) / 29.0 + 1)) - (x0 / (9.0 * (x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29) / 29.0 + 1)) * sin(10*3.14159*x0))
        </objective>
    </objectives>
    <!-- structured reference points -->
    <structured-reference-points steps="47" adaptive="false"/>
    <!-- population size -->
    <population-size>
        48
    </population-size>
    <!-- number of generations -->
    <generations-count>
        100
    </generations-count>
    <!-- real crossover & mutation probabilities -->
    <real-crossover-probability>0.9</real-crossover-probability>
    <real-mutation-probability>0.0333</real-mutation-probability>
    <!-- real crossover & mutation distribution indices -->
    <real-crossover-distribution-index>0</real-crossover-distribution-index>
    <real-mutation-distribution-index>0</real-mutation-distribution-index>
    <!-- binary crossover and mutation probabilities (the following information
    should be removed since we have no binary variables but the code will
    generate exceptions if the following tags are removed. This should be
    fixed) -->
    <binary-crossover-probability>0.75</binary-crossover-probability>
    <binary-mutation-probability>0.02</binary-mutation-probability>
</optimization-problem>


text:
package org.jf.util;

import java.io.FilterWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * Writer that wraps another writer and passes width-limited and
 * optionally-prefixed output to its subordinate. When lines are
 * wrapped they are automatically indented based on the start of the
 * line.
 */
public final class WrappedIndentingWriter extends FilterWriter {
    /**
     * null-ok; optional prefix for every line
     */
    private final String prefix;

    /**
     * > 0; the maximum output width
     */
    private final int width;

    /**
     * > 0; the maximum indent
     */
    private final int maxIndent;

    /**
     * >= 0; current output column (zero-based)
     */
    private int column;

    /**
     * whether indent spaces are currently being collected
     */
    private boolean collectingIndent;

    /**
     * >= 0; current indent amount
     */
    private int indent;

    /**
     * Constructs an instance.
     *
     * @param out    non-null; writer to send final output to
     * @param width  >= 0; the maximum output width (not including
     *               prefix), or 0 for no maximum
     * @param prefix non-null; the prefix for each line
     */
    public WrappedIndentingWriter(Writer out, int width, String prefix) {
        super(out);

        if (out == null) {
            throw new NullPointerException("out == null");
        }

        if (width < 0) {
            throw new IllegalArgumentException("width < 0");
        }

        if (prefix == null) {
            throw new NullPointerException("prefix == null");
        }

        this.width = (width != 0) ? width : Integer.MAX_VALUE;
        this.maxIndent = width >> 1;
        this.prefix = (prefix.length() == 0) ? null : prefix;

        bol();
    }

    /**
     * Constructs a no-prefix instance.
     *
     * @param out   non-null; writer to send final output to
     * @param width >= 0; the maximum output width (not including
     *              prefix), or 0 for no maximum
     */
    public WrappedIndentingWriter(Writer out, int width) {
        this(out, width, "");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void write(int c) throws IOException {
        synchronized (lock) {
            if (collectingIndent) {
                if (c == ' ') {
                    indent++;
                    if (indent >= maxIndent) {
                        indent = maxIndent;
                        collectingIndent = false;
                    }
                } else {
                    collectingIndent = false;
                }
            }

            if ((column == width) && (c != '\n')) {
                out.write('\n');
                column = 0;
                /*
                 * Note: No else, so this should fall through to the next
                 * if statement.
                 */
            }

            if (column == 0) {
                if (prefix != null) {
                    out.write(prefix);
                }

                if (!collectingIndent) {
                    for (int i = 0; i < indent; i++) {
                        out.write(' ');
                    }
                    column = indent;
                }
            }

            out.write(c);

            if (c == '\n') {
                bol();
            } else {
                column++;
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void write(char[] cbuf, int off, int len) throws IOException {
        synchronized (lock) {
            while (len > 0) {
                write(cbuf[off]);
                off++;
                len--;
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void write(String str, int off, int len) throws IOException {
        synchronized (lock) {
            while (len > 0) {
                write(str.charAt(off));
                off++;
                len--;
            }
        }
    }

    /**
     * Indicates that output is at the beginning of a line.
     */
    private void bol() {
        column = 0;
        collectingIndent = (maxIndent != 0);
        indent = 0;
    }
}


text:
namespace nana
{
	namespace detail
	{
		struct bedrock::pi_data
		{
			color_schemes scheme;

		};
	}
}
#endif


text:
#pragma once
#include <aws/iotanalytics/IoTAnalytics_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace IoTAnalytics
{
namespace Model
{

  /**
   *
The datastore activity that specifies where to store the processed
   * data.

See Also:
   AWS
   * API Reference

   */
  class AWS_IOTANALYTICS_API DatastoreActivity
  {
  public:
    DatastoreActivity();
    DatastoreActivity(Aws::Utils::Json::JsonView jsonValue);
    DatastoreActivity& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The name of the datastore activity.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of the datastore activity.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of the datastore activity.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of the datastore activity.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of the datastore activity.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of the datastore activity.

     */
    inline DatastoreActivity& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of the datastore activity.

     */
    inline DatastoreActivity& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of the datastore activity.

     */
    inline DatastoreActivity& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline const Aws::String& GetDatastoreName() const{ return m_datastoreName; }

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline bool DatastoreNameHasBeenSet() const { return m_datastoreNameHasBeenSet; }

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline void SetDatastoreName(const Aws::String& value) { m_datastoreNameHasBeenSet = true; m_datastoreName = value; }

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline void SetDatastoreName(Aws::String&& value) { m_datastoreNameHasBeenSet = true; m_datastoreName = std::move(value); }

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline void SetDatastoreName(const char* value) { m_datastoreNameHasBeenSet = true; m_datastoreName.assign(value); }

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline DatastoreActivity& WithDatastoreName(const Aws::String& value) { SetDatastoreName(value); return *this;}

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline DatastoreActivity& WithDatastoreName(Aws::String&& value) { SetDatastoreName(std::move(value)); return *this;}

    /**
     *
The name of the data store where processed messages are stored.

     */
    inline DatastoreActivity& WithDatastoreName(const char* value) { SetDatastoreName(value); return *this;}

  private:

    Aws::String m_name;
    bool m_nameHasBeenSet = false;

    Aws::String m_datastoreName;
    bool m_datastoreNameHasBeenSet = false;
  };

} // namespace Model
} // namespace IoTAnalytics
} // namespace Aws


text:
description: Troubleshooting, logs, and known issues
keywords: windows, troubleshooting, logs, issues
redirect_from:
- /windows/troubleshoot/
title: Logs and troubleshooting
---

Here is information about how to diagnose and troubleshoot problems, send logs
and communicate with the Docker for Windows team, use our forums and Knowledge
Hub, browse and log issues on GitHub, and find workarounds for known problems.

## Docker Knowledge Hub

**Looking for help with Docker for Windows?** Check out the [Docker Knowledge
Hub](http://success.docker.com/) for knowledge base articles, FAQs, and
technical support for various subscription levels.

## Submitting diagnostics, feedback, and GitHub issues

If you encounter problems for which you do not find solutions in this
documentation, on [Docker for Windows issues on
GitHub](https://github.com/docker/for-win/issues), or the [Docker for Windows
forum](https://forums.docker.com/c/docker-for-windows), we can help you
troubleshoot the log data. See [Diagnose and
Feedback](index.md#diagnose-and-feedback) to learn about diagnostics and how to
create new issues on GitHub.

## Checking the Logs

In addition to using the diagnose and feedback option to submit logs, you can browse the logs yourself.

### Use the systray menu to view logs

To view Docker for Windows latest log, click on the `Diagnose & Feedback` menu
entry in the systray and then on the `Log file` link. You can see the full
history of logs in your `AppData\Local` folder.

### Use the systray menu to report and issue

If you encounter an issue and the suggested troubleshoot procedures outlined
below don't fix it you can generate a diagnostics report. Click on the `Diagnose &
Feedback` menu entry in the systray and then on the `Upload diagnostic...` link.
This will upload diagnostics to our server and provide you with a unique ID you
can use in email or the forum to reference the upload.

## Troubleshooting

### inotify on shared drives does not work

Currently, `inotify` does not work on Docker for Windows. This will become
evident, for example, when an application needs to read/write to a
container across a mounted drive. Instead of relying on filesystem inotify, we recommend using polling features for your framework or programming language.

* **Workaround for nodemon and Node.js** - If you are using [nodemon](https://github.com/remy/nodemon) with  `Node.js`, try the fallback
polling mode described here: [nodemon isn't restarting node
applications](https://github.com/remy/nodemon#application-isnt-restarting)

* **Docker for Windows issue on GitHub** - See the issue [Inotify on shared drives does not work](https://github.com/docker/for-win/issues/56#issuecomment-242135705)

### Volume mounting requires shared drives for Linux containers

If you are using mounted volumes and get runtime errors indicating an
application file is not found, a volume mount is denied, or a service cannot
start (e.g., with [Docker Compose](/compose/gettingstarted.md)), you might need
to enable [shared drives](index.md#shared-drives).

Volume mounting requires shared drives for Linux containers (not for Windows
containers). Go to  --> **Settings** --> **Shared
Drives** and share the drive that contains the Dockerfile and volume.

### Verify domain user has permissions for shared drives (volumes)

>**Tip:** Shared drives are only required for volume mounting [Linux
containers](index.md#switch-between-windows-and-linux-containers),
not Windows containers.

Permissions to access shared drives are tied to the username and password you
use to set up shared drives. (See [Shared Drives](index.md#shared-drives).) If
you run `docker` commands and tasks under a different username than the one used
to set up shared drives, your containers will not have permissions to access the
mounted volumes. The volumes will show as empty.

The solution to this is to switch to the domain user account and reset
credentials on shared drives.

Here is an example of how to de-bug this problem, given a scenario where you
shared the `C` drive as a local user instead of as the domain user. Assume the
local user is `samstevens` and the domain user is `merlin`.

1. Make sure you are logged in as the Windows domain user (for our example, `merlin`).

2. Run `net share c` to view user permissions for `<host>\<username>, FULL`.

		PS C:\Users\jdoe> net share c
		Share name        C
		Path              C:\
		Remark
		Maximum users     No limit
		Users             SAMSTEVENS
		Caching           Caching disabled
		Permission        windowsbox\samstevens, FULL

3. Run the following command to remove the share.

		net share c /delete

4. Re-share the drive via the [Shared Drives dialog](index.md#shared-drives), and provide the Windows domain user account credentials.

5. Re-run `net share c`.

		PS C:\Users\jdoe> net share c
		Share name        C
		Path              C:\
		Remark
		Maximum users     No limit
		Users             MERLIN
		Caching           Caching disabled
		Permission        windowsbox\merlin, FULL

See also, the related issue on GitHub, [Mounted volumes are empty in the container](https://github.com/docker/for-win/issues/25).

### Local security policies can block shared drives and cause login errors

You need permissions to mount shared drives in order to use the Docker for
Windows [shared drives](index.md#shared-drives) feature.

If local policy prevents this, you will get errors when you attempt to enable
shared drives on Docker. This is not something Docker can resolve, you do need
these permissions to use the feature.

Here are snip-its from example error messages:

```
Logon failure: the user has not been granted the requested logon type at
this computer.

[19:53:26.900][SambaShare     ][Error  ] Unable to mount C drive: mount
error(5): I/O error Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount: mounting //10.0.75.1/C on /c failed: Invalid argument
```

See also, Docker for Windows issue #98.

### Understand symlinks limitations

Symlinks will work within and across containers. However, symlinks created outside of containers (for example, on the host) will not work. To learn more, see [Are symlinks supported?](faqs.md#are-symlinks-supported) in the FAQs.

### Avoid unexpected syntax errors, use Unix style line endings for files in containers

Any file destined to run inside a container must use Unix style `\n` line
endings. This includes files referenced at the command line for builds and in
RUN commands in Docker files.

Docker containers and `docker build` run in a Unix environment, so files in
containers must use Unix style line endings: `\n`, _not_ Windows style: `\r\n`.
Keep this in mind when authoring files such as shell scripts using Windows
tools, where the default is likely to be Windows style line endings.  These
commands ultimately get passed to Unix commands inside a Unix based container
(for example, a shell script passed to `/bin/sh`). If Windows style line endings
are used, `docker run` will fail with syntax errors.

For an example of this issue and the resolution, see this issue on GitHub: Docker RUN fails to execute shell script (https://github.com/docker/docker/issues/24388).

### Recreate or update your containers after Beta 18 upgrade

Docker 1.12.0 RC3 release introduces a backward incompatible change from RC2 to RC3. (For more information, see https://github.com/docker/docker/issues/24343#issuecomment-230623542.)

You may get the following error when you try to start a container created with pre-Beta 18 Docker for Windows applications.

    Error response from daemon: Unknown runtime specified default

You can fix this by either [recreating](troubleshoot.md#recreate-your-containers) or [updating](troubleshoot.md#update-your-containers) your containers.

If you get the error message shown above, we recommend recreating them.

#### Recreate your containers

To recreate your containers, use Docker Compose.

    docker-compose down && docker-compose up

#### Update your containers

To fix existing containers, follow these steps.

1.  Run this command.

    ```powershell
    PS C:\Users\jdoe> docker run --rm -v /var/lib/docker:/docker cpuguy83/docker112rc3-runtimefix:rc3

    Unable to find image 'cpuguy83/docker112rc3-runtimefix:rc3' locally
    rc3: Pulling from cpuguy83/docker112rc3-runtimefix
    91e7f9981d55: Pull complete
    Digest: sha256:96abed3f7a7a574774400ff20c6808aac37d37d787d1164d332675392675005c
    Status: Downloaded newer image for cpuguy83/docker112rc3-runtimefix:rc3
    proccessed 1648f773f92e8a4aad508a45088ca9137c3103457b48be1afb3fd8b4369e5140
    skipping container '433ba7ead89ba645efe9b5fff578e674aabba95d6dcb3910c9ad7f1a5c6b4538': already fixed
    proccessed 43df7f2ac8fc912046dfc48cf5d599018af8f60fee50eb7b09c1e10147758f06
    proccessed 65204cfa00b1b6679536c6ac72cdde1dbb43049af208973030b6d91356166958
    proccessed 66a72622e306450fd07f2b3a833355379884b7a6165b7527c10390c36536d82d
    proccessed 9d196e78390eeb44d3b354d24e25225d045f33f1666243466b3ed42fe670245c
    proccessed b9a0ecfe2ed9d561463251aa90fd1442299bcd9ea191a17055b01c6a00533b05
    proccessed c129a775c3fa3b6337e13b50aea84e4977c1774994be1f50ff13cbe60de9ac76
    proccessed dea73dc21126434f14c58b83140bf6470aa67e622daa85603a13bc48af7f8b04
    proccessed dfa8f9278642ab0f3e82ee8e4ad029587aafef9571ff50190e83757c03b4216c
    proccessed ee5bf706b6600a46e5d26327b13c3c1c5f7b261313438d47318702ff6ed8b30b
    ```

2. Quit Docker.

3. Start Docker.

	> **Note:**  Be sure to quit and then restart Docker for Windows before attempting to start containers.

4.  Try to start the container again:

    ```powershell
    PS C:\Users\jdoe> docker start old-container
    old-container
    ```

### Hyper-V

Docker for Windows requires a Hyper-V as well as the Hyper-V Module for Windows
Powershell to be installed and enabled. The Docker for Windows installer will
enable it for you.

See [these
instructions](https://msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/quick_start/walkthrough_install)
to install Hyper-V manually. A reboot is *required*. If you install Hyper-V
without the reboot, Docker for Windows will not work correctly. On some systems,
Virtualization needs to be enabled in the BIOS. The steps to do so are Vendor
specific, but typically the BIOS option is called `Virtualization Technology
(VTx)` or similar.

### Virtualization must be enabled

In addition to [Hyper-V](#hyper-v), virtualization must be enabled.

If, at some point, if you manually uninstall Hyper-V or disable virtualization, Docker for Windows will not start.

Verify that virtualization is enabled on Task Manager.

![Task Manager](images/win-virtualization-enabled.png)

See also, the user reported issue [Unable to run Docker for Windows on Windows
10 Enterprise](https://github.com/docker/for-win/issues/74)

### Windows containers and Windows Server 2016

If you have questions about how to set up and run Windows containers on Windows
Server 2016 or Windows 10, see [About Windows containers and Windows Server
2016](index.md#about-windows-containers-and-windows-server-2016).

A full tutorial is available in [docker/labs](https://github.com/docker/labs) at
[Getting Started with Windows
Containers](https://github.com/docker/labs/blob/master/windows/windows-containers/README.md).

You can install a native Windows binary which allows you to develop and run
Windows containers without Docker for Windows. However, if you install Docker
this way, you cannot develop or run Linux containers.  If you try to run a Linux
container on the native Docker daemon, an error occurs:

  ```no-highlight
  C:\Program Files\Docker\docker.exe:
   image operating system "linux" cannot be used on this platform.
   See 'C:\Program Files\Docker\docker.exe run --help'.
   ```

### Limitations of Windows containers for `localhost` and published ports

Docker for Windows provides the option to switch Windows and Linux containers.
If you are using Windows containers, keep in mind that there are some
limitations with regard to networking due to the current implementation of
Windows NAT (WinNAT). These limitations may potentially resolve as the Windows
containers project evolves.

One thing you may encounter rather immediately is that published ports on
Windows containers do not do loopback to the local host. Instead, container
endpoints are only reachable from the host using the container's IP and port.

So, in a scenario where you use Docker to pull an image and run a webserver with
a command like this:

```
docker run -d -p 80:80 --name webserver nginx
```

Using `curl http://localhost`, or pointing your web browser at
`http://localhost` will not display the `nginx` web page (as it would do with
Linux containers).

In order to reach a Windows container from the local host, you need to specify
the IP address and port for the container that is running the service.

You can get the container IP address by using [`docker inspect`](/engine/reference/commandline/inspect.md) with some
`--format` options and the ID or name of the container. For the example above,
the command would look like this, using the name we gave to the container
(`webserver`) instead of the container ID:

```bash
{% raw %}
$ docker inspect \
  --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
  webserver
{% endraw %}
```

This will give you the IP address of the container, for example:

```bash
{% raw %}
$ docker inspect \
  --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
  webserver

172.17.0.2
{% endraw %}
```

Now you can connect to the webserver by using `http://172.17.0.2:80` (or simply
`http://172.17.0.2`, since port `80` is the default HTTP port.)

For more information, see:

* Docker for Windows issue on GitHub: [Port binding does not work for locahost](https://github.com/docker/for-win/issues/458)

* [Published Ports on Windows Containers Don't Do Loopback](https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/)

* [Windows NAT capabilities and limitations](https://blogs.technet.microsoft.com/virtualization/2016/05/25/windows-nat-winnat-capabilities-and-limitations/)

### Running Docker for Windows in nested virtualization scenarios

Docker for Windows can run inside a Windows 10 virtual machine (VM) running on
apps like Parallels or VMware Fusion on a Mac provided that the VM is properly
configured. However, problems and intermittent failures may still occur due to
the way these apps virtualize the hardware. For these reasons, _**Docker for
Windows is not supported for nested virtualization scenarios**_. It
might work in some cases, and not in others.

The better solution is to run Docker for Windows natively on a Windows system
(to work with Windows or Linux containers), or Docker for Mac on Mac
to work with Linux containers.

#### If you still want to use nested virtualization

* Make sure your VMWare or Parallels has nested virtualization support enabled.
The path in both apps should be similar, e.g., **Hardware -> CPU & Memory -> Advanced Options -> Enable nested virtualization**.

* Configure your VM with at least 2 CPUs and sufficient memory (e.g., 6GB).

* Make sure your system is more or less idle.

* Make sure your Windows OS is up-to-date. There have been several issues with some insider builds.

* The processor you have may also be relevant. For example, Westmere based
Mac Pros have some additional hardware virtualization features over
Nehalem based Mac Pros and so do newer generations of Intel processors.

#### Typical failures we see with nested virtualization

* Slow boot time of the Linux VM. If you look in the logs, you'll see
some entries prefixed with `Moby`. On real hardware, it takes 5-10 seconds  to
boot the Linux VM; roughly the time between the `Connected` log entry and the `*
Starting Docker ... [ ok ]` log entry. If you boot the Linux VM inside a Window
VM, this may take considerably longer. We have a timeout of 60s or so. If the VM
hasn't started by that time, we retry. If the retry fails we print an error. You
may be able to work around this by providing more resources to the Windows VM.

* Sometimes the VM fails to boot when Linux tries to calibrate the
time stamp counter (TSC). This process is quite timing sensitive and may fail
when executed inside a VM which itself runs inside a VM. CPU utilization is also
likely to be higher.

#### Related issues

Discussion thread on GitHub at [Docker for Windows issue 267](https://github.com/docker/for-win/issues/267)

### Networking issues

Some users have reported problems connecting to Docker Hub on the Docker for Windows stable version. (See GitHub issue [22567](https://github.com/docker/docker/issues/22567).)

Here is an example command and error message:

	PS C:\Users\jdoe> docker run hello-world
	Unable to find image 'hello-world:latest' locally
	Pulling repository docker.io/library/hello-world
	C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp: lookup index.docker.io on 10.0.75.1:53: no such host.
	See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

As an immediate workaround to this problem, reset the DNS server to use the Google DNS fixed address: `8.8.8.8`. You can configure this via the **Settings** -> **Network** dialog, as described in the topic [Network](index.md#network). Docker will automatically restart when you apply this setting, which could take some time.

We are currently investigating this issue.

#### Networking issues on pre Beta 10 versions
Docker for Windows Beta 10 and later fixed a number of issues around the
networking setup.  If you still experience networking issue, this may be related
to previous Docker for Windows installations.  In this case, please quit Docker
for Windows and perform the following steps:

##### 1. Remove multiple `DockerNAT` VMswitches
You might have multiple Internal VMSwitches called `DockerNAT`. You can view all
VMSwitches either via the `Hyper-V Manager` sub-menu `Virtual Switch Manager` or
from an elevated Powershell (run as Administrator) prompt by typing
`Get-VMSwitch`. Simply delete all VMSwitches with `DockerNAT` in the name,
either via the `Virtual Switch Manager` or by using `Remove-VMSwitch` powershell
cmdlet.

##### 2. Remove lingering IP addresses

You might have lingering IP addresses on the system. They are supposed to get
removed when you remove the associated VMSwitches, but sometimes this fails.
Using `Remove-NetIPAddress 10.0.75.1` in an elevated Powershell prompt should
remove them.

##### 3. Remove stale NAT configurations

You might have stale NAT configurations on the system. You should remove them with `Remove-NetNat DockerNAT` on an elevated Powershell prompt.

##### 4. Remove stale network adapters

You might have stale Network Adapters on the system. You should remove them with the following commands on an elevated Powershell prompt:

```
    PS C:\Users\jdoe> vmNetAdapter = Get-VMNetworkAdapter -ManagementOS -SwitchName DockerNAT
    Get-NetAdapter "vEthernet (DockerNAT)" | ? { $_.DeviceID -ne $vmNetAdapter.DeviceID } | Disable-NetAdapter -Confirm:$False -PassThru | Rename-NetAdapter -NewName "Broken Docker Adapter"
```

Then you can remove them manually via the `devmgmt.msc` (aka Device Manager).
You should see them as disabled Hyper-V Virtual Ethernet Adapter under the
Network Adapter section. A right-click and selecting **uninstall** should remove
the adapter.

### NAT/IP configuration

By default, Docker for Windows uses an internal network prefix of
`10.0.75.0/24`. Should this clash with your normal network setup, you can change
the prefix from the **Settings** menu. See the [Network](index.md#network) topic
under [Settings](index.md#docker-settings).

#### NAT/IP configuration issues on pre Beta 15 versions

As of Beta 15, Docker for Windows is no longer using a switch with a NAT
configuration. The notes below are left here only for older Beta versions.

As of Beta14, networking for Docker for Windows is configurable through the UI.
See the [Network](index.md#network) topic under
[Settings](index.md#docker-settings).

By default, Docker for Windows uses an internal Hyper-V switch with a NAT
configuration with a `10.0.75.0/24` prefix. You can change the prefix used (as
well as the DNS server) via the **Settings** menu as described in the
[Network](index.md#network) topic.

If you have additional Hyper-V VMs and they are attached to their own NAT
prefixes, the prefixes need to be managed carefully, due to limitation of the
Windows NAT implementation. Specifically, Windows currently only allows a single
internal NAT prefix. If you need additional prefixes for your other VMs, you can
create a larger NAT prefix.

To create a larger NAT prefix, do the following.

1. Stop Docker for Windows and remove all NAT prefixes with `Remove-NetNAT`.

2. Create a new shorter NAT prefix which covers the Docker for Windows NAT prefix but allows room for additional NAT prefixes. For example:

        New-NetNat -Name DockerNAT -InternalIPInterfaceAddressPrefix 10.0.0.0/16

  The next time Docker for Windows starts, it will use the new, wider prefix.

Alternatively, you can use a different NAT name and NAT prefix and adjust the NAT prefix Docker for Windows uses accordingly via the `Settings` panel.

>**Note**: You also need to adjust your existing VMs to use IP addresses from within the new NAT prefix.

## Workarounds

### `inotify` currently does not work on Docker for Windows

If you are using `Node.js` with `nodemon`, a temporary workaround is to try the fallback polling mode described here: [nodemon isn't restarting node applications](https://github.com/remy/nodemon#application-isnt-restarting). See also this issue on GitHub [Inotify on shared drives does not work](https://github.com/docker/for-win/issues/56#issuecomment-242135705).

### Reboot

Restart your PC to stop / discard any vestige of the daemon running from the previously installed version.

### Unset `DOCKER_HOST`

You do not need `DOCKER_HOST` set, so unset as it may be pointing at
another Docker (e.g. VirtualBox). If you use bash, `unset ${!DOCKER_*}`
will unset existing `DOCKER` environment variables you have set. For other shells, unset each environment variable individually.

### Make sure Docker is running for webserver examples

For the `hello-world-nginx` example and others, Docker for Windows must be running in order to get to the webserver on `http://localhost/`. Make sure that the Docker whale is showing in the menu bar, and that you run the Docker commands in a shell that is connected to the Docker for Windows Engine (not Engine from Toolbox). Otherwise, you might start the webserver container but get a "web page not available" error when you go to `docker`.

### How to solve `port already allocated` errors

If you see errors like `Bind for 0.0.0.0:8080 failed: port is already allocated` or
  `listen tcp:0.0.0.0:8080: bind: address is already in use` ...

These errors are often caused by some other software on Windows using those
ports. To discover the identity of this software, either use the `resmon.exe`
GUI and click  "Network" and then "Listening Ports" or in a powershell use
`netstat -aon | find /i "listening "` to discover the PID of the process
currently using the port (the PID is the number in the rightmost column). Decide
whether to shut the other process down, or to use a different port in your
docker app.

### Docker fails to start when firewall or anti-virus software is installed

**Some firewalls and anti-virus software might be incompatible with  Microsoft Windows 10 buids** (e.g., Windows 10 Anniversary Update). The conflict typically occurs after a Windows update or new install of the firewall, and manifests as an error response from the Docker daemon and a **Docker for Windows start failure**. The Comodo Firewall was one example of this problem, but users report that software has since been updated to work with these Windows 10 builds.

See the Comodo forums topics [Comodo Firewall conflict with
Hyper-V](https://forums.comodo.com/bug-reports-cis/comodo-firewall-began-conflict-with-hyperv-t116351.0.html)
and [Windows 10 Anniversary build doesn't allow Comodo drivers to be
installed](https://forums.comodo.com/install-setup-configuration-help-cis/windows-10-aniversary-build-doesnt-allow-comodo-drivers-to-be-installed-t116322.0.html).
A Docker for Windows user-created issue describes the problem specifically as it
relates to Docker: [Docker fails to start on Windows
10](https://github.com/docker/for-win/issues/27).

For a temporary workaround, uninstall the firewall or anti-virus software, or explore other
workarounds suggested on the forum.


text:
(function() {

    'use strict';

    angular.module("cpPlacasEletronicasWebApp").controller('LoginCtrl', ["$scope", "validation", "LoginService", "$mdToast", "toast", "$location",
    function ($scope, validation, LoginService, $mdToast, toast, $location) {

        $scope.errorMessages = error_messages;
        $scope.btnLoginDisabled = false;

        //-- Username -- //
        $scope.showUsernameError = function() {
            var usernameRequired    = validation('username','required', $scope);
            var usernameInvalid     = $scope.form.username.$error.login_invalid;
            return usernameRequired || usernameInvalid;
        };
        //-- Password --  //
        $scope.showPasswordError = function() {
            var passwordError = validation('password','required', $scope);
            return passwordError;
        };

        function cleanInvalidFields() {
            $scope.form.username.$setValidity("login_invalid", true);
        };

        // -- LOGIN Button -- //
        $scope.login = function (user) {
            cleanInvalidFields();
            if ($scope.form.$valid) {
                $scope.btnLoginDisabled = true;
                LoginService.authenticate(user)
                .then(function () {
                    $scope.btnLoginDisabled = false;
                	$location.path('/home');
                }, function (error) {
                    $scope.btnLoginDisabled = false;
                	toast(error.data, $mdToast);
                });
            }
        };

    }]);
}());


text:
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Serialization;

namespace Framework
{
    [RequireComponent(typeof(Camera))]
    public class ActionCamera : CameraBase
    {
        [Header("Debug")]
        public bool InitOnStart;
        public bool Autoupdate;
        public bool DrawDebug;

        [Header("Target")]
        public string TargetTag = "Player";
        public Transform Target;
        public Transform LockOn;

        [Header("Input")]
        public string LookX = "Look X";
        public string LookY = "Look Y";

        [Header("Collision")]
        public LayerMask Mask;
        public float Margin = 0.15f;
        public float MinDist = 0.1f;
        public float MinHeight = 1.25f;

        [Header("Offset")]
        [FormerlySerializedAs("Offset")]
        public Vector3 RotatedOffset = new Vector3(0, 0, -4);
        public Vector3 FlatOffset = Vector3.zero;

        [Header("Speed")]
        public float SpeedX = 2;
        public float SpeedY = 2;

        [Header("Angles")]
        public float MaxAngleY =  45;
        public float MinAngleY = -45;

        [HideInInspector]
        public float AngleX;

        [HideInInspector]
        public float AngleY;

        void Start()
        {
            if (!InitOnStart)
                return;

            Init();
        }

        public void Init()
        {
            if (Target != null)
                return;

            var go = GameObject.FindGameObjectWithTag(TargetTag);
            Target = go ? go.transform : null;

            AngleX = 0;
            AngleY = 0;
        }

        void LateUpdate()
        {
            if (Autoupdate) OnUpdate();
        }

        public void SetLockOn(Transform lockOn)
        {
            LockOn = lockOn;
        }

        public void OnUpdate()
        {
            var rot = Quaternion.identity;

            if (LockOn)
            {
                var distance = transform.position - LockOn.position;
                var rawRot = Quaternion.LookRotation(-distance.normalized).eulerAngles;
                rot = Quaternion.Euler(rawRot.x, rawRot.y, rawRot.z);

                AngleY = rawRot.x;
                AngleX = rawRot.y;
            }
            else
            {
                AngleX += Input.GetAxis(LookX) * SpeedX;
                AngleY -= Input.GetAxis(LookY) * SpeedY;

                AngleY = Mathf.Min(Mathf.Max(MinAngleY, AngleY), MaxAngleY);

                rot = Quaternion.Euler(AngleY, AngleX, 0);
            }

            var offset    = rot * RotatedOffset + FlatOffset;
            var basePos   = (Target ? Target.position : Vector3.zero);
            var collision = CalcCameraDistance(basePos, offset);

            Debug.DrawRay(basePos, offset, Color.yellow);

            if (Mathf.Abs(collision) < offset.magnitude)
                offset = offset.normalized * -collision;

            Debug.DrawRay(basePos, offset, Color.red);

            var pos = basePos + offset;

            transform.position = pos;
            transform.rotation = rot; //Quaternion.RotateTowards(transform.rotation, rot, 360 * Time.deltaTime);
        }

        public float CalcCameraDistance(Vector3 from, Vector3 dir)
        {
            if (!Target)
                return RotatedOffset.z;

            RaycastHit hit;
            Vector3    offset = new Vector3(0, RotatedOffset.y, 0);

            if (!Physics.Raycast(from, dir, out hit, Mathf.Abs(RotatedOffset.z), Mask))
                return RotatedOffset.z;

            if (DrawDebug)
                Debug.DrawRay(Target.position + offset, -transform.forward * hit.distance, Color.red, 5.0f);

            return -Mathf.Max(MinDist, hit.distance - Margin);
        }
    }
}


text:
exports.util = require('./lib/util');
exports.DOMutil = require('./lib/DOMutil');

// data
exports.DataSet = require('./lib/DataSet');
exports.DataView = require('./lib/DataView');

// Graph3d
exports.Graph3d = require('./lib/graph3d/Graph3d');
exports.graph3d = {
  Camera: require('./lib/graph3d/Camera'),
  Filter: require('./lib/graph3d/Filter'),
  Point2d: require('./lib/graph3d/Point2d'),
  Point3d: require('./lib/graph3d/Point3d'),
  Slider: require('./lib/graph3d/Slider'),
  StepNumber: require('./lib/graph3d/StepNumber')
};

// Timeline
exports.Timeline = require('./lib/timeline/Timeline');
exports.Graph2d = require('./lib/timeline/Graph2d');
exports.timeline = {
  DataStep: require('./lib/timeline/DataStep'),
  Range: require('./lib/timeline/Range'),
  stack: require('./lib/timeline/Stack'),
  TimeStep: require('./lib/timeline/TimeStep'),

  components: {
    items: {
      Item: require('./lib/timeline/component/item/Item'),
      BackgroundItem: require('./lib/timeline/component/item/BackgroundItem'),
      BoxItem: require('./lib/timeline/component/item/BoxItem'),
      PointItem: require('./lib/timeline/component/item/PointItem'),
      RangeItem: require('./lib/timeline/component/item/RangeItem')
    },

    Component: require('./lib/timeline/component/Component'),
    CurrentTime: require('./lib/timeline/component/CurrentTime'),
    CustomTime: require('./lib/timeline/component/CustomTime'),
    DataAxis: require('./lib/timeline/component/DataAxis'),
    GraphGroup: require('./lib/timeline/component/GraphGroup'),
    Group: require('./lib/timeline/component/Group'),
    ItemSet: require('./lib/timeline/component/ItemSet'),
    Legend: require('./lib/timeline/component/Legend'),
    LineGraph: require('./lib/timeline/component/LineGraph'),
    TimeAxis: require('./lib/timeline/component/TimeAxis')
  }
};

// Network
exports.Network = require('./lib/network/Network');
exports.network = {
  Edge: require('./lib/network/Edge'),
  Groups: require('./lib/network/Groups'),
  Images: require('./lib/network/Images'),
  Node: require('./lib/network/Node'),
  Popup: require('./lib/network/Popup'),
  dotparser: require('./lib/network/dotparser'),
  gephiParser: require('./lib/network/gephiParser')
};

// Deprecated since v3.0.0
exports.Graph = function () {
  throw new Error('Graph is renamed to Network. Please create a graph as new vis.Network(...)');
};

// bundled external libraries
exports.moment = require('./lib/module/moment');
exports.hammer = require('./lib/module/hammer');


text:
class FStructBoxModule : public IStructBoxModuleInterface
{

};

IMPLEMENT_MODULE(FStructBoxModule, StructBox);


text:
<?xml version="1.0" encoding="UTF-8" ?>
        <XML>
            <Content>UPDATE</Content>
            <Clip>
                <ClipName>INPRNAD0272</ClipName>
                <TipoContenido>INFORMATIVOS PROGRAMAS</TipoContenido>
                <Contenido><![CDATA[ NAD 02AGO14]]></Contenido>
                <OriginalTitle></OriginalTitle>
                <Description> </Description>
                <Notes>a</Notes>
                <DurPrev></DurPrev>
                <Chapter></Chapter>
                <EndDate></EndDate>
                <EPG></EPG>
                <EPG_Content> </EPG_Content>
                <Segments>

                <Segment>
                    <SegTitle>1-3 NUESTRA AMERICA DEPORTIVA - NAD 02AGO14</SegTitle>
                    <MediaID>INPRNAD027201</MediaID>
                    <Duration>00:08:00.00</Duration>
                    <SegNumber>1</SegNumber>
                    <ClipGroup>PROGRAMA</ClipGroup>
                    <Description> </Description>
                </Segment>

                <Segment>
                    <SegTitle>2-3 NUESTRA AMERICA DEPORTIVA - NAD 02AGO14</SegTitle>
                    <MediaID>INPRNAD027202</MediaID>
                    <Duration>00:08:00.00</Duration>
                    <SegNumber>2</SegNumber>
                    <ClipGroup>PROGRAMA</ClipGroup>
                    <Description> </Description>
                </Segment>

                <Segment>
                    <SegTitle>3-3 NUESTRA AMERICA DEPORTIVA - NAD 02AGO14</SegTitle>
                    <MediaID>INPRNAD027203</MediaID>
                    <Duration>00:08:00.00</Duration>
                    <SegNumber>3</SegNumber>
                    <ClipGroup>PROGRAMA</ClipGroup>
                    <Description> </Description>
                </Segment>
            </Segments></Clip></XML>


text:
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
#include FT_OUTLINE_H
#include "ftsmooth.h"
#include "ftgrays.h"

#include "ftsmerrs.h"

  /* initialize renderer -- init its raster */
  static FT_Error
  ft_smooth_init( FT_Renderer  render )
  {

#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING

    FT_Vector*  sub = render->root.library->lcd_geometry;

    /* set up default subpixel geometry for striped RGB panels. */
    sub[0].x = -21;
    sub[0].y = 0;
    sub[1].x = 0;
    sub[1].y = 0;
    sub[2].x = 21;
    sub[2].y = 0;

#elif 0   /* or else, once ClearType patents expire */

    FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );

#endif

    render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );

    return 0;
  }

  /* sets render-specific mode */
  static FT_Error
  ft_smooth_set_mode( FT_Renderer  render,
                      FT_ULong     mode_tag,
                      FT_Pointer   data )
  {
    /* we simply pass it to the raster */
    return render->clazz->raster_class->raster_set_mode( render->raster,
                                                         mode_tag,
                                                         data );
  }

  /* transform a given glyph image */
  static FT_Error
  ft_smooth_transform( FT_Renderer       render,
                       FT_GlyphSlot      slot,
                       const FT_Matrix*  matrix,
                       const FT_Vector*  delta )
  {
    FT_Error  error = FT_Err_Ok;

    if ( slot->format != render->glyph_format )
    {
      error = FT_THROW( Invalid_Argument );
      goto Exit;
    }

    if ( matrix )
      FT_Outline_Transform( &slot->outline, matrix );

    if ( delta )
      FT_Outline_Translate( &slot->outline, delta->x, delta->y );

  Exit:
    return error;
  }

  /* return the glyph's control box */
  static void
  ft_smooth_get_cbox( FT_Renderer   render,
                      FT_GlyphSlot  slot,
                      FT_BBox*      cbox )
  {
    FT_ZERO( cbox );

    if ( slot->format == render->glyph_format )
      FT_Outline_Get_CBox( &slot->outline, cbox );
  }

  /* convert a slot's glyph image into a bitmap */
  static FT_Error
  ft_smooth_render_generic( FT_Renderer       render,
                            FT_GlyphSlot      slot,
                            FT_Render_Mode    mode,
                            const FT_Vector*  origin,
                            FT_Render_Mode    required_mode )
  {
    FT_Error     error   = FT_Err_Ok;
    FT_Outline*  outline = &slot->outline;
    FT_Bitmap*   bitmap  = &slot->bitmap;
    FT_Memory    memory  = render->root.memory;
    FT_Pos       x_shift = 0;
    FT_Pos       y_shift = 0;
    FT_Int       hmul    = ( mode == FT_RENDER_MODE_LCD );
    FT_Int       vmul    = ( mode == FT_RENDER_MODE_LCD_V );

    FT_Raster_Params  params;

    /* check glyph image format */
    if ( slot->format != render->glyph_format )
    {
      error = FT_THROW( Invalid_Argument );
      goto Exit;
    }

    /* check mode */
    if ( mode != required_mode )
    {
      error = FT_THROW( Cannot_Render_Glyph );
      goto Exit;
    }

    /* release old bitmap buffer */
    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
    {
      FT_FREE( bitmap->buffer );
      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
    }

    if ( ft_glyphslot_preset_bitmap( slot, mode, origin ) )
    {
      error = FT_THROW( Raster_Overflow );
      goto Exit;
    }

    /* allocate new one */
    if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
      goto Exit;

    slot->internal->flags |= FT_GLYPH_OWN_BITMAP;

    x_shift = 64 * -slot->bitmap_left;
    y_shift = 64 * -slot->bitmap_top;
    if ( bitmap->pixel_mode == FT_PIXEL_MODE_LCD_V )
      y_shift += 64 * (FT_Int)bitmap->rows / 3;
    else
      y_shift += 64 * (FT_Int)bitmap->rows;

    if ( origin )
    {
      x_shift += origin->x;
      y_shift += origin->y;
    }

    /* translate outline to render it into the bitmap */
    if ( x_shift || y_shift )
      FT_Outline_Translate( outline, x_shift, y_shift );

    /* set up parameters */
    params.target = bitmap;
    params.source = outline;
    params.flags  = FT_RASTER_FLAG_AA;

#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING

    /* implode outline if needed */
    {
      FT_Vector*  points     = outline->points;
      FT_Vector*  points_end = points + outline->n_points;
      FT_Vector*  vec;

      if ( hmul )
        for ( vec = points; vec < points_end; vec++ )
          vec->x *= 3;

      if ( vmul )
        for ( vec = points; vec < points_end; vec++ )
          vec->y *= 3;
    }

    /* render outline into the bitmap */
    error = render->raster_render( render->raster, &params );

    /* deflate outline if needed */
    {
      FT_Vector*  points     = outline->points;
      FT_Vector*  points_end = points + outline->n_points;
      FT_Vector*  vec;

      if ( hmul )
        for ( vec = points; vec < points_end; vec++ )
          vec->x /= 3;

      if ( vmul )
        for ( vec = points; vec < points_end; vec++ )
          vec->y /= 3;
    }

    if ( error )
      goto Exit;

    /* finally apply filtering */
    if ( hmul || vmul )
    {
      FT_Byte*                 lcd_weights;
      FT_Bitmap_LcdFilterFunc  lcd_filter_func;

      /* Per-face LCD filtering takes priority if set up. */
      if ( slot->face && slot->face->internal->lcd_filter_func )
      {
        lcd_weights     = slot->face->internal->lcd_weights;
        lcd_filter_func = slot->face->internal->lcd_filter_func;
      }
      else
      {
        lcd_weights     = slot->library->lcd_weights;
        lcd_filter_func = slot->library->lcd_filter_func;
      }

      if ( lcd_filter_func )
        lcd_filter_func( bitmap, lcd_weights );
    }

#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */

    if ( hmul )  /* lcd */
    {
      FT_Byte*  line;
      FT_Byte*  temp = NULL;
      FT_UInt   i, j;

      unsigned int  height = bitmap->rows;
      unsigned int  width  = bitmap->width;
      int           pitch  = bitmap->pitch;

      FT_Vector*  sub = slot->library->lcd_geometry;

      /* Render 3 separate monochrome bitmaps, shifting the outline.  */
      width /= 3;

      FT_Outline_Translate( outline,
                            -sub[0].x,
                            -sub[0].y );
      error = render->raster_render( render->raster, &params );
      if ( error )
        goto Exit;

      bitmap->buffer += width;
      FT_Outline_Translate( outline,
                            sub[0].x - sub[1].x,
                            sub[0].y - sub[1].y );
      error = render->raster_render( render->raster, &params );
      bitmap->buffer -= width;
      if ( error )
        goto Exit;

      bitmap->buffer += 2 * width;
      FT_Outline_Translate( outline,
                            sub[1].x - sub[2].x,
                            sub[1].y - sub[2].y );
      error = render->raster_render( render->raster, &params );
      bitmap->buffer -= 2 * width;
      if ( error )
        goto Exit;

      x_shift -= sub[2].x;
      y_shift -= sub[2].y;

      /* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD.    */
      /* XXX: It is more efficient to render every third byte above. */

      if ( FT_ALLOC( temp, (FT_ULong)pitch ) )
        goto Exit;

      for ( i = 0; i < height; i++ )
      {
        line = bitmap->buffer + i * (FT_ULong)pitch;
        for ( j = 0; j < width; j++ )
        {
          temp[3 * j    ] = line[j];
          temp[3 * j + 1] = line[j + width];
          temp[3 * j + 2] = line[j + width + width];
        }
        FT_MEM_COPY( line, temp, pitch );
      }

      FT_FREE( temp );
    }
    else if ( vmul )  /* lcd_v */
    {
      int  pitch  = bitmap->pitch;

      FT_Vector*  sub = slot->library->lcd_geometry;

      /* Render 3 separate monochrome bitmaps, shifting the outline. */
      /* Notice that the subpixel geometry vectors are rotated.      */
      /* Triple the pitch to render on each third row.               */
      bitmap->pitch *= 3;
      bitmap->rows  /= 3;

      FT_Outline_Translate( outline,
                            -sub[0].y,
                            sub[0].x );
      error = render->raster_render( render->raster, &params );
      if ( error )
        goto Exit;

      bitmap->buffer += pitch;
      FT_Outline_Translate( outline,
                            sub[0].y - sub[1].y,
                            sub[1].x - sub[0].x );
      error = render->raster_render( render->raster, &params );
      bitmap->buffer -= pitch;
      if ( error )
        goto Exit;

      bitmap->buffer += 2 * pitch;
      FT_Outline_Translate( outline,
                            sub[1].y - sub[2].y,
                            sub[2].x - sub[1].x );
      error = render->raster_render( render->raster, &params );
      bitmap->buffer -= 2 * pitch;
      if ( error )
        goto Exit;

      x_shift -= sub[2].y;
      y_shift += sub[2].x;

      bitmap->pitch /= 3;
      bitmap->rows  *= 3;
    }
    else  /* grayscale */
      error = render->raster_render( render->raster, &params );

#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */

  Exit:
    if ( !error )
    {
      /* everything is fine; the glyph is now officially a bitmap */
      slot->format = FT_GLYPH_FORMAT_BITMAP;
    }
    else if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
    {
      FT_FREE( bitmap->buffer );
      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
    }

    if ( x_shift || y_shift )
      FT_Outline_Translate( outline, -x_shift, -y_shift );

    return error;
  }

  /* convert a slot's glyph image into a bitmap */
  static FT_Error
  ft_smooth_render( FT_Renderer       render,
                    FT_GlyphSlot      slot,
                    FT_Render_Mode    mode,
                    const FT_Vector*  origin )
  {
    if ( mode == FT_RENDER_MODE_LIGHT )
      mode = FT_RENDER_MODE_NORMAL;

    return ft_smooth_render_generic( render, slot, mode, origin,
                                     FT_RENDER_MODE_NORMAL );
  }

  /* convert a slot's glyph image into a horizontal LCD bitmap */
  static FT_Error
  ft_smooth_render_lcd( FT_Renderer       render,
                        FT_GlyphSlot      slot,
                        FT_Render_Mode    mode,
                        const FT_Vector*  origin )
  {
    return ft_smooth_render_generic( render, slot, mode, origin,
                                     FT_RENDER_MODE_LCD );
  }

  /* convert a slot's glyph image into a vertical LCD bitmap */
  static FT_Error
  ft_smooth_render_lcd_v( FT_Renderer       render,
                          FT_GlyphSlot      slot,
                          FT_Render_Mode    mode,
                          const FT_Vector*  origin )
  {
    return ft_smooth_render_generic( render, slot, mode, origin,
                                     FT_RENDER_MODE_LCD_V );
  }

  FT_DEFINE_RENDERER(
    ft_smooth_renderer_class,

      FT_MODULE_RENDERER,
      sizeof ( FT_RendererRec ),

      "smooth",
      0x10000L,
      0x20000L,

      NULL,    /* module specific interface */

      (FT_Module_Constructor)ft_smooth_init,  /* module_init   */
      (FT_Module_Destructor) NULL,            /* module_done   */
      (FT_Module_Requester)  NULL,            /* get_interface */

    FT_GLYPH_FORMAT_OUTLINE,

    (FT_Renderer_RenderFunc)   ft_smooth_render,     /* render_glyph    */
    (FT_Renderer_TransformFunc)ft_smooth_transform,  /* transform_glyph */
    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,   /* get_glyph_cbox  */
    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,   /* set_mode        */

    (FT_Raster_Funcs*)&ft_grays_raster               /* raster_class    */
  )

  FT_DEFINE_RENDERER(
    ft_smooth_lcd_renderer_class,

      FT_MODULE_RENDERER,
      sizeof ( FT_RendererRec ),

      "smooth-lcd",
      0x10000L,
      0x20000L,

      NULL,    /* module specific interface */

      (FT_Module_Constructor)ft_smooth_init,  /* module_init   */
      (FT_Module_Destructor) NULL,            /* module_done   */
      (FT_Module_Requester)  NULL,            /* get_interface */

    FT_GLYPH_FORMAT_OUTLINE,

    (FT_Renderer_RenderFunc)   ft_smooth_render_lcd,  /* render_glyph    */
    (FT_Renderer_TransformFunc)ft_smooth_transform,   /* transform_glyph */
    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,    /* get_glyph_cbox  */
    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,    /* set_mode        */

    (FT_Raster_Funcs*)&ft_grays_raster                /* raster_class    */
  )

  FT_DEFINE_RENDERER(
    ft_smooth_lcdv_renderer_class,

      FT_MODULE_RENDERER,
      sizeof ( FT_RendererRec ),

      "smooth-lcdv",
      0x10000L,
      0x20000L,

      NULL,    /* module specific interface */

      (FT_Module_Constructor)ft_smooth_init,  /* module_init   */
      (FT_Module_Destructor) NULL,            /* module_done   */
      (FT_Module_Requester)  NULL,            /* get_interface */

    FT_GLYPH_FORMAT_OUTLINE,

    (FT_Renderer_RenderFunc)   ft_smooth_render_lcd_v,  /* render_glyph    */
    (FT_Renderer_TransformFunc)ft_smooth_transform,     /* transform_glyph */
    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,      /* get_glyph_cbox  */
    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,      /* set_mode        */

    (FT_Raster_Funcs*)&ft_grays_raster                  /* raster_class    */
  )

/* END */


text:
<!doctype html>

  <meta charset="utf-8">

Translation of more complex WebGL objects in JavaScript

      <canvas id="mycanvas" height=500 width=500 style="position: absolute;">
        Canvas does not appear to be supported.
      </canvas>

        x <input type=range id="x" max=500 min=0 step=1 value=0 oninput="sliderChange('x')"/>

        y <input type=range id="y" max=500 min=0 step=1 value=0 oninput="sliderChange('y')"/>


text: android_platform_frameworks_opt_colorpicker


text:
<?php
/**
 * A base class for redis entities.
 * Extends CBehavior to allow entities to be attached to models and components.
 * <pre>
 * $user = User::model()->findByPk(1);
 * $counter = new ARedisCounter("totalLogins");
 * $user->attachBehavior("totalLogins", $counter);
 * echo $user->totalLogins."\n"; // 0
 * $user->totalLogins->increment();
 * echo $user->totalLogins."\n"; // 1
 *
 * $friends = new ARedisSet("friendIds");
 * $user->attachBehavior("friendIds",$friends);
 * foreach($user->friendIds as $id) {
 *  echo "User ".$user->id." is friends with user ".$id."\n";
 * }
 *
 * </pre>
 * the last known user to change this file in the repository  <$LastChangedBy: suqian $>
 *
 * @author Charles Pick
 * @version $Id: PipiRedisEntity.php 8331 2013-03-29 14:44:24Z suqian $
 */
abstract class PipiRedisEntity extends CBehavior {
	/**
	 * The name of the redis entity (key)
	 * @var string
	 */
	public $name;

	/**
	 * Holds the redis connection
	 * @var PipiRedisConnection
	 */
	protected $_connection;

	/**
	 * The old name of this entity
	 * @var string
	 */
	protected $_oldName;
	/**
	 * Constructor
	 * @param string $name the name of the entity
	 * @param PipiRedisConnection|string $connection the redis connection to use with this entity
	 */
	public function __construct($name = null, $connection = null) {
		if ($name !== null) {
			$this->name = $name;
		}
		if ($connection !== null) {
			$this->setConnection($connection);
		}
	}
	/**
	 * Attaches the entity to a component
	 * @throws CException if no name is set
	 * @param CComponent $owner the owner component
	 */
	public function attach($owner) {
		parent::attach($owner);
		if ($this->name === null) {
			throw new CException("No name specified for ".get_class($this));
		}
		if (method_exists($owner, "getPrimaryKey")) {
			$this->_oldName = $this->name;

			$pk = $owner->getPrimaryKey();
			if (is_array($pk)) {
				foreach($pk as $key => $value) {
					$pk[$key] = $key.":".$value;
				}
				$pk = implode(":",$pk);
			}
			$this->name = get_class($owner).":".$pk.":".$this->name;
		}
	}
	/**
	 * Detaches the entity from a component
	 * @param CComponent $owner the owner component
	 */
	public function detach($owner) {
		parent::detach($owner);
		if (method_exists($owner, "getPrimaryKey")) {
			$this->name = $this->_oldName;
		}
	}

	/**
	 * Sets the redis connection to use for this entity
	 * @param PipiRedisConnection|string $connection the redis connection, if a string is provided, it is presumed to be a the name of an applciation component
	 */
	public function setConnection($connection)
	{
		if (is_string($connection)) {
			$connection = Yii::app()->{$connection};
		}
		$this->_connection = $connection;
	}

	/**
	 * Gets the redis connection to use for this entity
	 * @return PipiRedisConnection
	 */
	public function getConnection()
	{
		if ($this->_connection === null) {
			if (!isset(Yii::app()->redis)) {
				throw new CException(get_class($this)." expects a 'redis' application component");
			}
			$this->_connection = Yii::app()->redis;
		}
		return $this->_connection;
	}

}


text:
PMTK3:  (27) Latent Variable Models For Discrete Data

Revision Date: 27-Mar-2012

 Book Version: 26-Mar-2012

Auto-generated by publishDemos.m

Click on a link in the second column to go to a page showing the source code and the output that the function generates.
Some demos are tagged according to the table on the right.

<TABLE BGCOLOR=grey ALIGN=right CELLPADDING=9 VALIGN=top

S

stats toolbox needed

I

interactive (user input required)

B

bioinformatics toolbox needed

M

matlab  needed (will not work in octave)

O

optimization toolbox needed

W

windows needed (will not work in linux)

X

currently broken

*

slow (two stars indicates very slow)

	File Name
	Brief Description
	Page Number(s)
	Tags

bleiLDAperplexityPlot
	  Plot fig 9 of Blei'03, "latent dirichlet allocation"
911

netflixResultsPlot

937


text:
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { createStore, applyMiddleware, compose } from 'redux';
import reduxThunk from 'redux-thunk';

import reducer from './reducers';
import { init as initActions, getTerminalData } from './actions';

import App from './components/app';
import Index from './components/terminal/index';

const store = createStore(reducer, {},
	compose(applyMiddleware(reduxThunk),
	window.devToolsExtension ? window.devToolsExtension() : f => f));
let attachTo;
let terminalURL;

try {
    terminalURL = componentConfig.terminal.TERMINAL_URL
}catch(e){
    console.error(e);
    console.error('Warning: componentConfig.terminal.TERMINAL_URL not set. Please ensure PHP is serving the config correctly.');
}

try {
    attachTo = componentConfig.terminal.ATTACH_COMPONENT_TO;
}catch(e){
    console.error(e);
    console.error('Warning: componentConfig.terminal.ATTACH_COMPONENT_TO not set. Please ensure PHP is serving the config correctly.');
}

initActions(store.dispatch, terminalURL);
getTerminalData();

ReactDOM.render(
	<Provider store={store} >
		<Router history={browserHistory}>
			<Route path="/" component={App}>
				<Route path="terminal" component={Index} />
			</Route>
		</Router>
	</Provider>
  , document.querySelector(attachTo)
);


text:
using System.Collections.Generic;
using System.Reflection;

namespace RabbitBus.Configuration
{
	public interface IAutoConfigurationModel
	{
		IEnumerable<Assembly> Assemblies { get; set; }
		IEnumerable<IConsumeConfigurationConvention> ConsumeConfigurationConventions { get; set; }
		IEnumerable<IPublishConfigurationConvention> PublishConfigurationConventions { get; set; }
		IEnumerable<ISubscriptionConvention> SubscriptionConventions { get; set; }
		IDependencyResolver DependencyResolver { get; set; }
	}
}