text:
package org.eclipse.bpel.model.util;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import javax.xml.namespace.QName;

import org.eclipse.bpel.model.messageproperties.MessagepropertiesPackage;
import org.eclipse.bpel.model.messageproperties.Property;
import org.eclipse.bpel.model.partnerlinktype.PartnerLinkType;
import org.eclipse.bpel.model.partnerlinktype.PartnerlinktypePackage;
import org.eclipse.bpel.model.partnerlinktype.Role;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.Message;
import org.eclipse.wst.wsdl.Operation;
import org.eclipse.wst.wsdl.Part;
import org.eclipse.wst.wsdl.PortType;
import org.eclipse.wst.wsdl.Service;
import org.eclipse.wst.wsdl.Types;
import org.eclipse.wst.wsdl.WSDLPackage;
import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
import org.eclipse.wst.wsdl.internal.impl.ImportImpl;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDPackage;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.impl.XSDSchemaImpl;
import org.eclipse.xsd.util.XSDConstants;

/**
 * WSDLUtil supplies resolution (lookup) of various things that are useful in the BPEL
 * world.
 *
 */

public class WSDLUtil
{
	/** The WSDL Message attribute/name, most likely "message" */

    public static final String WSDL_MESSAGE = WSDLPackage.eINSTANCE.getMessage().getName();

    /** The WSDL Port Type attribute/name, most likely "portType" */
    public static final String WSDL_PORT_TYPE = WSDLPackage.eINSTANCE.getPortType().getName();

    /** The WSDL Operation attribute/name, most likely "operation" */
    public static final String WSDL_OPERATION = WSDLPackage.eINSTANCE.getOperation().getName();

    /** The WSDL Part attribute/name, most likely "part" */
    public static final String WSDL_PART = WSDLPackage.eINSTANCE.getPart().getName();

    /** The WSDL Service attribute/name, most likely "service" */
    public static final String WSDL_SERVICE = WSDLPackage.eINSTANCE.getService().getName();

    /** The XSD Type Definition attribute/name, most likely "type" */
    public static final String XSD_TYPE_DEFINITION = XSDPackage.eINSTANCE.getXSDTypeDefinition().getName();

    /** The XSD Element Declaration attribute/name, most likely "element" */
    public static final String XSD_ELEMENT_DECLARATION = XSDPackage.eINSTANCE.getXSDElementDeclaration().getName();

    /** The BPEL Partner Link Type attribute/name, most likely "partnerLinkType" */
    public static final String BPEL_PARTNER_LINK_TYPE = PartnerlinktypePackage.eINSTANCE.getPartnerLinkType().getName();

    /** The BPEL Role attribute/name, most likely "role" */
    public static final String BPEL_ROLE = PartnerlinktypePackage.eINSTANCE.getRole().getName();

    /** The BPEL Property attribute/name, most likely "property" */
    public static final String BPEL_PROPERTY = MessagepropertiesPackage.eINSTANCE.getProperty().getName();

    /** This should be a preference that can be easily turned on/off */
	private static boolean RESOLVING_DEEPLY = true;  // TODO: Preference based ?

    /**
     * Answer true if the type name passed is a WSDL thing.
     *
     * @param typeName
     * @return true if yes, false if no.
     */

    public static boolean isWSDLType(String typeName)
    {
        return typeName == null ? false :
            WSDL_MESSAGE.equals(typeName)
            || WSDL_PORT_TYPE.equals(typeName)
            || WSDL_OPERATION.equals(typeName)
            || WSDL_PART.equals(typeName)
            || WSDL_SERVICE.equals(typeName)
            || XSD_TYPE_DEFINITION.equals(typeName)
            || XSD_ELEMENT_DECLARATION.equals(typeName)
            || BPEL_PARTNER_LINK_TYPE.equals(typeName)
            || BPEL_ROLE.equals(typeName)
            || BPEL_PROPERTY.equals(typeName);
    }

    /**
     * Set to resolve deeply.
     * @param resolveDeeply
     */

    public static void setResolveDeeply ( boolean resolveDeeply ) {
    	RESOLVING_DEEPLY = resolveDeeply;
    }

    /**
     * Answer if resolving deeply.
     * @return answer true if resolving deeply, false otherwise.
     */

    public static boolean isResolvingDeeply () {
    	return RESOLVING_DEEPLY;
    }

    /**
     * Resolve with the given definition the QName given.
     * @param definition the definition to use.
     * @param qname the QName to resolve.
     * @param name
     * @param refType what to resolve (that things from WSDL that we can resolve).
     * @return  the EMF object that the QName resolves to.
     */

    public static EObject resolveWSDLReference(Definition definition, QName qname, String name, String refType)
    {
	    EObject resolvedObject = null;

	    if (WSDL_PORT_TYPE.equals(refType))  {
	        resolvedObject = resolvePortType(definition, qname);
	    } else if (WSDL_MESSAGE.equals(refType)) {
	        resolvedObject = resolveMessage(definition, qname);
	    } else if (WSDL_OPERATION.equals(refType))  {
	        resolvedObject = resolveOperation(definition, qname, name);
	    } else if (WSDL_PART.equals(refType)) {
	        resolvedObject = resolvePart(definition, qname, name);
	    } else if (WSDL_SERVICE.equals(refType)) {
            resolvedObject = resolveService(definition, qname);
        } else if (XSD_TYPE_DEFINITION.equals(refType)) {
	        resolvedObject = resolveXSDTypeDefinition(definition, qname);
	    } else if (XSD_ELEMENT_DECLARATION.equals(refType)) {
	        resolvedObject = resolveXSDElementDeclaration(definition, qname);
	    } else if (BPEL_PARTNER_LINK_TYPE.equals(refType)) {
	        resolvedObject = resolveBPELPartnerLinkType(definition, qname);
	    } else if (BPEL_ROLE.equals(refType)) {
            resolvedObject = resolveBPELRole(definition, qname, name);
        } else if (BPEL_PROPERTY.equals(refType)) {
	        resolvedObject = resolveBPELProperty(definition, qname);
	    } else {
	        System.err.println(WSDLUtil.class.getName() + ": unrecognized refType: " + refType); //$NON-NLS-1$
	    }

	    return resolvedObject;
    }

    /**
     * Use Java generics to write the "finders" of various elements, so that the general code
     * which does the lookups and follows imports does not need to be repeated.
     *
     * @author Michal Chmielewski (michal.chmielewski@oracle.com)
     * @date Feb 27, 2007
     *
     * @param <T> the type that we are looking up (PortType, Message, PartnerLinkType)
     */

    interface Finder<S,T> {
    	/**
    	 * Find the thing in the container
    	 *
    	 * @param source the source where to look (definition, schema)
    	 * @param qname the QName to lookup
    	 * @return the resolved entity, or null
    	 */
    	T find (S source, QName qname);
    }

    /** Generic way of looking up port types */
	static final Finder<Definition,PortType> PORT_TYPE_FINDER = new Finder<Definition, PortType>() {
		@Override
		public PortType find (Definition defn, QName qname) {
			return (PortType) defn.getPortType(qname) ;
		}
    };

    /** Generic way of looking up messages */
    static final Finder<Definition,Message> MESSAGE_FINDER = new Finder<Definition,Message> () {
    	@Override
		public Message find (Definition defn, QName qname) {
    		return (Message) defn.getMessage(qname);
    	}
    };

    /** Generic way of looking up partner link types */
    static final Finder<Definition,PartnerLinkType> PARTNER_LINK_TYPE_FINDER = new Finder<Definition,PartnerLinkType>() {

    	@Override
		public PartnerLinkType find (Definition defn, QName qname) {

    		if (defn.getTargetNamespace() == null)
    			return null;

	        if (defn.getTargetNamespace().equals(qname.getNamespaceURI()) == false) {
	        	return null;
	        }
	        Iterator<?> it = defn.getExtensibilityElements().iterator();
	        while (it.hasNext()) {
	        	Object e = it.next();
	        	if (e instanceof PartnerLinkType) {
	        		PartnerLinkType plt = (PartnerLinkType) e;
	                if (plt.getName().equals(qname.getLocalPart())) {
	                    return plt;
	                }
	        	}
	        }
	        return null;
    	}
    };

    /** Generic way of lookup up BPEL properties */
    static final Finder<Definition,Property> PROPERTY_FINDER = new Finder<Definition,Property>() {

		@Override
		public Property find(Definition defn, QName qname) {
	        if (defn.getTargetNamespace().equals(qname.getNamespaceURI()) == false) {
	        	return null;
	        }
	        Iterator<?> it = defn.getExtensibilityElements().iterator();
		    while (it.hasNext()) {
	            Object e = it.next();
	            if (e instanceof Property)  {
	                Property property = (Property) e;
	                if (property.getName().equals(qname.getLocalPart())) {
	                    return property;
	                }
	            }
	        }
		    return null;
		}
    };

    /** Type definition finder */
    static private final Finder<XSDSchema,XSDTypeDefinition> TYPE_DEFINITION_FINDER = new Finder<XSDSchema,XSDTypeDefinition>() {

		@Override
		public XSDTypeDefinition find(XSDSchema schema, QName typeName) {
	    	// Perhaps this is what we want ...
	    	//    http://www.eclipse.org/modeling/emf/faq/#dev20040602-1383194195
	    	//
	    	XSDTypeDefinition typeDef = schema.resolveTypeDefinition(typeName.getNamespaceURI(), typeName.getLocalPart());
	    	if (typeDef.getContainer() == null) {
	    		return null;
	    	}
	    	return typeDef;
		}
    };

