text:
#region -- License Terms --
//  MessagePack for CLI
//
//  Copyright (C) 2015-2015 FUJIWARA, Yusuke
//
//     Licensed 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.
#endregion -- License Terms --

#if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
#define UNITY
#endif

using System;
using System.Collections.Generic;
#if !UNITY
#if XAMIOS || XAMDROID
using Contract = MsgPack.MPContract;
#else
using System.Diagnostics.Contracts;
#endif // XAMIOS || XAMDROID
#endif // !UNITY
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;

using MsgPack.Serialization.Polymorphic;

namespace MsgPack.Serialization
{
	partial class PolymorphismSchema
	{
		/// <summary>
		///		Default instance (null object).
		/// </summary>
		internal static readonly PolymorphismSchema Default = new PolymorphismSchema();

		/// <summary>
		///		ForPolymorphicObject( Type targetType )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicObjectTypeEmbeddingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicObject", new[] { typeof( Type ) } );

		/// <summary>
		///		ForPolymorphicObject( Type targetType, IDictionary{byte, Type} codeTypeMapping )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicObjectCodeTypeMappingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicObject", new[] { typeof( Type ), typeof( IDictionary<byte, Type> ) } );

		/// <summary>
		///		ForContextSpecifiedCollection( Type targetType, PolymorphismSchema itemsSchema )
		/// </summary>
		internal static readonly MethodInfo ForContextSpecifiedCollectionMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForContextSpecifiedCollection", new[] { typeof( Type ), typeof( PolymorphismSchema ) } );

		/// <summary>
		///		ForPolymorphicCollection( Type targetType, PolymorphismSchema itemsSchema )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicCollectionTypeEmbeddingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicCollection", new[] { typeof( Type ), typeof( PolymorphismSchema ) } );

		/// <summary>
		///		ForPolymorphicCollection( Type targetType, IDictionary{byte, Type} codeTypeMapping, PolymorphismSchema itemsSchema )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicCollectionCodeTypeMappingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicCollection", new[] { typeof( Type ), typeof( IDictionary<byte, Type> ), typeof( PolymorphismSchema ) } );

		/// <summary>
		///		ForContextSpecifiedDictionary( Type targetType, PolymorphismSchema keysSchema, PolymorphismSchema valuesSchema )
		/// </summary>
		internal static readonly MethodInfo ForContextSpecifiedDictionaryMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForContextSpecifiedDictionary", new[] { typeof( Type ), typeof( PolymorphismSchema ), typeof( PolymorphismSchema ) } );

		/// <summary>
		///		ForPolymorphicDictionary( Type targetType, PolymorphismSchema keysSchema, PolymorphismSchema valuesSchema )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicDictionaryTypeEmbeddingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicDictionary", new[] { typeof( Type ), typeof( PolymorphismSchema ), typeof( PolymorphismSchema ) } );

		/// <summary>
		///		ForPolymorphicDictionary( Type targetType, IDictionary{byte, Type} codeTypeMapping, PolymorphismSchema keysSchema, PolymorphismSchema valuesSchema )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicDictionaryCodeTypeMappingMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicDictionary", new[] { typeof( Type ), typeof( IDictionary<byte, Type> ), typeof( PolymorphismSchema ), typeof( PolymorphismSchema ) } );

#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
		/// <summary>
		///		ForPolymorphicTuple( Type targetType, PolymorphismSchema[] itemSchemaList )
		/// </summary>
		internal static readonly MethodInfo ForPolymorphicTupleMethod =
			typeof( PolymorphismSchema ).GetMethod( "ForPolymorphicTuple", new[] { typeof( Type ), typeof( PolymorphismSchema[]) } );
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY

		internal static readonly ConstructorInfo CodeTypeMapConstructor =
			typeof( Dictionary<,> ).MakeGenericType( typeof( byte ), typeof( Type ) )
				.GetConstructor( new[] { typeof( int ) } );

		internal static readonly MethodInfo AddToCodeTypeMapMethod =
			typeof( Dictionary<,> ).MakeGenericType( typeof( byte ), typeof( Type ) )
				.GetMethod( "Add", new[] { typeof( byte ), typeof( Type ) } );

		internal string DebugString
		{
			get
			{
				var buffer = new StringBuilder();
				this.ToDebugString( buffer );
				return buffer.ToString();
			}
		}

		private void ToDebugString( StringBuilder buffer )
		{
			buffer.Append( "{TargetType:" ).Append( this.TargetType ).Append( ", SchemaType:" ).Append( this.PolymorphismType );
			switch ( this.ChildrenType )
			{
				case PolymorphismSchemaChildrenType.CollectionItems:
				{
					buffer.Append( ", CollectionItemsSchema:" );
					if ( this.ItemSchema == null )
					{
						buffer.Append( "null" );
					}
					else
					{
						this.ItemSchema.ToDebugString( buffer );
					}

					break;
				}
				case PolymorphismSchemaChildrenType.DictionaryKeyValues:
				{
					buffer.Append( ", DictinoaryKeysSchema:" );
					if ( this.KeySchema == null )
					{
						buffer.Append( "null" );
					}
					else
					{
						this.KeySchema.ToDebugString( buffer );
					}

					buffer.Append( ", DictinoaryValuesSchema:" );
					if ( this.ItemSchema == null )
					{
						buffer.Append( "null" );
					}
					else
					{
						this.ItemSchema.ToDebugString( buffer );
					}

					break;
				}
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
				case PolymorphismSchemaChildrenType.TupleItems:
				{
					buffer.Append( ", TupleItemsSchema:[" );
					var isFirst = true;
					foreach ( var child in this._children )
					{
						if ( isFirst )
						{
							isFirst = false;
						}
						else
						{
							buffer.Append( ", " );
						}

						if ( child == null )
						{
							buffer.Append( "null" );
						}
						else
						{
							child.ToDebugString( buffer );
						}
					}

					break;
				}
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY
			}

			buffer.Append( '}' );
		}

		internal static PolymorphismSchema Create(
			SerializationContext context,
			Type type,
#if !UNITY
			SerializingMember? memberMayBeNull
#else
			SerializingMember memberMayBeNull
#endif // !UNITY
 )
		{
			if ( type.GetIsValueType() )
			{
				// Value types will never be polymorphic.
				return Default;
			}

			if ( memberMayBeNull == null )
			{
				// Using default for collection/tuple items.
				return Default;
			}

#if !UNITY
			var member = memberMayBeNull.Value;
#else
			var member = memberMayBeNull;
#endif // !UNITY

			var table = TypeTable.Create( context, member.Member );

			var traits = member.Member.GetMemberValueType().GetCollectionTraits();
			switch ( traits.CollectionType )
			{
				case CollectionKind.Array:
				{
					if ( !table.Member.Exists && !table.CollectionItem.Exists )
					{
						return Default;
					}

					return
						new PolymorphismSchema(
							member.Member.GetMemberValueType(),
							table.Member.PolymorphismType,
							table.Member.CodeTypeMapping,
							PolymorphismSchemaChildrenType.CollectionItems,
							new PolymorphismSchema(
								traits.ElementType,
								table.CollectionItem.PolymorphismType,
								table.CollectionItem.CodeTypeMapping,
								PolymorphismSchemaChildrenType.None
							)
						);
				}
				case CollectionKind.Map:
				{
					if ( !table.Member.Exists && !table.DictionaryKey.Exists && !table.CollectionItem.Exists )
					{
						return Default;
					}

					return
						new PolymorphismSchema(
							member.Member.GetMemberValueType(),
							table.Member.PolymorphismType,
							table.Member.CodeTypeMapping,
							PolymorphismSchemaChildrenType.DictionaryKeyValues,
							new PolymorphismSchema(
								traits.ElementType.GetGenericArguments()[ 0 ],
								table.DictionaryKey.PolymorphismType,
								table.DictionaryKey.CodeTypeMapping,
								PolymorphismSchemaChildrenType.None
							),
							new PolymorphismSchema(
								traits.ElementType.GetGenericArguments()[ 1 ],
								table.CollectionItem.PolymorphismType,
								table.CollectionItem.CodeTypeMapping,
								PolymorphismSchemaChildrenType.None
							)
						);
				}
				default:
				{
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
					if ( TupleItems.IsTuple( member.Member.GetMemberValueType() ) )
					{
						if ( table.TupleItems.Count == 0 )
						{
							return Default;
						}

						var tupleItemTypes = TupleItems.GetTupleItemTypes( member.Member.GetMemberValueType() );
						return
							new PolymorphismSchema(
								member.Member.GetMemberValueType(),
								PolymorphismType.None,
								EmptyMap,
								PolymorphismSchemaChildrenType.TupleItems,
								table.TupleItems
								.Zip(tupleItemTypes, (e,t) => new { Entry = e, ItemType = t })
								.Select( e =>
									new PolymorphismSchema(
										e.ItemType,
										e.Entry.PolymorphismType,
										e.Entry.CodeTypeMapping,
										PolymorphismSchemaChildrenType.None
									)
								).ToArray()
							);
					}
					else
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY
					{
						if ( !table.Member.Exists )
						{
							return Default;
						}

						return
							new PolymorphismSchema(
								member.Member.GetMemberValueType(),
								table.Member.PolymorphismType,
								table.Member.CodeTypeMapping,
								PolymorphismSchemaChildrenType.None
							);
					}
				}
			}
		}

		private struct TypeTable
		{
			public readonly TypeTableEntry Member;
			public readonly TypeTableEntry CollectionItem;
			public readonly TypeTableEntry DictionaryKey;
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
			public readonly IList<TypeTableEntry> TupleItems;
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY

			private TypeTable(
				TypeTableEntry member,
				TypeTableEntry collectionItem,
				TypeTableEntry dictionaryKey
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
				, IList<TypeTableEntry> tupleItems
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY
			)
			{
				this.Member = member;
				this.CollectionItem = collectionItem;
				this.DictionaryKey = dictionaryKey;
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
				this.TupleItems = tupleItems;
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY
			}

			public static TypeTable Create( SerializationContext context, MemberInfo member )
			{
				return
					new TypeTable(
						TypeTableEntry.Create( context, member, PolymorphismTarget.Member ),
						TypeTableEntry.Create( context, member, PolymorphismTarget.CollectionItem ),
						TypeTableEntry.Create( context, member, PolymorphismTarget.DictionaryKey )
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
						, TypeTableEntry.CreateTupleItems( context, member )
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY
					);
			}
		}

