text:
//
// BodyPart.cs
//
// Author: Jeffrey Stedfast <jeff@xamarin.com>
//
// Copyright (c) 2013-2016 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

using System;
using System.Text;
using System.Collections.Generic;

using MimeKit;
using MimeKit.Utils;

namespace MailKit {
	/// <summary>
	/// An abstract body part of a message.
	/// </summary>
	/// <remarks>
	/// Each body part will actually be a <see cref="BodyPartBasic"/>,
	/// <see cref="BodyPartText"/>, <see cref="BodyPartMessage"/>, or
	/// <see cref="BodyPartMultipart"/>.
	/// </remarks>
	public abstract class BodyPart
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="MailKit.BodyPart"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="MailKit.BodyPart"/>.
		/// </remarks>
		protected BodyPart ()
		{
		}

		/// <summary>
		/// Gets the Content-Type of the body part.
		/// </summary>
		/// <remarks>
		/// Gets the Content-Type of the body part.
		/// </remarks>
		/// <value>The content type.</value>
		public ContentType ContentType {
			get; set;
		}

		/// <summary>
		/// Gets the part specifier.
		/// </summary>
		/// <remarks>
		/// Gets the part specifier.
		/// </remarks>
		/// <value>The part specifier.</value>
		public string PartSpecifier {
			get; set;
		}

		/// <summary>
		/// Dispatches to the specific visit method for this MIME body part.
		/// </summary>
		/// <remarks>
		/// This default implementation for <see cref="MailKit.BodyPart"/> nodes
		/// calls <see cref="MailKit.BodyPartVisitor.VisitBodyPart"/>. Override this
		/// method to call into a more specific method on a derived visitor class
		/// of the <see cref="MailKit.BodyPartVisitor"/> class. However, it should still
		/// support unknown visitors by calling
		/// <see cref="MailKit.BodyPartVisitor.VisitBodyPart"/>.
		/// </remarks>
		/// <param name="visitor">The visitor.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <paramref name="visitor"/> is <c>null</c>.
		/// </exception>
		public virtual void Accept (BodyPartVisitor visitor)
		{
			if (visitor == null)
				throw new ArgumentNullException ("visitor");

			visitor.VisitBodyPart (this);
		}

		internal static void Encode (StringBuilder builder, uint value)
		{
			builder.Append (value.ToString ());
		}

		internal static void Encode (StringBuilder builder, string value)
		{
			if (value != null)
				builder.Append (MimeUtils.Quote (value));
			else
				builder.Append ("NIL");
		}

		internal static void Encode (StringBuilder builder, Uri location)
		{
			if (location != null)
				builder.Append (MimeUtils.Quote (location.ToString ()));
			else
				builder.Append ("NIL");
		}

		internal static void Encode (StringBuilder builder, string[] values)
		{
			if (values == null || values.Length == 0) {
				builder.Append ("NIL");
				return;
			}

			builder.Append ('(');

			for (int i = 0; i < values.Length; i++) {
				if (i > 0)
					builder.Append (' ');

				Encode (builder, values[i]);
			}

			builder.Append (')');
		}

		internal static void Encode (StringBuilder builder, IList<Parameter> parameters)
		{
			if (parameters == null || parameters.Count == 0) {
				builder.Append ("NIL");
				return;
			}

			builder.Append ('(');

			for (int i = 0; i < parameters.Count; i++) {
				if (i > 0)
					builder.Append (' ');

				Encode (builder, parameters[i].Name);
				builder.Append (' ');
				Encode (builder, parameters[i].Value);
			}

			builder.Append (')');
		}

		internal static void Encode (StringBuilder builder, ContentDisposition disposition)
		{
			if (disposition == null) {
				builder.Append ("NIL");
				return;
			}

			builder.Append ('(');
			Encode (builder, disposition.Disposition);
			builder.Append (' ');
			Encode (builder, disposition.Parameters);
			builder.Append (')');
		}

		internal static void Encode (StringBuilder builder, ContentType contentType)
		{
			Encode (builder, contentType.MediaType);
			builder.Append (' ');
			Encode (builder, contentType.MediaSubtype);
			builder.Append (' ');
			Encode (builder, contentType.Parameters);
		}

		internal static void Encode (StringBuilder builder, BodyPartCollection parts)
		{
			if (parts == null || parts.Count == 0) {
				builder.Append ("NIL");
				return;
			}

			for (int i = 0; i < parts.Count; i++) {
				if (i > 0)
					builder.Append (' ');

				Encode (builder, parts[i]);
			}
		}

		internal static void Encode (StringBuilder builder, Envelope envelope)
		{
			if (envelope == null) {
				builder.Append ("NIL");
				return;
			}

			envelope.Encode (builder);
		}

		internal static void Encode (StringBuilder builder, BodyPart body)
		{
			if (body == null) {
				builder.Append ("NIL");
				return;
			}

			builder.Append ('(');
			body.Encode (builder);
			builder.Append (')');
		}

		/// <summary>
		/// Encodes the <see cref="BodyPart"/> into the <see cref="System.Text.StringBuilder"/>.
		/// </summary>
		/// <remarks>
		/// Encodes the <see cref="BodyPart"/> into the <see cref="System.Text.StringBuilder"/>.
		/// </remarks>
		/// <param name="builder">The string builder.</param>
		protected abstract void Encode (StringBuilder builder);

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents the current <see cref="MailKit.BodyPart"/>.
		/// </summary>
		/// <remarks>
		/// <para>Returns a <see cref="System.String"/> that represents the current <see cref="MailKit.BodyPart"/>.</para>
		/// <note type="note">The syntax of the string returned, while similar to IMAP's BODYSTRUCTURE syntax,
		/// is not completely compatible.</note>
		/// </remarks>
		/// <returns>A <see cref="System.String"/> that represents the current <see cref="MailKit.BodyPart"/>.</returns>
		public override string ToString ()
		{
			var builder = new StringBuilder ();

			builder.Append ('(');
			Encode (builder);
			builder.Append (')');

			return builder.ToString ();
		}

		static bool TryParse (string text, ref int index, out uint value)
		{
			while (index < text.Length && text[index] == ' ')
				index++;

			int startIndex = index;

			value = 0;

			while (index < text.Length && char.IsDigit (text[index]))
				value = (value * 10) + (uint) (text[index++] - '0');

			return index > startIndex;
		}

		static bool TryParse (string text, ref int index, out string nstring)
		{
			nstring = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length)
				return false;

			if (text[index] != '"') {
				if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
					index += 3;
					return true;
				}

				return false;
			}

			var token = new StringBuilder ();
			bool escaped = false;

			index++;

			while (index < text.Length) {
				if (text[index] == '"' && !escaped)
					break;

				if (escaped || text[index] != '\\') {
					token.Append (text[index]);
					escaped = false;
				} else {
					escaped = true;
				}

				index++;
			}

			if (index >= text.Length)
				return false;

			nstring = token.ToString ();

			index++;

			return true;
		}

		static bool TryParse (string text, ref int index, out string[] values)
		{
			values = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length)
				return false;

			if (text[index] != '(') {
				if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
					index += 3;
					return true;
				}

				return false;
			}

			index++;

			if (index >= text.Length)
				return false;

			var list = new List<string> ();
			string value;

			do {
				if (text[index] == ')')
					break;

				if (!TryParse (text, ref index, out value))
					return false;

				list.Add (value);
			} while (index < text.Length);

			if (index >= text.Length || text[index] != ')')
				return false;

			index++;

			return true;
		}

		static bool TryParse (string text, ref int index, out Uri uri)
		{
			string nstring;

			uri = null;

			if (!TryParse (text, ref index, out nstring))
				return false;

			if (!string.IsNullOrEmpty (nstring)) {
				if (Uri.IsWellFormedUriString (nstring, UriKind.Absolute))
					uri = new Uri (nstring, UriKind.Absolute);
				else if (Uri.IsWellFormedUriString (nstring, UriKind.Relative))
					uri = new Uri (nstring, UriKind.Relative);
			}

			return true;
		}

		static bool TryParse (string text, ref int index, out IList<Parameter> parameters)
		{
			string name, value;

			parameters = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length)
				return false;

			if (text[index] != '(') {
				if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
					parameters = new List<Parameter> ();
					index += 3;
					return true;
				}

				return false;
			}

			index++;

			if (index >= text.Length)
				return false;

			parameters = new List<Parameter> ();

			do {
				if (text[index] == ')')
					break;

				if (!TryParse (text, ref index, out name))
					return false;

				if (!TryParse (text, ref index, out value))
					return false;

				parameters.Add (new Parameter (name, value));
			} while (index < text.Length);

			if (index >= text.Length || text[index] != ')')
				return false;

			index++;

			return true;
		}

		static bool TryParse (string text, ref int index, out ContentDisposition disposition)
		{
			IList<Parameter> parameters;
			string value;

			disposition = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length)
				return false;

			if (text[index] != '(') {
				if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
					index += 3;
					return true;
				}

				return false;
			}

			index++;

			if (!TryParse (text, ref index, out value))
				return false;

			if (!TryParse (text, ref index, out parameters))
				return false;

			if (index >= text.Length || text[index] != ')')
				return false;

			index++;

			disposition = new ContentDisposition (value);

			foreach (var param in parameters)
				disposition.Parameters.Add (param);

			return true;
		}

		static bool TryParse (string text, ref int index, bool multipart, out ContentType contentType)
		{
			IList<Parameter> parameters;
			string type, subtype;

			contentType = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length)
				return false;

			if (!multipart) {
				if (!TryParse (text, ref index, out type))
					return false;
			} else {
				type = "multipart";
			}

			if (!TryParse (text, ref index, out subtype))
				return false;

			if (!TryParse (text, ref index, out parameters))
				return false;

			contentType = new ContentType (type ?? "application", subtype ?? "octet-stream");

			foreach (var param in parameters)
				contentType.Parameters.Add (param);

			return true;
		}

		static bool TryParse (string text, ref int index, string prefix, out IList<BodyPart> children)
		{
			BodyPart part;
			string path;
			int id = 1;

			children = null;

			if (index >= text.Length)
				return false;

			children = new List<BodyPart> ();

			do {
				if (text[index] != '(')
					break;

				path = prefix + id;

				if (!TryParse (text, ref index, path, out part))
					return false;

				while (index < text.Length && text[index] == ' ')
					index++;

				children.Add (part);
				id++;
			} while (index < text.Length);

			return index < text.Length;
		}

		static bool TryParse (string text, ref int index, string path, out BodyPart part)
		{
			ContentDisposition disposition;
			ContentType contentType;
			string[] array;
			string nstring;
			Uri location;
			uint number;

			part = null;

			while (index < text.Length && text[index] == ' ')
				index++;

			if (index >= text.Length || text[index] != '(') {
				if (index + 3 <= text.Length && text.Substring (index, 3) == "NIL") {
					index += 3;
					return true;
				}

				return false;
			}

			index++;

			if (index >= text.Length)
				return false;

			if (text[index] == '(') {
				var prefix = path.Length > 0 ? path + "." : string.Empty;
				var multipart = new BodyPartMultipart ();
				IList<BodyPart> children;

				if (!TryParse (text, ref index, prefix, out children))
					return false;

				foreach (var child in children)
					multipart.BodyParts.Add (child);

				if (!TryParse (text, ref index, true, out contentType))
					return false;

				multipart.ContentType = contentType;

				if (!TryParse (text, ref index, out disposition))
					return false;

				multipart.ContentDisposition = disposition;

				if (!TryParse (text, ref index, out array))
					return false;

				multipart.ContentLanguage = array;

				if (!TryParse (text, ref index, out location))
					return false;

				multipart.ContentLocation = location;

				part = multipart;
			} else {
				BodyPartMessage message = null;
				BodyPartText txt = null;
				BodyPartBasic basic;

				if (!TryParse (text, ref index, false, out contentType))
					return false;

				if (contentType.IsMimeType ("message", "rfc822"))
					basic = message = new BodyPartMessage ();
				else if (contentType.IsMimeType ("text", "*"))
					basic = txt = new BodyPartText ();
				else
					basic = new BodyPartBasic ();

				basic.ContentType = contentType;

				if (!TryParse (text, ref index, out nstring))
					return false;

				basic.ContentId = nstring;

				if (!TryParse (text, ref index, out nstring))
					return false;

				basic.ContentDescription = nstring;

				if (!TryParse (text, ref index, out nstring))
					return false;

				basic.ContentTransferEncoding = nstring;

				if (!TryParse (text, ref index, out number))
					return false;

				basic.Octets = number;

				if (!TryParse (text, ref index, out nstring))
					return false;

				basic.ContentMd5 = nstring;

				if (!TryParse (text, ref index, out disposition))
					return false;

				basic.ContentDisposition = disposition;

				if (!TryParse (text, ref index, out array))
					return false;

				basic.ContentLanguage = array;

				if (!TryParse (text, ref index, out location))
					return false;

				basic.ContentLocation = location;

				if (message != null) {
					Envelope envelope;
					BodyPart body;

					if (!Envelope.TryParse (text, ref index, out envelope))
						return false;

					message.Envelope = envelope;

					if (!TryParse (text, ref index, path, out body))
						return false;

					message.Body = body;

					if (!TryParse (text, ref index, out number))
						return false;

					message.Lines = number;
				} else if (txt != null) {
					if (!TryParse (text, ref index, out number))
						return false;

					txt.Lines = number;
				}

				part = basic;
			}

			part.PartSpecifier = path;

			if (index >= text.Length || text[index] != ')')
				return false;

			index++;

			return true;
		}

		/// <summary>
		/// Tries to parse the given text into a new <see cref="MailKit.BodyPart"/> instance.
		/// </summary>
		/// <remarks>
		/// <para>Parses a body part from the specified text.</para>
		/// <note type="note">This syntax, while similar to IMAP's BODYSTRUCTURE syntax, is not completely
		/// compatible.</note>
		/// </remarks>
		/// <returns><c>true</c>, if the body part was successfully parsed, <c>false</c> otherwise.</returns>
		/// <param name="text">The text to parse.</param>
		/// <param name="part">The parsed body part.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <paramref name="text"/> is <c>null</c>.
		/// </exception>
		public static bool TryParse (string text, out BodyPart part)
		{
			if (text == null)
				throw new ArgumentNullException ("text");

			int index = 0;

			return TryParse (text, ref index, string.Empty, out part) && index == text.Length;
		}
	}
}