    /** Element declaration finder */
    static private final Finder<XSDSchema,XSDElementDeclaration> ELEMENT_DECLARATION_FINDER = new Finder<XSDSchema,XSDElementDeclaration> () {

		@Override
		public XSDElementDeclaration find(XSDSchema schema, QName qn) {
	    	XSDElementDeclaration decl = schema.resolveElementDeclaration( qn.getNamespaceURI(), qn.getLocalPart());

	    	// TODO: (Hack)
	    	// Why has this started returning instances of XSDElementDeclrarion that are not proxies or null
	    	// if the element declaration is missing in the schema ?
	    	// Perhaps this is what we want: http://www.eclipse.org/modeling/emf/faq/#dev20040602-1383194195

	    	if (decl.getContainer() == null) {
	    		return null;
	    	}
	    	return decl;
		}
    };

    /**
     * Resolve the port type in the definition given.
     *
     * @param definition the WSDL definition
     * @param qname the QName of the portType
     * @return the resolved portType, or null
     */

    public static PortType resolvePortType (Definition definition, QName qname)
    {
    	return  resolveUsingFinder ( definition, qname, PORT_TYPE_FINDER, new HashSet<Definition>() );
    }

    /**
     * Resolve using finder resolves the QName in the definitions passed. The return object
     * extends from EObject (so PortType, Message, PartnerLinkType, etc). The finder has the actual lookup
     * code while the general code flow that deals with following the imports is shared among the lookup
     * methods in this class.
     *
     * @param <T> the type
     * @param defn the definition to use as the lookup
     * @param qname the QName to lookup
     * @param finder the finder to use.
     * @param seen the seen set
     * @return the object to be resolved.
     */

    @SuppressWarnings("restriction")
	static <T extends EObject> T resolveUsingFinder ( Definition defn, QName qname, Finder<Definition,T> finder , Set<Definition> seen) {

    	if (seen.contains(defn)) {
    		return null;
    	}
    	seen.add(defn);

    	T result = finder.find ( defn, qname );

    	if (result != null || RESOLVING_DEEPLY == false) {
    		return result;
    	}

    	Iterator<?> it = defn.getImports(qname.getNamespaceURI()).iterator();
    	while (it.hasNext() && result == null) {
             ImportImpl imp = (ImportImpl) it.next();
             imp.importDefinitionOrSchema();
             Definition importedDefinition = (Definition) imp.getDefinition();
             if (importedDefinition != null) {
                 result = resolveUsingFinder (importedDefinition, qname, finder, seen );
             }
        }
    	return result;
    }

    /**
     * Resolve the message name in the definitions passed.
     * @param definition the definitions
     * @param qname the message name
     * @return the message name or null
     */

    public static Message resolveMessage(Definition definition, QName qname)
    {
    	return resolveUsingFinder(definition, qname, MESSAGE_FINDER, new HashSet<Definition>());
    }

    /**
     * Resolve operation within a portType. First lookup portType, then find the operation by name given.
     * @param definition the definition to search
     * @param portTypeQName QName of the portType to lookup operation on
     * @param operationName the operation name.
     * @return the operation or null
     */

    public static Operation resolveOperation(Definition definition, QName portTypeQName, String operationName)
    {
        PortType portType = resolvePortType(definition, portTypeQName);
        return findOperation(portType, operationName);
    }

    /**
     * Resolve the part within a message.
     * @param definition the definition to use
     * @param qname QName of the message
     * @param name the name of the message part.
     * @return the part, or null
     */

    public static Part resolvePart(Definition definition, QName qname, String name)
    {
        return findPart( resolveMessage(definition, qname) , name );
    }

    /**
     * Resolve (lookup) a partner link type in the definitions given.
     * @param defn the definitions to use
     * @param qname the QName to lookup
     * @return the partner link type or null
     */

    public static PartnerLinkType resolveBPELPartnerLinkType(Definition defn, QName qname)
    {
    	return resolveUsingFinder(defn, qname, PARTNER_LINK_TYPE_FINDER, new HashSet<Definition>() );
    }

    /**
     * Resolve BPEL Role on the partner link specified.
     *
     * @param definition the definition to use
     * @param qname QNAme of the partner link type
     * @param name the name of the role on that partner link type
     * @return the BPEL role, or null
     */

    public static EObject resolveBPELRole(Definition definition, QName qname, String name)
    {
        return findRole (  resolveBPELPartnerLinkType(definition, qname) , name );
    }

    /**
     * Lookup the BPEL property in the definition given.
     *
     * @param defn the definition
     * @param qname the property QName to lookup
     * @return the property or null
     */

    public static Property resolveBPELProperty(Definition defn, QName qname)
    {
    	return resolveUsingFinder(defn, qname, PROPERTY_FINDER, new HashSet<Definition>());
    }

    private static Service resolveService(Definition definition, QName qname) {
        return (Service) definition.getService(qname);
    }

    /**
     * Common code for resolving XSDTypeDefinitions and XSDElementDeclarations
     */
    @SuppressWarnings("restriction")
	static <T> T resolveXSD (Definition definition, QName qname, Finder<XSDSchema,T> finder, Set<Definition> seen )
    {
        T result = null;

        if (seen.contains(definition)) {
        	return result;
        }
        seen.add(definition);

        // Check for built-in types
        // TODO Slightly inefficient to evaluate this when recursing

        XSDSchema schema = null;
        String namespace = qname.getNamespaceURI();

        if ("".equals(namespace)) { //$NON-NLS-1$
            namespace = null;
        }

        if (XSDConstants.isSchemaForSchemaNamespace(namespace)) {
            schema = XSDSchemaImpl.getSchemaForSchema(namespace);
        } else if (XSDConstants.isSchemaInstanceNamespace(namespace)) {
            schema = XSDSchemaImpl.getSchemaInstance(namespace);
        }
        if (schema != null) {
            result = finder.find(schema, qname);
            if (result != null) {
                return result;
            }
        }

        // Check in-line schema
        Types types = definition.getETypes();
        if (types != null) {
        	Iterator<?> it = types.getExtensibilityElements().iterator();
        	while (it.hasNext()) {
                Object e = it.next();
                if (e instanceof XSDSchemaExtensibilityElement == false) {
                	continue;
                }
                XSDSchemaExtensibilityElement schemaEE = (XSDSchemaExtensibilityElement) e;
                schema = schemaEE.getSchema();
                if (schema != null) {
                    result = finder.find(schema, qname);
                    if (result != null)
                        return result;
                }
            }
        }

        /**
          * Check imported schemas and definitions.
          * If we are here, then result is still null
          */

        // TODO: I think I need to check all imports, not just those
        // matching the same namespace...

        Iterator<?> it = definition.getImports(qname.getNamespaceURI()).iterator();
        while (it.hasNext()) {
            ImportImpl imp = (ImportImpl) it.next();
            imp.importDefinitionOrSchema();
            schema = imp.getESchema();
            if (schema != null) {
                result = finder.find(schema, qname);
                if (result != null)
                    return result;
            }
            Definition importedDefinition = imp.getEDefinition();
            if (importedDefinition != null) {
                result = resolveXSD(importedDefinition, qname, finder, seen );
                if (result != null) {
                    return result;
                }
            }
        }
        return result;
    }

    /**
     * Resolve type definition. Basically lookup type by QName.
     *
     * @param definition
     * @param qname
     * @return the XSDTypeDefinition found or null if it does not exist.
     */

    public static XSDTypeDefinition resolveXSDTypeDefinition(Definition definition, QName qname)
    {
        return resolveXSD(definition, qname ,TYPE_DEFINITION_FINDER, new HashSet<Definition>() );
    }

    /**
     * Resolve the XSDElement declaration in this definition. Basically, lookup element declaration using the
     * QName specified in the definition indicated.
     *
     * @param definition
     * @param qname
     * @return the XSDElement declaration if found. null otherwise.
     */

    public static XSDElementDeclaration resolveXSDElementDeclaration(Definition definition, QName qname)
    {
        return resolveXSD(definition, qname, ELEMENT_DECLARATION_FINDER, new HashSet<Definition>() );
    }

    /**
     * Find a role in the partner link type.
     * @param plt the partner link type
     * @param name the role name to find.
     * @return the found role or null if it does not exist.
     */
	public static Role findRole ( PartnerLinkType plt, String name ) {

    	if (plt != null) {
    		Iterator<Role> it = plt.getRole().iterator();
    		while (it.hasNext()) {
    			Role role = it.next();
    			if (name.equals(role.getName())) {
	                return role;
	            }
    		}
    	}
    	return null;
    }

    /**
     * Find the operation in the port type.
     * @param portType the port type
     * @param operationName the operation name
     * @return return the operation in the port type or null
     */

    @SuppressWarnings("unchecked")
	public static Operation findOperation (PortType portType, String operationName) {
        if (portType != null) {
        	Iterator<Operation> it = portType.getOperations().iterator();
        	while (it.hasNext()) {
                Operation operation = it.next();
                if (operation.getName().equals(operationName)) {
                    return operation;
                }
            }
        }
        return null;
    }

	/**
	 * Find the message part in the message structure.
	 * @param message
	 * @param name
	 * @return the part or null
	 */
	public static Part findPart(Message message, String name) {
		Part result = null;
        if (message != null) {
            result = (Part) message.getPart(name);
        }
	    return result;
	}
}


text:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This change log follows the conventions of
[keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased]

[Unreleased]: https://github.com/rxedu/tensorflow-tutorials/compare/v0.0.0...HEAD

redpajama_set_name: RedPajamaGithub


text:
"""Contrib recurrent neural network module."""

from . import basic_layers

from .basic_layers import *

__all__ = basic_layers.__all__


text:
package missinggo

// todo move to httptoo as ResponseRecorder

import (
	"bufio"
	"net"
	"net/http"
	"time"
)