		private sealed class TypeTableEntry
		{
#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
			private static readonly TypeTableEntry[] EmptyEntries = new TypeTableEntry[ 0 ];
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY

			private readonly Dictionary<byte, Type> _knownTypeMapping = new Dictionary<byte, Type>();

			public IDictionary<byte, Type> CodeTypeMapping { get { return this._knownTypeMapping; } }

			private bool _useTypeEmbedding;

			public PolymorphismType PolymorphismType
			{
				get
				{
					return
						this._useTypeEmbedding
							? PolymorphismType.RuntimeType
							: this._knownTypeMapping.Count > 0
								? PolymorphismType.KnownTypes
								: PolymorphismType.None;
				}
			}

			public bool Exists { get { return this._useTypeEmbedding || this._knownTypeMapping.Count > 0; } }

			private TypeTableEntry() { }

			public static TypeTableEntry Create( SerializationContext context, MemberInfo member, PolymorphismTarget targetType )
			{
				var result = new TypeTableEntry();
				foreach (
					var attribute in
						member.GetCustomAttributes( false )
							.OfType<IPolymorphicHelperAttribute>()
							.Where( a => a.Target == targetType )
				)
				{
					result.Interpret( context, attribute, member.ToString(), -1 );
				}

				return result;
			}

#if !WINDOWS_PHONE && !NETFX_35 && !UNITY
			public static TypeTableEntry[] CreateTupleItems( SerializationContext context, MemberInfo member )
			{
				if ( !TupleItems.IsTuple( member.GetMemberValueType() ) )
				{
					return EmptyEntries;
				}

				var tupleItems = TupleItems.GetTupleItemTypes( member.GetMemberValueType() );
				var result = Enumerable.Repeat( default( object ), tupleItems.Count ).Select( _ => new TypeTableEntry() ).ToArray();
				foreach (
					var attribute in
						member.GetCustomAttributes( false )
							.OfType<IPolymorphicTupleItemTypeAttribute>()
							.OrderBy( a => a.ItemNumber )
				)
				{
					result[ attribute.ItemNumber - 1 ].Interpret( context, attribute, member.ToString(), attribute.ItemNumber );
				}

				return result;
			}
#endif // !WINDOWS_PHONE && !NETFX_35 && !UNITY

			private void Interpret( SerializationContext context, IPolymorphicHelperAttribute attribute, string memberName, int tupleItemNumber )
			{
				var asKnown = attribute as IPolymorphicKnownTypeAttribute;
				if ( asKnown != null )
				{
					if ( this._useTypeEmbedding )
					{
						throw new SerializationException(
							GetCannotSpecifyKnownTypeAndRuntimeTypeErrorMessage( attribute, memberName, tupleItemNumber )
						);
					}

					var bindingCode = asKnown.GetBindingCode( context );
					try
					{
						this._knownTypeMapping.Add( bindingCode, asKnown.BindingType );
						return;
					}
					catch ( ArgumentException )
					{
						throw new SerializationException(
							GetCannotDuplicateKnownTypeCodeErrorMessage( attribute, bindingCode, memberName, tupleItemNumber )
						);
					}
				}

#if DEBUG && !UNITY
				Contract.Assert( attribute is IPolymorphicRuntimeTypeAttribute, attribute + " is IPolymorphicRuntimeTypeAttribute" );
#endif // DEBUG && !UNITY
				if ( this._useTypeEmbedding )
				{
#if DEBUG && !UNITY
					Contract.Assert( attribute.Target == PolymorphismTarget.TupleItem, attribute.Target + " == PolymorphismTarget.TupleItem" );
#endif // DEBUG && !UNITY
					throw new SerializationException(
						String.Format(
							CultureInfo.CurrentCulture,
							"Cannot specify multiple '{0}' to #{1} item of tuple type member '{2}'.",
							typeof( MessagePackRuntimeTupleItemTypeAttribute ),
							tupleItemNumber,
							memberName
						)
					);
				}

				if ( this._knownTypeMapping.Count > 0 )
				{
					throw new SerializationException(
						GetCannotSpecifyKnownTypeAndRuntimeTypeErrorMessage( attribute, memberName, tupleItemNumber )
					);
				}

				this._useTypeEmbedding = true;
			}

			private static string GetCannotSpecifyKnownTypeAndRuntimeTypeErrorMessage( IPolymorphicHelperAttribute attribute, string memberName, int tupleItemNumber )
			{
				switch ( attribute.Target )
				{
					case PolymorphismTarget.CollectionItem:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify '{0}' and '{1}' simultaneously to collection items of member '{2}' itself.",
								typeof( MessagePackRuntimeCollectionItemTypeAttribute ),
								typeof( MessagePackKnownCollectionItemTypeAttribute ),
								memberName
							);
					}
					case PolymorphismTarget.DictionaryKey:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify '{0}' and '{1}' simultaneously to dictionary keys of member '{2}' itself.",
								typeof( MessagePackRuntimeDictionaryKeyTypeAttribute ),
								typeof( MessagePackKnownDictionaryKeyTypeAttribute ),
								memberName
							);
					}
					case PolymorphismTarget.TupleItem:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify '{0}' and '{1}' simultaneously to #{2} item of tuple type member '{3}' itself.",
								typeof( MessagePackRuntimeTupleItemTypeAttribute ),
								typeof( MessagePackKnownTupleItemTypeAttribute ),
								tupleItemNumber,
								memberName
							);
					}
					default:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify '{0}' and '{1}' simultaneously to member '{2}' itself.",
								typeof( MessagePackRuntimeTypeAttribute ),
								typeof( MessagePackKnownTypeAttribute ),
								memberName
							);
					}
				}
			}

			private static string GetCannotDuplicateKnownTypeCodeErrorMessage( IPolymorphicHelperAttribute attribute, byte bindingCode, string memberName, int tupleItemNumber )
			{
				switch ( attribute.Target )
				{
					case PolymorphismTarget.CollectionItem:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify multiple types for ext-type code '{0}' for collection items of member '{1}'.",
								bindingCode,
								memberName
							);
					}
					case PolymorphismTarget.DictionaryKey:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify multiple types for ext-type code '{0}' for dictionary keys of member '{1}'.",
								bindingCode,
								memberName
							);
					}
					case PolymorphismTarget.TupleItem:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify multiple types for ext-type code '{0}' for #{1} item of tuple type member '{2}'.",
								bindingCode,
								tupleItemNumber,
								memberName
							);
					}
					default:
					{
						return
							String.Format(
								CultureInfo.CurrentCulture,
								"Cannot specify multiple types for ext-type code '{0}' for member '{1}'.",
								bindingCode,
								memberName
							);
					}
				}
			}
		}
	}
}


text:
<!DOCTYPE html>

    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="width=640">

    <link rel="stylesheet" href="css/core.css" media="screen">
    <link rel="stylesheet" href="css/mobile.css" media="handheld, only screen and (max-device-width:640px)">
    <link rel="stylesheet" href="css/pygment_trac.css">

    <title>Deptree by leungwensen</title>

    View on GitHub

Deptree

view dependency tree of your modules in browser.

          download .ZIPdownload .TGZ

        Welcome to homepage of deptree.

deptree is a tool to display the dependency tree of your modules, so that you can understand the connects between modules and dependency circle easier.

$ git clone https://github.com/leungwensen/deptree.git
$ cd deptree
$ npm install
$ ./bin/deptree.js -d node_modules/pastry/src -a js-amd

 demo

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eas.client;

import com.eas.client.cache.PlatypusFiles;
import com.eas.client.threetier.PlatypusConnection;
import com.eas.client.threetier.requests.ModuleStructureRequest;
import com.eas.client.threetier.requests.ResourceRequest;
import com.eas.concurrent.CallableConsumer;
import com.eas.script.Scripts;
import com.eas.util.FileUtils;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import java.util.logging.Level;
import java.util.logging.Logger;
import jdk.nashorn.api.scripting.JSObject;
import jdk.nashorn.internal.runtime.JSType;

/**
 *
 * @author mg
 */
public class RemoteModulesProxy implements ModulesProxy {

    public static final String SERVER_DEPENDENCIES_PROP_NAME = "serverDependencies";
    public static final String QUERY_DEPENDENCIES_PROP_NAME = "queryDependencies";
    public static final String CLIENT_DEPENDENCIES_PROP_NAME = "clientDependencies";
    public static final String STRUCTURE_PROP_NAME = "structure";
    public static final String LENGTH_PROP_NAME = "length";

    protected PlatypusConnection conn;
    protected Path basePath;
    protected Map<String, File> id2files = new ConcurrentHashMap<>();

    public RemoteModulesProxy(PlatypusConnection aConn) {
        super();
        conn = aConn;
        basePath = makePathInUserProfile(Math.abs(conn.getUrl().hashCode()) + "");
    }

    @Override
    public Path getLocalPath() {
        return basePath;
    }

    @Override
    public ModuleStructure getModule(String aName, Scripts.Space aSpace, Consumer<ModuleStructure> onSuccess, Consumer<Exception> onFailure) throws Exception {
        if (onSuccess != null) {
            requestModuleStructure(aName, aSpace, (ModuleStructureRequest.Response structureResp) -> {
                try {
                    ModuleStructure structure = new ModuleStructure();
                    JSObject jsStructure = (JSObject) aSpace.parseJson(structureResp.getJson());
                    readCommons(jsStructure, structure);
                    JSObject jsParts = (JSObject) jsStructure.getMember(STRUCTURE_PROP_NAME);
                    int partsLength = JSType.toInteger(jsParts.getMember(LENGTH_PROP_NAME));
                    for (int i = 0; i < partsLength; i++) {
                        String resourceName = JSType.toString(jsParts.getSlot(i));
                        getResource(resourceName, aSpace, (File aSynced) -> {
                            structure.getParts().addFile(aSynced);
                            if (structure.getParts().getFiles().size() == partsLength) {
                                id2files.put(aName, structure.getParts().findFileByExtension(PlatypusFiles.JAVASCRIPT_EXTENSION));
                                onSuccess.accept(structure);
                            }
                        }, onFailure);
                    }
                } catch (Exception ex) {
                    if (onFailure != null) {
                        onFailure.accept(ex);
                    }
                }
            }, onFailure);
            return null;
        } else {
            ModuleStructureRequest.Response structureResp = requestModuleStructure(aName, null, null, null);
            ModuleStructure structure = new ModuleStructure();
            JSObject jsStructure = (JSObject) aSpace.parseJson(structureResp.getJson());
            readCommons(jsStructure, structure);
            JSObject jsParts = (JSObject) jsStructure.getMember(STRUCTURE_PROP_NAME);
            int partsLength = JSType.toInteger(jsParts.getMember(LENGTH_PROP_NAME));
            for (int i = 0; i < partsLength; i++) {
                String resourceName = JSType.toString(jsParts.getSlot(i));
                File synced = getResource(resourceName, aSpace, null, null);
                structure.getParts().addFile(synced);
            }
            id2files.put(aName, structure.getParts().findFileByExtension(PlatypusFiles.JAVASCRIPT_EXTENSION));
            return structure;
        }
    }