text:
import sympy
from repr import ReprPrinter
from str import StrPrinter

# A list of classes that should be printed using StrPrinter
STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity",
            "Pow", "Zero")

class PythonPrinter(ReprPrinter, StrPrinter):
    """A printer which converts an expression into its Python interpretation."""

    def __init__(self, settings=None):
        ReprPrinter.__init__(self)
        StrPrinter.__init__(self, settings)
        self.symbols = []
        self.functions = []

        # Create print methods for classes that should use StrPrinter instead
        # of ReprPrinter.
        for name in STRPRINT:
            f_name = "_print_%s"%name
            f = getattr(StrPrinter, f_name)
            setattr(PythonPrinter, f_name, f)

    def _print_Function(self, expr):
        func = expr.func.__name__
        if not hasattr(sympy, func) and not func in self.functions:
            self.functions.append(func)
        return StrPrinter._print_Function(self, expr)

    # procedure (!) for defining symbols which have be defined in print_python()
    def _print_Symbol(self, expr):
        symbol = self._str(expr)
        if symbol not in self.symbols:
            self.symbols.append(symbol)
        return StrPrinter._print_Symbol(self, expr)

    def _print_module(self, expr):
        raise ValueError('Modules in the expression are unacceptable')

def python(expr, **settings):
    """Return Python interpretation of passed expression
    (can be passed to the exec() function without any modifications)"""

    printer = PythonPrinter(settings)
    expr = printer.doprint(expr)

    result = ''
    # Returning found symbols and functions
    for symbol in printer.symbols:
        result += symbol + ' = Symbol(\'' + symbol + '\')\n'
    for function in printer.functions:
        result += function + ' = Function(\'' + function + '\')\n'

    result += 'e = ' + printer._str(expr)
    return result

def print_python(expr, **settings):
    """Print output of python() function"""
    print python(expr, **settings)

redpajama_set_name: RedPajamaGithub


text:
package org.ehcache.clustered.common.internal.store;

import org.ehcache.clustered.common.internal.util.ByteBufferInputStream;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.function.Predicate;

public class Util {

  public static Object unmarshall(ByteBuffer payload, Predicate<Class<?>> isClassPermitted) {
    try (ObjectInputStream objectInputStream =
           new FilteredObjectInputStream(new ByteBufferInputStream(payload), isClassPermitted, null)) {
      return objectInputStream.readObject();
    } catch (IOException | ClassNotFoundException ex) {
      throw new IllegalArgumentException(ex);
    }
  }

  public static byte[] marshall(Object message) {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try(ObjectOutputStream oout = new ObjectOutputStream(out)) {
      oout.writeObject(message);
    } catch (IOException e) {
      throw new IllegalArgumentException(e);
    }
    return out.toByteArray();
  }
}


text:
"use strict";

const EventImpl = require("./Event-impl").implementation;

const CustomEventInit = require("../generated/CustomEventInit");

class CustomEventImpl extends EventImpl {
  initCustomEvent(type, bubbles, cancelable, detail) {
    if (this._dispatchFlag) {
      return;
    }

    this.initEvent(type, bubbles, cancelable);
    this.detail = detail;
  }
}
CustomEventImpl.defaultInit = CustomEventInit.convert(undefined, undefined);

module.exports = {
  implementation: CustomEventImpl
};


text:
source_file "$ALOJA_REPO_PATH/shell/common/common_hbase.sh"
set_hbase_requires

#BENCH_REQUIRED_FILES["tpch-hive"]="$ALOJA_PUBLIC_HTTP/aplic2/tarballs/tpch-hive.tar.gz"
[ ! "$BENCH_LIST" ] && BENCH_LIST="hbase_create hbase_insert hbase_drop"

# Implement only the different functionality

benchmark_suite_config() {
  initialize_hadoop_vars
  prepare_hadoop_config "$NET" "$DISK" "$BENCH_SUITE"
  start_hadoop

  initialize_hbase_vars
  prepare_hbase_config "$HBASE_SETTINGS_FILE" "$HBASE_SETTINGS_FILE_PATH"
  start_hbase
}

benchmark_suite_cleanup() {
  clean_hbase
  clean_hadoop
}

benchmark_hbase_create() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"create \\\"usertable\\\", \\\"family\\\";\"" "time"
}

benchmark_hbase_insert() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"put \\\"usertable\\\",\\\"row1\\\",\\\"family:testcol\\\",\\\"42\\\";\"" "time"
}

benchmark_hbase_drop() {
  local bench_name="${FUNCNAME[0]##*benchmark_}"
  logger "INFO: Running $bench_name"

  execute_hbase "$bench_name" "hbase shell -n <<< \"disable \\\"usertable\\\"; drop \\\"usertable\\\";\"" "time"
}


text:
package org.droidparts.inner.converter;

import org.droidparts.inner.TypeHelper;
import org.json.JSONObject;

import android.content.ContentValues;
import android.database.Cursor;

public class LongConverter extends Converter<Long> {

	@Override
	public boolean canHandle(Class<?> cls) {
		return TypeHelper.isLong(cls, true);
	}

	@Override
	public String getDBColumnType() {
		return INTEGER;
	}

	@Override
	public <V> Long readFromJSON(Class<Long> valType, Class<V> componentType,
			JSONObject obj, String key) throws Exception {
		return obj.getLong(key);
	}

	@Override
	protected <V> Long parseFromString(Class<Long> valType,
			Class<V> componentType, String str) {
		return Long.valueOf(str);
	}

	@Override
	public <V> void putToContentValues(Class<Long> valueType,
			Class<V> componentType, ContentValues cv, String key, Long val) {
		cv.put(key, val);
	}

	@Override
	public <V> Long readFromCursor(Class<Long> valType, Class<V> componentType,
			Cursor cursor, int columnIndex) {
		return cursor.getLong(columnIndex);
	}

}


text:
				<button type="button" class="close" data-dismiss="modal">×Close</button>

 My Account

 Account

						<form class="form-horizontal" role="form" id="account_details" >

							<input type="hidden" name="userID" value="{{ Auth::user()->id }}">

								First name

									<input type="text" class="form-control" id="firstname" name="firstname" placeholder="First name" value="{{ Auth::user()->first_name }}">

								Last name

									<input type="text" class="form-control" id="lastname" name="lastname" placeholder="Last name" value="{{ Auth::user()->last_name }}">

									<button type="button" class="btn btn-primary btn-embossed btn-block" id="accountDetailsSubmit"> Update Details</button>

						</form>

						<form class="form-horizontal" role="form" id="account_login">

							<input type="hidden" name="userID" value="{{ Auth::user()->id }}">

								Username

									<input type="text" class="form-control" id="email" name="email" placeholder="Username" value="{{ Auth::user()->email }}">

								Password

									<input type="password" class="form-control" id="password" name="password" placeholder="Password" value="">

									<button type="button" class="btn btn-primary btn-embossed btn-block" id="accountLoginSubmit"> Update Details</button>

						</form>

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


text:
/* NOTE: This file is autogenerated, do not edit this file directly.*/

#ifndef TRChartsJNI_PointDecoration_hpp
#define TRChartsJNI_PointDecoration_hpp

#include <TRChartsJNI/Support/Common.hpp>

#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT jlong JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeCreate(JNIEnv *env, jobject obj);