// A http.ResponseWriter that tracks the status of the response. The status
// code, and number of bytes written for example.
type StatusResponseWriter struct {
	http.ResponseWriter
	Code            int
	BytesWritten    int64
	Started         time.Time
	TimeToFirstByte time.Duration // Time to first byte
	GotFirstByte    bool
	WroteHeader     Event
	Hijacked        bool
}

var _ interface {
	http.ResponseWriter
	http.Hijacker
} = (*StatusResponseWriter)(nil)

func (me *StatusResponseWriter) Write(b []byte) (n int, err error) {
	// Exactly how it's done in the standard library. This ensures Code is
	// correct.
	if !me.WroteHeader.IsSet() {
		me.WriteHeader(http.StatusOK)
	}
	if me.Started.IsZero() {
		panic("Started was not initialized")
	}
	timeBeforeWrite := time.Now()
	n, err = me.ResponseWriter.Write(b)
	if n > 0 && !me.GotFirstByte {
		me.TimeToFirstByte = timeBeforeWrite.Sub(me.Started)
		me.GotFirstByte = true
	}
	me.BytesWritten += int64(n)
	return
}

func (me *StatusResponseWriter) WriteHeader(code int) {
	me.ResponseWriter.WriteHeader(code)
	if !me.WroteHeader.IsSet() {
		me.Code = code
		me.WroteHeader.Set()
	}
}

func (me *StatusResponseWriter) Hijack() (c net.Conn, b *bufio.ReadWriter, err error) {
	me.Hijacked = true
	c, b, err = me.ResponseWriter.(http.Hijacker).Hijack()
	if b.Writer.Buffered() != 0 {
		panic("unexpected buffered writes")
	}
	c = responseConn{c, me}
	return
}

type responseConn struct {
	net.Conn
	s *StatusResponseWriter
}

func (me responseConn) Write(b []byte) (n int, err error) {
	n, err = me.Conn.Write(b)
	me.s.BytesWritten += int64(n)
	return
}


text:
class Window
  include Mixin::SurfaceMicro
end


text:
/**
 * SECTION:gstpbutilsmissingplugins
 * @title: Missing plugins
 * @short_description: Create, recognise and parse missing-plugins messages
 *
 * Functions to create, recognise and parse missing-plugins messages for
 * applications and elements.
 *
 * Missing-plugin messages are posted on the bus by elements like decodebin
 * or playbin if they can't find an appropriate source element or decoder
 * element. The application can use these messages for two things:
 *
 *   * concise error/problem reporting to the user mentioning what exactly
 *     is missing, see gst_missing_plugin_message_get_description()
 *
 *   * initiate installation of missing plugins, see
 *     gst_missing_plugin_message_get_installer_detail() and
 *     gst_install_plugins_async()
 *
 * Applications may also create missing-plugin messages themselves to install
 * required elements that are missing, using the install mechanism mentioned
 * above.
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>            /* getpid on UNIX */
#endif
#ifdef HAVE_PROCESS_H
# include <process.h>           /* getpid on win32 */
#endif

#include "gst/gst-i18n-plugin.h"

#include "pbutils.h"
#include "pbutils-private.h"

#include <string.h>

#define GST_DETAIL_STRING_MARKER "gstreamer"

typedef enum
{
  GST_MISSING_TYPE_UNKNOWN = 0,
  GST_MISSING_TYPE_URISOURCE,
  GST_MISSING_TYPE_URISINK,
  GST_MISSING_TYPE_ELEMENT,
  GST_MISSING_TYPE_DECODER,
  GST_MISSING_TYPE_ENCODER
} GstMissingType;

static const struct
{
  GstMissingType type;
  const gchar type_string[12];
} missing_type_mapping[] = {
  {
  GST_MISSING_TYPE_URISOURCE, "urisource"}, {
  GST_MISSING_TYPE_URISINK, "urisink"}, {
  GST_MISSING_TYPE_ELEMENT, "element"}, {
  GST_MISSING_TYPE_DECODER, "decoder"}, {
  GST_MISSING_TYPE_ENCODER, "encoder"}
};

static GstMissingType
missing_structure_get_type (const GstStructure * s)
{
  const gchar *type;
  guint i;

  type = gst_structure_get_string (s, "type");
  g_return_val_if_fail (type != NULL, GST_MISSING_TYPE_UNKNOWN);

  for (i = 0; i < G_N_ELEMENTS (missing_type_mapping); ++i) {
    if (strcmp (missing_type_mapping[i].type_string, type) == 0)
      return missing_type_mapping[i].type;
  }

  return GST_MISSING_TYPE_UNKNOWN;
}

GstCaps *
copy_and_clean_caps (const GstCaps * caps)
{
  GstStructure *s;
  GstCaps *ret;

  ret = gst_caps_copy (caps);

  /* make caps easier to interpret, remove common fields that are likely
   * to be irrelevant for determining the right plugin (ie. mostly fields
   * where template caps usually have the standard MIN - MAX range as value) */
  s = gst_caps_get_structure (ret, 0);
  gst_structure_remove_field (s, "codec_data");
  gst_structure_remove_field (s, "streamheader");
  gst_structure_remove_field (s, "palette_data");
  gst_structure_remove_field (s, "pixel-aspect-ratio");
  gst_structure_remove_field (s, "framerate");
  gst_structure_remove_field (s, "leaf_size");
  gst_structure_remove_field (s, "packet_size");
  gst_structure_remove_field (s, "block_align");
  gst_structure_remove_field (s, "metadata-interval");  /* icy caps */
  /* decoders/encoders almost always handle the usual width/height/channel/rate
   * range (and if we don't remove this then the app will have a much harder
   * time blacklisting formats it has unsuccessfully tried to install before) */
  gst_structure_remove_field (s, "width");
  gst_structure_remove_field (s, "depth");
  gst_structure_remove_field (s, "height");
  gst_structure_remove_field (s, "channels");
  gst_structure_remove_field (s, "rate");
  /* parsed, framed, stream-format and alignment are going to be handled by
   * parsers and not relevant for decoders/encoders usually */
  gst_structure_remove_field (s, "parsed");
  gst_structure_remove_field (s, "framed");
  gst_structure_remove_field (s, "stream-format");
  gst_structure_remove_field (s, "alignment");
  /* rtp fields */
  gst_structure_remove_field (s, "config");
  gst_structure_remove_field (s, "clock-rate");
  gst_structure_remove_field (s, "timestamp-offset");
  gst_structure_remove_field (s, "maxps");
  gst_structure_remove_field (s, "seqnum-offset");
  gst_structure_remove_field (s, "npt-start");
  gst_structure_remove_field (s, "npt-stop");
  gst_structure_remove_field (s, "play-speed");
  gst_structure_remove_field (s, "play-scale");
  gst_structure_remove_field (s, "dynamic_range");

  return ret;
}