    @Override
    public File getResource(String aResourceName, Scripts.Space aSpace, Consumer<File> onSuccess, Consumer<Exception> onFailure) throws Exception {
        if (onSuccess != null) {
            String cachePathName = constructResourcePath(aResourceName);
            File cachePath = new File(cachePathName);
            syncResource(cachePath, aResourceName, aSpace, (Void aVoid) -> {
                onSuccess.accept(cachePath);
            }, onFailure);
            return null;
        } else {
            String cachePathName = constructResourcePath(aResourceName);
            File cachePath = new File(cachePathName);
            syncResource(cachePath, aResourceName, null, null, null);
            return cachePath;
        }
    }

    private void readCommons(JSObject jsStructure, ModuleStructure structure) {
        JSObject jsClientDependencies = (JSObject) jsStructure.getMember(CLIENT_DEPENDENCIES_PROP_NAME);
        int clientDepsLength = JSType.toInteger(jsClientDependencies.getMember(LENGTH_PROP_NAME));
        for (int i = 0; i < clientDepsLength; i++) {
            String dep = JSType.toString(jsClientDependencies.getSlot(i));
            structure.getClientDependencies().add(dep);
        }
        JSObject jsQueryDependencies = (JSObject) jsStructure.getMember(QUERY_DEPENDENCIES_PROP_NAME);
        int queryDepsLength = JSType.toInteger(jsQueryDependencies.getMember(LENGTH_PROP_NAME));
        for (int i = 0; i < queryDepsLength; i++) {
            String dep = JSType.toString(jsQueryDependencies.getSlot(i));
            structure.getQueryDependencies().add(dep);
        }
        JSObject jsServerDependencies = (JSObject) jsStructure.getMember(SERVER_DEPENDENCIES_PROP_NAME);
        int serverDepsLength = JSType.toInteger(jsServerDependencies.getMember(LENGTH_PROP_NAME));
        for (int i = 0; i < serverDepsLength; i++) {
            String dep = JSType.toString(jsServerDependencies.getSlot(i));
            structure.getServerDependencies().add(dep);
        }
    }

    private void syncResource(File cachePath, String aName, Scripts.Space aSpace, Consumer<Void> onSuccess, Consumer<Exception> onFailure) throws Exception {
        Date localTimeStamp = null;
        if (cachePath.exists() && cachePath.isFile()) {
            localTimeStamp = new Date(cachePath.lastModified());
        }
        CallableConsumer<Void, ResourceRequest.Response> doWork = (ResourceRequest.Response resourceResp) -> {
            if (resourceResp.getContent() != null) {
                cachePath.getParentFile().mkdirs();
                boolean deleted = cachePath.delete();
                if (!deleted) {
                    if (cachePath.isDirectory()) {
                        FileUtils.clearDirectory(cachePath, false);
                        cachePath.delete();
                    }
                }
                cachePath.createNewFile();
                try (OutputStream out = new BufferedOutputStream(new FileOutputStream(cachePath))) {
                    out.write(resourceResp.getContent());
                    out.flush();
                }
                cachePath.setLastModified(resourceResp.getTimeStamp().getTime());
            }
            return null;
        };
        if (onSuccess != null) {
            requestResource(localTimeStamp, aName, aSpace, (ResourceRequest.Response resourceResp) -> {
                try {
                    doWork.call(resourceResp);
                    try {
                        onSuccess.accept(null);
                    } catch (Exception ex) {
                        Logger.getLogger(RemoteModulesProxy.class.getName()).log(Level.SEVERE, null, ex);
                    }
                } catch (Exception ex) {
                    if (onFailure != null) {
                        onFailure.accept(ex);
                    }
                }
            }, onFailure);
        } else {
            ResourceRequest.Response resourceResp = requestResource(localTimeStamp, aName, null, null, null);
            doWork.call(resourceResp);
        }
    }

    private ModuleStructureRequest.Response requestModuleStructure(String aName, Scripts.Space aSpace, Consumer<ModuleStructureRequest.Response> onSuccess, Consumer<Exception> onFailure) throws Exception {
        ModuleStructureRequest req = new ModuleStructureRequest(aName);
        if (onSuccess != null) {
            conn.enqueueRequest(req, aSpace, onSuccess, onFailure);
            return null;
        } else {
            return conn.executeRequest(req);
        }
    }

    private ResourceRequest.Response requestResource(Date aTimeStamp, String aResourceName, Scripts.Space aSpace, Consumer<ResourceRequest.Response> onSuccess, Consumer<Exception> onFailure) throws Exception {
        ResourceRequest req = new ResourceRequest(aTimeStamp, aResourceName);
        if (onSuccess != null) {
            conn.enqueueRequest(req, aSpace, onSuccess, onFailure);
            return null;
        } else {
            return conn.executeRequest(req);
        }
    }

    private Path makePathInUserProfile(String aAppNameHash) {
        //Make file cache directories
        String path = System.getProperty(ClientConstants.USER_HOME_PROP_NAME);
        if (!path.endsWith(File.separator)) {
            path += File.separator;
        }
        path += ClientConstants.USER_HOME_PLATYPUS_DIRECTORY_NAME;
        File newDir = new File(path);
        if (!newDir.exists()) {
            newDir.mkdir();
        }
        path += File.separator + ClientConstants.ENTITIES_CACHE_DIRECTORY_NAME;
        newDir = new File(path);
        if (!newDir.exists()) {
            newDir.mkdir();
        }
        path += File.separator + aAppNameHash;
        newDir = new File(path);
        if (!newDir.exists()) {
            newDir.mkdir();
        }
        return Paths.get(newDir.toURI());
    }

    /**
     * Generates path for some platypus resource.
     *
     * @param aResourceName A resource name.
     * @return Generated path name.
     */
    protected String constructResourcePath(String aResourceName) {
        String pathName = basePath + File.separator + aResourceName;
        return pathName.replace('/', File.separatorChar);
    }

    @Override
    public File nameToFile(String aName) throws Exception {
        return id2files.get(aName);
    }

    @Override
    public String getDefaultModuleName(File aFile) {
        String defaultModuleName = basePath.relativize(Paths.get(aFile.toURI())).toString().replace(File.separator, "/");
        defaultModuleName = defaultModuleName.substring(0, defaultModuleName.length() - PlatypusFiles.JAVASCRIPT_FILE_END.length());
        return defaultModuleName;
    }

}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Regex Types Used With MFC Strings</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../../index.html" title="Boost.Regex 5.1.1">
<link rel="up" href="../mfc_strings.html" title="Using Boost Regex With MFC Strings">
<link rel="prev" href="mfc_intro.html" title="Introduction to Boost.Regex and MFC Strings">
<link rel="next" href="mfc_regex_create.html" title="Regular Expression Creation From an MFC String">

Home
Libraries
People
FAQ
More

Regex
          Types Used With MFC Strings

            The following typedefs are provided for the convenience of those working
            with TCHAR's:

typedef basic_regex<TCHAR>                  tregex;
typedef match_results<TCHAR const*>         tmatch;
typedef regex_iterator<TCHAR const*>        tregex_iterator;
typedef regex_token_iterator<TCHAR const*>  tregex_token_iterator;

            If you are working with explicitly narrow or wide characters rather than
            TCHAR, then use the regular Boost.Regex types regex
            and wregex instead.

Copyright © 1998-2013 John Maddock

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
using System.Diagnostics.CodeAnalysis;
using Calculator.Contract;
using Calculator.WebService;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using XRoadLib.Extensions.AspNetCore;

namespace Calculator
{
    public class Startup
    {
        [SuppressMessage("Microsoft.Performance", "CA1822:MarkMemberAsStatic")]
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddXRoadLib();

            services.AddSingleton<ICalculate, CalculateWebService>();
            services.AddSingleton<ISumOfIntegers, SumOfIntegersWebService>();
            services.AddSingleton<CalculatorServiceManager>();
        }

        [SuppressMessage("Microsoft.Performance", "CA1822:MarkMemberAsStatic")]
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
                app.UseDeveloperExceptionPage();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapGet("/", c => c.ExecuteWsdlRequest<CalculatorServiceManager>());
                endpoints.MapPost("/", c => c.ExecuteWebServiceRequest<CalculatorServiceManager>());
            });
        }
    }
}


text:
namespace Azure.ResourceManager.TrafficManager.Models
{
    /// <summary> Custom header name and value. </summary>
    public partial class TrafficManagerMonitorConfigCustomHeaderInfo
    {
        /// <summary> Initializes a new instance of TrafficManagerMonitorConfigCustomHeaderInfo. </summary>
        public TrafficManagerMonitorConfigCustomHeaderInfo()
        {
        }

        /// <summary> Initializes a new instance of TrafficManagerMonitorConfigCustomHeaderInfo. </summary>
        /// <param name="name"> Header name. </param>
        /// <param name="value"> Header value. </param>
        internal TrafficManagerMonitorConfigCustomHeaderInfo(string name, string value)
        {
            Name = name;
            Value = value;
        }

        /// <summary> Header name. </summary>
        public string Name { get; set; }
        /// <summary> Header value. </summary>
        public string Value { get; set; }
    }
}


text:
package com.vaadin.tests.components.listselect;

import java.util.List;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;

import com.vaadin.testbench.elements.ListSelectElement;
import com.vaadin.tests.tb3.SingleBrowserTest;

public class ListSelectNoDomRebuildTest extends SingleBrowserTest {
    @Override
    protected Class<?> getUIClass() {
        return ListSelects.class;
    }