JNIEXPORT void JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeDestroy(JNIEnv *env, jobject obj, jlong ptr);

JNIEXPORT jobject JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeGetAbscissaAxis(JNIEnv * env, jobject obj, jlong ptr);

JNIEXPORT void JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeSetAbscissaAxis(JNIEnv * env, jobject obj, jlong ptr, jobject value);

JNIEXPORT jobject JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeGetOrdinateAxis(JNIEnv * env, jobject obj, jlong ptr);

JNIEXPORT void JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeSetOrdinateAxis(JNIEnv * env, jobject obj, jlong ptr, jobject value);

JNIEXPORT jobject JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeGetValue(JNIEnv * env, jobject obj, jlong ptr);

JNIEXPORT void JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeSetValue(JNIEnv * env, jobject obj, jlong ptr, jobject value);

JNIEXPORT jobject JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeGetPointStyle(JNIEnv * env, jobject obj, jlong ptr);

JNIEXPORT void JNICALL Java_com_thomsonreuters_corptech_charts_PointDecoration_nativeSetPointStyle(JNIEnv * env, jobject obj, jlong ptr, jobject value);

#ifdef __cplusplus
}
#endif
#endif


text:
/**
 * Perdido.row: Creates a row that is a fraction of the size of its containing
 *              element's height with a gutter.
 *
 * @param  {string} rowVal fraction of the containing element's height.
 * @param  {string} gutter The bottom margin size of the element.
 * @param  {boolean} flex   Whether to utilize flexbox or not
 * @return {object} an object containing the valid JSS rules and values to
 *                  create a row.
 */
export default function row(rowVal, gutter, flex) {
  const style = {
    width: '100%',
  };

  if (flex === true) {
    style.flex = '0 0 auto';
  }

  if (gutter !== '0') {
    style.height =
      `calc(99.99% * ${rowVal} - (${gutter} - ${gutter} * ${rowVal}))`;
  } else {
    style.height = `calc(99.999999% * ${rowVal})`;
  }

  style.marginBottom = gutter;

  style['&:last-child'] = {
    marginBottom: '0',
  };

  return style;
}


text: home work 06 'Zazor' preview http://fujul.github.io/hw06/


text:
#ifndef _SQUID__SRC_AUTH_AUTHTYPE_H
#define _SQUID__SRC_AUTH_AUTHTYPE_H

#if USE_AUTH

namespace Auth
{

typedef enum {
    AUTH_UNKNOWN,               /* default */
    AUTH_BASIC,
    AUTH_NTLM,
    AUTH_DIGEST,
    AUTH_NEGOTIATE,
    AUTH_BROKEN                 /* known type, but broken data */
} Type;

extern const char *Type_str[];

}; // namespace Auth

#endif /* USE_AUTH */
#endif


text:
class ColorChangeHandler : public content::WebContentsObserver,
                           public color_change_listener::mojom::PageHandler {
 public:
  ColorChangeHandler(
      content::WebContents* web_contents,
      mojo::PendingReceiver<color_change_listener::mojom::PageHandler>
          pending_page_handler);
  ColorChangeHandler(const ColorChangeHandler&) = delete;
  ColorChangeHandler& operator=(const ColorChangeHandler&) = delete;
  ~ColorChangeHandler() override;

  // content::WebContentsObserver:
  void OnColorProviderChanged() override;

  // color_change_listener::mojom::PageHandler:
  void SetPage(mojo::PendingRemote<color_change_listener::mojom::Page>
                   pending_page) override;

 private:
  mojo::Remote<color_change_listener::mojom::Page> page_;
  mojo::Receiver<color_change_listener::mojom::PageHandler> page_handler_;
};

#endif  // CHROME_BROWSER_UI_WEBUI_COLOR_CHANGE_LISTENER_COLOR_CHANGE_HANDLER_H_


text:
2015-03-01  version 0.3 alpha

## Prerequisites

As github projects go, this one is intended to be accessible to the person of "general computing literacy." If you are interested in getting started with establishing a Github track record, this might be a good project to start with. There is a diversity of technology here, and some nontrivial tools, but the concepts are all relatively simple. This really is more about systems administration than true software development.

In terms of skills, you need to be able to install software on your computer, edit text files (NOT using Microsoft Word), and be comfortable with a command prompt. You need some understanding of basic computing, virtualization, networking, and the like. You should have at least a little programming or scripting ability.

You also need at least a little Vagrant. It is probably the easiest tool in the box here to familiarize yourself with, and there is good material on the web just a Google search away. Spend an hour with the Vagrant tutorial and vagrant up a simple VM or two and you'll be more or less ready for this.

You'll find yourself learning Chef, but since you are starting with a simple, functioning set of interrelated recipes it's not a bad way to start. This project might make a good adjunct if you're running a Chef tutorial. If you want to modify or extend the system, you'll have to pick up some Ruby. There's also a few *.bash scripts.

You need enough git to clone this repository to your machine. That's just one command, shown below. But it would be nice if you could help improve the project by forking your own repo, making enhancements, and sending up pull requests. They will be reviewed and acted upon.

You need:

* Internet connectivity for all the install steps (the cluster will run without Internet once it is up)

* Recent (< 3 yrs old) Pentium or Xeon or similar class AMD chip, multi-core preferable.

* Windows 7+, Mac OS X Mavericks or later, or Ubuntu 14 (note: I have not done extensive version testing; if you have a platform that runs the prequisites listed below it probably will work)

* At least 8 GB of RAM (16 or more recommended; if you have 4 you can try --  shut everything else off) and a computer capable of running 64-bit VMs