/**
 * gst_missing_uri_source_message_new:
 * @element: the #GstElement posting the message
 * @protocol: the URI protocol the missing source needs to implement,
 *            e.g. "http" or "mms"
 *
 * Creates a missing-plugin message for @element to notify the application
 * that a source element for a particular URI protocol is missing. This
 * function is mainly for use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_uri_source_message_new (GstElement * element,
    const gchar * protocol)
{
  GstStructure *s;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (protocol != NULL, NULL);

  description = gst_pb_utils_get_source_description (protocol);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "urisource", "detail", G_TYPE_STRING, protocol, "name", G_TYPE_STRING,
      description, NULL);

  g_free (description);
  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}

/**
 * gst_missing_uri_sink_message_new:
 * @element: the #GstElement posting the message
 * @protocol: the URI protocol the missing sink needs to implement,
 *            e.g. "http" or "smb"
 *
 * Creates a missing-plugin message for @element to notify the application
 * that a sink element for a particular URI protocol is missing. This
 * function is mainly for use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_uri_sink_message_new (GstElement * element, const gchar * protocol)
{
  GstStructure *s;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (protocol != NULL, NULL);

  description = gst_pb_utils_get_sink_description (protocol);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "urisink", "detail", G_TYPE_STRING, protocol, "name", G_TYPE_STRING,
      description, NULL);

  g_free (description);
  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}

/**
 * gst_missing_element_message_new:
 * @element: the #GstElement posting the message
 * @factory_name: the name of the missing element (element factory),
 *            e.g. "videoscale" or "cdparanoiasrc"
 *
 * Creates a missing-plugin message for @element to notify the application
 * that a certain required element is missing. This function is mainly for
 * use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_element_message_new (GstElement * element,
    const gchar * factory_name)
{
  GstStructure *s;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (factory_name != NULL, NULL);

  description = gst_pb_utils_get_element_description (factory_name);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "element", "detail", G_TYPE_STRING, factory_name, "name", G_TYPE_STRING,
      description, NULL);

  g_free (description);
  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}

/**
 * gst_missing_decoder_message_new:
 * @element: the #GstElement posting the message
 * @decode_caps: the (fixed) caps for which a decoder element is needed
 *
 * Creates a missing-plugin message for @element to notify the application
 * that a decoder element for a particular set of (fixed) caps is missing.
 * This function is mainly for use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_decoder_message_new (GstElement * element,
    const GstCaps * decode_caps)
{
  GstStructure *s;
  GstCaps *caps;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (decode_caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (decode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_any (decode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_empty (decode_caps), NULL);
  g_return_val_if_fail (gst_caps_is_fixed (decode_caps), NULL);

  description = gst_pb_utils_get_decoder_description (decode_caps);
  caps = copy_and_clean_caps (decode_caps);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "decoder", "detail", GST_TYPE_CAPS, caps, "name", G_TYPE_STRING,
      description, NULL);

  gst_caps_unref (caps);
  g_free (description);

  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}

/**
 * gst_missing_encoder_message_new:
 * @element: the #GstElement posting the message
 * @encode_caps: the (fixed) caps for which an encoder element is needed
 *
 * Creates a missing-plugin message for @element to notify the application
 * that an encoder element for a particular set of (fixed) caps is missing.
 * This function is mainly for use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_encoder_message_new (GstElement * element,
    const GstCaps * encode_caps)
{
  GstStructure *s;
  GstCaps *caps;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (encode_caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_any (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_empty (encode_caps), NULL);
  g_return_val_if_fail (gst_caps_is_fixed (encode_caps), NULL);

  description = gst_pb_utils_get_encoder_description (encode_caps);
  caps = copy_and_clean_caps (encode_caps);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "encoder", "detail", GST_TYPE_CAPS, caps, "name", G_TYPE_STRING,
      description, NULL);

  gst_caps_unref (caps);
  g_free (description);

  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}

static gboolean
missing_structure_get_string_detail (const GstStructure * s, gchar ** p_detail)
{
  const gchar *detail;
  GType detail_type;

  *p_detail = NULL;

  detail_type = gst_structure_get_field_type (s, "detail");
  if (!g_type_is_a (detail_type, G_TYPE_STRING)) {
    GST_WARNING ("expected 'detail' field to be of G_TYPE_STRING");
    return FALSE;
  }

  detail = gst_structure_get_string (s, "detail");
  if (detail == NULL || *detail == '\0') {
    GST_WARNING ("empty 'detail' field");
    return FALSE;
  }
  *p_detail = g_strdup (detail);
  return TRUE;
}

static gboolean
missing_structure_get_caps_detail (const GstStructure * s, GstCaps ** p_caps)
{
  const GstCaps *caps;
  const GValue *val;
  GType detail_type;

  *p_caps = NULL;

  detail_type = gst_structure_get_field_type (s, "detail");
  if (!g_type_is_a (detail_type, GST_TYPE_CAPS)) {
    GST_WARNING ("expected 'detail' field to be of GST_TYPE_CAPS");
    return FALSE;
  }

  val = gst_structure_get_value (s, "detail");
  caps = gst_value_get_caps (val);
  if (gst_caps_is_empty (caps) || gst_caps_is_any (caps)) {
    GST_WARNING ("EMPTY or ANY caps not allowed");
    return FALSE;
  }

  *p_caps = gst_caps_copy (caps);
  return TRUE;
}

/**
 * gst_missing_plugin_message_get_installer_detail:
 * @msg: a missing-plugin #GstMessage of type #GST_MESSAGE_ELEMENT
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_plugin_message_get_installer_detail (GstMessage * msg)
{
  GstMissingType missing_type;
  const gchar *progname;
  const gchar *type;
  GString *str = NULL;
  gchar *detail = NULL;
  gchar *desc;
  const GstStructure *structure;

  g_return_val_if_fail (gst_is_missing_plugin_message (msg), NULL);

  structure = gst_message_get_structure (msg);
  GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, structure);

  missing_type = missing_structure_get_type (structure);
  if (missing_type == GST_MISSING_TYPE_UNKNOWN) {
    GST_WARNING ("couldn't parse 'type' field");
    goto error;
  }

  type = gst_structure_get_string (structure, "type");
  g_assert (type != NULL);      /* validity already checked above */

  /* FIXME: use gst_installer_detail_new() here too */
  str = g_string_new (GST_DETAIL_STRING_MARKER "|");
  g_string_append_printf (str, "%s|", GST_API_VERSION);

  progname = (const gchar *) g_get_prgname ();
  if (progname) {
    g_string_append_printf (str, "%s|", progname);
  } else {
    g_string_append_printf (str, "pid/%lu|", (gulong) getpid ());
  }

  desc = gst_missing_plugin_message_get_description (msg);
  if (desc) {
    g_strdelimit (desc, "|", '#');
    g_string_append_printf (str, "%s|", desc);
    g_free (desc);
  } else {
    g_string_append (str, "|");
  }

  switch (missing_type) {
    case GST_MISSING_TYPE_URISOURCE:
    case GST_MISSING_TYPE_URISINK:
    case GST_MISSING_TYPE_ELEMENT:
      if (!missing_structure_get_string_detail (structure, &detail))
        goto error;
      break;
    case GST_MISSING_TYPE_DECODER:
    case GST_MISSING_TYPE_ENCODER:{
      GstCaps *caps = NULL;

      if (!missing_structure_get_caps_detail (structure, &caps))
        goto error;

      detail = gst_caps_to_string (caps);
      gst_caps_unref (caps);
      break;
    }
    default:
      g_return_val_if_reached (NULL);
  }

  g_string_append_printf (str, "%s-%s", type, detail);
  g_free (detail);

  return g_string_free (str, FALSE);

/* ERRORS */
error:
  {
    GST_WARNING ("Failed to parse missing-plugin msg: %" GST_PTR_FORMAT, msg);
    if (str)
      g_string_free (str, TRUE);
    return NULL;
  }
}

/**
 * gst_missing_plugin_message_get_description:
 * @msg: a missing-plugin #GstMessage of type #GST_MESSAGE_ELEMENT
 *
 * Returns a localised string describing the missing feature, for use in
 * error dialogs and the like. Should never return NULL unless @msg is not
 * a valid missing-plugin message.
 *
 * This function is mainly for applications that need a human-readable string
 * describing a missing plugin, given a previously collected missing-plugin
 * message
 *
 * Returns: a newly-allocated description string, or NULL on error. Free
 *          string with g_free() when not needed any longer.
 */
gchar *
gst_missing_plugin_message_get_description (GstMessage * msg)
{
  GstMissingType missing_type;
  const gchar *desc;
  gchar *ret = NULL;
  const GstStructure *structure;

  g_return_val_if_fail (gst_is_missing_plugin_message (msg), NULL);

  structure = gst_message_get_structure (msg);
  GST_LOG ("Parsing missing-plugin message: %" GST_PTR_FORMAT, structure);

  desc = gst_structure_get_string (structure, "name");
  if (desc != NULL && *desc != '\0') {
    ret = g_strdup (desc);
    goto done;
  }

  /* fallback #1 */
  missing_type = missing_structure_get_type (structure);

  switch (missing_type) {
    case GST_MISSING_TYPE_URISOURCE:
    case GST_MISSING_TYPE_URISINK:
    case GST_MISSING_TYPE_ELEMENT:{
      gchar *detail = NULL;

      if (missing_structure_get_string_detail (structure, &detail)) {
        if (missing_type == GST_MISSING_TYPE_URISOURCE)
          ret = gst_pb_utils_get_source_description (detail);
        else if (missing_type == GST_MISSING_TYPE_URISINK)
          ret = gst_pb_utils_get_sink_description (detail);
        else
          ret = gst_pb_utils_get_element_description (detail);
        g_free (detail);
      }
      break;
    }
    case GST_MISSING_TYPE_DECODER:
    case GST_MISSING_TYPE_ENCODER:{
      GstCaps *caps = NULL;

      if (missing_structure_get_caps_detail (structure, &caps)) {
        if (missing_type == GST_MISSING_TYPE_DECODER)
          ret = gst_pb_utils_get_decoder_description (caps);
        else
          ret = gst_pb_utils_get_encoder_description (caps);
        gst_caps_unref (caps);
      }
      break;
    }
    default:
      break;
  }

  if (ret)
    goto done;

  /* fallback #2 */
  switch (missing_type) {
    case GST_MISSING_TYPE_URISOURCE:
      desc = _("Unknown source element");
      break;
    case GST_MISSING_TYPE_URISINK:
      desc = _("Unknown sink element");
      break;
    case GST_MISSING_TYPE_ELEMENT:
      desc = _("Unknown element");
      break;
    case GST_MISSING_TYPE_DECODER:
      desc = _("Unknown decoder element");
      break;
    case GST_MISSING_TYPE_ENCODER:
      desc = _("Unknown encoder element");
      break;
    default:
      /* we should really never get here, but we better still return
       * something if we do */
      desc = _("Plugin or element of unknown type");
      break;
  }
  ret = g_strdup (desc);

done:

  GST_LOG ("returning '%s'", ret);
  return ret;
}

/**
 * gst_is_missing_plugin_message:
 * @msg: a #GstMessage
 *
 * Checks whether @msg is a missing plugins message.
 *
 * Returns: %TRUE if @msg is a missing-plugins message, otherwise %FALSE.
 */
gboolean
gst_is_missing_plugin_message (GstMessage * msg)
{
  const GstStructure *structure;

  g_return_val_if_fail (msg != NULL, FALSE);
  g_return_val_if_fail (GST_IS_MESSAGE (msg), FALSE);

  structure = gst_message_get_structure (msg);
  if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT || structure == NULL)
    return FALSE;

  return gst_structure_has_name (structure, "missing-plugin");
}

/* takes ownership of the description */
static gchar *
gst_installer_detail_new (gchar * description, const gchar * type,
    const gchar * detail)
{
  const gchar *progname;
  GString *s;

  s = g_string_new (GST_DETAIL_STRING_MARKER "|");
  g_string_append_printf (s, "%s|", GST_API_VERSION);

  progname = (const gchar *) g_get_prgname ();
  if (progname) {
    g_string_append_printf (s, "%s|", progname);
  } else {
    g_string_append_printf (s, "pid/%lu|", (gulong) getpid ());
  }

  if (description) {
    g_strdelimit (description, "|", '#');
    g_string_append_printf (s, "%s|", description);
    g_free (description);
  } else {
    g_string_append (s, "|");
  }

  g_string_append_printf (s, "%s-%s", type, detail);

  return g_string_free (s, FALSE);
}