    @Test
    public void testNoDomRebuild() {
        openTestURL();

        // Testbench doesn't seem to support sending key events to the right
        // location, so we will just verify that the DOM is not rebuilt
        selectMenuPath("Component", "Selection", "Multi select");
        selectMenuPath("Component", "Listeners", "Value change listener");

        ListSelectElement list = $(ListSelectElement.class).first();
        List<WebElement> options = list.findElements(By.tagName("option"));

        assertNotStale(options);

        options.get(4).click();

        assertNotStale(options);

        new Actions(driver).keyDown(Keys.SHIFT).perform();
        options.get(2).click();
        options.get(6).click();
        new Actions(driver).keyUp(Keys.SHIFT).perform();

        assertNotStale(options);
    }

    private void assertNotStale(List<WebElement> options) {
        for (WebElement element : options) {
            // We really don't expect the text to be null, mainly doing this
            // since getText() will throw if the element is detached.
            Assert.assertNotNull(element.getText());
        }
    }

}


text:
package com.spun.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class WhiteSpaceStripper
{
	/***********************************************************************/
	public static void stripFolder(File dir)
  {
    stripFolder(dir, true);
  }
	/***********************************************************************/
	public static void stripFolder(File dir, boolean recursive)
  {
  	if (!dir.isDirectory())
    {
    	MySystem.warning("File is not a Directory - " + dir.toString());
    	return;
    }

  	File[] files = dir.listFiles(new WhiteSpaceFileFilter());
  	for (int i = 0; i < files.length; i++)
    {
    	if (files[i].isDirectory())
      {
      	MySystem.event("Scaning Directory -" + files[i].getName());
      	if (recursive) stripFolder(files[i], recursive);
      }
    	else
      {
        stripFile(files[i]);
      }
    }
//    My_System.markerOut("WhiteSpaceStripper:stripFolder");
  }
	/***********************************************************************/
	public static void stripFile(String file)
	{
    stripFile(new File(file));
	}
	/***********************************************************************/
	public static void stripFile(File file)
  {

  	if (!file.isFile())
    {
    	MySystem.warning("File is not a File - " + file.toString());
    	return;
    }
		if(!file.canWrite())
		{
			MySystem.event("File '" + file.toString() + "' is readonly");
			return;
		}
		else
		{
	    try
	    {
	      String contents = readFile(file);
	      String stripped = stripWhiteSpace(contents);
	      writeFile(file, stripped);
	    }
	    catch (IOException e)
	    {
	      MySystem.warning(e);
	    }
		}
  }
  /***********************************************************************/
  public static String stripWhiteSpace(String text)
  {
    StringBuffer newText = new StringBuffer();
    boolean whitespace = false;
    int num = text.length();
		char whiteSpaceChar = ' ';
    for (int i = 0; i < num; i++)
    {
      char c = text.charAt(i);
			switch (c)
			{
				case '\n' : whiteSpaceChar = '\n';whitespace = true;break;
				case '\t' :
				case ' '  : whitespace = true;break;
				default	  :
					if (whitespace)
					{
						whitespace = false;
						newText.append(whiteSpaceChar);
						whiteSpaceChar = ' ';
					}
	        newText.append(c);break;
      }
    }
    return newText.toString();
  }
  /***********************************************************************/
  public static String stripBlankLines(String text)
  {
    StringBuffer newText = new StringBuffer();
    boolean inWhiteSpace = true;
    int num = text.length();
    String saving = "";
    for (int i = 0; i < num; i++)
    {
      char c = text.charAt(i);
      switch (c)
      {
        case '\r' :
        case '\n' : if(!inWhiteSpace)
                    {
                      newText.append(saving);
                    }
                    inWhiteSpace = true;
                    if (!"\r".equals(saving))
                    {
                     saving = "";
                    }
                    break;
        case '\t' :
        case ' '  : break; // donothing;
        default   : inWhiteSpace = false;break;
        }
      saving += c;
    }
    if (!inWhiteSpace)
    {
      newText.append(saving);
    }
    return newText.toString();
  }

	/***********************************************************************/
  private static String readFile(File file)
  throws IOException
  {
    BufferedReader reader = new BufferedReader(new FileReader(file));
    StringBuffer output = new StringBuffer();

    while (reader.ready())
    {
      output.append(reader.readLine());
	    output.append("\n");
    }

    reader.close();
    return output.toString();
  }
	/***********************************************************************/
	private static void writeFile(File file, String text)
	throws IOException
	{
    FileWriter writer = new FileWriter(file);

    writer.write(text);

    writer.close();
	}
	/***********************************************************************/
  public static void main (String [] args)
  {
//    stripFolder(new File("C:\\temp\\stockgazing"));
  }
	/***********************************************************************/
  /***********************************************************************/
}

class WhiteSpaceFileFilter
  implements java.io.FileFilter
{

  /***********************************************************************/

  public boolean accept(File pathname)
  {

    if (pathname.getName().equals(".") || pathname.getName().equals("."))
    {
      return false;
    }
    else if (pathname.getName().equalsIgnoreCase("email"))
    {
      return false;
    }
    else if(pathname.isDirectory() || (pathname.getName().indexOf(".htm") != -1) || (pathname.getName().indexOf(".txt") != -1))
    {
      return true;
    }
  	else
    {
    	return false;
    }
  }

  /***********************************************************************/
  /***********************************************************************/
}


text:
<?php
// Establish connection to database and retrieve comments.
require_once('Dao.php');
try {
  $dao = new Dao();
  $comments = $dao->getComments();
} catch (PDOException $e) {
  echo $e->getMessage(); // only print this during development. We want to log in production.
  die(); // stop the page from loading because something is not right.
}
?>

    <title>List of Comments</title>
    <link rel="stylesheet" type="text/css" href="style.css">

    <form name="commentForm" action="handler.php" method="POST">

        Leave a comment:
        <input type="text" id="comment" name="comment">

        <input type="submit" name="commentButton" value="Submit">

    </form>

    <?php foreach ($comments as $comment) { ?>

        <?= $comment["comment"]; ?>
        <?= $comment["created"]; ?>

    <?php } ?>


text:
set_aws_accountid
=========
This role sets the aws account ID based on AWS KEY ID

Configure
------------

None

Role Variables
--------------

saaid_retval_accountid: The account ID that is returned

Dependencies
------------

None

Example Playbook
----------------

  - role: tools_roles/set_aws_accountid

License
-------

ASL 2.0

Author Information
------------------

OpenShift operations, Red Hat, Inc