* AT LEAST 20 gb of free hard drive space
* Strongly recommend a visualizer so you can monitor VM consumption of disk:
  * [WinDirStat](https://windirstat.info/) for Windows
  * [KDirStat](http://kdirstat.sourceforge.net/) for Unix & Linux
  * [DiskInventoryX](http://www.derlien.com/) for Mac

* You may need to enable [hardware acceleration](http://www.sysprobs.com/disable-enable-virtualization-technology-bios)

The virtual machines use a range of local IP addresses from 192.168.33.29 through 192.168.33.36. Make sure you are not using those for some other project.

You also may wish to review the [Vagrantfile](https://github.com/CharlesTBetz/Calavera/blob/master/Vagrantfile) for port redirect conflicts. A consistent numeric approach has been adopted for redirecting 22, 80 and 8080. If you don't know what this is about that's fine for now.

## Installation precursors and overview

First, you need to install:

* [VirtualBox](https://www.virtualbox.org/)
* [Chef Development Kit](https://downloads.chef.io/chef-dk/) version 0.4 or later
* [Vagrant](http://www.vagrantup.com/downloads.html)
  * [Vagrant Berkshelf plugin](https://github.com/berkshelf/vagrant-berkshelf)
  * [Vagrant VBoxGuest plugin](https://github.com/dotless-de/vagrant-vbguest)

And of course you will need [git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git), to download from Github.

**Critical pre-install configuration tweak**
At this writing you MUST do this AFTER you install the ChefDK:

In a text editor open /opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/berksfile.rb

Find the line starting with EXCLUDED_VCS_FILES_WHEN_VENDORING

change '.git' to '**/.git' in this line:

````
EXCLUDED_VCS_FILES_WHEN_VENDORING = ['.arch-ids', '{arch}', '.bzr', \
 '.bzrignore', '.bzrtags', 'CVS', '.cvsignore', '_darcs', '.git', '.hg', \
  '.hgignore', '.hgrags', 'RCS', 'SCCS', '.svn'].freeze

````

See https://github.com/berkshelf/vagrant-berkshelf/issues/237.

Calavera starts with a script, "startup.sh" or "startup.bat", which takes a standard Opscode image and adds:

* Chef
* Java
* Virtualbox addins
* curl & tree

It then repackages it and destroys the Vagrant machine. The remaining 6 VMs all then use this repackaged base image.

The VMs need to be instantiated in a particular order:

1. cerebro (Remote git repo)
1. brazos (Slave build environment)
1. espina (Artifactory)
1. hombros (Jenkins)
1. manos (Development environment)
1. cara (Production environment)

Any other order will likely result in errors and a "cluster" in another sense of that word.

## Issues

I  am actively monitoring [Github Issues for this project](https://github.com/CharlesTBetz/Calavera/issues). If you run into something, please post there.

## Installation step by step

Figure out a suitable location to download the repository from Github. It is not large, but I recommend that you not "nest" it too deeply (Windows is especially annoying this way) and that you avoid having spaces in the pathnames (e.g. "My Documents"). Creating a C:\home\myname directory would be a good location example. Open a command window there and type:

    git clone https://github.com/CharlesTBetz/Calavera.git

CD to the new Calavera directory, and run the following, one at a time. They will generate LOTS of console output, but hopefully no errors. This may take you around 20 minutes. It will appear to hang in places (Java related stuff in particular); give it at least 15 minutes before killing anything.

Disclaimner: this is still very early stage work. Many failure modes.

````
./startup.sh  (or startup.bat on windows)
vagrant up cerebro
vagrant up brazos
vagrant up espina
vagrant up hombros
````

All done with those first 5? Good.

### Bringing up manos

Now, the acid test: bringing up manos. The user guide (to be written) will go into details on this, but let's just say there are a lot of ways Manos can fail. The precursor machines must have all come up without error.

    vagrant up manos

If the console output seems to have gone without a hitch, go first to Jenkins. As part of its provisioning, manos does an initial ant build & test, local Tomcat deployment, and git commit and remote push which should result in a Jenkins build and an Artifactory check in.

To check all this out, first go to:

http://192.168.33.34:8080/MainServlet

This is the developer instance of Tomcat. You should see the Calavera message there.

![](img/ManosServletView.png)

Then, go to Jenkins. You should see a first successful build:
![](img/JenkinsSuccess.png)

(Feel free to click on the "#1" and poke around.)

Finally, if you go to:

http://192.168.33.32:8081/artifactory/webapp/home.html

you will see that Artifactory is now "happily serving 2 artifacts." Hooray! Click on the "Artifacts" tab:

![](img/ArtifactorySuccess2.png)

and if you expand the tree node that says "ext-release-local" (remember configuring that above?) you will see that the Calavera release artifacts are deployed and ready for production!

![](img/ArtifactorySuccess3.png)

[author's note: take a pre-manos shot of hombros espina for contrast next time it is built]

### Deploying to cara

Bringing up cara is a little anticlimactic.

    vagrant up cara

Assuming everything previously went well, chef will pull the .jar and .xml file from Artifactory on espina and deploy and restart Tomcat. You can go to:

http://192.168.33.35:8080/MainServlet

and should see:

![](img/CaraSuccess.png)

Hooray! What next?

A user guide is in process to describe the various aspects of Calavera and how to actually use and extend the pipeline. Stay tuned. Or better yet, help!


text:
<?php

namespace Gitblog;

class PostRenderer
{
    /**
     * @var PostRepository
     */
    private $repository;

    /**
     * @var RenderEngine
     */
    private $engine;

    /**
     * @param PostRepository $repository
     * @param RenderEngine   $engine
     */
    public function __construct(PostRepository $repository, RenderEngine $engine)
    {
        $this->repository = $repository;
        $this->engine = $engine;
    }

    /**
     * @param string $author
     * @param string $name
     *
     * @return string
     */
    public function render($author, $name)
    {
        $post = $this->repository->findByAuthorAndName($author, $name);

        return $this->engine->renderPost($post);
    }
}


text:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' ;

/*
 * Class to manage the metadata for a One-To-Many Relationship
 * The One-To-Many relationships created by this class are a combination of a subpanel and a custom relate field
 * The LHS (One) module will receive a new subpanel for the RHS module. The subpanel gets its data ('get_subpanel_data') from a link field that references a new Relationship
 * The RHS (Many) module will receive a new relate field to point back to the LHS
 *
 * OOB modules implement One-To-Many relationships as:
 *
 * On the LHS (One) side:
 * A Relationship of type one-to-many in the rhs modules vardefs.php
 * A link field in the same vardefs.php with 'relationship'= the relationship name and 'source'='non-db'
 * A subpanel which gets its data (get_subpanel_data) from the link field
 *
 * On the RHS (Many) side:
 * A Relate field in the vardefs, formatted as in this example, which references a link field:
 * 'name' => 'account_name',
 * 'rname' => 'name',
 * 'id_name' => 'account_id',
 * 'vname' => 'LBL_ACCOUNT_NAME',
 * 'join_name'=>'accounts',
 * 'type' => 'relate',
 * 'link' => 'accounts',
 * 'table' => 'accounts',
 * 'module' => 'Accounts',
 * 'source' => 'non-db'
 * A link field which references the shared Relationship
 */

class OneToManyRelationship extends AbstractRelationship
{

    /*
     * Constructor
     * @param array $definition Parameters passed in as array defined in parent::$definitionKeys
     * The lhs_module value is for the One side; the rhs_module value is for the Many
     */
    function __construct ($definition)
    {
        parent::__construct ( $definition ) ;
    }

    /*
     * BUILD methods called during the build
     */

    /*
     * Construct subpanel definitions
     * The format is that of TO_MODULE => relationship, FROM_MODULE, FROM_MODULES_SUBPANEL, mimicking the format in the layoutdefs.php
     * @return array    An array of subpanel definitions, keyed by the module
     */
    function buildSubpanelDefinitions ()
    {
        if ($this->relationship_only)
            return array () ;

        $source = "";
        if ($this->rhs_module == $this->lhs_module)
        {
        	$source = $this->getJoinKeyLHS();
        }

        return array(
        	$this->lhs_module => $this->getSubpanelDefinition (
        		$this->relationship_name, $this->rhs_module, $this->rhs_subpanel , $this->getRightModuleSystemLabel() , $source
        	)
        );
    }

    /*
     * @return array    An array of field definitions, ready for the vardefs, keyed by module
     */
	function buildVardefs ( )
    {
        $vardefs = array ( ) ;

        $vardefs [ $this->rhs_module ] [] = $this->getLinkFieldDefinition ( $this->lhs_module, $this->relationship_name, false,
            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getLeftModuleSystemLabel() ) . '_TITLE',
            $this->relationship_only ? false : $this->getIDName( $this->lhs_module )
        ) ;
        if ($this->rhs_module != $this->lhs_module )
        {
        	$vardefs [ $this->lhs_module ] [] = $this->getLinkFieldDefinition ( $this->rhs_module, $this->relationship_name, true,
                'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()  ) . '_TITLE');
        }
        if (! $this->relationship_only)
        {
            $vardefs [ $this->rhs_module ] [] = $this->getRelateFieldDefinition ( $this->lhs_module, $this->relationship_name, $this->getLeftModuleSystemLabel() ) ;
            $vardefs [ $this->rhs_module ] [] = $this->getLink2FieldDefinition ( $this->lhs_module, $this->relationship_name, true,
                'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()  ) . '_TITLE');
        }

        return $vardefs ;
    }

    /*
     * Define what fields to add to which modules layouts
     * @return array    An array of module => fieldname
     */
    function buildFieldsToLayouts ()
    {
        if ($this->relationship_only)
            return array () ;

        return array( $this->rhs_module =>$this->getValidDBName($this->relationship_name . "_name")); // this must match the name of the relate field from buildVardefs
    }

    /*
     * @return array    An array of relationship metadata definitions
     */
    function buildRelationshipMetaData ()
    {
        return array( $this->lhs_module => $this->getRelationshipMetaData ( MB_ONETOMANY ) ) ;
    }

}
?>


text:
package org.kitteh.irc.client.library;

import org.kitteh.irc.client.library.element.ChannelUserMode;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;

/**
 * Provides information about the server to which the client is connected.
 * This information is primarily acquired via ISUPPORT.
 */
public interface ServerInfo {
    /**
     * Gets the casemapping for the server. By default {@link
     * CaseMapping#RFC1459}
     *
     * @return the casemapping
     */
    @Nonnull
    CaseMapping getCaseMapping();

    /**
     * Gets the maximum length of channel names.
     *
     * @return channel length limit or -1 if unknown
     */
    int getChannelLengthLimit();

    /**
     * Gets the channel join limits.
     *
     * @return a map of channel prefixes to limits
     */
    @Nonnull
    Map<Character, Integer> getChannelLimits();

    /**
     * Gets the channel modes available. If the server has not provided
     * information on channel modes, the default specified by {@link
     * ChannelModeType#getDefaultModes()} is used and returned here.
     *
     * @return a mapping of mode characters to their type
     */
    @Nonnull
    Map<Character, ChannelModeType> getChannelModes();

    /**
     * Gets the list of accepted channel prefixes. If the server has not
     * provided this information all four listed in the IRC spec are
     * returned (#{@literal &}!+).
     *
     * @return available channel prefixes
     */
    @Nonnull
    List<Character> getChannelPrefixes();

    /**
     * Gets the list of accepted channel user modes, such as op. Modes are
     * listed from most powerful to least powerful. If the server has not
     * provided this information a default list of op (mode o for prefix @)
     * and voice (mode v for prefix +) are returned.
     *
     * @return channel modes defining user status
     */
    @Nonnull
    List<ChannelUserMode> getChannelUserModes();

    /**
     * Gets the name of this network.
     *
     * @return network name or null if unknown
     */
    @Nullable
    String getNetworkName();

    /**
     * Gets the maximum length of nicknames.
     *
     * @return nickname length limit or -1 if unknown
     */
    int getNickLengthLimit();

    /**
     * Gets the server-stated address of the server.
     *
     * @return the server's address or null if unknown
     */
    @Nullable
    String getServerAddress();

    /**
     * Gets the version of the IRCd.
     *
     * @return server version or null if unknown
     */
    @Nullable
    String getServerVersion();

    /**
     * Gets if a given string is a valid channel name according to the
     * available server information.
     *
     * @param name potentially valid name
     * @return true if valid according to the known info
     */
    boolean isValidChannel(@Nonnull String name);
}


text:
import { UrlString, StringUtils, CommonAuthorizationCodeRequest, AuthorizationCodeClient, Constants, Logger } from "@azure/msal-common";
import { InteractionHandler } from "./InteractionHandler";
import { BrowserAuthError } from "../error/BrowserAuthError";
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
import { BrowserSystemOptions, DEFAULT_IFRAME_TIMEOUT_MS } from "../config/Configuration";

export class SilentHandler extends InteractionHandler {

    private navigateFrameWait: number;
    private pollIntervalMilliseconds: number;

    constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, logger: Logger, systemOptions: Required<Pick<BrowserSystemOptions, "navigateFrameWait" | "pollIntervalMilliseconds">>) {
        super(authCodeModule, storageImpl, authCodeRequest, logger);
        this.navigateFrameWait = systemOptions.navigateFrameWait;
        this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;
    }

    /**
     * Creates a hidden iframe to given URL using user-requested scopes as an id.
     * @param urlNavigate
     * @param userRequestScopes
     */
    async initiateAuthRequest(requestUrl: string): Promise<HTMLIFrameElement> {
        if (StringUtils.isEmpty(requestUrl)) {
            // Throw error if request URL is empty.
            this.logger.info("Navigate url is empty");
            throw BrowserAuthError.createEmptyNavigationUriError();
        }

        return this.navigateFrameWait ? await this.loadFrame(requestUrl) : this.loadFrameSync(requestUrl);
    }

    /**
     * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.
     * @param iframe
     * @param timeout
     */
    monitorIframeForHash(iframe: HTMLIFrameElement, timeout: number): Promise<string> {
        return new Promise((resolve, reject) => {
            if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {
                this.logger.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${timeout}ms) than the default (${DEFAULT_IFRAME_TIMEOUT_MS}ms). This may result in timeouts.`);
            }

            /*
             * Polling for iframes can be purely timing based,
             * since we don't need to account for interaction.
             */
            const nowMark = window.performance.now();
            const timeoutMark = nowMark + timeout;

            const intervalId = setInterval(() => {
                if (window.performance.now() > timeoutMark) {
                    this.removeHiddenIframe(iframe);
                    clearInterval(intervalId);
                    reject(BrowserAuthError.createMonitorIframeTimeoutError());
                    return;
                }

                let href: string = Constants.EMPTY_STRING;
                const contentWindow = iframe.contentWindow;
                try {
                    /*
                     * Will throw if cross origin,
                     * which should be caught and ignored
                     * since we need the interval to keep running while on STS UI.
                     */
                    href = contentWindow ? contentWindow.location.href : Constants.EMPTY_STRING;
                } catch (e) {}

                if (StringUtils.isEmpty(href)) {
                    return;
                }

                const contentHash = contentWindow ? contentWindow.location.hash: Constants.EMPTY_STRING;
                if (UrlString.hashContainsKnownProperties(contentHash)) {
                    // Success case
                    this.removeHiddenIframe(iframe);
                    clearInterval(intervalId);
                    resolve(contentHash);
                    return;
                }
            }, this.pollIntervalMilliseconds);
        });
    }

    /**
     * @hidden
     * Loads iframe with authorization endpoint URL
     * @ignore
     */
    private loadFrame(urlNavigate: string): Promise<HTMLIFrameElement> {
        /*
         * This trick overcomes iframe navigation in IE
         * IE does not load the page consistently in iframe
         */

        return new Promise((resolve, reject) => {
            const frameHandle = this.createHiddenIframe();

            setTimeout(() => {
                if (!frameHandle) {
                    reject("Unable to load iframe");
                    return;
                }

                frameHandle.src = urlNavigate;

                resolve(frameHandle);
            }, this.navigateFrameWait);
        });
    }

    /**
     * @hidden
     * Loads the iframe synchronously when the navigateTimeFrame is set to `0`
     * @param urlNavigate
     * @param frameName
     * @param logger
     */
    private loadFrameSync(urlNavigate: string): HTMLIFrameElement{
        const frameHandle = this.createHiddenIframe();

        frameHandle.src = urlNavigate;

        return frameHandle;
    }

    /**
     * @hidden
     * Creates a new hidden iframe or gets an existing one for silent token renewal.
     * @ignore
     */
    private createHiddenIframe(): HTMLIFrameElement {
        const authFrame = document.createElement("iframe");

        authFrame.style.visibility = "hidden";
        authFrame.style.position = "absolute";
        authFrame.style.width = authFrame.style.height = "0";
        authFrame.style.border = "0";
        authFrame.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms");
        document.getElementsByTagName("body")[0].appendChild(authFrame);

        return authFrame;
    }

    /**
     * @hidden
     * Removes a hidden iframe from the page.
     * @ignore
     */
    private removeHiddenIframe(iframe: HTMLIFrameElement): void {
        if (document.body === iframe.parentNode) {
            document.body.removeChild(iframe);
        }
    }
}


text:
Set-StrictMode -Version Latest

InModuleScope Pester {
    Describe "New-PesterState" {
        Context "TestNameFilter parameter is set" {
            $p = new-pesterstate -TestNameFilter "filter"

            it "sets the TestNameFilter property" {
                $p.TestNameFilter | should be "filter"
            }

        }
        Context "TagFilter parameter is set" {
            $p = new-pesterstate -TagFilter "tag","tag2"

            it "sets the TestNameFilter property" {
                $p.TagFilter | should be ("tag","tag2")
            }
        }

        Context "ExcludeTagFilter parameter is set" {
            $p = new-pesterstate -ExcludeTagFilter "tag3", "tag"

            it "sets the ExcludeTagFilter property" {
                $p.ExcludeTagFilter | should be ("tag3", "tag")
            }
        }

        Context "TagFilter and ExcludeTagFilter parameter are set" {
            $p = new-pesterstate -TagFilter "tag","tag2" -ExcludeTagFilter "tag3"

            it "sets the TestNameFilter property" {
                $p.TagFilter | should be ("tag","tag2")
            }

            it "sets the ExcludeTagFilter property" {
                $p.ExcludeTagFilter | should be ("tag3")
            }
        }
        Context "TestNameFilter and TagFilter parameter is set" {
            $p = new-pesterstate -TagFilter "tag","tag2" -testnamefilter "filter"

            it "sets the TestNameFilter property" {
                $p.TagFilter | should be ("tag","tag2")
            }

            it "sets the TestNameFilter property" {
                $p.TagFilter | should be ("tag","tag2")
            }

        }
    }

    Describe "Pester state object" {
        $p = New-PesterState

        Context "entering describe" {
            It "enters describe" {
                $p.EnterDescribe("describe")
                $p.CurrentDescribe | should be "Describe"
            }
            It "can enter describe only once" {
                { $p.EnterDescribe("describe") } | Should Throw
            }

            It "Reports scope correctly" {
                $p.Scope | should be "describe"
            }
        }
        Context "leaving describe" {
            It "leaves describe" {
                $p.LeaveDescribe()
                $p.CurrentDescribe | should benullOrEmpty
            }
            It "Reports scope correctly" {
                $p.Scope | should benullOrEmpty
            }
        }

        context "Entering It from Describe" {
            $p.EnterDescribe('Describe')

            It "Enters It successfully" {
                { $p.EnterTest("It") } | Should Not Throw
            }

            It "Reports scope correctly" {
                $p.Scope | Should Be 'It'
            }

            It "Cannot enter It after already entered" {
                { $p.EnterTest("It") } | Should Throw
            }

            It "Cannot enter Context from inside It" {
                { $p.EnterContext("Context") } | Should Throw
            }
        }

        context "Leaving It from Describe" {
            It "Leaves It to Describe" {
                { $p.LeaveTest() } | Should Not Throw
            }

            It "Reports scope correctly" {
                $p.Scope | Should Be 'Describe'
            }

            $p.LeaveDescribe()
        }

        Context "entering Context" {
            it "Cannot enter Context before Describe" {
                { $p.EnterContext("context") } | should throw
            }

            it "enters context from describe" {
                $p.EnterDescribe("Describe")
                $p.EnterContext("Context")
                $p.CurrentContext | should be "Context"
            }
            It "can enter context only once" {
                { $p.EnterContext("Context") } | Should Throw
            }

            It "Reports scope correctly" {
                $p.Scope | should be "Context"
            }
        }

        Context "leaving context" {
            it "cannot leave describe before leaving context" {
                { $p.LeaveDescribe() } | should throw
            }
            it "leaves context" {
                $p.LeaveContext()
                $p.CurrentContext | should BeNullOrEmpty
            }
            It "Returns from context to describe" {
                $p.Scope | should be "Describe"
            }

            $p.LeaveDescribe()
        }

        context "Entering It from Context" {
            $p.EnterDescribe('Describe')
            $p.EnterContext('Context')

            It "Enters It successfully" {
                { $p.EnterTest("It") } | Should Not Throw
            }

            It "Reports scope correctly" {
                $p.Scope | Should Be 'It'
            }

            It "Cannot enter It after already entered" {
                { $p.EnterTest("It") } | Should Throw
            }
        }

        context "Leaving It from Context" {
            It "Leaves It to Context" {
                { $p.LeaveTest() } | Should Not Throw
            }

            It "Reports scope correctly" {
                $p.Scope | Should Be 'Context'
            }

            $p.LeaveContext()
            $p.LeaveDescribe()
        }

        context "adding test result" {
            $p.EnterDescribe('Describe')

            it "adds passed test" {
                $p.AddTestResult("result","Passed", 100)
                $result = $p.TestResult[-1]
                $result.Name | should be "result"
                $result.passed | should be $true
                $result.Result | Should be "Passed"
                $result.time.ticks | should be 100
            }
            it "adds failed test" {
                try { throw 'message' } catch { $e = $_ }
                $p.AddTestResult("result","Failed", 100, "fail", "stack","suite name",@{param='eters'},$e)
                $result = $p.TestResult[-1]
                $result.Name | should be "result"
                $result.passed | should be $false
                $result.Result | Should be "Failed"
                $result.time.ticks | should be 100
                $result.FailureMessage | should be "fail"
                $result.StackTrace | should be "stack"
                $result.ParameterizedSuiteName | should be "suite name"
                $result.Parameters['param'] | should be 'eters'
                $result.ErrorRecord.Exception.Message | should be 'message'
            }

            it "adds skipped test" {
                $p.AddTestResult("result","Skipped", 100)
                $result = $p.TestResult[-1]
                $result.Name | should be "result"
                $result.passed | should be $true
                $result.Result | Should be "Skipped"
                $result.time.ticks | should be 100
            }

            it "adds Pending test" {
                $p.AddTestResult("result","Pending", 100)
                $result = $p.TestResult[-1]
                $result.Name | should be "result"
                $result.passed | should be $true
                $result.Result | Should be "Pending"
                $result.time.ticks | should be 100
            }

            it "can add test result before entering describe" {
                if ($p.CurrentContext) { $p.LeaveContext()}
                if ($p.CurrentDescribe) { $p.LeaveDescribe() }
                { $p.addTestResult(1,"Passed",1) } | should not throw
            }

            $p.LeaveContext()
            $p.LeaveDescribe()

        }

        Context "Path and TestNameFilter parameter is set" {
            $strict = New-PesterState -Strict

            It "Keeps Passed state" {
                $strict.AddTestResult("test","Passed")
                $result = $strict.TestResult[-1]

                $result.passed | should be $true
                $result.Result | Should be "Passed"
            }

            It "Keeps Failed state" {
                $strict.AddTestResult("test","Failed")
                $result = $strict.TestResult[-1]

                $result.passed | should be $false
                $result.Result | Should be "Failed"
            }

            It "Changes Pending state to Failed" {
                $strict.AddTestResult("test","Pending")
                $result = $strict.TestResult[-1]

                $result.passed | should be $false
                $result.Result | Should be "Failed"
            }

            It "Changes Skipped state to Failed" {
                $strict.AddTestResult("test","Skipped")
                $result = $strict.TestResult[-1]

                $result.passed | should be $false
                $result.Result | Should be "Failed"
            }
        }
    }
    Describe ConvertTo-FailureLines {
        $testPath = Join-Path $TestDrive test.ps1
        $escapedTestPath = [regex]::Escape($testPath)
        It 'produces correct message lines.' {
            try { throw 'message' } catch { $e = $_ }

            $r = $e | ConvertTo-FailureLines

            $r.Message[0] | Should be 'RuntimeException: message'
            $r.Message.Count | Should be 1
        }
        It 'failed should produces correct message lines.' {
            try { 'One' | Should be 'Two' } catch { $e = $_ }
            $r = $e | ConvertTo-FailureLines

            $r.Message[0] | Should be 'String lengths are both 3. Strings differ at index 0.'
            $r.Message[1] | Should be 'Expected: {Two}'
            $r.Message[2] | Should be 'But was:  {One}'
            $r.Message[3] | Should be '-----------^'
            $r.Message[4] | Should match "'One' | Should be 'Two'"
            $r.Message.Count | Should be 5
        }
        Context 'should fails in file' {
            Set-Content -Path $testPath -Value @'
                $script:IgnoreErrorPreference = 'SilentlyContinue'
                'One' | Should be 'Two'
'@

            try { & $testPath } catch { $e = $_ }
            $r = $e | ConvertTo-FailureLines

            It 'produces correct message lines.' {

                $r.Message[0] | Should be 'String lengths are both 3. Strings differ at index 0.'
                $r.Message[1] | Should be 'Expected: {Two}'
                $r.Message[2] | Should be 'But was:  {One}'
                $r.Message[3] | Should be '-----------^'
                $r.Message[4] | Should be "2:                 'One' | Should be 'Two'"
                $r.Message.Count | Should be 5
            }
            if ( $e | Get-Member -Name ScriptStackTrace )
            {
                It 'produces correct trace lines.' {
                    $r.Trace[0] | Should be "at <ScriptBlock>, $testPath`: line 2"
                    $r.Trace[1] -match 'at <ScriptBlock>, .*\\Functions\\PesterState.Tests.ps1: line [0-9]*$' |
                        Should be $true
                    $r.Trace.Count | Should be 2
                }
            }
            else
            {
                It 'produces correct trace lines.' {
                    $r.Trace[0] | Should be "at line: 2 in $testPath"
                    $r.Trace.Count | Should be 1
                }
            }
        }
        Context 'exception thrown in nested functions in file' {
            Set-Content -Path $testPath -Value @'
                function f1 {
                    throw 'f1 message'
                }
                function f2 {
                    f1
                }
                f2
'@

            try { & $testPath } catch { $e = $_ }

            $r = $e | ConvertTo-FailureLines

            It 'produces correct message lines.' {
                $r.Message[0] | Should be 'RuntimeException: f1 message'
            }
            if ( $e | Get-Member -Name ScriptStackTrace )
            {
                It 'produces correct trace lines.' {
                    $r.Trace[0] | Should be "at f1, $testPath`: line 2"
                    $r.Trace[1] | Should be "at f2, $testPath`: line 5"
                    $r.Trace[2] | Should be "at <ScriptBlock>, $testPath`: line 7"
                    $r.Trace[3] -match 'at <ScriptBlock>, .*\\Functions\\PesterState.Tests.ps1: line [0-9]*$' |
                        Should be $true
                    $r.Trace.Count | Should be 4
                }
            }
            else
            {
                It 'produces correct trace lines.' {
                    $r.Trace[0] | Should be "at line: 2 in $testPath"
                    $r.Trace.Count | Should be 1
                }
            }
        }
        Context 'nested exceptions thrown in file' {
            Set-Content -Path $testPath -Value @'
                try
                {
                    throw New-Object System.ArgumentException(
                        'inner message',
                        'param_name'
                    )
                }
                catch
                {
                    throw New-Object System.FormatException(
                        'outer message',
                        $_.Exception
                    )
                }
'@

            try { & $testPath } catch { $e = $_ }

            $r = $e | ConvertTo-FailureLines

            It 'produces correct message lines.' {
                $r.Message[0] | Should be 'ArgumentException: inner message'
                $r.Message[1] | Should be 'Parameter name: param_name'
                $r.Message[2] | Should be 'FormatException: outer message'
            }
            if ( $e | Get-Member -Name ScriptStackTrace )
            {
                It 'produces correct trace line.' {
                    $r.Trace[0] | Should be "at <ScriptBlock>, $testPath`: line 10"
                    $r.Trace[1] -match 'at <ScriptBlock>, .*\\Functions\\PesterState.Tests.ps1: line [0-9]*$'
                    $r.Trace.Count | Should be 2
                }
            }
            else
            {
                It 'produces correct trace line.' {
                    $r.Trace[0] | Should be "at line: 10 in $testPath"
                    $r.Trace.Count | Should be 1
                }
            }
        }
    }
}


text:
<?php
/**
 * Create by PhpStorm
 * Author: Liu  <470401911@qq.com>
 * Date: 2016/5/8
 * Time: 17:40
 * Version: weekly
 */
class Login_Model extends CI_Model{
    function __construct(){
        parent::__construct();
        $this->load->model('Base_Model','base');
    }

    public function check_login($name,$password){
        $admin = $this->base->select('*','admin','admin',$name);

        if($admin['password'] == sha1(sha1(md5($password)))){
            return $admin;
        }else{
            return 0;
        }
    }
}


text:
namespace TrainMe.Web.ViewModels.Account
{
    public class ExternalLoginListViewModel
    {
        public string ReturnUrl { get; set; }
    }
}


text:
package flatbuf

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

/// Compressed Sparse Row format, that is matrix-specific.
type SparseMatrixIndexCSR struct {
	_tab flatbuffers.Table
}

func GetRootAsSparseMatrixIndexCSR(buf []byte, offset flatbuffers.UOffsetT) *SparseMatrixIndexCSR {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &SparseMatrixIndexCSR{}
	x.Init(buf, n+offset)
	return x
}

func (rcv *SparseMatrixIndexCSR) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *SparseMatrixIndexCSR) Table() flatbuffers.Table {
	return rcv._tab
}

/// The type of values in indptrBuffer
func (rcv *SparseMatrixIndexCSR) IndptrType(obj *Int) *Int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(Int)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

/// The type of values in indptrBuffer
/// indptrBuffer stores the location and size of indptr array that
/// represents the range of the rows.
/// The i-th row spans from indptr[i] to indptr[i+1] in the data.
/// The length of this array is 1 + (the number of rows), and the type
/// of index value is long.
///
/// For example, let X be the following 6x4 matrix:
///
///   X := [[0, 1, 2, 0],
///         [0, 0, 3, 0],
///         [0, 4, 0, 5],
///         [0, 0, 0, 0],
///         [6, 0, 7, 8],
///         [0, 9, 0, 0]].
///
/// The array of non-zero values in X is:
///
///   values(X) = [1, 2, 3, 4, 5, 6, 7, 8, 9].
///
/// And the indptr of X is:
///
///   indptr(X) = [0, 2, 3, 5, 5, 8, 10].
func (rcv *SparseMatrixIndexCSR) IndptrBuffer(obj *Buffer) *Buffer {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		x := o + rcv._tab.Pos
		if obj == nil {
			obj = new(Buffer)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

/// indptrBuffer stores the location and size of indptr array that
/// represents the range of the rows.
/// The i-th row spans from indptr[i] to indptr[i+1] in the data.
/// The length of this array is 1 + (the number of rows), and the type
/// of index value is long.
///
/// For example, let X be the following 6x4 matrix:
///
///   X := [[0, 1, 2, 0],
///         [0, 0, 3, 0],
///         [0, 4, 0, 5],
///         [0, 0, 0, 0],
///         [6, 0, 7, 8],
///         [0, 9, 0, 0]].
///
/// The array of non-zero values in X is:
///
///   values(X) = [1, 2, 3, 4, 5, 6, 7, 8, 9].
///
/// And the indptr of X is:
///
///   indptr(X) = [0, 2, 3, 5, 5, 8, 10].
/// The type of values in indicesBuffer
func (rcv *SparseMatrixIndexCSR) IndicesType(obj *Int) *Int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(Int)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

/// The type of values in indicesBuffer
/// indicesBuffer stores the location and size of the array that
/// contains the column indices of the corresponding non-zero values.
/// The type of index value is long.
///
/// For example, the indices of the above X is:
///
///   indices(X) = [1, 2, 2, 1, 3, 0, 2, 3, 1].
///
/// Note that the indices are sorted in lexicographical order for each row.
func (rcv *SparseMatrixIndexCSR) IndicesBuffer(obj *Buffer) *Buffer {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		x := o + rcv._tab.Pos
		if obj == nil {
			obj = new(Buffer)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

/// indicesBuffer stores the location and size of the array that
/// contains the column indices of the corresponding non-zero values.
/// The type of index value is long.
///
/// For example, the indices of the above X is:
///
///   indices(X) = [1, 2, 2, 1, 3, 0, 2, 3, 1].
///
/// Note that the indices are sorted in lexicographical order for each row.
func SparseMatrixIndexCSRStart(builder *flatbuffers.Builder) {
	builder.StartObject(4)
}
func SparseMatrixIndexCSRAddIndptrType(builder *flatbuffers.Builder, indptrType flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(indptrType), 0)
}
func SparseMatrixIndexCSRAddIndptrBuffer(builder *flatbuffers.Builder, indptrBuffer flatbuffers.UOffsetT) {
	builder.PrependStructSlot(1, flatbuffers.UOffsetT(indptrBuffer), 0)
}
func SparseMatrixIndexCSRAddIndicesType(builder *flatbuffers.Builder, indicesType flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(indicesType), 0)
}
func SparseMatrixIndexCSRAddIndicesBuffer(builder *flatbuffers.Builder, indicesBuffer flatbuffers.UOffsetT) {
	builder.PrependStructSlot(3, flatbuffers.UOffsetT(indicesBuffer), 0)
}
func SparseMatrixIndexCSREnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}


text:
const Event = require('./event.js');

class GroupedCardEvent extends Event {
    allowAutomaticSave() {
        return false;
    }

    saveCard(card) {
        this.removeCard(card);
        card.markAsSaved();
        card.game.raiseEvent('onCardSaved', { card: card });
    }

    removeCard(card) {
        this.cards = this.cards.filter(c => c !== card);

        let primaryEvents = this.childEvents.map(event => event.getPrimaryEvent());
        for(let event of primaryEvents) {
            if(event.card === card) {
                event.cancel();
            }
        }

        if(this.cards.length === 0) {
            this.cancel();
        }
    }

    replaceCards(newCards) {
        if(newCards.length !== this.childEvents.length) {
            return;
        }

        let index = 0;

        for(let card of newCards) {
            this.childEvents[index].card = card;
            ++index;
        }

        this.cards = newCards;
    }

    onChildCancelled(event) {
        super.onChildCancelled(event);
        this.removeCard(event.card);
    }
}

module.exports = GroupedCardEvent;


text:
package com.opensoc.tagging.adapters;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

public interface TaggerAdapter {

	JSONArray tag(JSONObject raw_message);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<es:job-bag xmlns:es="http://www.marklogic.com/enhanced-search#">

         <meta property="rnews:description"
               content="The BBC's Sanjoy Majumder travels to the flood-hit Himalayan mountains in India's Uttarakhand state where bad weather and damaged roads are hampering rescue operations"/>
         <meta property="rnews:datePublished" content="2013-06-28T11:30:13"/>
         <meta property="rnews:thumbnailUrl"
               content="http://news.bbcimg.co.uk/media/images/68436000/jpg/_68436292_68433264.jpg"/>
         <meta property="rnews:headline"
               content="A journey through Uttarakhand's flooded landscape"/>
         <meta name="CPS_SECTION_PATH" content="World/Asia/India"/>
         <meta property="rnews:creator" content="http://www.bbc.co.uk#org"/>
         <link rel="copyright"
               href="http://www.bbc.co.uk/terms/"
               title="Terms of Use"/>
         <link rel="http://purl.org/dc/terms/source"
               href="http://www.bbc.co.uk/news/world-asia-india-23095184"/>
         <title>BBC News - India floods: A journey through Uttarakhand's
flooded landscape</title>

               28 June 2013
               Last updated
at
               12:30

India floods: A journey through
Uttarakhand's flooded landscape

The BBC's Sanjoy Majumder visits a town left
encased in mud by the floods

Devastating floods
in India's mountainous state of Uttarakhand damaged roads and
destroyed buildings frustrating the efforts of relief workers. The
BBC's Sanjoy Majumder took a journey into the mountains and found
ghost towns and abandoned homes.

As we drive into the mountains it begins to rain, hard, just as
it has for much of the past week.

We are on the main highway leading from Rishikesh, in the
foothills of the Himalayas, to Rudraprayag town and beyond to the
Hindu temple towns of Kedarnath and Badrinath.

The Ganges river snakes alongside - its normally crystal blue
waters are completely muddy because of sediments from the floods
and landslides further up.

Usually this highway is a busy one, filled with buses carrying
pilgrims either on their way to the Hindu shrines or back from
their spiritual journey.

But for the most part now, there is hardly any traffic. It is
easy to see why.

The road has been damaged in places and is so narrow in parts
that only one vehicle can pass at a time.

At Devprayag, where the Alakananda and Bhagirathi rivers meet to
form the Ganges, part of the highway has been washed away. Workers
are busy trying to rebuild it.

A few hours into our drive and the first real impact of the
floods becomes apparent.

Just outside the town of Srinagar, we drive into a settlement
that is completely buried in the mud.

The tops of a few houses are visible and a few cars stick out
from the sand that has been left behind after the flood waters
retreated.

               Many homes have been damaged by the
flood waters and landslides

It is eerily silent, like a ghost town.

I finally meet a young man who is from a neighbouring
village.

"There used to be 70 houses here," he tells me. "Most of them
were washed away."

I walk into what used to be the local polytechnic. Its various
buildings - the library, the science block, the hostel - are all
covered with mud almost up to the roof.

I peer into the window of what was clearly a classroom on the
second floor - it is now at the level of my knees and I can see the
ceiling fans inside. The rest of it is completely covered with
earth and muck.

I find the college principal, Sanjeev Kumar, deep in
conversation with a few officials as they survey the damage.

"It rained for 60 straight hours because of which the
Alakananda, which flows alongside, broke its banks and we were
flooded," he says.

"Everything here was under 30 feet of water. The students rushed
out of their hostel, leaving everything behind. Now there's nothing
left. Their clothes, books, our equipment - all gone."

We press on and join a convoy of trucks carrying relief material
heading up.

Just outside Rudraprayag we come to a grinding halt. It is soon
obvious why.

Ahead of us, a 50-metre section of the road is missing. It has
caved in because of a landslide. Some 200 vehicles are stranded at
both ends as bulldozers try and clear an alternate path.

It is a frustrating wait especially for a group of volunteers
who have come from Delhi with several truckloads of critical
supplies.

"We are carrying biscuits, water and medicines," one of the
volunteers - all dressed in bright red t-shirts - tells me.

               Indian armed forces have carried out the
country's largest ever rescue operations

"We're headed for Badrinath, we've heard there are many people
there who need our help."

They have already spent three hours waiting and it is not clear
how much longer it will take.

Up ahead, the road to Badrinath is clear.

But the highway to Kedarnath, the worst affected area, is
completely blocked. The only way to get there is to trek through
the thickly wooded mountains. Or from the air.

Up above us, an Indian air force helicopter flies past in one of
several hundred missions in what has been the country's largest
ever rescue operation.

Among those brought down is a group of Westerners who had come
here for a spiritual retreat on the banks of the Ganges.

"We woke up to the news that the bridge leading to our ashram
over the river had been swept away," says Vishaal Kishore, who was
born in Essex, in the UK.

"We realise now how incredibly lucky we are to have got
out."

The local villagers were the first to come to their aid.

"These people had lost everything, their homes, their
belongings," Mr Kishore says.

"Yet they found time to cook food for us and cut a path through
the mountain to help us out."

Most of those stranded in the mountains, mostly Hindu pilgrims
and tourists, have now been evacuated.

But the focus is now shifting, as it must, to those left behind
- villages and local communities which have been completely
destroyed.

It could take months before their homes and their lives are
rebuilt.

Related Stories

                  In pictures: Uttarakhand after
floods

                  Frustrated efforts to rescue
flood victims

                  Survivors' stories

   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:og="http://opengraphprotocol.org/schema/"
            xmlns:rnews="http://iptc.org/std/rNews/2011-10-07#">
      <rdf:Description rdf:about="http://www.bbc.co.uk/news/world-asia-india-23095184">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#NewsItem"/>
         <rnews:identifier rdf:resource="http://www.bbc.co.uk/news/world-asia-india-23095184"/>
         <rnews:usageTerms rdf:resource="http://www.bbc.co.uk/terms/"/>
         <rnews:description xml:lang="en-GB">The BBC's Sanjoy Majumder travels to the flood-hit Himalayan mountains in India's Uttarakhand state where bad weather and damaged roads are hampering rescue operations</rnews:description>
         <rnews:datePublished rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-06-28T11:30:13</rnews:datePublished>
         <rnews:thumbnailUrl rdf:resource="http://news.bbcimg.co.uk/media/images/68436000/jpg/_68436292_68433264.jpg"/>
         <rnews:headline xml:lang="en-GB">A journey through Uttarakhand's flooded landscape</rnews:headline>
         <rnews:articleSection rdf:datatype="http://www.w3.org/2001/XMLSchema#string">World</rnews:articleSection>
         <rnews:creator rdf:resource="http://www.bbc.co.uk#org"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68437000/jpg/_68437412_68437411.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/world-asia-india-23095184"/>
         <rnews:description xml:lang="en-GB">Empty town covered in mud following India's floods</rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68433000/jpg/_68433265_68433264.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/world-asia-india-23095184"/>
         <rnews:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">304</rnews:width>
         <rnews:height rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">171</rnews:height>
         <rnews:description xml:lang="en-GB">Damaged houses above the flash flood-eroded Mandakini river in the town of Tilwara, around 30kms from Rudraprayag</rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68433000/jpg/_68433269_68433268.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/world-asia-india-23095184"/>
         <rnews:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">464</rnews:width>
         <rnews:height rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">261</rnews:height>
         <rnews:description xml:lang="en-GB">Personnel from the Indian armed forces carry relief supplies from a helicopter for the stranded people at Guptkashi </rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
   </rdf:RDF>
</es:job-bag>


text:
Do you have any ideas for this project? Want to tackle any of the
[open issues](https://github.com/smartystreets/goconvey/issues?direction=desc&sort=created&state=open)?
Great! As a starting point please take the time to peruse the tests in the part of the project you want
to work on. That will help you get to know the existing code and will give you an idea of the kinds of
test cases you should include with your pull request. We expect to maintain a high level of confidence
in the code for GoConvey. Your [disciplined efforts](http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd)
will make the project much more maintainable in the long-term.

Or, if you're feeling brave, how about tackling one of our [deferred/known issues](Known Issues)? Not for the faint of heart. You have been warned...

Want to contribute but not sure how? There are a few modules that still aren't up to snuff as far as test coverage is concerned (yes, I know test coverage isn't a silver bullet, but where it can be improved why not do so?). Maybe a good way to get your feet wet would be to implement tests that prove the functionality of the packages in question. Here's a current breakdown of test coverage (2013-11-16):

```
PASS
coverage: 33.8% of statements
ok    github.com/smartystreets/goconvey/reporting 0.016s

PASS
coverage: 50.0% of statements
ok    github.com/smartystreets/goconvey/web/server/contract 0.025s

PASS
coverage: 71.6% of statements
ok    github.com/smartystreets/goconvey/web/server/system 0.049s

PASS
coverage: 87.5% of statements
ok    github.com/smartystreets/goconvey/printing  0.011s

PASS
coverage: 92.3% of statements
ok    github.com/smartystreets/goconvey/convey  0.044s

PASS
coverage: 97.4% of statements
ok    github.com/smartystreets/goconvey/web/server/parser 0.025s

PASS
coverage: 98.6% of statements
ok    github.com/smartystreets/goconvey/web/server/executor 1.075s

PASS
coverage: 99.8% of statements
ok    github.com/smartystreets/goconvey/assertions  0.019s

PASS
coverage: 100.0% of statements
ok    github.com/smartystreets/goconvey/examples  0.063s

PASS
coverage: 100.0% of statements
ok    github.com/smartystreets/goconvey/web/server/api  0.266s

PASS
coverage: 100.0% of statements
ok    github.com/smartystreets/goconvey/web/server/watcher  0.083s

```

Of course, you'll want to get more details from the the built-in (as of Go 1.2) cover tool so you know where to start within each module. I'll leave that as your first exercise...


text:
#!/usr/bin/env node

'use strict';

var spawn = require('child_process').spawn;

var input = process.argv.slice(2);
var bin = require('./');

if (bin !== null) {
  spawn(bin, input, {stdio: 'inherit'}).on('exit', process.exit);
} else {
  throw new Error('Platform not supported.');
}


text:
---
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

title: iOS WebViews
---

# iOS WebViews

Esta guía le muestra cómo incrustar un componente WebView Cordova habilitado dentro de una aplicación iOS más grande. Para más detalles sobre cómo estos componentes pueden comunicarse entre sí, vea aplicación Plugins.

Apoyo WebViews iOS comenzó con Córdoba versión 1.4, usando un `Cleaver` para que sirve la plantilla de Xcode como una implementación de referencia del componente. Cordova 2.0 y versiones posteriores sólo admiten la implementación basada en el subproyecto Cleaver.

Estas instrucciones requieren menos Cordova 3.x y Xcode 6.0, junto con un `config.xml` el archivo de un proyecto de iOS recién creado. Puede utilizar el procedimiento en la interfaz de línea de comandos para crear un nuevo proyecto, y luego obtener el `config.xml` archivo de dentro del subdirectorio dentro de la aplicación llamado`platforms/ios`.

Para seguir estas instrucciones, asegúrate de que tienes la última distribución de Córdoba. Descargar desde [cordova.apache.org][1] y descomprimir el paquete de iOS.

 [1]: http://cordova.apache.org

## Cleaver agregando al proyecto Xcode (subproyecto CordovaLib)

1.  Deja de Xcode si se está ejecutando.

2.  Abra una terminal y desplácese hasta el directorio fuente para iOS Cordova.

3.  Copia el `config.xml` archivo descrito anteriormente en el directorio del proyecto.

4.  Abra Xcode y utilizar el buscador para copiar el `config.xml` archivo en la ventana de su **Navegador de proyectos** .

5.  Elija **crear grupos para cualquier añadidos carpetas** y pulse **Finalizar**.

6.  Utilice el buscador para copiar el `CordovaLib/CordovaLib.xcodeproj` archivo de Xcode **Navegador de proyectos**

7.  Seleccione `CordovaLib.xcodeproj` en el **navegador de proyectos**.

8.  Tipo de la combinación de teclas **Command-Option-1** para mostrar el **Inspector File**.

9.  Elegir **relativo al grupo** en el **Inspector de archivo** del menú desplegable para **Ubicación**.

10. Seleccione el **icono de proyecto** en el **Navegador de proyectos**, seleccione el **destino**y seleccione la ficha **Configuración de construir** .

11. Agregar `-force_load` y `-Obj-C` para el valor de **Otras banderas del vinculador** .

12. Haga clic en el **icono de proyecto** en el navegador de proyectos, seleccione el **destino**y seleccione la ficha **Fases construir** .

13. Ampliar **los binarios de enlace con las bibliotecas**.

14. Seleccione el **+** botón y agregue los siguientes **Marcos**. Opcionalmente en el **Navegador de proyectos**, moverlos en el grupo de **Marcos** :

        AssetsLibrary.framework
        CoreLocation.framework
        CoreGraphics.framework
        MobileCoreServices.framework

15. Ampliar **Las dependencias de destino**, el cuadro superior con esa etiqueta si hay más de una caja.

16. Seleccione el **+** botón y agregar el `CordovaLib` construir el producto.

17. Ampliar **Los binarios de enlace con las bibliotecas**, el cuadro superior con esa etiqueta si hay más de una caja.

18. Seleccione el **+** botón y añadir `libCordova.a`.

19. Fijar la **Xcode preferencias → ubicaciones → derivada datos → avanzado...** a **único**.

20. Seleccione el **icono de proyecto** en el navegador de proyectos, selecciona tu **destino**y seleccione la ficha **Configuración de construir** .

21. Búsqueda de **rutas de búsqueda encabezado**. Para esa configuración, agregar estos tres valores abajo, incluyendo las comillas:

        "$(TARGET_BUILD_DIR)/usr/local/lib/include"
        "$(OBJROOT)/UninstalledProducts/include"
        "$(BUILT_PRODUCTS_DIR)"

    A partir de Cordova 2.1.0, `CordovaLib` ha sido actualizado para utilizar el **Conteo automático de referencia (ARC)**. No necesitas actualizar a **ARC** para utilizar `CordovaLib` , pero si desea actualizar su proyecto para utilizar **ARC**, debe usar el Asistente para migración de Xcode de la **Editar → Refactor → convertir en Objective-C arco...** menú, **anular la selección de libCordova.a**, luego ejecute el Asistente para completar.

## Usando CDVViewController

1.  Agregue el siguiente encabezado:

        #import <Cordova/CDVViewController.h>

2.  Instanciar un nuevo `CDVViewController` y consérvelo en algún sitio, por ejemplo, a una propiedad de clase:

        CDVViewController* viewController = [CDVViewController new];

3.  Opcionalmente, establezca el `wwwFolderName` propiedad, cuyo valor predeterminado es `www` :

        viewController.wwwFolderName = @"myfolder";

4.  Opcionalmente, configurar la página de inicio el `config.xml` del archivo `<content>` de la etiqueta, ya sea un archivo local:

        <content src="index.html" />

    .. .o un sitio remoto:

        <content src="http://apache.org" />

5.  Opcionalmente, establezca el `useSplashScreen` propiedad, cuyo valor predeterminado es `NO` :

        viewController.useSplashScreen = YES;

6.  Establecer el **marco de la vista**. Siempre definir esto como la última propiedad:

        viewController.view.frame = CGRectMake(0, 0, 320, 480);

7.  Agregar la cuchilla a la vista:

        [myView addSubview:viewController.view];

## Adición de HTML, CSS y JavaScript activos

1.  Crear un nuevo directorio dentro del proyecto, `www` por ejemplo.

2.  Coloque el HTML, CSS y JavaScript activos en este directorio.

3.  Utilice el buscador para copiar el directorio en la ventana del **Navegador de proyecto** de Xcode.

4.  Seleccione **crear carpeta referencias para cualquier añadidas carpetas**.

5.  Establecer la adecuada `wwwFolderName` y `startPage` las propiedades para el directorio creado inicialmente, o utilizar los valores predeterminados (especificados en la sección anterior) al crear instancias de la`CDVViewController`.

        /*
         if you created a folder called 'myfolder' and
         you want the file 'mypage.html' in it to be
         the startPage
        */
        viewController.wwwFolderName = @"myfolder";
        viewController.startPage = @"mypage.html"


text:
from mlflow.tracking.request_header.abstract_request_header_provider import RequestHeaderProvider
from mlflow.utils import databricks_utils

class DatabricksRequestHeaderProvider(RequestHeaderProvider):
    """
    Provides request headers indicating the type of Databricks environment from which a request
    was made.
    """

    def in_context(self):
        return (
            databricks_utils.is_in_cluster()
            or databricks_utils.is_in_databricks_notebook()
            or databricks_utils.is_in_databricks_job()
        )

    def request_headers(self):
        request_headers = {}
        if databricks_utils.is_in_databricks_notebook():
            request_headers["notebook_id"] = databricks_utils.get_notebook_id()
        if databricks_utils.is_in_databricks_job():
            request_headers["job_id"] = databricks_utils.get_job_id()
            request_headers["job_run_id"] = databricks_utils.get_job_run_id()
            request_headers["job_type"] = databricks_utils.get_job_type()
        if databricks_utils.is_in_cluster():
            request_headers["cluster_id"] = databricks_utils.get_cluster_id()
        command_run_id = databricks_utils.get_command_run_id()
        if command_run_id is not None:
            request_headers["command_run_id"] = command_run_id

        return request_headers


text:
movie
{{.movie.Id}}

<embed src="{{.movie.Content}}" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>


text:
package com.seanchenxi.gwt.websocket.client;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.typedarrays.shared.ArrayBuffer;
import com.google.gwt.typedarrays.shared.ArrayBufferView;
import com.seanchenxi.gwt.file.client.Blob;
import com.seanchenxi.gwt.html.client.BinaryType;
import com.seanchenxi.gwt.html.client.FNObject;
import com.seanchenxi.gwt.html.client.event.CloseEvent;
import com.seanchenxi.gwt.html.client.event.ErrorEvent;
import com.seanchenxi.gwt.html.client.event.MessageEvent;
import com.seanchenxi.gwt.html.client.event.OpenEvent;

/**
 * User: Xi
 */
public final class WebSocket extends FNObject {

    public enum ReadyState {

        CONNECTING(0), OPEN(1), CLOSING(2), CLOSED(3);

        private final int value;

        private ReadyState(int value) {
            this.value = value;
        }

        public static ReadyState parseValue(int value) {
            for (ReadyState rs : values()) {
                if (rs.value == value) {
                    return rs;
                }
            }
            return null;
        }

    }

    private final WebSocketNative impl;

    public WebSocket(String url, String... protocols) {
        impl = WebSocketNative.create(url, protocols);
    }

    public WebSocket(String url) {
        impl = WebSocketNative.create(url);
    }

    public ReadyState getReadyState() {
        return ReadyState.parseValue(impl.getReadyState());
    }

    public double getBufferedAmount() {
        return impl.getBufferedAmount();
    }

    public String getExtensions() {
        return impl.getExtensions();
    }

    public String getProtocol() {
        return impl.getProtocol();
    }

    public BinaryType getBinaryType() {
        return BinaryType.parseValue(impl.getBinaryType());
    }

    public void close() {
        impl.close();
    }

    public void close(int code) {
        impl.close(code);
    }

    public void close(int code, String reason) {
        impl.close(code, reason);
    }

    public void send(String data) {
        impl.send(data);
    }

    public void send(Blob data) {
        impl.send(data);
    }

    public void send(ArrayBuffer data) {
        impl.send(data);
    }

    public void send(ArrayBufferView data) {
        impl.send(data);
    }

    public HandlerRegistration addOpenHandler(OpenEvent.Handler handler){
        return addFnEventHandler(OpenEvent.getType(), handler);
    }

    public HandlerRegistration addCloseHandler(CloseEvent.Handler handler){
        return addFnEventHandler(CloseEvent.getType(), handler);
    }

    public HandlerRegistration addErrorHandler(ErrorEvent.Handler<NativeEvent> handler){
        return addFnEventHandler(ErrorEvent.getType(), handler);
    }

    public HandlerRegistration addMessageHandler(MessageEvent.Handler handler){
        return addFnEventHandler(MessageEvent.getType(), handler);
    }

    @Override
    public JavaScriptObject asNative() {
        return impl;
    }
}


text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\FlexApi\V1;

use Twilio\Options;
use Twilio\Values;

abstract class ChannelOptions {
    /**
     * @param string $target The Target Contact Identity
     * @param string $chatUniqueName The chat channel's unique name
     * @param string $preEngagementData The pre-engagement data
     * @param string $taskSid The SID of the TaskRouter Task
     * @param string $taskAttributes The Task attributes to be added for the
     *                               TaskRouter Task
     * @param bool $longLived Whether to create the channel as long-lived
     * @return CreateChannelOptions Options builder
     */
    public static function create(string $target = Values::NONE, string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE, string $taskSid = Values::NONE, string $taskAttributes = Values::NONE, bool $longLived = Values::NONE): CreateChannelOptions {
        return new CreateChannelOptions($target, $chatUniqueName, $preEngagementData, $taskSid, $taskAttributes, $longLived);
    }
}

class CreateChannelOptions extends Options {
    /**
     * @param string $target The Target Contact Identity
     * @param string $chatUniqueName The chat channel's unique name
     * @param string $preEngagementData The pre-engagement data
     * @param string $taskSid The SID of the TaskRouter Task
     * @param string $taskAttributes The Task attributes to be added for the
     *                               TaskRouter Task
     * @param bool $longLived Whether to create the channel as long-lived
     */
    public function __construct(string $target = Values::NONE, string $chatUniqueName = Values::NONE, string $preEngagementData = Values::NONE, string $taskSid = Values::NONE, string $taskAttributes = Values::NONE, bool $longLived = Values::NONE) {
        $this->options['target'] = $target;
        $this->options['chatUniqueName'] = $chatUniqueName;
        $this->options['preEngagementData'] = $preEngagementData;
        $this->options['taskSid'] = $taskSid;
        $this->options['taskAttributes'] = $taskAttributes;
        $this->options['longLived'] = $longLived;
    }

    /**
     * The Target Contact Identity, for example the phone number of an SMS.
     *
     * @param string $target The Target Contact Identity
     * @return $this Fluent Builder
     */
    public function setTarget(string $target): self {
        $this->options['target'] = $target;
        return $this;
    }

    /**
     * The chat channel's unique name.
     *
     * @param string $chatUniqueName The chat channel's unique name
     * @return $this Fluent Builder
     */
    public function setChatUniqueName(string $chatUniqueName): self {
        $this->options['chatUniqueName'] = $chatUniqueName;
        return $this;
    }

    /**
     * The pre-engagement data.
     *
     * @param string $preEngagementData The pre-engagement data
     * @return $this Fluent Builder
     */
    public function setPreEngagementData(string $preEngagementData): self {
        $this->options['preEngagementData'] = $preEngagementData;
        return $this;
    }

    /**
     * The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external`
     *
     * @param string $taskSid The SID of the TaskRouter Task
     * @return $this Fluent Builder
     */
    public function setTaskSid(string $taskSid): self {
        $this->options['taskSid'] = $taskSid;
        return $this;
    }

    /**
     * The Task attributes to be added for the TaskRouter Task.
     *
     * @param string $taskAttributes The Task attributes to be added for the
     *                               TaskRouter Task
     * @return $this Fluent Builder
     */
    public function setTaskAttributes(string $taskAttributes): self {
        $this->options['taskAttributes'] = $taskAttributes;
        return $this;
    }

    /**
     * Whether to create the channel as long-lived.
     *
     * @param bool $longLived Whether to create the channel as long-lived
     * @return $this Fluent Builder
     */
    public function setLongLived(bool $longLived): self {
        $this->options['longLived'] = $longLived;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString(): string {
        $options = \http_build_query(Values::of($this->options), '', ' ');
        return '[Twilio.FlexApi.V1.CreateChannelOptions ' . $options . ']';
    }
}