/**
 * gst_missing_uri_source_installer_detail_new:
 * @protocol: the URI protocol the missing source needs to implement,
 *            e.g. "http" or "mms"
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions in
 * the case where the application knows exactly what kind of plugin it is
 * missing.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_uri_source_installer_detail_new (const gchar * protocol)
{
  gchar *desc;

  g_return_val_if_fail (protocol != NULL, NULL);

  desc = gst_pb_utils_get_source_description (protocol);
  return gst_installer_detail_new (desc, "urisource", protocol);
}

/**
 * gst_missing_uri_sink_installer_detail_new:
 * @protocol: the URI protocol the missing source needs to implement,
 *            e.g. "http" or "mms"
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions in
 * the case where the application knows exactly what kind of plugin it is
 * missing.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_uri_sink_installer_detail_new (const gchar * protocol)
{
  gchar *desc;

  g_return_val_if_fail (protocol != NULL, NULL);

  desc = gst_pb_utils_get_sink_description (protocol);
  return gst_installer_detail_new (desc, "urisink", protocol);
}

/**
 * gst_missing_element_installer_detail_new:
 * @factory_name: the name of the missing element (element factory),
 *            e.g. "videoscale" or "cdparanoiasrc"
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions in
 * the case where the application knows exactly what kind of plugin it is
 * missing.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_element_installer_detail_new (const gchar * factory_name)
{
  gchar *desc;

  g_return_val_if_fail (factory_name != NULL, NULL);

  desc = gst_pb_utils_get_element_description (factory_name);
  return gst_installer_detail_new (desc, "element", factory_name);
}

/**
 * gst_missing_decoder_installer_detail_new:
 * @decode_caps: the (fixed) caps for which a decoder element is needed
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions in
 * the case where the application knows exactly what kind of plugin it is
 * missing.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_decoder_installer_detail_new (const GstCaps * decode_caps)
{
  GstCaps *caps;
  gchar *detail_str, *caps_str, *desc;

  g_return_val_if_fail (decode_caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (decode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_any (decode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_empty (decode_caps), NULL);
  g_return_val_if_fail (gst_caps_is_fixed (decode_caps), NULL);

  desc = gst_pb_utils_get_decoder_description (decode_caps);
  caps = copy_and_clean_caps (decode_caps);
  caps_str = gst_caps_to_string (caps);
  detail_str = gst_installer_detail_new (desc, "decoder", caps_str);
  g_free (caps_str);
  gst_caps_unref (caps);

  return detail_str;
}

/**
 * gst_missing_encoder_installer_detail_new:
 * @encode_caps: the (fixed) caps for which an encoder element is needed
 *
 * Returns an opaque string containing all the details about the missing
 * element to be passed to an external installer called via
 * gst_install_plugins_async() or gst_install_plugins_sync().
 *
 * This function is mainly for applications that call external plugin
 * installation mechanisms using one of the two above-mentioned functions in
 * the case where the application knows exactly what kind of plugin it is
 * missing.
 *
 * Returns: a newly-allocated detail string, or NULL on error. Free string
 *          with g_free() when not needed any longer.
 */
gchar *
gst_missing_encoder_installer_detail_new (const GstCaps * encode_caps)
{
  GstCaps *caps;
  gchar *detail_str, *caps_str, *desc;

  g_return_val_if_fail (encode_caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_any (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_empty (encode_caps), NULL);
  g_return_val_if_fail (gst_caps_is_fixed (encode_caps), NULL);

  desc = gst_pb_utils_get_encoder_description (encode_caps);
  caps = copy_and_clean_caps (encode_caps);
  caps_str = gst_caps_to_string (caps);
  detail_str = gst_installer_detail_new (desc, "encoder", caps_str);
  g_free (caps_str);
  gst_caps_unref (caps);

  return detail_str;
}


text:
<?php
/**
 * @package WordPress
 * @subpackage Structure
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php wp_title(); ?> <?php bloginfo('name'); ?></title>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php if ( st_option( 'dark_scheme' ) ) : ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/dark.css" type="text/css" media="screen" />
<?php endif; ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/ie6.css" type="text/css" media="screen" />

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_head(); ?>

<body <?php body_class(); ?>>

<a href="<?php echo home_url( '/' ); ?>" title="Home"><?php bloginfo('name'); ?>

		<?php if ( ! st_option( 'search_and_navicons' ) ) :	?>

            <form id="searchformheader" method="get" action="<?php echo home_url(); ?>">
	            <input type="text" value="<?php esc_attr_e( 'Type here and press enter to search', 'structuretheme' ); ?>" name="s" id="searchbox" onfocus="if (this.value == '<?php esc_attr_e( 'Type here and press enter to search', 'structuretheme' ); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php esc_attr_e( 'Type here and press enter to search', 'structuretheme' ); ?>';}" />
	            <input type="hidden" id="searchbutton" value="Go" />
			</form>

        	<?php if ( st_option( 'dark_scheme' ) ) : ?>

				<?php if ( st_option('twitter_url') ) : ?>
				<a href="<?php echo esc_url( st_option('twitter_url') ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/twitter_icon_black.png" title="Twitter" alt="Twitter" />

				<?php endif; ?>

				<?php if ( st_option('facebook_url') ) : ?>
				<a href="<?php echo esc_url( st_option('facebook_url') ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/facebook_icon_black.png" title="Facebook" alt="Facebook" />

				<?php endif; ?>

				<a href="<?php bloginfo( 'rss2_url' ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/rss_icon_black.png" title="<?php esc_attr_e( 'RSS feed', 'structuretheme' ); ?>" alt="RSS" />

        	<?php else : ?>

				<?php if ( st_option('twitter_url') ) : ?>
				<a href="<?php echo esc_attr( st_option('twitter_url') ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/twitter_icon.png" title="Twitter" alt="Twitter" />

				<?php endif; ?>

				<?php if ( st_option('facebook_url') ) : ?>
				<a href="<?php echo esc_attr( st_option('facebook_url') ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/facebook_icon.png" title="Facebook" alt="Facebook" />

				<?php endif; ?>

				<a href="<?php bloginfo( 'rss2_url' ); ?>">
					<img class="navicon" src="<?php bloginfo('template_url'); ?>/images/rss_icon.png" title="<?php esc_attr_e( 'RSS feed', 'structuretheme' ); ?>" alt="RSS" />

        	<?php endif; ?>

		<?php endif; // check for search_and_navicons ?>

    <?php
    if ( function_exists('wp_nav_menu') ) {
	    wp_nav_menu( array( 'container_class' => 'navbar', 'menu_class' => 'ot-menu', 'theme_location' => 'primary' ) );
    } else {
	    wp_page_menu();
    }
    ?>


text:
using Localization.Net.Parsing;
using Localization.Net.Processing.ValueFormatters;

namespace Localization.Net.Processing
{
    /// <summary>
    /// Decorates the pattern parts with value formatters, switch case evaluators and parameter evaluators
    /// </summary>
    public class PatternDecorator : DescendingPatternVisitor<object>
    {
        private PatternDialect _dialect;
        private TextManager _manager;

        public PatternDecorator(TextManager manager, PatternDialect dialect)
        {
            _manager = manager;
            _dialect = dialect;
        }

        public override void Visit(ParameterSpec spec, object state)
        {
            spec.Evaluator = _dialect.GetParameterEvaluator(spec, _manager);
            spec.Formatter = _dialect.GetValueFormatter(spec.ParameterFormat, _manager);

            base.Visit(spec, null);
        }

        public override void Visit(Switch sw, object state)
        {
            Visit((ParameterSpec)sw, state);
            //Don't apply default format on the value evaluated in switches
            if (sw.Formatter is DefaultFormatter)
            {
                sw.Formatter = null;
            }

            base.Visit(sw, state);
        }

        public override void Visit(SwitchCase sc, object state)
        {
            sc.Evaluator = _dialect.GetSwitchConditionEvaluator(sc.Condition, _manager);

            base.Visit(sc, null);
        }

        public override void Visit(FormatGroup group, object state)
        {
            group.Evaluator = _dialect.GetParameterEvaluator(new ParameterSpec { ParameterName = group.ParameterName }, _manager);
            group.Expander = _dialect.FormatGroupExpander;

            base.Visit(group, state);
        }

        public override void Visit(CustomExpressionPart part, object state)
        {
            part.Decorate(_dialect, _manager);

            base.Visit(part, state);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

class CountWords
{
    static void Main()
    {
        try
        {
            StreamReader readerWords = new StreamReader(@"..\..\words.txt");

            using (readerWords)
            {
                string[] words = readerWords.ReadLine().Split(new char[] { ' ' });
            }

            StreamReader readText = new StreamReader(@"..\..\text.txt");

            StringBuilder separate = new StringBuilder();
            List<string> wordsFromText = new List<string>();

            using (readText)
            {
                string currentLine = readText.ReadLine();

                while (currentLine != null)
                {
                    for (int i = 0; i < currentLine.Length; i++)
                    {
                        if (Char.IsPunctuation(currentLine[i]))
                        {
                            separate.Append(currentLine[i]);
                        }
                    }

                    separate.Append((char)32);
                    string separator = separate.ToString();

                    string[] words = currentLine.Split(separator.ToCharArray(),
                        StringSplitOptions.RemoveEmptyEntries);

                    for (int i = 0; i < words.Length; i++)
                    {
                        wordsFromText.Add(words[i]);
                    }

                    currentLine = readText.ReadLine();
                }
            }
            int counter = 0;

        }
        catch (OutOfMemoryException)
        {
            Console.WriteLine("Program runs out of memory.");
            return;
        }
        catch (IOException)
        {
            Console.WriteLine("File cannot be open.");
        }
        catch (ArgumentOutOfRangeException)
        {
            Console.WriteLine("Enlarging the value of this instance would exceed the max capacity.");
        }
        catch (ObjectDisposedException)
        {
            Console.WriteLine("Buffer is full.");
        }
        catch (NotSupportedException)
        {
            Console.WriteLine("Contents of buffer cannot be written.");
        }
    }
}


text:
package io.quantumdb.core.schema.operations;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import com.google.common.collect.Maps;
import org.junit.Test;

public class PartitionTableTest {

	@Test
	public void testPartitionTable() {
		PartitionTable operation = SchemaOperations.partitionTable("users")
				.into("debtors", "credit < 0")
				.into("creditors", "credit > 0");

		Map<String, String> partitions = Maps.newHashMap();
		partitions.put("debtors", "credit < 0");
		partitions.put("creditors", "credit > 0");

		assertEquals("users", operation.getTableName());
		assertEquals(partitions, operation.getPartitions());
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatTableNameCannotBeNull() {
		SchemaOperations.partitionTable(null);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatTableNameCannotBeEmptyString() {
		SchemaOperations.partitionTable("");
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatDecompositionTableNameCannotBeNull() {
		SchemaOperations.partitionTable("users")
				.into(null, "credit < 0");
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatDecompositionTableNameCannotBeEmptyString() {
		SchemaOperations.partitionTable("users")
				.into("", "credit < 0");
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatDecompositionExpressionCannotBeNull() {
		SchemaOperations.partitionTable("users")
				.into("creditors", null);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatDecompositionExpressionCannotBeEmptyString() {
		SchemaOperations.partitionTable("users")
				.into("creditors", "");
	}

	@Test(expected = IllegalArgumentException.class)
	public void testThatYouCannotDecomposeIntoTheSameTableTwice() {
		SchemaOperations.partitionTable("users")
				.into("creditors", "true")
				.into("creditors", "true");
	}

}


text:
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io').listen(server, { log: false });
var fs = require('fs');

server.listen('9000');

app.use("/css", express.static(__dirname + '/css'));
app.use("/js", express.static(__dirname + '/js'));
app.use("/img", express.static(__dirname + '/img'));

//Main page of the server
app.get('/', function (req, res) {
        res.sendfile(__dirname + '/index.html');
});

//Player List
var players = {};

io.sockets.on('connection', function(socket){
	//Detect socket when you connect
	socket.on('connect', function(data){
		//Save player on the Array
		players[data.nickname] = new Player(data.nickname, data.y, data.x, socket.id);

		//Send broadcast of connection
		socket.broadcast.emit('user_connect', {'nickname' : data.nickname, 'y' : data.y, 'x' : data.x});

		log('Connecting: ' + data.nickname);
	})

	//Detect player movement and update the player
	socket.on('player_move', function (data){
		if( players[data.nickname] ){
			players[data.nickname].y = data.y;
			players[data.nickname].x = data.x;
		}else{
			players[data.nickname] = new Player(data.nickname, data.y, data.x, socket.id);
		}
	});

	//Detect the Disconnection
	socket.on('disconnect', function(){
		for (key in players){
			if( players[key].socketId  == socket.id){
				log('Disconnecting: ' + key);

				//Send broadcast of disconnection
				socket.broadcast.emit('user_disconnect', {'nickname' : players[key].nickname});

				delete players[key];
			}
		}
	})

	//Game Loop
	setInterval(function(){
		socket.emit('players_position', players);
	}, 30);

});

//Player Class
function Player (nickname, y, x, socketId){
	this.nickname = nickname;
	this.y = y;
	this.x = x;
	this.socketId = socketId;
}

function log(logMessage){
	console.log(logMessage);
}


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    SKCircleProgressView *progress = [[SKCircleProgressView alloc] initWithFrame:CGRectMake(100, 150, 100, 100)];
    [self.view addSubview:progress];
    [progress setProgressStrokeColor:[UIColor colorWithRed:(233 / 255.0) green:(192 / 255.0) blue:(10 / 255.0) alpha:1]];
    [progress setBackgroundStrokeColor:[UIColor colorWithRed:(217 / 255.0) green:(234 / 255.0) blue:(234 / 255.0) alpha:1]];
    [progress setProgress:0.88 Animated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
/**
 * This is where you add new components to the application.
 * you don't need to worry about the dependency order (that's what RequireJS is for).
 */
define([
    './templates',
    './controllers/example-ctrl',
    './directives/example-directive',
    './services/example-service',
    './filters/example-filter',
    './animations/example-animation'
], function () {});


text:
class Boom::Platform
  class Linux < Base
    def copy_command
      'xclip -selection clipboard'
    end

    def open item
      system "#{open_command} '#{item.url.gsub("\'","'\\\\''")}'"
    end

    def open_command
      "xdg-open"
    end
  end
end


text:
using System;

namespace Gwen.Control.Layout
{
	/// <summary>
	/// Arrange child controls into a column.
	/// </summary>
	[Xml.XmlControl]
	public class VerticalLayout : StackLayout
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="VerticalLayout"/> class.
		/// </summary>
		/// <param name="parent">Parent control.</param>
		public VerticalLayout(ControlBase parent)
			: base(parent)
		{
			this.HorizontalAlignment = HorizontalAlignment.Stretch;
			this.VerticalAlignment = VerticalAlignment.Top;
		}
	}
}