text:
(function ($) {
    "use strict";

    var Filestyle = function (element, options) {
        this.options = options;
        this.$elementFilestyle = [];
        this.$element = $(element);
    };

    Filestyle.prototype = {
        clear: function () {
            this.$element.val('');
            this.$elementFilestyle.find(':text').val('');
        },

        destroy: function () {
            this.$element
                .removeAttr('style')
                .removeData('filestyle')
                .val('');
            this.$elementFilestyle.remove();
        },

        disabled: function (value) {
        	if (value === true) {
        		if (!this.options.disabled) {
	        		this.$element
		                .attr('disabled', 'true');
		            this.$elementFilestyle.find('label').attr('disabled', 'true');
		            this.options.disabled = true;
		        }
        	} else if (value === false) {
        		if (this.options.disabled) {
		            this.$element
		                .removeAttr('disabled');
		            this.$elementFilestyle.find('label').removeAttr('disabled');
		            this.options.disabled = false;
		        }
            } else {
                return this.options.disabled;
            }
        },

        buttonBefore: function (value) {
        	if (value === true) {
        		if (!this.options.buttonBefore) {
	        		this.options.buttonBefore = true;
	        		if (this.options.input) {
	        			this.$elementFilestyle.remove();
	        			this.constructor();
	        			this.pushNameFiles();
	        		}
	        	}
        	} else if (value === false) {
        		if (this.options.buttonBefore) {
		            this.options.buttonBefore = false;
		            if (this.options.input) {
	        			this.$elementFilestyle.remove();
	        			this.constructor();
	        			this.pushNameFiles();
	        		}
		        }
            } else {
                return this.options.buttonBefore;
            }
        },

        icon: function (value) {
            if (value === true) {
                if (!this.options.icon) {
                    this.options.icon = true;
                    this.$elementFilestyle.find('label').prepend(this.htmlIcon());
                }
            } else if (value === false) {
                if (this.options.icon) {
                    this.options.icon = false;
                    this.$elementFilestyle.find('i').remove();
                }
            } else {
                return this.options.icon;
            }
        },

        input: function (value) {
            if (value === true) {
                if (!this.options.input) {
                    this.options.input = true;

                    if (this.options.buttonBefore) {
                    	this.$elementFilestyle.append(this.htmlInput());
                    } else {
                    	this.$elementFilestyle.prepend(this.htmlInput());
                    }

                    this.$elementFilestyle.find('.quant-files-filestyle').remove();

                    var content = '',
                        files = [];
                    if (this.$element[0].files === undefined) {
                        files[0] = {'name': this.$element[0].value};
                    } else {
                        files = this.$element[0].files;
                    }

                    for (var i = 0; i < files.length; i++) {
                        content += files[i].name.split("\\").pop() + ', ';
                    }
                    if (content !== '') {
                        this.$elementFilestyle.find(':text').val(content.replace(/\, $/g, ''));
                    }
                }
            } else if (value === false) {
                if (this.options.input) {
                    this.options.input = false;
                    this.$elementFilestyle.find(':text').remove();
                    var files = [];
	                if (this.$element[0].files === undefined) {
	                    files[0] = {'name': this.$element[0].value};
	                } else {
	                    files = this.$element[0].files;
	                }
	                if (files.length > 0) {
	                	var style;
	                	if (this.options.classButton.search(/btn-inverse|btn-primary|btn-danger|btn-warning|btn-success/i) !== -1) {
		                    style = 'style="background-color: #fff !important; color: 000;"';
		                } else {
		                	style = 'style="background-color: #000 !important; color: fff;"';
		                }
	                	this.$elementFilestyle.find('label').append(' '+files.length+'');
	                }
                }
            } else {
                return this.options.input;
            }
        },

        buttonText: function (value) {
            if (value !== undefined) {
                this.options.buttonText = value;
                this.$elementFilestyle.find('label span').html(this.options.buttonText);
            } else {
                return this.options.buttonText;
            }
        },

        classButton: function (value) {
            if (value !== undefined) {
                this.options.classButton = value;
                this.$elementFilestyle.find('label').attr({'class': this.options.classButton});
                if (this.options.classButton.search(/btn-inverse|btn-primary|btn-danger|btn-warning|btn-success/i) !== -1) {
                    this.$elementFilestyle.find('label i').addClass('icon-white');
                } else {
                    this.$elementFilestyle.find('label i').removeClass('icon-white');
                }
            } else {
                return this.options.classButton;
            }
        },

        classIcon: function (value) {
            if (value !== undefined) {
                this.options.classIcon = value;
                if (this.options.classButton.search(/btn-inverse|btn-primary|btn-danger|btn-warning|btn-success/i) !== -1) {
                    this.$elementFilestyle.find('label').find('i').attr({'class': 'icon-white '+this.options.classIcon});
                } else {
                    this.$elementFilestyle.find('label').find('i').attr({'class': this.options.classIcon});
                }
            } else {
                return this.options.classIcon;
            }
        },

        classInput: function (value) {
            if (value !== undefined) {
                this.options.classInput = value;
                this.$elementFilestyle.find(':text').addClass(this.options.classInput);
            } else {
                return this.options.classInput;
            }
        },

        htmlIcon: function () {
            if (this.options.icon) {
                var colorIcon = '';
                if (this.options.classButton.search(/btn-inverse|btn-primary|btn-danger|btn-warning|btn-success/i) !== -1) {
                    colorIcon = ' icon-white ';
                }

                return ' ';
            } else {
                return '';
            }
        },

        htmlInput: function () {
            if (this.options.input) {
                return '<input type="text" class="'+this.options.classInput+'" disabled> ';
            } else {
                return '';
            }
        },

        // puts the name of the input files
        pushNameFiles: function () {
        	var content = '',
        	    files = [];
            if (this.$element[0].files === undefined) {
                files[0] = {'name': this.$element.value};
            } else {
                files = this.$element[0].files;
            }

            for (var i = 0; i < files.length; i++) {
                content += files[i].name.split("\\").pop() + ', ';
            }

            if (content !== '') {
                this.$elementFilestyle.find(':text').val(content.replace(/\, $/g, ''));
            } else {
            	this.$elementFilestyle.find(':text').val('');
            }
        },

        constructor: function () {
            var _self = this,
                html = '',
                id = this.$element.attr('id'),
                files = [];

            if (id === '' || !id) {
                id = 'filestyle-'+$('.bootstrap-filestyle').length;
                this.$element.attr({'id': id});
            }

            if(this.options.buttonBefore) {
                html = ''+
                           this.htmlIcon()+
                           ''+this.options.buttonText+''+
                       ''+
                   	   this.htmlInput();
            } else {
                html = this.htmlInput()+
                       ' '+
                           this.htmlIcon()+
                    	   ''+this.options.buttonText+''+
                	   '';
            }

            this.$elementFilestyle = $('
'+html+'
');

            var $label = this.$elementFilestyle.find('label');
            var $labelFocusableContainer = $label.parent();

            $labelFocusableContainer
                .attr('tabindex', "0")
                .keypress(function(e) {
                    if (e.keyCode === 13 || e.charCode === 32) {
                        $label.click();
                    }
                });

            // hidding input file and add filestyle
            this.$element
                .css({'position':'absolute','clip':'rect(0,0,0,0)'})
                .attr('tabindex', "-1")
                .after(this.$elementFilestyle);

            if (this.options.disabled) {
            	this.$element.attr('disabled', 'true');
            }

            // Getting input file value
            this.$element.change(function () {
                var content = '';
                if (this.files === undefined) {
                    files[0] = {'name': this.value};
                } else {
                    files = this.files;
                }

                for (var i = 0; i < files.length; i++) {
                    content += files[i].name.split("\\").pop() + ', ';
                }

                if (content !== '') {
                    _self.$elementFilestyle.find(':text').val(content.replace(/\, $/g, ''));
                } else {
                	_self.$elementFilestyle.find(':text').val('');
                }

                if (_self.options.input == false) {
                	var style;
                	if (_self.options.classButton.search(/btn-inverse|btn-primary|btn-danger|btn-warning|btn-success/i) !== -1) {
	                    style = 'style="background-color: #fff !important; color: #000;"';
	                } else {
	                	style = 'style="background-color: #000 !important; color: #fff;"';
	                }
                	if (_self.$elementFilestyle.find('.quant-files-filestyle').length == 0) {
                		_self.$elementFilestyle.find('label').append(' '+files.length+'');
                	} else if (files.length == 0) {
                		_self.$elementFilestyle.find('.quant-files-filestyle').remove();
                	} else {
                		_self.$elementFilestyle.find('.quant-files-filestyle').html(files.length);
                	}
                } else {
                	_self.$elementFilestyle.find('.quant-files-filestyle').remove();
                }
            });

            // Check if browser is Firefox
            if (window.navigator.userAgent.search(/firefox/i) > -1) {
                // Simulating choose file for firefox
                this.$elementFilestyle.find('label').click(function () {
                    _self.$element.click();
                    return false;
                });
            }
        }
    };

    var old = $.fn.filestyle;

    $.fn.filestyle = function (option, value) {
        var get = '',
            element = this.each(function () {
                if ($(this).attr('type') === 'file') {
                    var $this = $(this),
                        data = $this.data('filestyle'),
                        options = $.extend({}, $.fn.filestyle.defaults, option, typeof option === 'object' && option);

                    if (!data) {
                        $this.data('filestyle', (data = new Filestyle(this, options)));
                        data.constructor();
                    }

                    if (typeof option === 'string') {
                        get = data[option](value);
                    }
                }
            });

        if (typeof get !== undefined) {
            return get;
        } else {
            return element;
        }
    };

    $.fn.filestyle.defaults = {
        'buttonText': 'Choose file',
        'input': true,
        'icon': true,
        'buttonBefore': false,
        'disabled': false,

        'classButton': 'btn btn-default',
        'classInput': 'input-large',
        'classIcon': 'icon-folder-open'
    };

    $.fn.filestyle.noConflict = function () {
        $.fn.filestyle = old;
        return this;
    };

    // Data attributes register
    $(function() {
        $('.filestyle').each(function () {
            var $this = $(this),
                options = {

                    'input': $this.attr('data-input') === 'false' ? false : true,
                    'icon': $this.attr('data-icon') === 'false' ? false : true,
                    'buttonBefore': $this.attr('data-buttonBefore') === 'true' ? true : false,
                    'disabled': $this.attr('data-disabled') === 'true' ? true : false,

                    'buttonText': $this.attr('data-buttonText'),
                    'classButton': $this.attr('data-classButton'),
                    'classInput': $this.attr('data-classInput'),
                    'classIcon': $this.attr('data-classIcon')
                };

            $this.filestyle(options);
        });
    });
})(window.jQuery);


text:
#ifndef IVW_BACKGROUND_H
#define IVW_BACKGROUND_H

#include <modules/basegl/baseglmoduledefine.h>
#include <inviwo/core/common/inviwo.h>
#include <inviwo/core/processors/processor.h>
#include <inviwo/core/properties/optionproperty.h>
#include <inviwo/core/properties/ordinalproperty.h>
#include <inviwo/core/properties/buttonproperty.h>
#include <inviwo/core/ports/imageport.h>
#include <modules/opengl/inviwoopengl.h>
#include <modules/opengl/shader/shader.h>

namespace inviwo {

/** \docpage{org.inviwo.Background, Background}
 * ![](org.inviwo.Background.png?classIdentifier=org.inviwo.Background)
 * Adds a background to an image.
 * The following mixing is applied
 *
 *     out.rgb = in.rgb + color.rgb * color.a * (1.0 - in.a)
 *     out.a = in.a + color.a * (1.0 - in.a)
 *
 * ### Inports
 *   * __ImageInport__ Input image.
 *
 * ### Outports
 *   * __ImageOutport__ Output image.
 *
 * ### Properties
 *   * __Style__ The are three different styles to choose from Linear gradient, uniform color,
 *     or checker board.
 *   * __Color1__ Used as the uniform color and as color 1 in the gradient and checkerboard.
 *   * __Color2__ Used as color 2 the gradient and checkerboard.
 *   * __Checker Board Size__ The size of the rectangles in the checker board.
 *   * __Switch colors__ Button to switch color 1 and 2.
 */

/**
 * \brief Adds a background to an image.
 *
 */
class IVW_MODULE_BASEGL_API Background : public Processor {
public:
    virtual const ProcessorInfo getProcessorInfo() const override;
    static const ProcessorInfo processorInfo_;

    Background();
    virtual ~Background();

    virtual void initializeResources() override;

protected:
    virtual void process() override;

private:
    void switchColors();

    ImageInport inport_;
    ImageOutport outport_;

    OptionPropertyInt backgroundStyle_;
    FloatVec4Property color1_;
    FloatVec4Property color2_;
    IntVec2Property checkerBoardSize_;
    ButtonProperty switchColors_;
    Shader shader_;
    bool hadData_;
};

} // namespace

#endif // IVW_BACKGROUND_H


text:
pyModeS.decoder.bds.bds08 module
================================

.. automodule:: pyModeS.decoder.bds.bds08
    :members:
    :undoc-members:
    :show-inheritance:


text:
from __future__ import print_function

import unittest
import pytest
import logging
import requests
import responses
import mock
import mwclient
from mwclient.page import Page

try:
    import json
except ImportError:
    import simplejson as json

if __name__ == "__main__":
    print()
    print("Note: Running in stand-alone mode. Consult the README")
    print("      (section 'Contributing') for advice on running tests.")
    print()

class TestPage(unittest.TestCase):

    def setUp(self):
        pass

    @mock.patch('mwclient.client.Site')
    def test_api_call_on_page_init(self, mock_site):
        # Check that site.api() is called once on Page init

        title = 'Some page'
        mock_site.api.return_value = {
            'query': {'pages': {'1': {}}}
        }
        page = Page(mock_site, title)

        # test that Page called site.api with the right parameters
        mock_site.api.assert_called_once_with('query', inprop='protection', titles=title, prop='info')

    @mock.patch('mwclient.client.Site')
    def test_nonexisting_page(self, mock_site):
        # Check that API response results in page.exists being set to False

        title = 'Some nonexisting page'
        mock_site.api.return_value = {
            'query': {'pages': {'-1': {'missing': ''}}}
        }
        page = Page(mock_site, title)

        assert page.exists is False

    @mock.patch('mwclient.client.Site')
    def test_existing_page(self, mock_site):
        # Check that API response results in page.exists being set to True

        title = 'Norge'
        mock_site.api.return_value = {
            'query': {'pages': {'728': {}}}
        }
        page = Page(mock_site, title)

        assert page.exists is True

    @mock.patch('mwclient.client.Site')
    def test_pageprops(self, mock_site):
        # Check that variouse page props are read correctly from API response

        title = 'Some page'
        mock_site.api.return_value = {
            'query': {
                'pages': {
                    '728': {
                        'contentmodel': 'wikitext',
                        'counter': '',
                        'lastrevid': 13355471,
                        'length': 58487,
                        'ns': 0,
                        'pageid': 728,
                        'pagelanguage': 'nb',
                        'protection': [],
                        'title': title,
                        'touched': '2014-09-14T21:11:52Z'
                    }
                }
            }
        }
        page = Page(mock_site, title)

        assert page.exists is True
        assert page.redirect is False
        assert page.revision == 13355471
        assert page.length == 58487
        assert page.namespace == 0
        assert page.name == title
        assert page.page_title == title

    @mock.patch('mwclient.client.Site')
    def test_proection_levels(self, mock_site):
        # If page is protected, check that protection is parsed correctly

        title = 'Some page'
        mock_site.api.return_value = {
            'query': {
                'pages': {
                    '728': {
                        'protection': [
                            {
                                'expiry': 'infinity',
                                'level': 'autoconfirmed',
                                'type': 'edit'
                            },
                            {
                                'expiry': 'infinity',
                                'level': 'sysop',
                                'type': 'move'
                            }
                        ]
                    }
                }
            }
        }
        mock_site.rights = ['read', 'edit', 'move']

        page = Page(mock_site, title)

        assert page.protection == {'edit': ('autoconfirmed', 'infinity'), 'move': ('sysop', 'infinity')}
        assert page.can('read') is True
        assert page.can('edit') is False  # User does not have 'autoconfirmed' right
        assert page.can('move') is False  # User does not have 'sysop' right

        mock_site.rights = ['read', 'edit', 'move', 'autoconfirmed']

        assert page.can('edit') is True   # User has 'autoconfirmed'  right
        assert page.can('move') is False  # User doesn't have 'sysop'  right

        mock_site.rights = ['read', 'edit', 'move', 'autoconfirmed', 'editprotected']

        assert page.can('edit') is True  # User has 'autoconfirmed'  right
        assert page.can('move') is True  # User has 'sysop' right

    @mock.patch('mwclient.client.Site')
    def test_redirect(self, mock_site):
        # Check that page.redirect is set correctly

        title = 'Some redirect page'
        mock_site.api.return_value = {
            "query": {
                "pages": {
                    "796917": {
                        "contentmodel": "wikitext",
                        "counter": "",
                        "lastrevid": 9342494,
                        "length": 70,
                        "ns": 0,
                        "pageid": 796917,
                        "pagelanguage": "nb",
                        "protection": [],
                        "redirect": "",
                        "title": title,
                        "touched": "2014-08-29T22:25:15Z"
                    }
                }
            }
        }
        page = Page(mock_site, title)

        assert page.exists is True
        assert page.redirect is True

    @mock.patch('mwclient.client.Site')
    def test_captcha(self, mock_site):
        # Check that Captcha results in EditError
        mock_site.blocked = False
        mock_site.rights = ['read', 'edit']

        title = 'Norge'
        mock_site.api.return_value = {
            'query': {'pages': {'728': {'protection': []}}}
        }
        page = Page(mock_site, title)
        mock_site.api.return_value = {
            'edit': {'result': 'Failure', 'captcha': {
                'type': 'math',
                'mime': 'text/tex',
                'id': '509895952',
                'question': '36 + 4 = '
            }}
        }

        # For now, mwclient will just raise an EditError.
        # <https://github.com/mwclient/mwclient/issues/33>
        with pytest.raises(mwclient.errors.EditError):
            page.save('Some text')

class TestPageApiArgs(unittest.TestCase):

    def setUp(self):
        title = 'Some page'
        self.page_text = 'Hello world'

        MockSite = mock.patch('mwclient.client.Site').start()
        self.site = MockSite()

        self.site.api.return_value = {'query': {'pages': {'1': {'title': title}}}}
        self.site.rights = ['read']

        self.page = Page(self.site, title)

        self.site.api.return_value = {'query': {'pages': {'2': {
            'ns': 0, 'pageid': 2, 'revisions': [{'*': 'Hello world', 'timestamp': '2014-08-29T22:25:15Z'}], 'title': title
        }}}}

    def get_last_api_call_args(self):
        args, kwargs = self.site.api.call_args
        action = args[0]
        args = args[1:]
        kwargs.update(args)
        return kwargs

    def tearDown(self):
        mock.patch.stopall()

    def test_get_page_text(self):
        # Check that page.text() works, and that a correct API call is made
        text = self.page.text()
        args = self.get_last_api_call_args()

        assert text == self.page_text
        assert args == {
            'prop': 'revisions',
            'rvdir': 'older',
            'titles': self.page.page_title,
            'rvprop': 'content|timestamp',
            'rvlimit': '1'
        }

    def test_get_page_text_cached(self):
        # Check page.text() caching
        self.page.revisions = mock.Mock(return_value=iter([]))
        self.page.text()
        self.page.text()
        # When cache is hit, revisions is not, so call_count should be 1
        assert self.page.revisions.call_count == 1
        self.page.text(cache=False)
        # With cache explicitly disabled, we should hit revisions
        assert self.page.revisions.call_count == 2

    def test_get_section_text(self):
        # Check that the 'rvsection' parameter is sent to the API
        text = self.page.text(section=0)
        args = self.get_last_api_call_args()

        assert args['rvsection'] == '0'

    def test_get_text_expanded(self):
        # Check that the 'rvexpandtemplates' parameter is sent to the API
        text = self.page.text(expandtemplates=True)
        args = self.get_last_api_call_args()

        assert args['rvexpandtemplates'] == '1'

    def test_get_text_expanded_deprecated(self):
        # Check that the 'rvexpandtemplates' parameter is sent to the API
        text = self.page.get_expanded()
        args = self.get_last_api_call_args()

        assert args['rvexpandtemplates'] == '1'

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


text:
import argparse
import sys
from os import path

def parse():
    if not args["reparse"]:
        settings.use_filesystem_cache = False
    settings.unit_testing_mode = True

    c = CodeParser()

    if args["verbose"]:
        c.verbose = True

    if args["reparse"]:
        c.reparse(args["source"])
    else:
        c.parse(args["source"])

    #Since this is for unit testing, we will access the "private" variables.
    for fname in c._modulefiles:
        for moduledat in c._modulefiles[fname]:
            if args["verbose"]:
                print c.modules[moduledat]
            else:
                print moduledat

        for progdat in c._programfiles[fname]:
            if args["verbose"]:
                print c.programs[progdat]
            else:
                print progdat

#Create a parser so that the script can receive arguments
parser = argparse.ArgumentParser(description="Fortpy File Parsing Unit Testing Tool")

#Add arguments to decide which of the systems and penalties to process.
parser.add_argument("source", help="Specify the path to the source file to parse.")
parser.add_argument("-verbose", help="Sets whether the comparison output is verbose.", action="store_true")
parser.add_argument("-reparse", help="Overwrite the cached version of the module.", action="store_true")
parser.add_argument("-pypath", help="Specify a path to add to sys.path before running the tests.")

#Parse the args from the commandline that ran the script, call initialize
args = vars(parser.parse_args())

#We added this argument for debugging installations. That way we can make changes
#without doing a pip install each time; just put the path to the repo root in 'pypath'
if args["pypath"]:
    import sys
    sys.path.append(args["pypath"])

import fortpy
from fortpy.code import CodeParser
from fortpy import settings
from fortpy import msg

parse()


text: <title>tinycms example </title>


text:
package org.apache.flink.runtime.testutils;

import org.apache.flink.util.function.RunnableWithException;

/**
 * Enables to run code with a {@link SecurityManager}.
 */
public class SecurityManagerContext implements AutoCloseable {

	private final SecurityManager previousSecurityManager;

	public SecurityManagerContext(final SecurityManager newSecurityManager) {
		this.previousSecurityManager = System.getSecurityManager();
		System.setSecurityManager(newSecurityManager);
	}

	public static void runWithSecurityManager(final SecurityManager securityManager, final RunnableWithException runnable) {
		try (SecurityManagerContext ignored = new SecurityManagerContext(securityManager)) {
			try {
				runnable.run();
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
	}

	@Override
	public void close() {
		System.setSecurityManager(previousSecurityManager);
	}
}


text:
'use strict'

// import Vue from 'vue'
import { mount } from 'avoriaz'

import App from '@/App.vue'
import router from '@/router'
import conf from '@/config'
import SearchBar from '@/components/SearchBar.vue'

describe('App.vue', function () {
  it('should mount correctly', function () {
    const wrapper = mount(App, { router })
    expect(wrapper.vm.$route).to.be.a('object')
    expect(wrapper.vm.$children).not.to.be.empty
  })

  it('should render blog title', function () {
    const wrapper = mount(App, { router })
    const renderedTitle = wrapper.find('.header a')[0].text()
    expect(renderedTitle).to.equal(conf.blogTitle)
  })

  it('should render search bar in list page', async function () {
    const wrapper = await mount(App, { router })
    router.push('/')

    expect(wrapper.vm.isPageList).to.be.true
    expect(wrapper.contains(SearchBar)).to.be.true

    // wait for dom update
    wrapper.update()
    const expectHtml = `<input placeholder="Search.." type="search" class="searchbar-input">`
    expect(wrapper.find('.searchbar-input')[0].html()).to.equal(expectHtml)
  })

  it('should not render search bar in post page', async function () {
    const wrapper = await mount(App, { router })
    router.push('/post/d7266981ec507bc60b13b6f8585d449b26729039')

    expect(wrapper.vm.isPageList).to.be.false

    // wait for dom update
    wrapper.update()
    expect(wrapper.find('.searchbar-input')).to.be.empty
  })
})


text:
require('../paging');
require('../tabindex');
require('../../template/pager/pager.html.js');
require('./pager');

var MODULE_NAME = 'ui.bootstrap.module.pager';

angular.module(MODULE_NAME, ['ui.bootstrap.pager', 'uib/template/pager/pager.html']);

module.exports = MODULE_NAME;


text:
Copy common scripts to remote hosts

Copy common files in ``scripts`` directory in remote home directory.


text:
package org.jbehave.core.steps.spring;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.not;

import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.jbehave.core.annotations.Given;
import org.jbehave.core.configuration.MostUsefulConfiguration;
import org.jbehave.core.steps.CandidateSteps;
import org.jbehave.core.steps.Steps;
import org.jbehave.core.steps.spring.SpringStepsFactoryBehaviour.FooSteps;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;

class SpringStepsFactoryAOPBehaviour {

    @Test
    void aopEnvelopedStepsCanBeCreated() {
        // Given
        ApplicationContext context = createApplicationContext(StepsWithAOPAnnotationConfiguration.class
                .getName());
        SpringStepsFactory factory = new SpringStepsFactory(
                new MostUsefulConfiguration(), context);
        // When
        List<CandidateSteps> steps = factory.createCandidateSteps();
        // Then
        assertAOPFooStepsFound(steps);
    }

    private void assertAOPFooStepsFound(List<CandidateSteps> steps) {
        // // Only one returned, the IFooSteps will not be detected
        assertThat(steps.size(), equalTo(1));
        assertThat(steps, hasItem(isCandidateStepInstanceOf(FooSteps.class)));
        // Make it explicit that the steps bean with the annotation in the
        // interface is not provided
        assertThat(steps,
                not(hasItem(isCandidateStepInstanceOf(IFooSteps.class))));
    }

    private ApplicationContext createApplicationContext(String... resources) {
        return new SpringApplicationContextFactory(resources)
                .createApplicationContext();
    }

    @Configuration
    @EnableAspectJAutoProxy
    public static class StepsWithAOPAnnotationConfiguration {

        @Bean
        public FooAspect fooAspect() {
            return new FooAspect();
        }

        // JDK Proxy
        @Bean
        @Scope(proxyMode = ScopedProxyMode.INTERFACES)
        public SpringStepsFactoryAOPBehaviour.IFooSteps iFooSteps() {
            return new SpringStepsFactoryAOPBehaviour.FooStepsImpl();
        }

        // CGLIB-based
        @Bean
        @Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
        public SpringStepsFactoryBehaviour.FooSteps fooSteps() {
            return new SpringStepsFactoryBehaviour.FooSteps();
        }

    }

    @Aspect
    public static class FooAspect {
        public final AtomicInteger executions = new AtomicInteger(0);

        @Around(value = "bean(fooSteps) || bean(iFooSteps)")
        public Object around(ProceedingJoinPoint pjp) throws Throwable {
            try {
                return pjp.proceed();

            } finally {
                System.err.println("Accounted for "
                        + executions.incrementAndGet() + " executions");
            }
        }
    }

    public static interface IFooSteps {
        @Given("a step declared in an interface, with a $param")
        void aStepWithAParam(String param);
    }

    public static class FooStepsImpl implements IFooSteps {

        @Override
        public void aStepWithAParam(String param) {

        }

    }

    public static CandidateStepsInstanceOfMatcher isCandidateStepInstanceOf(
            Class<?> target) {
        return new CandidateStepsInstanceOfMatcher(target);
    }

    private static class CandidateStepsInstanceOfMatcher extends
            BaseMatcher<CandidateSteps> {

        private final Class<?> target;

        public CandidateStepsInstanceOfMatcher(Class<?> target) {
            this.target = target;
        }

        @Override
        public boolean matches(Object item) {
            if (item instanceof CandidateSteps) {
                Object instance = ((Steps) item).instance();
                return target.isAssignableFrom(instance.getClass());
            }
            return false;
        }

        @Override
        public void describeTo(Description description) {
            description
                    .appendText("Step class instantiated from this CandidateStep is of type "
                            + target.getName());
        }

    }
}


text:
- Correção do tratamento interno

# 2.0.6
- Ajuste arquivo de credenciais

# 2.0.5
- Correção do tratamento de responses

# 2.0.4

- Correção na função req

# 2.0.3

- Correção endpoint deletePlan

# 2.0.2

- Correção do exemplo: UpdateParcel
- Correção do exemplo: GetInstallments

# 2.0.1

- Melhoria do arquivo Credentials
- Adicionada a tratativa para o ValidadeMtls

# 2.0.0

- Adicionado os endpoints do Pix
- Novo modelo arquivo credentials
- Adição das funções do Pix na chamada principal da sdk
- Adicionada Autenticação PIX
- Substituição do request pelo axios
- Melhoria na leitura do certificado
- Atualização dos exemplos
- Nome das funções atualizadas e padronizadas

# 1.0.0

- Stable release

# 0.0.25

- Updated: package.json
- Added: new endpoint (one step)

# 0.0.24

- Updated: package.json

# 0.0.23

- Added: new endpoint (settle charge)
- Added: new endpoint (settle carnet parcel)

# 0.0.22

- Added: new endpoint (create charge balance sheet)

# 0.0.21

- Fix: dependencies

# 0.0.20

- Added: new endpoint (update plan)
- Added: new endpoint (create subscription history)

# 0.0.19
- Added: new endpoint (update charge link)

# 0.0.18
- Added: forward `partner-token` header

# 0.0.17
- Added: new endpoint (charge link)
- Updated: docs

# 0.0.16
- Added: new endpoint (cancel carnet)
- Added: new endpoint (cancel parcel)
- Updated: docs

# 0.0.15
- Added: new endpoint (carnet history)
- Added: new endpoint (carnet resend)
- Updated: docs

# 0.0.14
- Added: new endpoint (charge history)
- Added: custom header
- Updated: docs

# 0.0.13
- Added: new endpoint (resend billet)
- Updated: docs

# 0.0.12
- Updated: code examples
- Updated: docs

# 0.0.11

- Refactored: gn-auth - client credentials are now sent within the header
- Refactored: gn-constants/gn-endpoints/gn-sdk - each function now has two arguments: *params* and *body*.
              The *body* is meant to be sent in the request body as usual, whereas the *params* will be mapped to                url params as defined in gn-constants. If the param is not present in the url, it will be sent as a                query string
- Refactored: gn-endpoints - now Gerencianet endpoints are restfull, which means that the sdk must consider sending               also put and delete
- Updated: docs

# 0.0.10

- Updated: gn-constants - added new endpoints
- Refactored: gn-sdk - loop through gn-constants endpoints and create the prototype functions
- Updated: docs

# 0.0.9

- Updated: gn-sdk - added createPlan

# 0.0.8

- Updated: docs
- Updated: getPaymentMethods endpoint now is getPaymentData

# 0.0.7

- Updated: node modules dependencies

# 0.0.6

- Fixed: nock net connection issues

# 0.0.5

- Changed: Gerenciant's urls for production and sandbox
- Added: new endpoints (subscriptions, notifications)

# 0.0.1

- Initial release


text:
<!DOCTYPE html>

<meta charset="utf-8"/>
<title>历史数据</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>

<link href="__PUBLIC__/Style/assets/global/fonts/2.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" type="text/css" href="__PUBLIC__/Style/assets/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Style/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>

<link href="__PUBLIC__/Style/assets/global/css/components.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/global/css/plugins.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/admin/layout3/css/layout.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Style/assets/admin/layout3/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color">
<link href="__PUBLIC__/Style/assets/admin/layout3/css/custom.css" rel="stylesheet" type="text/css">

<link rel="shortcut icon" href="favicon.ico"/>

	<include file="./Application/Admin/View/Public/tpl/header.html" />

	<include file="./Application/Admin/View/Public/tpl/nav.html" />

历史数据历史数据列表信息

<include file="./Application/Admin/View/Public/tpl/settings.html" />

							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Modal title

							 Widget settings form goes here

							<button type="button" class="btn blue">Save changes</button>
							<button type="button" class="btn default" data-dismiss="modal">Close</button>

					Home

					Extra

					Data Tables

					 Managed Datatables

								历史杀死害虫数

									按天计算

									按月计算

									按年计算

									Dropdown

											Option 1

											Option 2

											Option 3

											Option 4

											<input type="checkbox" class="group-checkable" data-set="#sample_2 .checkboxes"/>

										编号	设备名称	日期	放电次数	杀死害虫数	拥有者

									<volist name="dayData" id="vo">

												<input type="checkbox" class="checkboxes" value="1"/>

											{$vo.deviceSN}	{$vo.deviceName}	{$vo.daychar}	{$vo.electricShockCount}	{$vo.bugCount}	{$users[$vo['UserId']]['realname']|default=""}

									</volist>

											<input type="checkbox" class="group-checkable" data-set="#sample_2_month .checkboxes"/>

										编号	设备名称	日期	放电次数	杀死害虫数	拥有者

									<volist name="monthData" id="vo">

												<input type="checkbox" class="checkboxes" value="1"/>

											{$vo.deviceSN}	{$vo.deviceName}	{$vo.monthchar}	{$vo.electricShockCount}	{$vo.bugCount}	{$users[$vo['UserId']]['realname']|default=""}

									</volist>

										 Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.

										 Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.

											<input type="checkbox" class="group-checkable" data-set="#sample_2_year .checkboxes"/>

										编号	设备名称	日期	放电次数	杀死害虫数	拥有者

									<volist name="yearData" id="vo">

												<input type="checkbox" class="checkboxes" value="1"/>

											{$vo.deviceSN}	{$vo.deviceName}	{$vo.year}	{$vo.electricShockCount}	{$vo.bugCount}	{$users[$vo['UserId']]['realname']|default=""}

									</volist>

								历史杀虫灯数据

									<input type="checkbox" class="group-checkable" data-set="#sample_2_2 .checkboxes"/>

								编号
								设备名称

									 开灯时间

								关灯时间

									 开灯时长

								放电次数
								杀死害虫数
								拥有者

							<volist name="lampData" id="vo">

									<input type="checkbox" class="checkboxes" value="1"/>

								{$vo.deviceSN}
								{$vo.deviceName}

									{$vo.lampOnTime}

									{$vo.lampOffTime}

								<?php echo intval(( strtotime($vo['lampOffTime'])-strtotime($vo['lampOnTime']) )/3600);?>小时
								{$vo.electricShockCount}
								{$vo.bugCount}
								{$users[$vo['UserId']]['realname']|default=""}

							</volist>

								历史放电次数据

									<input type="checkbox" class="group-checkable" data-set="#sample_2_1 .checkboxes"/>

								编号
								设备名称

									放电时间

								电压值

									 杀死害虫数

								拥有者

								<volist name="electricShockData" id="vo">

											<input type="checkbox" class="checkboxes" value="1"/>

										{$vo.deviceSN}

											{$vo.deviceName}

											{$vo.LogTime}

											{$vo.voltage}V

											{$vo.bugCount|default=1}

										{$users[$vo['UserId']]['realname']|default=""}

								</volist>

<include file="./Application/Admin/View/Public/tpl/footer.html" />


text:
<?php

/* TwigBundle:Exception:error.atom.twig */
class __TwigTemplate_1cb07d61dd8d709c6c58d74af8118a9aaf56d33972736eb2895b1521a9b63141 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        $this->env->loadTemplate("TwigBundle:Exception:error.xml.twig")->display($context);
    }

    public function getTemplateName()
    {
        return "TwigBundle:Exception:error.atom.twig";
    }

    public function getDebugInfo()
    {
        return array (  19 => 1,);
    }
}


text:
using Arduino4Net.Components.Leds;
using Arduino4Net.Interfaces;
using Arduino4Net.Models;
using Arduino4Net.Tests.Fakes;
using FakeItEasy;
using NUnit.Framework;
using Should;

namespace Arduino4Net.Tests.Components.Leds
{
    public class LedTests
    {
        private const int Pin = 13;
        private IArduino _arduino;
        private Led _led;
        private FakeTimer _timer;

        [SetUp]
        public void Setup()
        {
            _arduino = A.Fake<IArduino>();
            _timer = new FakeTimer();
            _led = new Led(_arduino, Pin, _timer);
        }

        [Test]
        public void Off_should_digitalwrite_low()
        {
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).DoesNothing();
            var ledState = LedState.On;
            _led.OnStateChanged = state => { ledState = state; };

            _led.Off();

            _led.State.ShouldEqual(LedState.Off);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).MustHaveHappened(Repeated.Exactly.Twice);
            ledState.ShouldEqual(LedState.Off);
        }

        [Test]
        public void On_should_digitalwrite_high()
        {
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).DoesNothing();
            var ledState = LedState.On;
            _led.OnStateChanged = state => { ledState = state; };

            _led.On();

            _led.State.ShouldEqual(LedState.On);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).MustHaveHappened(Repeated.Exactly.Once);
            ledState.ShouldEqual(LedState.On);
        }

        [Test]
        public void Toggle_should_toggle_LedState_and_digitalwrite()
        {
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).DoesNothing();
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).DoesNothing();
            _led.On();

            _led.Toggle();
            _led.State.ShouldEqual(LedState.Off);
            _led.Toggle();
            _led.State.ShouldEqual(LedState.On);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).MustHaveHappened(Repeated.Exactly.Twice);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).MustHaveHappened(Repeated.Exactly.Twice);
        }

        [Test]
        public void StrobeOn_should_start_timer()
        {
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).DoesNothing();
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).DoesNothing();
            _led.On();

            _led.StrobeOn();
            _led.State.ShouldEqual(LedState.Off);
            _timer.Tick();
            _led.State.ShouldEqual(LedState.On);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.High)).MustHaveHappened(Repeated.Exactly.Twice);
            A.CallTo(() => _arduino.DigitalWrite(Pin, DigitalPin.Low)).MustHaveHappened(Repeated.Exactly.Twice);
        }

        [Test]
        public void StrobeOff_should_stop_timer()
        {
            _led.StrobeOff();
            _timer.IsDisposed.ShouldEqual(true);
        }
    }
}