text:
import { createSimpleFunctional } from '../../util/helpers'
import VCard from './VCard'
import VCardMedia from './VCardMedia'
import VCardTitle from './VCardTitle'

export { VCard, VCardMedia, VCardTitle }

VCard.install = function install (Vue) {
  const VCardActions = createSimpleFunctional('card__actions')
  const VCardText = createSimpleFunctional('card__text')

  Vue.component(VCard.name, VCard)
  Vue.component(VCardMedia.name, VCardMedia)
  Vue.component(VCardTitle.name, VCardTitle)
  Vue.component('v-card-actions', VCardActions)
  Vue.component('v-card-text', VCardText)
}

export default VCard


text:
template <class T>
class BST : HeterogeneousListContainer<T> {
    BSTNode<T> *root;
    int itemsCount;

    using Condition = bool (*)(T const&);

public:
    BST() {
        root = nullptr;
        itemsCount = 0;
    }

    bool member(const T& item) {
        BSTNode<T> *currentNode = root;
        while (currentNode != nullptr) {
            if (item == currentNode->data)
                return true;
            else if(item < currentNode->data)
                insertNode = insertNode->left;
            else
                insertNode = insertNode->right;
        }
        return false;
    }

    bool search(Condition) {}

    void addItem(const T item) {
        BSTNode<T> *&insertNode = root, *parent = nullptr;
        while (insertNode != nullptr) {
            parent = insertNode;
            if (item <= currentNode->data)
                insertNode = insertNode->left;
            else
                insertNode = insertNode->right;
        }
        insertNode = new BSTNode<T>(item, parent);
    }

    void removeAt(BSTNode<T> *node) {
        if (node->parent->left == node)
            node->parent->left = nullptr;
        else
            node->parent->right = nullptr;
    }

    void removeItem() {}

    void removeMatching(Condition) {}

    void print() {}

    int size() {}

    void sort() {}

    DoublyLinkedListNode<T>* begin() const {}

    void write(std::ofstream&) {}
};

template<class T>
ostream& operator<<(ostream& os, const BST<T> &l) {
    os << "- ";
    for(DoublyLinkedListNode<T> *node = l.begin(); node != nullptr; node = node->next)
        os << node->data << " - ";
    return os << std::endl;
}

#endif //CONTAINERS_BST_H


text:
package com.stevenschoen.putionew.transfers;

import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.stevenschoen.putionew.PutioUtils;
import com.stevenschoen.putionew.R;
import com.stevenschoen.putionew.model.transfers.PutioTransfer;

import org.joda.time.Period;
import org.joda.time.Seconds;
import org.joda.time.format.PeriodFormatter;
import org.joda.time.format.PeriodFormatterBuilder;

import java.util.List;

import androidx.recyclerview.widget.RecyclerView;

public class TransfersAdapter extends RecyclerView.Adapter<TransfersAdapter.TransferHolder> {

  private PeriodFormatter remainingFormatter;
  private PeriodFormatter remainingWithoutSecondsFormatter;
  private PeriodFormatter remainingWithoutMinutesFormatter;

  private OnItemClickListener itemClickListener;
  private OnItemLongClickListener itemLongClickListener;

  private List<PutioTransfer> data;

  public TransfersAdapter(List<PutioTransfer> data) {
    super();
    this.data = data;
    setHasStableIds(true);

    remainingFormatter = new PeriodFormatterBuilder()
        .appendDays().appendSuffix("d").appendSeparator(" ")
        .appendHours().appendSuffix("h").appendSeparator(" ")
        .appendMinutes().appendSuffix("m").appendSeparator(" ")
        .appendSeconds().appendSuffix("s")
        .toFormatter();
    remainingWithoutSecondsFormatter = new PeriodFormatterBuilder()
        .appendDays().appendSuffix("d").appendSeparator(" ")
        .appendHours().appendSuffix("h").appendSeparator(" ")
        .appendMinutes().appendSuffix("m")
        .toFormatter();
    remainingWithoutMinutesFormatter = new PeriodFormatterBuilder()
        .appendDays().appendSuffix("d").appendSeparator(" ")
        .appendHours().appendSuffix("h")
        .toFormatter();
  }

  String formatRemainingTime(long remainingSeconds) {
    Period period = new Period(Seconds.seconds((int) remainingSeconds)).normalizedStandard();
    if (period.getDays() > 0) {
      return remainingWithoutMinutesFormatter.print(period);
    } else if (period.getHours() > 0) {
      return remainingWithoutSecondsFormatter.print(period);
    } else {
      return remainingFormatter.print(period);
    }
  }

  @Override
  public TransferHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext())
        .inflate(R.layout.transfer, parent, false);

    return new TransferHolder(view);
  }

  @Override
  public void onBindViewHolder(TransferHolder holder, final int position) {
    PutioTransfer transfer = data.get(position);

    View.OnClickListener onClickListener;
    if (itemClickListener != null) {
      onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          itemClickListener.onItemClick(v, position);
        }
      };
    } else {
      onClickListener = null;
    }
    holder.itemView.setOnClickListener(onClickListener);
    View.OnLongClickListener onLongClickListener;
    if (itemLongClickListener != null) {
      onLongClickListener = new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
          itemLongClickListener.onItemLongClick(v, position);
          return true;
        }
      };
    } else {
      onLongClickListener = null;
    }
    holder.itemView.setOnLongClickListener(onLongClickListener);

    holder.buttonView.setOnClickListener(onClickListener);

    holder.progressBar.setProgress(transfer.percentDone);

    holder.textName.setText(transfer.name);

    String downString = PutioUtils.humanReadableByteCount(transfer.downSpeed, false);
    holder.textDown.setText(holder.textDown.getResources().getString(R.string.x_per_sec, downString));
    String upString = PutioUtils.humanReadableByteCount(transfer.upSpeed, false);
    holder.textUp.setText(holder.textUp.getResources().getString(R.string.x_per_sec, upString));

    switch (transfer.status) {
      case "COMPLETED":
      case "SEEDING":
        holder.progressBar.setError(false);
        holder.imgStatusIcon.setImageResource(R.drawable.ic_transfer_done);
        holder.imgStatusIcon.setVisibility(View.VISIBLE);
        holder.statusLoading.setVisibility(View.INVISIBLE);
        holder.textMessage.setVisibility(View.GONE);
        holder.buttonView.setVisibility(View.VISIBLE);
        holder.downHolder.setVisibility(View.GONE);
        holder.upHolder.setVisibility(View.VISIBLE);
        if (transfer.currentRatio != 0) {
          holder.textRatio.setText(holder.textRatio.getContext().getString(R.string.ratio_is, transfer.currentRatio));
          holder.ratioHolder.setVisibility(View.VISIBLE);
        } else {
          holder.ratioHolder.setVisibility(View.GONE);
        }
        holder.textRemaining.setVisibility(View.GONE);
        holder.textRemaining.setTextColor(holder.textRemaining.getContext().getResources().getColor(R.color.putio_green));
        break;
      case "ERROR":
        holder.progressBar.setError(true);
        holder.imgStatusIcon.setImageResource(R.drawable.ic_transfer_failed);
        holder.imgStatusIcon.setVisibility(View.VISIBLE);
        holder.statusLoading.setVisibility(View.INVISIBLE);
        holder.textMessage.setText(holder.textMessage.getContext().getString(R.string.transferfailed));
        holder.textMessage.setVisibility(View.VISIBLE);
        holder.buttonView.setVisibility(View.GONE);
        holder.downHolder.setVisibility(View.GONE);
        holder.upHolder.setVisibility(View.GONE);
        holder.ratioHolder.setVisibility(View.GONE);
        holder.textRemaining.setVisibility(View.VISIBLE);
        holder.textRemaining.setText(":(");
        holder.textRemaining.setTextColor(Color.RED);
        break;
      default:
        holder.progressBar.setError(false);
        holder.imgStatusIcon.setVisibility(View.INVISIBLE);
        holder.statusLoading.setVisibility(View.VISIBLE);
        holder.textMessage.setVisibility(View.GONE);
        holder.buttonView.setVisibility(View.GONE);
        holder.downHolder.setVisibility(View.VISIBLE);
        holder.upHolder.setVisibility(View.VISIBLE);
        holder.ratioHolder.setVisibility(View.GONE);
        String remainingString = "";
        long remainingSeconds = transfer.estimatedTime;
        if (remainingSeconds > 0) {
          remainingString = formatRemainingTime(remainingSeconds);
        }
        holder.textRemaining.setVisibility(View.VISIBLE);
        holder.textRemaining.setText(remainingString);
        holder.textRemaining.setTextColor(Color.BLACK);
    }
  }

  @Override
  public int getItemCount() {
    return data.size();
  }

  @Override
  public long getItemId(int position) {
    return data.get(position).id;
  }

  public void setOnItemClickListener(OnItemClickListener itemClickListener) {
    this.itemClickListener = itemClickListener;
  }

  public void setOnItemLongClickListener(OnItemLongClickListener itemLongClickListener) {
    this.itemLongClickListener = itemLongClickListener;
  }

  public interface OnItemClickListener {
    void onItemClick(View view, int position);
  }

  public interface OnItemLongClickListener {
    void onItemLongClick(View view, int position);
  }

  public static class TransferHolder extends RecyclerView.ViewHolder {
    View root;

    TextView textName;
    TextView textDown;
    TextView textUp;
    TextView textRatio;
    TextView textRemaining;
    ImageView imgStatusIcon;
    ProgressBar statusLoading;
    Button buttonView;

    TransferProgressBarView progressBar;
    TextView textMessage;
    View downHolder;
    View upHolder;
    View ratioHolder;

    public TransferHolder(View itemView) {
      super(itemView);

      root = itemView;
      textName = itemView.findViewById(R.id.text_transfer_name);
      textDown = itemView.findViewById(R.id.text_transfer_down);
      textUp = itemView.findViewById(R.id.text_transfer_up);
      textRatio = itemView.findViewById(R.id.text_transfer_ratio);
      textRemaining = itemView.findViewById(R.id.text_transfer_remaining);
      imgStatusIcon = itemView.findViewById(R.id.img_transfer_icon);
      statusLoading = itemView.findViewById(R.id.transfer_statusLoading);
      buttonView = itemView.findViewById(R.id.transfer_view_button);

      progressBar = itemView.findViewById(R.id.transfer_progressbar);
      textMessage = itemView.findViewById(R.id.text_transfer_message);
      downHolder = itemView.findViewById(R.id.holder_transfer_down);
      upHolder = itemView.findViewById(R.id.holder_transfer_up);
      ratioHolder = itemView.findViewById(R.id.holder_transfer_ratio);
    }
  }
}


text:
package camelcoredemo;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PurchaseOrderVelocityMain extends Main {

static Logger LOG = LoggerFactory.getLogger(PurchaseOrderVelocityMain.class);

	public static void main(String[] args) throws Exception{
		PurchaseOrderVelocityMain main = new PurchaseOrderVelocityMain();
		main.enableHangupSupport();
		main.addRouteBuilder(createRouteBuilder());
		main.run();
	}

	static RouteBuilder createRouteBuilder(){
		return new PurchaseOrderRouteBuilder();
	}
}


text:
package example.springdata.elasticsearch.conference;

import static org.assertj.core.api.Assertions.*;

import reactor.test.StepVerifier;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.query.Criteria;
import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;

import org.testcontainers.elasticsearch.ElasticsearchContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

/**
 * Test case to show Spring Data Elasticsearch functionality.
 *
 * @author Christoph Strobl
 * @author Prakhar Gupta
 */
@SpringBootTest(classes = ApplicationConfiguration.class)
@Testcontainers
class ReactiveElasticsearchOperationsTest {

	private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

	@Container //
	private static ElasticsearchContainer container = new ElasticsearchContainer(
			DockerImageName.parse("docker.elastic.co/elasticsearch/elasticsearch:7.17.2")) //
					.withPassword("foobar") //
					.withReuse(true);

	@DynamicPropertySource
	static void setProperties(DynamicPropertyRegistry registry) {
		registry.add("spring.elasticsearch.uris", () -> "http://" + container.getHttpHostAddress());
		registry.add("spring.elasticsearch.username", () -> "elastic");
		registry.add("spring.elasticsearch.password", () -> "foobar");
	}

	@Autowired ReactiveElasticsearchOperations operations;

	@Test
	void textSearch() {

		var expectedDate = "2014-10-29";
		var expectedWord = "java";
		var query = new CriteriaQuery(
				new Criteria("keywords").contains(expectedWord).and(new Criteria("date").greaterThanEqual(expectedDate)));

		operations.search(query, Conference.class) //
				.as(StepVerifier::create) //
				.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
				.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
				.consumeNextWith(it -> verify(it, expectedWord, expectedDate)) //
				.verifyComplete();
	}

	private void verify(SearchHit<Conference> hit, String expectedWord, String expectedDate) {

		assertThat(hit.getContent().getKeywords()).contains(expectedWord);
		try {
			assertThat(format.parse(hit.getContent().getDate())).isAfter(format.parse(expectedDate));
		} catch (ParseException e) {
			fail("o_O", e);
		}
	}
}


text:
<?php

namespace Base\TestBundle\Admin;

use WhiteOctober\AdminBundle\DataManager\Doctrine\ORM\Admin\DoctrineORMAdmin;

class CategoryAdmin extends DoctrineORMAdmin
{
    protected function configure()
    {
        $this
            ->setName('Category')
            ->setDataClass('Base\TestBundle\Entity\Category')
            ->addActions(array(
                'doctrine.orm.crud',
            ))
            ->addFields(array(
                'title',
                'published',
            ))
        ;
    }
}


text:
from django.contrib.auth.models import User
from django.db import models

class Profile(models.Model):
    """Profile model."""

    user = models.OneToOneField(User, related_name='profile')
    modified = models.DateTimeField(auto_now=True)
    is_verified = models.BooleanField(default=False)
    name = models.CharField(max_length=50)
    update = models.TextField()
    image = models.ImageField(null=True, blank=True)

    def __str__(self):
        return self.name.title()


text:
define('first',[], function(){
    return "I am first.";
});