text:
@external .gwt-TabBarItem;
@external .gwt-TabBarItem-disabled;
@external .gwt-TabBarItem-selected;
@external .gwt-TabBarRest;
@external .gwt-TabPanelBottom;
@eval selectionColor com.google.gerrit.client.Gerrit.getTheme().selectionColor;

.row {
  white-space: nowrap;
}

.activeRow {
  background-color: selectionColor !important;
}

.activeRow .pointer {
  visibility: visible;
}

.pointer {
  display: inline-block;
  vertical-align: top;
  visibility: hidden;
}

.subject {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 355px;
}

.tabPanel .gwt-TabBarItem,
.tabPanel .gwt-TabBarItem-selected,
.tabPanel .gwt-TabBarRest {
  background: none repeat scroll 0 0 #FFF !important;
}

.tabPanel .gwt-TabPanelBottom {
  padding: 2px 0 0 0;
}

.tabPanel .gwt-TabBarItem-selected {
  border-bottom-color: #000 !important;
  color: #000 !important;
}

.tabPanel .gwt-TabBarItem-disabled {
  display: none;
}

.current,
.gitweb,
.indirect,
.notCurrent {
  display: inline-block;
  text-align: center;
  vertical-align: top;
  width: 12px;
}

.gitweb {
  color: #000;
}

.indirect {
  color: #090;      /* green */
  font-weight: bold;
}

.notCurrent {
  color: #FFA62F;   /* orange */
}


text:
var amqp = require('amqplib');

amqp.connect('amqp://localhost').then(function(conn) {
  process.once('SIGINT', function() { conn.close(); });
  return conn.createChannel().then(function(ch) {

    var ok = ch.assertQueue('hello', {durable: false});

    ok = ok.then(function(_qok) {
      return ch.consume('hello', function(msg) {
        console.log(" [x] Received '%s'", msg.content.toString());
      }, {noAck: true});
    });

    return ok.then(function(_consumeOk) {
      console.log(' [*] Waiting for messages. To exit press CTRL+C');
    });
  });
}).catch(console.warn);


text:
package com.rwxlicai.activity;

import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.loopj.android.http.RequestParams;
import com.rwxlicai.R;
import com.rwxlicai.base.RwxActivity;
import com.rwxlicai.net.NetCallBack;
import com.rwxlicai.net.RwxHttpClient;
import com.rwxlicai.net.RwxUrlFactory;
import com.rwxlicai.utils.DesEncrypt;
import com.rwxlicai.view.TitleBuilder;

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

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Created by xuebing on 16/1/16.
 */
public class User_ModifyPwdActivity extends RwxActivity {
    @InjectView(R.id.titlebar_iv_left)
    ImageView back;
    @InjectView(R.id.pwd)
    EditText pwd;
    @InjectView(R.id.new_pwd)
    EditText new_pwd;
    @InjectView(R.id.sure_pwd)
    EditText sure_pwd;
    @InjectView(R.id.next)
    Button next;