text:
<!DOCTYPE html>

	    <meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
		<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
		<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">

		<title>
		    Accesibilidad web
		</title>

		<link href="../Plantilla/css/bootstrap.min.css" rel="stylesheet">
		<link href="../Plantilla/css/other.css" rel="stylesheet">

		<link rel="apple-touch-icon" href="/apple-touch-icon.png">
		<link rel="icon" href="favicon.ico">

					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-8">
					Toggle navigation

					</button>

¿Qué es?

Nutricion

Sobre Nosotros

¿Qué vas a comer hoy?

                <button id="btnComenzar" class="btn btn-primary pull-right"  onclick="muestraTabla()" >Comenzar</button>
                <input id="img" type="file" name="file1" accept="image/*" />
                Mundo

Calorias

Grasas

Vitaminas y Minerales

Proteinas

							CUCEI, Guadalajara, Jalisco.

							 DreamTeam: ciip@lux.edu.mx

							36142587

						Mas Información


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SpecFlow.Api.Common.Utils;
using System.Linq;
using TechTalk.SpecFlow;

namespace SpecFlow.Api.Common
{
    public class ContextBase
    {
        protected static EndpointContext _context;
        protected static RunSuite Suite(string keySuffix) { return FeatureContext.Current.Get<RunSuite>("suite" + keySuffix); }

        public ContextBase(EndpointContext context)
        {
            _context = context;
        }

        protected bool IsAuthenticated(string keySuffix)
        {
            var suite = Suite(keySuffix);
            if (suite == null || !suite.Scenarios.Any()) return false;

            var scenario = suite.Scenarios.FirstOrDefault(x => x.Results.Contains("Token"));
            if (scenario == null) return false;

            return _context.HasAuthenticationToken("Token",
                scenario.Results,
                "using System; public class Results {public string Token {get;set;} public DateTime ExpirationDate {get;set;} public string TargetUrl {get;set;}}");
        }

        protected static void RegisterSuite(string keySuffix)
        {
            FeatureContext.Current.Add("suite" + keySuffix, new RunSuite());
        }

        protected static void SaveSuiteResults(string keySuffix)
        {
            var suite = Suite(keySuffix);
            Assert.IsTrue(_context.SaveResults(suite));

            _context.RunProcess(@"C:\Windows\explorer.exe", PdfReport.CreateReport(suite));
        }

        protected static void RegisterScenario(string keySuffix)
        {
            var suite = Suite(keySuffix);
            suite.Name = FeatureContext.Current.FeatureInfo.Title;
            suite.Scenarios.Add(_context.Scenario);
        }
    }
}


text:
<?php

class Admin_ParticipantsControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
{

    public function setUp()
    {
        $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
        parent::setUp();
    }

    public function testIndexAction()
    {
        $params = array('action' => 'index', 'controller' => 'Participants', 'module' => 'admin');
        $urlParams = $this->urlizeOptions($params);
        $url = $this->url($urlParams);
        $this->dispatch($url);

        // assertions
        $this->assertModule($urlParams['module']);
        $this->assertController($urlParams['controller']);
        $this->assertAction($urlParams['action']);
        $this->assertQueryContentContains(
            'div#view-content p',
            'View script for controller ' . $params['controller'] . ' and script/action name ' . $params['action'] . ''
            );
    }

    public function testAddAction()
    {
        $params = array('action' => 'add', 'controller' => 'Participants', 'module' => 'admin');
        $urlParams = $this->urlizeOptions($params);
        $url = $this->url($urlParams);
        $this->dispatch($url);

        // assertions
        $this->assertModule($urlParams['module']);
        $this->assertController($urlParams['controller']);
        $this->assertAction($urlParams['action']);
        $this->assertQueryContentContains(
            'div#view-content p',
            'View script for controller ' . $params['controller'] . ' and script/action name ' . $params['action'] . ''
            );
    }

    public function testEditAction()
    {
        $params = array('action' => 'edit', 'controller' => 'Participants', 'module' => 'admin');
        $urlParams = $this->urlizeOptions($params);
        $url = $this->url($urlParams);
        $this->dispatch($url);

        // assertions
        $this->assertModule($urlParams['module']);
        $this->assertController($urlParams['controller']);
        $this->assertAction($urlParams['action']);
        $this->assertQueryContentContains(
            'div#view-content p',
            'View script for controller ' . $params['controller'] . ' and script/action name ' . $params['action'] . ''
            );
    }

    public function testPendingAction()
    {
        $params = array('action' => 'pending', 'controller' => 'Participants', 'module' => 'admin');
        $urlParams = $this->urlizeOptions($params);
        $url = $this->url($urlParams);
        $this->dispatch($url);

        // assertions
        $this->assertModule($urlParams['module']);
        $this->assertController($urlParams['controller']);
        $this->assertAction($urlParams['action']);
        $this->assertQueryContentContains(
            'div#view-content p',
            'View script for controller ' . $params['controller'] . ' and script/action name ' . $params['action'] . ''
            );
    }

}


text:
<?php

namespace Innmind\CrawlerBundle\Tests\Parser;

use Innmind\CrawlerBundle\Parser\AndroidPass;
use Innmind\CrawlerBundle\Event\ResourceEvent;
use Innmind\CrawlerBundle\Entity\Resource;
use Innmind\CrawlerBundle\Entity\HtmlPage;
use GuzzleHttp\Message\Response;
use Symfony\Component\DomCrawler\Crawler;

class AndroidPassTest extends \PHPUnit_Framework_TestCase
{
    protected $pass;

    public function setUp()
    {
        $this->pass = new AndroidPass();
    }

    public function testDoesNotHandleIfNotHtmlPage()
    {
        $event = new ResourceEvent(new Resource, new Response(200), new Crawler);

        try {
            $this->pass->handle($event);
            $this->assertTrue(true);
        } catch (\Exception $e) {
            $this->assertTrue(false, 'Should not throw if handling raw resource');
        }
    }

    public function testDoesNotSetAndroidURI()
    {
        $event = new ResourceEvent(new HtmlPage, new Response(200), new Crawler);

        $this->pass->handle($event);

        $this->assertEquals($event->getResource()->hasAndroidURI(), false);
    }

    public function testSetAndroidURI()
    {
        $dom = new Crawler;
        $dom->addContent('<link rel="alternate" href="android-app://com.google.foo">');
        $event = new ResourceEvent(new HtmlPage, new Response(200), $dom);

        $this->pass->handle($event);

        $this->assertEquals($event->getResource()->hasAndroidURI(), true);
        $this->assertEquals($event->getResource()->getAndroidURI(), 'android-app://com.google.foo');
    }
}


text:
function New-WikiLabel {
    <#
    .SYNOPSIS
    Add a new global label to an existing Confluence page.

    .DESCRIPTION
    Add one or more labels to one or more Confluence pages. Label can be brand new.

    .EXAMPLE
    New-WikiLabel -Label alpha,bravo,charlie -PageID 123456 -Verbose
    Apply the labels alpha, bravo, and charlie to the page with ID 123456. Verbose output.

    .EXAMPLE
    Get-WikiPage -SpaceKey SRV | New-WikiLabel -Label servers -WhatIf
    Would apply the label "servers" to all pages in the space with key SRV. -WhatIf flag supported.

    .LINK
    https://github.com/brianbunke/ConfluencePS
    #>
    [CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Medium')]
    param (
        # One or more labels to be added. Currently supports labels of prefix "global."
        [Parameter(Mandatory = $true)]
        [string[]]$Label,

        # The page ID to apply the label to. Accepts multiple IDs via pipeline input.
        [Parameter(Mandatory = $true,
                   ValueFromPipeline = $true,
                   ValueFromPipelineByPropertyName = $true)]
        [ValidateRange(1,[int]::MaxValue)]
        [Alias('ID')]
        [int]$PageID
    )

    BEGIN {
        If (!($Header) -or !($BaseURI)) {
            Write-Warning 'Confluence instance info not yet defined in this session. Calling Set-WikiInfo'
            Set-WikiInfo
        }
    }

    PROCESS {

        # Set both of these for use inside the ForEach
        $Int = 0
        $Body = @()

        ForEach ($SingleLabel in $Label) {
            # If not the first loop, add a comma to separate previous
            If ($Int -gt 0) {
                $Body += ','
            }

            $Body += @{prefix = 'global'
                       name   = "$SingleLabel"
                      } | ConvertTo-Json -Compress

            $Int++
        }

        $Body = '[' + $Body + ']'

        $URI = $BaseURI + "/content/$PageID/label"

        Write-Verbose "Posting to $URI"
        If ($PSCmdlet.ShouldProcess("Label $Label, PageID $PageID")) {
            $Rest = Invoke-RestMethod -Headers $Header -Uri $URI -Body $Body -Method Post -ContentType 'application/json'

            # Hashing everything because I don't like the lower case property names from the REST call
            ForEach ($Result in $Rest.results) {
                $Result | Select @{n='Label';   e={$_.name}},
                                 @{n='LabelID'; e={$_.id}},
                                 @{n='Prefix';  e={$_.prefix}},
                                 @{n='PageID';  e={$PageID}}
            }
        }
    }
}


text:
package org.artifactory.rest.services.config;

import org.artifactory.api.context.ContextHelper;
import org.artifactory.common.ArtifactoryHome;
import org.artifactory.security.mission.control.MissionControlProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

import java.io.File;
import java.io.IOException;

/**
 * @author Chen Keinan
 */
@Configuration
@ImportResource({"classpath:/META-INF/spring/restContext.xml"})
public class RestServiceConfiguration {

    @Bean(name = "missionControlProperties")
    public MissionControlProperties getDbProperties() throws IOException {
        ArtifactoryHome artifactoryHome = ContextHelper.get().getArtifactoryHome();
        File storagePropsFile = artifactoryHome.getMissionControlPropertiesFile();
        return new MissionControlProperties(storagePropsFile);
    }

}