    @Override
    protected void initView() {
        setContentView(R.layout.user_modifypwd_activity);
        ButterKnife.inject(this);
        new TitleBuilder(this).setTitleText("修改登陆密码").setLeftImage(R.mipmap.top_view_back);
        next.setText("提交修改登陆密码");
    }

    @Override
    protected void initData() {

    }

    @OnClick({R.id.titlebar_iv_left, R.id.next})
    public void clickAction(View view) {
        switch (view.getId()) {
            case R.id.titlebar_iv_left:
                finish();
                break;
            case R.id.next:
                if (TextUtils.isEmpty(pwd.getText().toString())) {
                    showToast("请输旧密码!");
                    return;
                }
                if (TextUtils.isEmpty(new_pwd.getText().toString())) {
                    showToast("请输入新密码!");
                    return;
                }
                if (TextUtils.isEmpty(sure_pwd.getText().toString())) {
                    showToast("请输入确认密码!");
                    return;
                }
                hideKeyboard(view);
                updatePass();
                break;
            default:
                break;
        }
    }

    public void updatePass() {

        RequestParams params = new RequestParams();
        try {
            params.put("userOldPassword", DesEncrypt.DesUtil(pwd.getText().toString()));
            params.put("userPassword", DesEncrypt.DesUtil(new_pwd.getText().toString()));
            params.put("userPrePassword", DesEncrypt.DesUtil(sure_pwd.getText().toString()));
        } catch (Exception e) {
            e.printStackTrace();
        }
        RwxHttpClient.ClientTokenPost(User_ModifyPwdActivity.this, RwxUrlFactory.BASE_URL + RwxUrlFactory.updatePass, params, new NetCallBack(this) {
            @Override
            public void onMzbSuccess(String result) {
                try {
                    JSONObject obj = new JSONObject(result);

                    if (obj.getInt("code") == 0) {
                        showToast(obj.getString("message"));
                    } else {
                        showToast(obj.getString("message"));
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }

            @Override
            public void onMzbFailues(Throwable arg0) {
                Toast.makeText(context, "请确认网络连接!", Toast.LENGTH_LONG).show();
            }
        });
    }
}


text:
<?php

/**
 * Apply filters for dynamic embed data.
 * Called by js/wysiwyg/plugins/wysiwyg.embed.js
 */

$page->layout = false;
header ('Content-Type: application/json');

if (! User::require_admin ()) {
	echo json_encode ((object) array ('success' => false, 'error' => 'Must be logged in', 'data' => $_POST['data']));
	return;
}

list ($app, $extra) = explode ('/', $_POST['handler']);

$rules = parse_ini_file ('apps/' . $app . '/conf/embed.php', true);

if (! isset ($rules[$_POST['handler']])) {
	echo json_encode ((object) array ('success' => false, 'error' => 'No embed data', 'data' => $_POST['data']));
	return;
}

// apply filters
$out = array ();
foreach ($_POST['data'] as $key => $value) {
	if (! isset ($rules[$_POST['handler']][$key]['filter'])) {
		// no filter
		$out[$key] = $value;
	} else {
		if (isset ($rules[$_POST['handler']][$key]['require'])) {
			require_once ($rules[$_POST['handler']][$key]['require']);
		}
		$out[$key] = $rules[$_POST['handler']][$key]['filter'] ($value);
	}
}

echo json_encode ((object) array ('success' => true, 'data' => $out));

?>


text:
package android.text.style;

import android.graphics.Paint;
import android.graphics.Canvas;
import android.text.TextPaint;

public abstract class ReplacementSpan extends MetricAffectingSpan {

    public abstract int getSize(Paint paint, CharSequence text,
                         int start, int end,
                         Paint.FontMetricsInt fm);
    public abstract void draw(Canvas canvas, CharSequence text,
                     int start, int end, float x,
                     int top, int y, int bottom, Paint paint);

    /**
     * This method does nothing, since ReplacementSpans are measured
     * explicitly instead of affecting Paint properties.
     */
    public void updateMeasureState(TextPaint p) { }

    /**
     * This method does nothing, since ReplacementSpans are drawn
     * explicitly instead of affecting Paint properties.
     */
    public void updateDrawState(TextPaint ds) { }
}