text:
LIBDIR=$DEST/neutron/devstack/lib

source $LIBDIR/dns
source $LIBDIR/flavors
source $LIBDIR/l2_agent
source $LIBDIR/l2_agent_sriovnicswitch
source $LIBDIR/l3_agent
source $LIBDIR/ml2
source $LIBDIR/qos
source $LIBDIR/ovs
source $LIBDIR/segments
source $LIBDIR/trunk
source $LIBDIR/log

Q_BUILD_OVS_FROM_GIT=$(trueorfalse False Q_BUILD_OVS_FROM_GIT)

if [ -f $LIBDIR/${NEUTRON_AGENT}_agent ]; then
    source $LIBDIR/${NEUTRON_AGENT}_agent
fi

if [[ "$1" == "stack" ]]; then
    case "$2" in
        install)
            if [[ "$NEUTRON_AGENT" == "openvswitch" ]] && \
               [[ "$Q_BUILD_OVS_FROM_GIT" == "True" ]]; then
                remove_ovs_packages
                compile_ovs True /usr /var
                start_new_ovs
            fi
            ;;
        post-config)
            if is_service_enabled q-flavors neutron-flavors; then
                configure_flavors
            fi
            if is_service_enabled q-qos neutron-qos; then
                configure_qos
            fi
            if is_service_enabled q-trunk neutron-trunk; then
                configure_trunk_extension
            fi
            if is_service_enabled q-log neutron-log; then
                configure_log
            fi
            if is_service_enabled q-dns neutron-dns; then
                configure_dns_extension
                post_config_dns_extension
                if is_service_enabled designate; then
                    configure_dns_integration
                fi
            fi
            if is_service_enabled neutron-segments; then
                configure_segments_extension
            fi
            if is_service_enabled q-agt neutron-agent; then
                configure_l2_agent
            fi
            #Note: sriov agent should run with OVS or linux bridge agent
            #because they are the mechanisms that bind the DHCP and router ports.
            #Currently devstack lacks the option to run two agents on the same node.
            #Therefore we create new service, q-sriov-agt, and the
            # q-agt/neutron-agent should be OVS or linux bridge.
            if is_service_enabled q-sriov-agt neutron-sriov-agent; then
                configure_$NEUTRON_CORE_PLUGIN
                configure_l2_agent
                configure_l2_agent_sriovnicswitch
            fi
            if is_service_enabled q-l3 neutron-l3; then
                if is_service_enabled q-qos neutron-qos; then
                    configure_l3_agent_extension_fip_qos
                fi
                configure_l3_agent
            fi
            if [ $NEUTRON_CORE_PLUGIN = ml2 ]; then
                configure_ml2_extension_drivers
            fi
            ;;
        extra)
            if is_service_enabled q-sriov-agt neutron-sriov-agent; then
                start_l2_agent_sriov
            fi
            ;;
    esac
elif [[ "$1" == "unstack" ]]; then
    if is_service_enabled q-sriov-agt neutron-sriov-agent; then
        stop_l2_agent_sriov
    fi
    if [[ "$NEUTRON_AGENT" == "openvswitch" ]] && \
       [[ "$Q_BUILD_OVS_FROM_GIT" == "True" ]]; then
        stop_new_ovs
    fi
fi


text:
package de.felixbruns.jotify.util;

import java.io.StringWriter;
import java.nio.charset.Charset;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * XML Builder is a utility that creates simple XML documents using relatively
 * sparse Java code. It is intended to allow for quick and painless creation of
 * XML documents where you might otherwise be tempted to use concatenated
 * strings, rather than face the tedium and verbosity of coding with
 * JAXP (http://jaxp.dev.java.net/).
 *

 * Internally, XML Builder uses JAXP to build a standard W3C
 * {@link Document} model (DOM) that you can easily export as a
 * string, or access and manipulate further if you have special requirements.
 *

 *

 * The XMLBuilder class serves as a wrapper of {@link Element} nodes,
 * and provides a number of utility methods that make it simple to
 * manipulate the underlying element and the document to which it belongs.
 * In essence, this class performs dual roles: it represents a specific XML
 * node, and also allows manipulation of the entire underlying XML document.
 * The platform's default {@link DocumentBuilderFactory} and
 * {@link DocumentBuilder} classes are used to build the document.
 *

 *
 * @author James Murty
 * @author Felix Bruns
 */
public class XMLBuilder {
	/**
	 * A {@link Document} that stores the underlying XML document operated on by
	 * {@link XMLBuilder} instances. This document object belongs to the root node
	 * of a document, and is shared by this node with all other XMLBuilder instances.
	 */
	private Document document;

	/**
	 * The underlying element represented by this builder node.
	 */
	private Element element;

	/**
	 * Construct a new {@link XMLBuilder} that wraps the given {@link Document}.
	 *
	 * @param document A {@link Document} that the {@link XMLBuilder}
	 * will manage and manipulate.
	 */
	protected XMLBuilder(Document document){
		this.document = document;
		this.element  = document.getDocumentElement();
	}

	/**
	 * Construct a new {@link XMLBuilder} that wraps the given {@link Element}.
	 *
	 * @param element The {@link Element} that this {@link XMLBuilder} will wrap.
	 * This element may be part of the XML document, or it may be a new element
	 * that is to be added to the document.
	 */
	protected XMLBuilder(Element element){
		this.document = element.getOwnerDocument();
		this.element  = element;
	}

	/**
	 * Construct a new {@link XMLBuilder}. The underlying document will be created
	 * with the given root element, and the builder returned by this method
	 * will serve as the starting-point for any further document additions.
	 *
	 * @param name The name of the documents root element.
	 *
	 * @return An {@link XMLBuilder} that can be used to add more nodes to
	 * the XML document.
	 *
	 * @throws FactoryConfigurationError
	 * @throws ParserConfigurationException
	 */
	public static XMLBuilder create(String name){
		try{
			DocumentBuilder builder  = DocumentBuilderFactory.newInstance().newDocumentBuilder();
			Document        document = builder.newDocument();

			document.appendChild(document.createElement(name));

			return new XMLBuilder(document);
		}
		catch(ParserConfigurationException e){
			throw new RuntimeException(e);
		}
	}

	/**
	 * Construct a new {@link XMLBuilder}. The underlying document will be created
	 * and the builder returned by this method will serve as the starting-point for
	 * any further document additions.
	 *
	 * @return An {@link XMLBuilder} that can be used to add more nodes to
	 * the XML document.
	 *
	 * @throws FactoryConfigurationError
	 * @throws ParserConfigurationException
	 */
	public static XMLBuilder create(){
		return create("xml-builder");
	}

	private static String toUTF8(String s){
		return new String(s.getBytes(Charset.forName("UTF-8")));
	}

	/**
	 * Returns the {@link XMLBuilder} representing the root element of the XML document.
	 *
	 * @return An {@link XMLBuilder} instance.
	 */
	public XMLBuilder root(){
		return new XMLBuilder(this.document);
	}

	/**
	 * Add a child node with text content to the document, and return the
	 * {@link XMLBuilder} representing the new child.
	 *
	 * @param name  The name of the new child node.
	 * @param value The text content of the new child node or {@code null}.
	 *
	 * @return An {@link XMLBuilder} representing the new child.
	 *
	 * @throws IllegalStateException
	 * If you attempt to add a child element to an XML node that already
	 * contains a text node value.
	 */
	public XMLBuilder element(String name, String value){
		NodeList children = this.element.getChildNodes();
		Element  element  = this.document.createElement(name);

		for(int i = 0; i < children.getLength(); i++){
			if(Element.TEXT_NODE == children.item(i).getNodeType()){
				throw new IllegalStateException(
					"Can't add subelement <" + name + "> to element " +
					"<" + this.element.getNodeName() + "> that already " +
					"contains the text node: " + children.item(i)
				);
			}
		}

		if(value != null){
			element.appendChild(this.document.createTextNode(XMLBuilder.toUTF8(value)));
		}

		this.element.appendChild(element);

		return new XMLBuilder(element);
	}

	public XMLBuilder element(String name, String format, Object... args){
		return this.element(name, String.format(format, args));
	}

	public XMLBuilder element(String name){
		return this.element(name, null);
	}

	/**
	 * Synonym for {@link #element(String)}.
	 *
	 * @param name  The name of the new child node.
	 * @param value The text content of the new child node or {@code null}.
	 *
	 * @return An {@link XMLBuilder} representing the new child.
	 *
	 * @throws IllegalStateException
	 * If you attempt to add a child element to an XML node that already
	 * contains a text node value.
	 */
	public XMLBuilder e(String name, String value){
		return this.element(name, value);
	}

	public XMLBuilder e(String name, String format, Object... args){
		return this.element(name, String.format(format, args));
	}

	public XMLBuilder e(String name){
		return this.element(name);
	}

	/**
	 * Add an attribute to the element represented by this {@link XMLBuilder}
	 * and return the {@link XMLBuilder} representing the element to which the
	 * attribute was added (not the new attribute node).
	 *
	 * @param name  The attribute's name.
	 * @param value The attribute's value.
	 *
	 * @return The {@link XMLBuilder} representing the {@link Element} to which
	 * the attribute was added.
	 */
	public XMLBuilder attribute(String name, String value){
		this.element.setAttribute(name, XMLBuilder.toUTF8(value));

		return this;
	}

	/**
	 * Synonym for {@link #attribute(String, String)}.
	 *
	 * @param name  The attribute's name.
	 * @param value The attribute's value.
	 *
	 * @return The {@link XMLBuilder} representing the {@link Element} to which
	 * the attribute was added.
	 */
	public XMLBuilder a(String name, String value){
		return this.attribute(name, value);
	}

	/**
	 * Add a text value to the element represented by this {@link XMLBuilder}
	 * and return the {@link XMLBuilder} representing the element to which the
	 * text was added (not the new text node).
	 *
	 * @param value The text value to add to the element.
	 *
	 * @return The {@link XMLBuilder} representing the element to which the text was added.
	 */
	public XMLBuilder text(String value){
		this.element.appendChild(this.document.createTextNode(XMLBuilder.toUTF8(value)));

		return this;
	}

	/**
	 * Synonm for {@link #text(String)}.
	 *
	 * @param value The text value to add to the element.
	 *
	 * @return The {@link XMLBuilder} representing the element to which the text was added.
	 */
	public XMLBuilder t(String value){
		return this.text(value);
	}

	/**
	 * Add a formatted string to the element represented by this {@link XMLBuilder}
	 * and return the {@link XMLBuilder} representing the element to which the
	 * text was added (not the new text node).
	 *
	 * @param format The format string.
	 * @param args   The format arguments.
	 *
	 * @return The {@link XMLBuilder} representing the element to which the numeric value was added.
	 */
	public XMLBuilder format(String format, Object... args){
		return this.text(String.format(format, args));
	}

	/**
	 * Synonm for {@link #format(String, Object...)}.
	 *
	 * @param format The format string.
	 * @param args   The format arguments.
	 *
	 * @return The {@link XMLBuilder} representing the element to which the numeric value was added.
	 */
	public XMLBuilder f(String format, Object... args){
		return this.format(format, args);
	}

	/**
	 * Return the {@link XMLBuilder} representing the nth ancestor element
	 * of this node, or the root node if n exceeds the documents depth.
	 *
	 * @param steps The number of parent elements to step over while navigating up
	 * the chain of node ancestors. A steps value of 1 will find a nodes parent, 2
	 * will find its grandparent etc.
	 *
	 * @return The {@link XMLBuilder} representing the nth ancestor of this
	 * node, or the root node if this is reached before the nth parent is found.
	 */
	public XMLBuilder up(int steps){
		Node node = (Node)this.element;

		while(node.getParentNode() != null && steps-- > 0){
			node = node.getParentNode();
		}

		return new XMLBuilder((Element)node);
	}

	/**
	 * Return the {@link XMLBuilder} representing the parent of the current node.
	 *
	 * @return The {@link XMLBuilder} representing the parent of this node, or the
	 * root node if this method is called on the root node.
	 */
	public XMLBuilder up(){
		return this.up(1);
	}

	/**
	 * Serialize the XML document to a string. If the initial {@link XMLBuilder} was
	 * created using {@link #create(String)}, a normal XML document is returned. If
	 * it was created using {@link #create()}, the XML declaration is ommited and it
	 * also doesn't have a document element.
	 *
	 * @return The XML document as a string
	 *
	 * @throws TransformerException
	 */
	public String toString(){
		try{
			StringWriter  writer	 = new StringWriter();
			StreamResult  result     = new StreamResult(writer);
			Transformer   serializer = TransformerFactory.newInstance().newTransformer();
			Element       element    = this.document.getDocumentElement();

			serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");

			if(element.getNodeName().equals("xml-builder")){
				NodeList nodeList = element.getChildNodes();

				serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");

				for(int i = 0; i < nodeList.getLength(); i++){
					serializer.transform(new DOMSource(nodeList.item(i)), result);
				}
			}
			else{
				serializer.transform(new DOMSource(element), result);
			}

			return writer.toString();
		}
		catch(TransformerException e){
			throw new RuntimeException(e);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text: java -classpath ../../../../lib/hsqldb/hsqldb.jar org.hsqldb.Server -database petclinic


text:
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Vlc.DotNet.Core.Interops
{
    internal class Win32Exception : ExternalException
    {
        private readonly int myNativeErrorCode;

        public Win32Exception()
            : this(Marshal.GetLastWin32Error())
        {
        }

        public Win32Exception(int error)
            : this(error, GetErrorMessage(error))
        {
        }

        public Win32Exception(string message)
            : this(Marshal.GetLastWin32Error(), message)
        {
        }

        public Win32Exception(int error, string message)
            : base(message)
        {
            myNativeErrorCode = error;
        }

        public Win32Exception(string message, Exception innerException)
            : base(message, innerException)
        {
            myNativeErrorCode = Marshal.GetLastWin32Error();
        }

        public int NativeErrorCode
        {
            get { return myNativeErrorCode; }
        }

        private static string GetErrorMessage(int error)
        {
            var lpBuffer = new StringBuilder(0x100);
            if (FormatMessage(0x3200, new HandleRef(null, IntPtr.Zero), error, 0, lpBuffer, lpBuffer.Capacity + 1, IntPtr.Zero) == 0)
            {
                return ("Unknown error (0x" + Convert.ToString(error, 0x10) + ")");
            }
            int length = lpBuffer.Length;
            while (length > 0)
            {
                char ch = lpBuffer[length - 1];
                if ((ch > ' ') && (ch != '.'))
                {
                    break;
                }
                length--;
            }
            return lpBuffer.ToString(0, length);
        }

        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        internal static extern int FormatMessage(int dwFlags, HandleRef lpSource, int dwMessageId, int dwLanguageId, StringBuilder lpBuffer, int nSize, IntPtr arguments);

        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        internal static extern int FormatMessage(int dwFlags, SafeHandle lpSource, uint dwMessageId, int dwLanguageId, StringBuilder lpBuffer, int nSize, IntPtr[] arguments);

        #region Nested type: HandleRef

        [StructLayout(LayoutKind.Sequential), ComVisible(true)]
        public struct HandleRef
        {
            internal object m_wrapper;
            internal IntPtr m_handle;

            public HandleRef(object wrapper, IntPtr handle)
            {
                m_wrapper = wrapper;
                m_handle = handle;
            }

            public object Wrapper
            {
                get { return m_wrapper; }
            }

            public IntPtr Handle
            {
                get { return m_handle; }
            }

            public static explicit operator IntPtr(HandleRef value)
            {
                return value.m_handle;
            }

            public static IntPtr ToIntPtr(HandleRef value)
            {
                return value.m_handle;
            }
        }

        #endregion
    }
}


text:
<!-- ignore the following lines, they are not important to this demo -->
<jigsaw-demo-description [summary]="summary" [content]="description">
</jigsaw-demo-description>

<!-- start to learn the demo from here -->
<jigsaw-mobile-input [disabled]="!enabled"></jigsaw-mobile-input>

<jigsaw-mobile-switch [(checked)]="enabled" onLabel="enabled" offLabel="disabled">
</jigsaw-mobile-switch>


text:
<%#
 Copyright 2013-2018 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see http://www.jhipster.tech/
 for more information.

 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.
-%>
FROM <%= DOCKER_JAVA_JRE %>

ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
    JHIPSTER_SLEEP=0 \
    JAVA_OPTS="<%_ if (cacheProvider === 'infinispan') { _%>-Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true<%_ } _%>"

CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
    sleep ${JHIPSTER_SLEEP} && \
    java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.war

EXPOSE <%= serverPort %><% if (cacheProvider === 'hazelcast') { %> 5701/udp<% } %>

ADD *.war /app.war


text:
<?php

/**
 * TPagedDataSource class
 *
 * TPagedDataSource implements an integer-indexed collection class with paging functionality.
 *
 * Data items in TPagedDataSource can be traversed using foreach
 * PHP statement like the following,
 *
 * foreach($pagedDataSource as $dataItem)
 *
 * The data are fetched from {@link setDataSource DataSource}. Only the items
 * within the specified page will be returned and traversed.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package System.Collections
 * @since 3.0
 */
class TPagedDataSource extends TComponent implements IteratorAggregate,Countable
{
	/**
	 * @var mixed original data source
	 */
	private $_dataSource=null;
	/**
	 * @var integer number of items in each page
	 */
	private $_pageSize=10;
	/**
	 * @var integer current page index
	 */
	private $_currentPageIndex=0;
	/**
	 * @var boolean whether to allow paging
	 */
	private $_allowPaging=false;
	/**
	 * @var boolean whether to allow custom paging
	 */
	private $_allowCustomPaging=false;
	/**
	 * @var integer user-assigned number of items in data source
	 */
	private $_virtualCount=0;

	/**
	 * @return mixed original data source. Defaults to null.
	 */
	public function getDataSource()
	{
		return $this->_dataSource;
	}

	/**
	 * @param mixed original data source
	 */
	public function setDataSource($value)
	{
		if(!($value instanceof TMap) && !($value instanceof TList))
		{
			if(is_array($value))
				$value=new TMap($value);
			else if($value instanceof Traversable)
				$value=new TList($value);
			else if($value!==null)
				throw new TInvalidDataTypeException('pageddatasource_datasource_invalid');
		}
		$this->_dataSource=$value;
	}

	/**
	 * @return integer number of items in each page. Defaults to 10.
	 */
	public function getPageSize()
	{
		return $this->_pageSize;
	}

	/**
	 * @param integer number of items in each page
	 */
	public function setPageSize($value)
	{
		if(($value=TPropertyValue::ensureInteger($value))>0)
			$this->_pageSize=$value;
		else
			throw new TInvalidDataValueException('pageddatasource_pagesize_invalid');
	}

	/**
	 * @return integer current page index. Defaults to 0.
	 */
	public function getCurrentPageIndex()
	{
		return $this->_currentPageIndex;
	}

	/**
	 * @param integer current page index
	 */
	public function setCurrentPageIndex($value)
	{
		if(($value=TPropertyValue::ensureInteger($value))<0)
			$value=0;
		$this->_currentPageIndex=$value;
	}

	/**
	 * @return boolean whether to allow paging. Defaults to false.
	 */
	public function getAllowPaging()
	{
		return $this->_allowPaging;
	}

	/**
	 * @param boolean whether to allow paging
	 */
	public function setAllowPaging($value)
	{
		$this->_allowPaging=TPropertyValue::ensureBoolean($value);
	}

	/**
	 * @return boolean whether to allow custom paging. Defaults to false.
	 */
	public function getAllowCustomPaging()
	{
		return $this->_allowCustomPaging;
	}

	/**
	 * @param boolean whether to allow custom paging
	 */
	public function setAllowCustomPaging($value)
	{
		$this->_allowCustomPaging=TPropertyValue::ensureBoolean($value);
	}

	/**
	 * @return integer user-assigned number of items in data source Defaults to 0.
	 */
	public function getVirtualItemCount()
	{
		return $this->_virtualCount;
	}

	/**
	 * @param integer user-assigned number of items in data source
	 */
	public function setVirtualItemCount($value)
	{
		if(($value=TPropertyValue::ensureInteger($value))>=0)
			$this->_virtualCount=$value;
		else
			throw new TInvalidDataValueException('pageddatasource_virtualitemcount_invalid');
	}

	/**
	 * @return integer number of items in current page
	 */
	public function getCount()
	{
		if($this->_dataSource===null)
			return 0;
		if(!$this->_allowPaging)
			return $this->getDataSourceCount();
		if(!$this->_allowCustomPaging && $this->getIsLastPage())
			return $this->getDataSourceCount()-$this->getFirstIndexInPage();
		return $this->_pageSize;
	}

	/**
	 * Returns the number of items in the current page.
	 * This method is required by Countable interface.
	 * @return integer number of items in the current page.
	 */
	public function count()
	{
		return $this->getCount();
	}

	/**
	 * @return integer number of pages
	 */
	public function getPageCount()
	{
		if($this->_dataSource===null)
			return 0;
		$count=$this->getDataSourceCount();
		if(!$this->_allowPaging || $count<=0)
			return 1;
		return (int)(($count+$this->_pageSize-1)/$this->_pageSize);
	}

	/**
	 * @return boolean whether the current page is the first page Defaults to false.
	 */
	public function getIsFirstPage()
	{
		if($this->_allowPaging)
			return $this->_currentPageIndex===0;
		else
			return true;
	}

	/**
	 * @return boolean whether the current page is the last page
	 */
	public function getIsLastPage()
	{
		if($this->_allowPaging)
			return $this->_currentPageIndex===$this->getPageCount()-1;
		else
			return true;
	}

	/**
	 * @return integer the index of the item in data source, where the item is the first in
	 * current page
	 */
	public function getFirstIndexInPage()
	{
		if($this->_dataSource!==null && $this->_allowPaging && !$this->_allowCustomPaging)
			return $this->_currentPageIndex*$this->_pageSize;
		else
			return 0;
	}

	/**
	 * @return integer number of items in data source, if available
	 */
	public function getDataSourceCount()
	{
		if($this->_dataSource===null)
			return 0;
		else if($this->_allowCustomPaging)
			return $this->_virtualCount;
		else
			return $this->_dataSource->getCount();
	}

	/**
	 * @return Iterator iterator
	 */
	public function getIterator()
	{
		if($this->_dataSource instanceof TList)
			return new TPagedListIterator($this->_dataSource,$this->getFirstIndexInPage(),$this->getCount());
		else if($this->_dataSource instanceof TMap)
			return new TPagedMapIterator($this->_dataSource,$this->getFirstIndexInPage(),$this->getCount());
		else
			return null;
	}
}

/**
 * TPagedListIterator class
 *
 * TPagedListIterator implements Iterator interface.
 *
 * TPagedListIterator is used by {@link TPagedDataSource}. It allows TPagedDataSource
 * to return a new iterator for traversing the items in a {@link TList} object.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package System.Collections
 * @since 3.0
 */
class TPagedListIterator implements Iterator
{
	private $_list;
	private $_startIndex;
	private $_count;
	private $_index;

	/**
	 * Constructor.
	 * @param TList the data to be iterated through
	 * @param integer start index
	 * @param integer number of items to be iterated through
	 */
	public function __construct(TList $list,$startIndex,$count)
	{
		$this->_list=$list;
		$this->_index=0;
		$this->_startIndex=$startIndex;
		if($startIndex+$count>$list->getCount())
			$this->_count=$list->getCount()-$startIndex;
		else
			$this->_count=$count;
	}

	/**
	 * Rewinds internal array pointer.
	 * This method is required by the interface Iterator.
	 */
	public function rewind()
	{
		$this->_index=0;
	}

	/**
	 * Returns the key of the current array item.
	 * This method is required by the interface Iterator.
	 * @return integer the key of the current array item
	 */
	public function key()
	{
		return $this->_index;
	}

	/**
	 * Returns the current array item.
	 * This method is required by the interface Iterator.
	 * @return mixed the current array item
	 */
	public function current()
	{
		return $this->_list->itemAt($this->_startIndex+$this->_index);
	}

	/**
	 * Moves the internal pointer to the next array item.
	 * This method is required by the interface Iterator.
	 */
	public function next()
	{
		$this->_index++;
	}

	/**
	 * Returns whether there is an item at current position.
	 * This method is required by the interface Iterator.
	 * @return boolean
	 */
	public function valid()
	{
		return $this->_index<$this->_count;
	}
}

/**
 * TPagedMapIterator class
 *
 * TPagedMapIterator implements Iterator interface.
 *
 * TPagedMapIterator is used by {@link TPagedDataSource}. It allows TPagedDataSource
 * to return a new iterator for traversing the items in a {@link TMap} object.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package System.Collections
 * @since 3.0
 */
class TPagedMapIterator implements Iterator
{
	private $_map;
	private $_startIndex;
	private $_count;
	private $_index;
	private $_iterator;

	/**
	 * Constructor.
	 * @param array the data to be iterated through
	 */
	public function __construct(TMap $map,$startIndex,$count)
	{
		$this->_map=$map;
		$this->_index=0;
		$this->_startIndex=$startIndex;
		if($startIndex+$count>$map->getCount())
			$this->_count=$map->getCount()-$startIndex;
		else
			$this->_count=$count;
		$this->_iterator=$map->getIterator();
	}

	/**
	 * Rewinds internal array pointer.
	 * This method is required by the interface Iterator.
	 */
	public function rewind()
	{
		$this->_iterator->rewind();
		for($i=0;$i<$this->_startIndex;++$i)
			$this->_iterator->next();
		$this->_index=0;
	}

	/**
	 * Returns the key of the current array item.
	 * This method is required by the interface Iterator.
	 * @return integer the key of the current array item
	 */
	public function key()
	{
		return $this->_iterator->key();
	}

	/**
	 * Returns the current array item.
	 * This method is required by the interface Iterator.
	 * @return mixed the current array item
	 */
	public function current()
	{
		return $this->_iterator->current();
	}

	/**
	 * Moves the internal pointer to the next array item.
	 * This method is required by the interface Iterator.
	 */
	public function next()
	{
		$this->_index++;
		$this->_iterator->next();
	}

	/**
	 * Returns whether there is an item at current position.
	 * This method is required by the interface Iterator.
	 * @return boolean
	 */
	public function valid()
	{
		return $this->_index<$this->_count;
	}
}


text:
#ifndef AliHMPIDPid_h
#define AliHMPIDPid_h

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// AliHMPIDPid                                                          //
//                                                                      //
// HMPID class to perfom pattern recognition based on Hough transfrom   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include <TNamed.h>

class AliESDtrack;

class AliHMPIDPid : public TNamed
{
public :
             AliHMPIDPid();    //ctor
    virtual ~AliHMPIDPid() {;} //dtor

    void     FindPid(AliESDtrack *pESD,Double_t nmean,Int_t nsp,Double_t *prob);  //Find PID for tracks
    Double_t Resolution(Int_t iPart, Double_t thetaCerTh, AliESDtrack *pTrk);   //Find the sigma for a given ThetaCerTh

//
protected:

private:
  AliHMPIDPid(const AliHMPIDPid& r);                //dummy copy constructor
  AliHMPIDPid &operator=(const AliHMPIDPid& r);     //dummy assignment operator
//
  ClassDef(AliHMPIDPid,0)
};

#endif // #ifdef AliHMPIDPid_cxx


text:
"use strict";

// Parameter utilities
const ParamUtils = {};

/*
 *
 * function loadCallback(params, callback, setFunc)
 *
 * Enforces correct order of parameters in a function that accepts two: a set of
 * packed parameters and a callback function. The presence of a parameters
 * package will be enforced and the callback will be loaded into it. An outward
 * set function constructed like so is required to modify the calling function's
 * parameters: function() { return packedParamsObj = {}; }
 *
 */
ParamUtils.loadCallback = function(params, callback, setFunc) {
    // If callback is in place of params
    if (typeof params === "function" && typeof callback === "undefined") {
        // Move callback to appropriate place
        callback = params;
    }

    // If params is improperly typed
    if (typeof params !== "object" || params === null) {
        // Set params to a blank object (use a function to notify the caller)
        params = setFunc();
    }

    // Set callback as a parameter if it is not already
    if (typeof params.callback === "undefined") {
        params.callback = callback;
    }
};

/*
 *
 * function expectParams(params, expects)
 *
 * Asserts that a given set of packed parameters follows a given set of type
 * and presence expectations. Throws a detailed error message if otherwise.
 *
 */
ParamUtils.expectParams = function(params, expects) {
    // If parameters are invalidly typed
    if (params === null || typeof params !== "object") {
        throw "Invalid parameters (as of version 2.0.0, this library expects packed parameters)";
    }

    // A list of all unmet expectations
    let unmet = [];

    // Iterate over expectations
    for (let paramName in expects) {
        // Get expectation
        let expect = expects[paramName];
        let expectOptional = false;

        // Handle full expectations
        if (typeof expect === "object" && expect.type) {
            let temp = expect;
            expect = temp.type;
            expectOptional = temp.opt || false;
        }

        // Handle simple string type expectations
        if (typeof expect === "string") {
            // Wrap in array
            expect = [expect];
        }

        // Expectation must now be in array form
        if (!(typeof expect === "object" && expect instanceof Array)) {
            throw `Invalid expectation: unable to enforce ${typeof expect}`;
        }

        // Get parameter and its type
        let param = params[paramName];
        let paramType = typeof param;

        // If parameter is omitted, but optional, skip it
        if (paramType === "undefined" && expectOptional) {
            continue;
        }

        // Flag indicating match success
        let match = false;

        // Try to match expectation based on its type
        for (let expectType of expect) {
            if (typeof expectType === "string") {
                if (paramType === expectType) {
                    match = true;
                }
            } else if (typeof expectType === "function") {
                if (param instanceof expectType) {
                    match = true;
                }
            }

            // Succeed on first match, no need to continue
            if (match) {
                break;
            }
        }

        // If types did not match, record an appropriate error message
        if (!match) {
            let expectString = expect.join(" OR ");
            if (paramType === "undefined") {
                unmet.push(`Expected parameter \"${paramName}\" of type ${expectString}`);
            } else {
                unmet.push(`Expected${expectOptional ? " optional" : ""} parameter \"${paramName}\" of type ${expectString}, but got ${paramType}`);
            }
        }
    }

    // If problems were encountered, fail with compiled error message
    if (unmet.length > 0) {
        throw unmet.join("\n");
    }
};

module.exports = ParamUtils;


text:
This project demonstrates how to write unit tests for Jenkins pipeline code including declarative pipelines, scripted pipelines and shared library code under the /vars area. The framework does not strictly validate the pipeline syntax but it will emulate the pipeline using the JenkinsPipelineUnit framework and can validate any groovy script sections in the pipeline and logic. It may not be complete for all pipeline syntax.

It is using Spock, Gradle and Groovy and the JenkinsPipelineUnit framework available here: https://github.com/lesfurets/JenkinsPipelineUnit

The unit test is actually testing the Jenkinsfile that builds this Gradle project on Jenkins.

The below is an example of a unit test output from Jenkins console:

```
tests.job.JenkinsfileTestSpec > Jenkinsfile should run gradle tests with expected command line STANDARD_OUT
    post failure skipped as not FAILURE
    post unstable skipped as SUCCESS
    >>>>>> pipeline call stack -------------------------------------------------
       Jenkinsfile.run()
          Jenkinsfile.pipeline(groovy.lang.Closure)
             Jenkinsfile.agent(groovy.lang.Closure)
             Jenkinsfile.options(groovy.lang.Closure)
                Jenkinsfile.logRotator({numToKeepStr=10})
                Jenkinsfile.buildDiscarder(null)
                Jenkinsfile.timestamps()
             Jenkinsfile.triggers(groovy.lang.Closure)
                Jenkinsfile.pollSCM(*/5 * * * *)
             Jenkinsfile.stages(groovy.lang.Closure)
                Jenkinsfile.stage(Checkout, groovy.lang.Closure)
                   Jenkinsfile.steps(groovy.lang.Closure)
                      Jenkinsfile.deleteDir()
                      Jenkinsfile.checkout(groovy.lang.Closure)
                Jenkinsfile.stage(build, groovy.lang.Closure)
                   Jenkinsfile.steps(groovy.lang.Closure)
                      Jenkinsfile.tool({name=GRADLE_3, type=hudson.plugins.gradle.GradleInstallation})
                      Jenkinsfile.withEnv([GRADLE_HOME=GRADLE_3_HOME], groovy.lang.Closure)
                         Jenkinsfile.withEnv([PATH=/some/path:GRADLE_3_HOME/bin], groovy.lang.Closure)
                            Jenkinsfile.echo(GRADLE_HOME=GRADLE_3_HOME)
                            Jenkinsfile.echo(PATH=/some/path:GRADLE_3_HOME/bin)
                            Jenkinsfile.sh(gradle clean build test -i)
                Jenkinsfile.stage(validate, groovy.lang.Closure)
                   Jenkinsfile.steps(groovy.lang.Closure)
                      Jenkinsfile.echo(TODO: syntactic validation of Jenkinsfiles)
             Jenkinsfile.post(groovy.lang.Closure)
                Jenkinsfile.always(groovy.lang.Closure)
                   Jenkinsfile.echo(pipeline unit tests completed)
                Jenkinsfile.success(groovy.lang.Closure)
                   Jenkinsfile.echo(pipeline unit tests PASSED)
                Jenkinsfile.failure(groovy.lang.Closure)
                Jenkinsfile.changed(groovy.lang.Closure)
                   Jenkinsfile.echo(pipeline unit tests results have CHANGED)
                Jenkinsfile.unstable(groovy.lang.Closure)
       Jenkinsfile.execute()
```


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;

namespace NMF.Models.Changes
{

    /// <summary>
    /// The public interface for CompositionMoveToCollection
    /// </summary>
    [DefaultImplementationTypeAttribute(typeof(CompositionMoveToCollection))]
    [XmlDefaultImplementationTypeAttribute(typeof(CompositionMoveToCollection))]
    [ModelRepresentationClassAttribute("http://nmf.codeplex.com/changes#//CompositionMoveToCollection")]
    public interface ICompositionMoveToCollection : NMF.Models.IModelElement, ICompositionChange
    {

        /// <summary>
        /// The movedElement property
        /// </summary>
        [DisplayNameAttribute("movedElement")]
        [CategoryAttribute("CompositionMoveToCollection")]
        [XmlElementNameAttribute("movedElement")]
        [XmlAttributeAttribute(true)]
        NMF.Models.IModelElement MovedElement
        {
            get;
            set;
        }

        /// <summary>
        /// The origin property
        /// </summary>
        [BrowsableAttribute(false)]
        [XmlElementNameAttribute("origin")]
        [XmlAttributeAttribute(false)]
        [ContainmentAttribute()]
        IElementaryChange Origin
        {
            get;
            set;
        }

        /// <summary>
        /// Gets fired before the MovedElement property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> MovedElementChanging;

        /// <summary>
        /// Gets fired when the MovedElement property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> MovedElementChanged;

        /// <summary>
        /// Gets fired before the Origin property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> OriginChanging;

        /// <summary>
        /// Gets fired when the Origin property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> OriginChanged;
    }
}


text:
namespace MoreLinq
{
    using System.Collections.Generic;
    using System.Linq;

    static partial class MoreEnumerable
    {
        /// <summary>
        /// Returns a sequence of <see cref="KeyValuePair{TKey,TValue}"/>
        /// where the key is the zero-based index of the value in the source
        /// sequence.
        /// </summary>
        /// <typeparam name="TSource">Type of elements in <paramref name="source"/> sequence.</typeparam>
        /// <param name="source">The source sequence.</param>
        /// <returns>A sequence of <see cref="KeyValuePair{TKey,TValue}"/>.</returns>
        /// <remarks>This operator uses deferred execution and streams its
        /// results.</remarks>

        public static IEnumerable<KeyValuePair<int, TSource>> Index<TSource>(this IEnumerable<TSource> source)
        {
            return source.Index(0);
        }

        /// <summary>
        /// Returns a sequence of <see cref="KeyValuePair{TKey,TValue}"/>
        /// where the key is the index of the value in the source sequence.
        /// An additional parameter specifies the starting index.
        /// </summary>
        /// <typeparam name="TSource">Type of elements in <paramref name="source"/> sequence.</typeparam>
        /// <param name="source">The source sequence.</param>
        /// <param name="startIndex"></param>
        /// <returns>A sequence of <see cref="KeyValuePair{TKey,TValue}"/>.</returns>
        /// <remarks>This operator uses deferred execution and streams its
        /// results.</remarks>

        public static IEnumerable<KeyValuePair<int, TSource>> Index<TSource>(this IEnumerable<TSource> source, int startIndex)
        {
            return source.Select((item, index) => new KeyValuePair<int, TSource>(startIndex + index, item));
        }
    }
}


text:
package com.azure.spring.messaging.implementation.listener;

import com.azure.spring.cloud.service.listener.MessageListener;
import com.azure.spring.messaging.implementation.listener.adapter.MessagingMessageListenerAdapter;

public class SimpleMessagingMessageListener extends MessagingMessageListenerAdapter implements MessageListener<String> {

    @Override
    public void onMessage(String message) {

    }
}


text:
{{pollName}}

Search for this email to join: {{userEmail}}

 0">Question {{currentQuestionNumber}} / {{totalQuestions}}

{{currentQuestion.name}}

{{answer.name}} ({{answer.count}} votes)

Voting is allowed! {{timerRemaining}} seconds remaining

Voting as anonymous is allowed for this question

Voting is not allowed

			Go to the next question
			View poll results

			<canvas id="doughnut" class="chart chart-doughnut" chart-options="options" chart-data="data" chart-labels="labels"></canvas>

			<canvas id="votingactivity" width="300" height="70"></canvas>

			Firstname
			Lastname
			Email

			{{user.firstName}}
			{{user.lastName}}
			{{user.email}}


text:
package com.orientechnologies.orient.server.config;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "user")
@XmlType(propOrder = { "resources", "password", "name" })
public class OServerUserConfiguration {
	@XmlAttribute
	public String	name;

	@XmlAttribute
	public String	password;

	@XmlAttribute
	public String	resources;

	public OServerUserConfiguration() {
	}

	public OServerUserConfiguration(final String iName, final String iPassword, final String iResources) {
		name = iName;
		password = iPassword;
		resources = iResources;
	}
}


text:
"""
This package contains helper classes utilized elsewhere in the project.
"""

# __all__ = ['Boundary', 'Location', 'Pin']


text:
var cluster = require('cluster'),
    cpus = require('os').cpus();

module.exports = function (serverPath) {
    'use strict';

    if (cluster.isMaster) {
        // Fork workers
        cpus.forEach(function () {
            cluster.fork();
        });
    } else {
        // Workers can share any TCP server
        require(serverPath);
    }
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="c0fdbfce-4906-4c3c-86a6-1135baa2eb0e" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/k-means-forel/dbscan.js" afterPath="$PROJECT_DIR$/k-means-forel/dbscan.js" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/k-means-forel/index.html" afterPath="$PROJECT_DIR$/k-means-forel/index.html" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/k-means-forel/main.js" afterPath="$PROJECT_DIR$/k-means-forel/main.js" />
    </list>
    <ignored path="$PROJECT_DIR$/.tmp/" />
    <ignored path="$PROJECT_DIR$/temp/" />
    <ignored path="$PROJECT_DIR$/tmp/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="dbscan.js" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/k-means-forel/dbscan.js">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="380">
              <caret line="71" column="30" lean-forward="true" selection-start-line="71" selection-start-column="30" selection-end-line="71" selection-end-column="30" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/kmeans/index.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="116">
              <caret line="9" column="113" lean-forward="false" selection-start-line="9" selection-start-column="113" selection-end-line="9" selection-end-column="113" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.js" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/kmeans/index.js">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="439">
              <caret line="113" column="19" lean-forward="false" selection-start-line="113" selection-start-column="19" selection-end-line="113" selection-end-column="19" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/k-means-forel/index.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="72">
              <caret line="7" column="101" lean-forward="true" selection-start-line="7" selection-start-column="2" selection-end-line="7" selection-end-column="101" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="JavaScript File" />
      </list>
    </option>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>list</find>
      <find>property</find>
      <find>children</find>
      <find>foundObject</find>
      <find>data</find>
      <find>squaredError</find>
      <find>distance</find>
      <find>findClosestMean</find>
      <find>findIndexOfMinimum</find>
      <find>assignPointsToMeans</find>
      <find>algorithm</find>
      <find>region_query</find>
      <find>dbscan_state</find>
      <find>means</find>
      <find>reduce</find>
      <find>averagePosition</find>
    </findStrings>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/index.js" />
        <option value="$PROJECT_DIR$/src/components/data/index.js" />
        <option value="$PROJECT_DIR$/src/components/App.js" />
        <option value="$PROJECT_DIR$/src/components/Table.js" />
        <option value="$PROJECT_DIR$/src/css/index.css" />
        <option value="$PROJECT_DIR$/src/components/questions.js" />
        <option value="$PROJECT_DIR$/src/components/SearchCard.js" />
        <option value="$PROJECT_DIR$/k-means-forel/config.js" />
        <option value="$PROJECT_DIR$/k-means-forel/index.html" />
        <option value="$PROJECT_DIR$/k-means-forel/dbscan.js" />
        <option value="$PROJECT_DIR$/k-means-forel/main.js" />
        <option value="$PROJECT_DIR$/kmeans/index.html" />
        <option value="$PROJECT_DIR$/kmeans/index.js" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
    <package-json value="$PROJECT_DIR$/package.json" />
  </component>
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="NodeModulesDirectoryManager">
    <handled-path value="$PROJECT_DIR$/node_modules" />
  </component>
  <component name="ProjectFrameBounds">
    <option name="y" value="24" />
    <option name="width" value="1920" />
    <option name="height" value="991" />
  </component>
  <component name="ProjectLevelVcsManager">
    <ConfirmationsSetting value="1" id="Add" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="kmeans" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ii" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="k-means-forel" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../Pixel" />
    <property name="HbShouldOpenHtmlAsHb" value="" />
    <property name="js.eslint.eslintPackage" value="$PROJECT_DIR$/node_modules/eslint" />
    <property name="nodejs_interpreter_path" value="C:/Program Files/nodejs/node" />
    <property name="js-jscs-nodeInterpreter" value="C:\Program Files\nodejs\node.exe" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$" />
    </key>
  </component>
  <component name="RunManager">
    <configuration default="false" name="start" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
      <package-json value="$PROJECT_DIR$/package.json" />
      <command value="run" />
      <scripts>
        <script value="start" />
      </scripts>
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <method />
    </configuration>
    <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test">
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma">
      <config-file value="" />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
      <config-file value="" />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" value="" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run" />
      <scripts />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <working-directory />
      <pass-parent-env>true</pass-parent-env>
      <envs />
      <ui />
      <extra-mocha-options />
      <test-kind>DIRECTORY</test-kind>
      <test-directory />
      <recursive>false</recursive>
      <method />
    </configuration>
    <list size="1">
      <item index="0" class="java.lang.String" itemvalue="npm.start" />
    </list>
    <recent_temporary>
      <list size="1">
        <item index="0" class="java.lang.String" itemvalue="npm.start" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="c0fdbfce-4906-4c3c-86a6-1135baa2eb0e" name="Default" comment="" />
      <created>1488481886991</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1488481886991</updated>
      <workItem from="1488481892698" duration="5611000" />
      <workItem from="1488706196718" duration="3559000" />
      <workItem from="1488715779982" duration="3199000" />
      <workItem from="1488968450424" duration="1261000" />
      <workItem from="1488977063842" duration="28000" />
      <workItem from="1489122749271" duration="343000" />
      <workItem from="1489123105123" duration="7000" />
      <workItem from="1489124414220" duration="7871000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="21879000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="24" width="1920" height="991" extended-state="6" />
    <editor active="false" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24934107" sideWeight="0.4869281" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2474804" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24934107" sideWeight="0.5130719" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32968238" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32362822" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32968238" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="processedProjectFiles" value="true" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="1" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/k-means-forel/dbscan.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="558">
          <caret line="31" column="16" lean-forward="false" selection-start-line="31" selection-start-column="16" selection-end-line="31" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/config.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="630">
          <caret line="35" column="0" lean-forward="false" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/dbscan.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="558">
          <caret line="31" column="16" lean-forward="true" selection-start-line="31" selection-start-column="16" selection-end-line="31" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/config.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="630">
          <caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="10" column="2" lean-forward="false" selection-start-line="10" selection-start-column="2" selection-end-line="10" selection-end-column="2" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="36">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1296">
          <caret line="76" column="22" lean-forward="false" selection-start-line="76" selection-start-column="22" selection-end-line="76" selection-end-column="22" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="200">
          <caret line="10" column="2" lean-forward="false" selection-start-line="10" selection-start-column="2" selection-end-line="10" selection-end-column="2" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="40">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="200">
          <caret line="10" column="2" lean-forward="true" selection-start-line="10" selection-start-column="2" selection-end-line="10" selection-end-column="2" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="40">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="100">
          <caret line="5" column="15" lean-forward="false" selection-start-line="5" selection-start-column="15" selection-end-line="5" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="40">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1040">
          <caret line="56" column="21" lean-forward="false" selection-start-line="56" selection-start-column="21" selection-end-line="56" selection-end-column="21" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="100">
          <caret line="5" column="15" lean-forward="true" selection-start-line="5" selection-start-column="15" selection-end-line="5" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="40">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="580">
          <caret line="33" column="39" lean-forward="false" selection-start-line="33" selection-start-column="39" selection-end-line="33" selection-end-column="39" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/Table.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="216">
          <caret line="16" column="9" lean-forward="true" selection-start-line="10" selection-start-column="8" selection-end-line="16" selection-end-column="9" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="216">
          <caret line="12" column="4" lean-forward="false" selection-start-line="12" selection-start-column="4" selection-end-line="12" selection-end-column="4" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="36">
          <caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/css/index.css">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="72">
          <caret line="4" column="1" lean-forward="true" selection-start-line="4" selection-start-column="1" selection-end-line="4" selection-end-column="1" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/questions.js" />
    <entry file="file://$PROJECT_DIR$/src/components/SearchCard.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="525">
          <caret line="123" column="5" lean-forward="true" selection-start-line="123" selection-start-column="5" selection-end-line="123" selection-end-column="5" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/App.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="126">
          <caret line="7" column="8" lean-forward="false" selection-start-line="7" selection-start-column="8" selection-end-line="7" selection-end-column="8" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/components/data/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="10" column="2" lean-forward="false" selection-start-line="10" selection-start-column="2" selection-end-line="10" selection-end-column="2" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/generate.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="191">
          <caret line="28" column="9" lean-forward="false" selection-start-line="28" selection-start-column="9" selection-end-line="28" selection-end-column="9" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/kmeans2/.idea/kmeans.iml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="126">
          <caret line="7" column="14" lean-forward="true" selection-start-line="7" selection-start-column="14" selection-end-line="7" selection-end-column="14" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/config.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="576">
          <caret line="32" column="9" lean-forward="false" selection-start-line="32" selection-start-column="9" selection-end-line="32" selection-end-column="9" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="396">
          <caret line="46" column="32" lean-forward="true" selection-start-line="46" selection-start-column="32" selection-end-line="46" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="72">
          <caret line="7" column="101" lean-forward="true" selection-start-line="7" selection-start-column="2" selection-end-line="7" selection-end-column="101" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/kmeans/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="116">
          <caret line="9" column="113" lean-forward="false" selection-start-line="9" selection-start-column="113" selection-end-line="9" selection-end-column="113" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/kmeans/index.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="439">
          <caret line="113" column="19" lean-forward="false" selection-start-line="113" selection-start-column="19" selection-end-line="113" selection-end-column="19" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/k-means-forel/dbscan.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="380">
          <caret line="71" column="30" lean-forward="true" selection-start-line="71" selection-start-column="30" selection-end-line="71" selection-end-column="30" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Settings — Bambu Blog 2.0.1 documentation</title>

    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="Bambu Blog 2.0.1 documentation" href="index.html" />
    <link rel="next" title="Haystack" href="haystack.html" />
    <link rel="prev" title="Menus" href="menus.html" />

Navigation

          index

          modules |

          next |

          previous |

Bambu Blog 2.0.1 documentation »

Settings¶

<tt class="docutils literal">BLOG_COMMENTS_FORM</tt>

The class of the form used to post comments on a blog entry, expressed as a string (default is
‘bambu_comments.forms.CommentForm’)

<tt class="docutils literal">BLOG_COMMENTS_MODEL</tt>

The model used to store and query comments against blog posts. Use the notation supported by
<tt class="docutils literal">django.db.models.loading.get_model</tt> (default is <tt class="docutils literal">comments.Comment</tt>)

<tt class="docutils literal">BLOG_EXCERPT_LENGTH</tt>

The number of words in a blog excerpt before it’ll be truncated (default is 30)

<tt class="docutils literal">BLOG_POSTS_PER_PAGE</tt>

The number of blog posts to display on a page or in a feed (default is 10)

<tt class="docutils literal">BLOG_THUMBNAIL_WIDTH</tt>

The number of pixels wide a featured blog post image should be (default is 640)

<tt class="docutils literal">BLOG_XMLRPC_STAFF_ONLY</tt>

Set to <tt class="docutils literal">True</tt> to only allow staff users to access the XML-RPC endpoint

Previous topic

Menus

Next topic

Haystack

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

Bambu Blog 2.0.1 documentation »

        © Copyright 2014, Steadman.
      Created using Sphinx 1.2.2.


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

<TITLE>
I-Index
</TITLE>

<META NAME="date" CONTENT="2015-04-08">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

C D G I L S T

I

image -
Variable in class imagerecognition.ImageRecognition

imagerecognition - package imagerecognition

ImageRecognition - Class in imagerecognition
ImageRecognition
ImageRecognition() -
Constructor for class imagerecognition.ImageRecognition

isLOSFeatureInBoundary(int, boolean) -
Method in class imagerecognition.ImageRecognition

Check if the satellite is still within boundary

isSatelliteLost() -
Method in class imagerecognition.ImageRecognition

Check if the satellite has been lost

      Package
      Class
      Use
      Tree
      Deprecated
    Index
      Help

 PREV LETTER
 NEXT LETTER

  FRAMES
 NO FRAMES

  All Classes

C D G I L S T


text:
extern crate env_logger;
#[macro_use]
extern crate log;
extern crate vulkan_rs;

use std::ffi::CString;

use vulkan_rs::prelude::*;

fn create_instance<'l>(app_name: &str, _exts: &[&str]) -> VkResult<VkInstance<'l>> {
  let app_name = CString::new(app_name).unwrap();
  //TODO:let exts: Vec<CString> = exts.iter().map(|s| CString::new(*s).unwrap()).collect();
  //TODO:let exts_p: Vec<*const c_char> = exts.iter().map(|s| s.as_ptr()).collect();
  let app_info = VkApplicationInfo::new()
    .set_application_name(Some(&app_name))
    .set_application_version(vk_make_version(1, 0, 0))
    .set_engine_name(Some(&app_name))
    .set_engine_version(vk_make_version(1, 0, 0))
    .set_api_version(VK_API_VERSION_1_0);
  let create_info = VkInstanceCreateInfo::new()
                        //.set_pp_enabled_extension_names(exts_p)
                        .set_application_info(Some(&app_info));
  let r = vkCreateInstance(&create_info, None);
  match r {
    Ok(instance) => {
      debug!("created instance {:?}", instance);
      return Ok(instance);
    }
    Err(e) => {
      debug!("unable to create instance: {:?}", e);
      return Err(e);
    }
  }
}

fn main() {
  env_logger::init_from_env(env_logger::Env::new().filter_or(env_logger::DEFAULT_FILTER_ENV, "info"));

  let instance = create_instance("example create_instance", &[]).unwrap();

  let r = vkEnumeratePhysicalDevices(instance);
  match r {
    Ok(phys_devs) => {
      println!("There are {} devices", phys_devs.len());
    }
    Err(e) => {
      debug!("unable to enumerate devices: {:?}", e);
    }
  }
  vkDestroyInstance(instance, None);
}


text:
import _ from 'underscore';

import FileCollection from 'girder/collections/FileCollection';
import ItemView from 'girder/views/body/ItemView';
import { wrap } from 'girder/utilities/PluginUtils';

import ItemViewTemplate from '../templates/itemView.pug';

import FlowView from './FlowView';

// Show thumbnails on the item page
wrap(ItemView, 'render', function (render) {
    // ItemView is a special case in which rendering is done asynchronously,
    // so we must listen for a render event.
    this.once('g:rendered', function () {
        const thumbnails = new FileCollection(
            _.map(this.model.get('_thumbnails'), (id) => ({_id: id}))
        );

        if (thumbnails && thumbnails.length) {
            this.$('.g-item-info').before(ItemViewTemplate());

            new FlowView({
                className: 'g-thumbnails-flow-view-container',
                parentView: this,
                thumbnails: thumbnails,
                accessLevel: this.model.getAccessLevel()
            })
                .render()
                .$el.insertBefore(this.$('.g-item-info'));
        }
    }, this);

    render.call(this);
});


text:
var FeaturedUpdater = require('streamhub-sdk/collection/streams/featured-updater');
var Collection = require('streamhub-sdk/collection');
var MockCollection = require('streamhub-sdk-tests/mocks/collection/mock-collection');
var CollectionUpdater = require('streamhub-sdk/collection/streams/updater');
var Annotator = require('streamhub-sdk/content/annotator');
var Content = require('streamhub-sdk/content');

'use strict';

describe('streamhub-sdk/collection/streams/featured-updater', function () {
    var featuredUpdater;
    var mockCollection;
    beforeEach(function () {
        mockCollection = new MockCollection();
        var origCreateUpdater = mockCollection.createUpdater;
        var pushedFeatured = false;
        // Updater should just emit one featured thing and then end
        mockCollection.createUpdater = function () {
            var updater = origCreateUpdater.apply(this, arguments);
            updater._read = function () {
                if (pushedFeatured) {
                    this.push(null);
                    return;
                }
                var content = new Content('i am featured');
                content.set({ featured: true });
                pushedFeatured = true;
                this.push(content);
            };
            return updater;
        };
        featuredUpdater = new FeaturedUpdater({
            collection: mockCollection
        });
    });
    afterEach(function () {
        featuredUpdater.pause();
    });
    describe('on construction', function () {
        it('has a CollectionUpdater', function () {
            expect(featuredUpdater._updater instanceof CollectionUpdater).toBe(true);
        });

        it('has a Annotator', function () {
            expect(featuredUpdater._annotator instanceof Annotator).toBe(true);
        });

        it('observes "annotationDiff" event emitted by the CollectionUpdater', function () {
            expect(featuredUpdater._updater._listeners.annotationDiff.length).toBe(1);
        });
    });

    describe('handleAnnotations', function () {
        it('is handler for "annotationDiff" event emitted by the CollectionUpdater', function () {
            spyOn(featuredUpdater, 'handleAnnotations');
            var mockAnnotationDiff = {
                added: 'yay'
            };
            featuredUpdater._updater._handleAnnotationDiff('content1234', mockAnnotationDiff);
            expect(featuredUpdater.handleAnnotations).toHaveBeenCalled();
        });
    });
});


text:
package javax.application.event;

import java.util.function.Function;

/**
 * Annotation to define a filter for an {@link EventHandler}.
 *
 * @author Andres Almiray
 * @author Hendrik Ebbers
 */
public interface EventFilter<E> extends Function<EventMetadata<E>, Boolean> {
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /home/pedro/Code/Todos/TodosBackend/app/Http/Middleware/VerifyCsrfToken.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="../../css/bootstrap.min.css" rel="stylesheet">
  <link href="../../css/style.css" rel="stylesheet">

/home/pedro/Code/Todos/TodosBackend/app

Http

Middleware

VerifyCsrfToken.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

n/a

0 / 0

n/a

0 / 0

      CRAP

n/a

0 / 0

      VerifyCsrfToken

n/a

0 / 0

n/a

0 / 0

      0

n/a

0 / 0

1
	<?php

2

3
	namespace App\Http\Middleware;

4

5
	use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

6

7
	/**

8
	 * Class VerifyCsrfToken

9
	 * @package App\Http\Middleware

10
	 */

11
	class VerifyCsrfToken extends BaseVerifier

12
	{

13
	    /**

14
	     * The URIs that should be excluded from CSRF verification.

15
	     *

16
	     * @var array

17
	     */

18
	    protected $except = [

19
	        //

20
	    ];

21
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by php-code-coverage 4.0.5 using PHP 7.0.15-0ubuntu0.16.04.2 with Xdebug 2.5.0rc1 and PHPUnit 5.7.8 at Fri Mar 3 15:05:43 UTC 2017.


text:
layout: post
title: ajax
categories: Js
description: AJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术。
keywords: ajax
---

AJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术。

### 一、原生js的ajax使用
### 1.1 get请求
```
function getAjaxData(){
	var xmlhttp;
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
	    xmlhttp = new XMLHttpRequest();
	}else{// code for IE6, IE5
	    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function(){
	    if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	        document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
	    }
	}
	xmlhttp.open("GET","/ajax/get.php?fname=Bill&lname=Gates",true);
	xmlhttp.send();
}
```
### 1.2 post请求
```
function getAjaxData(){
    var xmlhttp;
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
	    xmlhttp = new XMLHttpRequest();
	}else{// code for IE6, IE5
	    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function(){
	    if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
	        document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
	    }
	}
	xmlhttp.open("POST","/ajax/post.php",true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("fname=Bill&lname=Gates");
}
```
### 二、jquery的ajax使用
```
function ajax(param) {
	var info = {
		url: param.url,
		type: param.type,
		dataType: 'json',
		success: function(rs) {
			if (rs.status == 200) {
				param.callback(rs.data);
			}else if(rs.status == 300) {
				window.location.href = rs.msg;
			}else{
				if(param.error){
					param.error();
				}
			}
		},
		error: function(err) {
			if(!err.reponseText) {
				err.reponseText = "系统错误,请稍后再试!";
			}
			if(param.error){
				param.error();
			}
		}
	};
	if (param.data) {
		info['data'] = param.data;
	}
	$.ajax(info);
}
```


text:
date: 2011-08-29 22:07:38+00:00
layout: post
image:
  thumbnail: /images/blog/collage.jpg
slug: penarroya-de-tastavins
title: Peñarroya de Tastavins
categories: day-by-day
---

[![](/images/blog/collage.jpg)](/images/blog/collage.jpg)

Amigos, un pueblo empinado... mucho tiempo libre y una buena excursión remontando el nacimiento del Matarraña. Resultado: Un finde muy corto :)


text:
import time

class SplitTableMixin(object):
    UPDATE_PROJECTS_TIME = 10 * 60

    def _collection_name(self, project):
        if self.collection_prefix:
            return "%s.%s" % (self.collection_prefix, project)
        else:
            return project

    @property
    def projects(self):
        if time.time() - getattr(self, '_last_update_projects', 0) \
                > self.UPDATE_PROJECTS_TIME:
            self._list_project()
        return self._projects

    @projects.setter
    def projects(self, value):
        self._projects = value

    def _list_project(self):
        self._last_update_projects = time.time()
        self.projects = set()
        if self.collection_prefix:
            prefix = "%s." % self.collection_prefix
        else:
            prefix = ''
        for each in self.database.collection_names():
            if each.startswith('system.'):
                continue
            if each.startswith(prefix):
                self.projects.add(each[len(prefix):])

    def drop(self, project):
        if project not in self.projects:
            self._list_project()
        if project not in self.projects:
            return
        collection_name = self._collection_name(project)
        self.database[collection_name].drop()
        self._list_project()


text:
import statistics

def mean(list):
    try:
        mean = statistics.mean(list)
    except statistics.StatisticsError:
        mean = 0
    return(mean)

def stdev(list):
    try:
        stdev = statistics.stdev(list)
    except statistics.StatisticsError:
        stdev = 0
    return(stdev)

def depth_search(depth_filename, region):
    doc_file = open(depth_filename)
    index_file = open(depth_filename + ".idx")

    chrom, lower_limit, upper_limit = parse_region(region)

    mem_read_depth = 0
    mem_offset_pos = 0

    #Find offset number for seek()
    index_file.readline()
    for mline in index_file:
        mline = mline.split("\t")
        if chrom == mline[0] and int(mline[1]) <= lower_limit: # Get the offset that is one before the lower limit
            mem_offset_pos = int(mline[2])
        elif chrom == mline[0] and lower_limit < int(mline[1]):
            break

    #In case lower_limit == 1, or lower_limit < first offset bp pos
    if mem_offset_pos == 0:
        index_file.seek(0)
        for mline in index_file:
            mline = mline.split("\t")
            if chrom == mline[0]:
                mem_offset_pos = int(mline[2])
                break

    depth_list = []

    # Make list of read depths in requested region
    doc_file.seek(mem_offset_pos)
    for line in doc_file:
        docline_chr, docline_position, docline_depth = line.strip().split("\t")
        docline_chr = docline_chr.replace("chr", "")
        docline_position = int(docline_position)
        docline_depth = int(docline_depth)
        if chrom == docline_chr and (lower_limit <= docline_position <= upper_limit):
            depth_list.append(docline_depth)
        elif chrom == docline_chr and upper_limit < docline_position:
            break
        elif chrom != docline_chr:
            break

    return(depth_list)

# Read in a two column file, and make a dictionary where the
# key is the first column and the value is the second column
def dict_from_file(filename, delimiter="\t", key_col=0, value_col=1, header=False, value_type="string"):
    f = file_or_stdin(filename)

    if header:
        f.readline()

    d = {}

    for line in f:
        fields = line.split(delimiter)
        if value_type == "int":
            d[fields[key_col].rstrip("\n")] = int(fields[value_col].rstrip("\n"))
        elif value_type == "float":
            d[fields[key_col].rstrip("\n")] = float(fields[value_col].rstrip("\n"))
        else:
            d[fields[key_col].rstrip("\n")] = fields[value_col].rstrip("\n")

    return(d)

def get_depth_lists(chrom, CNV_start, CNV_end, depth_filename, compute_left_left_right_right=False):
    region_template = "{0}:{1}-{2}"

    chrom_size = dict_from_file(depth_filename + ".chrinfo", header=True, value_type="int")

    if CNV_end < CNV_start:
        print("Invalid region entered (start coordinate {} is less than end coordinate {}). Please try again.".format(CNV_start, CNV_end))
        quit()
    if CNV_start < 1:
        print("Invalid region entered (start coordinate is less than 1). Please try again.")
        quit()
    if chrom not in chrom_size:
        print("Invalid chromomosome {} entered. Please try again.".format(chrom))
        quit()
    if CNV_end > chrom_size[chrom]:
        CNV_end = chrom_size[chrom]
        #print("Invalid region entered (end coordinate {} is greater than chromomosome {} size of {:d}). Please try again.".format(CNV_end, chrom, chrom_size[chrom]))
    if CNV_start > chrom_size[chrom]:
        return (None, None, None)

    CNV_size = CNV_end - CNV_start + 1

    left_flank_start = max(1, CNV_start - CNV_size)
    left_flank_end = CNV_start - 1
    left_flank_size = left_flank_end - left_flank_start + 1

    right_flank_start = CNV_end + 1
    right_flank_end = min(right_flank_start + CNV_size - 1, chrom_size[chrom])
    right_flank_size = right_flank_end - right_flank_start + 1

    left_flank_region = region_template.format(chrom, left_flank_start, left_flank_end)
    CNV_region = region_template.format(chrom, CNV_start, CNV_end)
    right_flank_region = region_template.format(chrom, right_flank_start, right_flank_end)

    left_flank_depths = depth_search(depth_filename, left_flank_region)
    CNV_depths = depth_search(depth_filename, CNV_region)
    right_flank_depths = depth_search(depth_filename, right_flank_region)

    depth_lists = {}
    depth_lists["left_flank_depths"] = left_flank_depths + [0] * (left_flank_size - len(left_flank_depths))
    depth_lists["CNV_depths"] = CNV_depths + [0] * (CNV_size - len(CNV_depths))
    depth_lists["right_flank_depths"] = right_flank_depths + [0] * (right_flank_size - len(right_flank_depths))

    if compute_left_left_right_right:  # For calculating read depth for short reads, if CNV is 251-300, compare with 151-200 and 351-400
        left_left_flank_start = max(1, CNV_start - 2*CNV_size)
        left_left_flank_end = max(1, left_flank_start - 1)
        left_left_flank_size = left_left_flank_end - left_left_flank_start + 1

        right_right_flank_start = min(right_flank_end + 1, chrom_size[chrom])
        right_right_flank_end = min(right_right_flank_start + CNV_size - 1, chrom_size[chrom])
        right_right_flank_size = right_right_flank_end - right_right_flank_start + 1

        left_left_flank_region = region_template.format(chrom, left_left_flank_start, left_left_flank_end)
        right_right_flank_region = region_template.format(chrom, right_right_flank_start, right_right_flank_end)

        left_left_flank_depths = depth_search(depth_filename, left_left_flank_region)
        right_right_flank_depths = depth_search(depth_filename, right_right_flank_region)

        depth_lists["left_left_flank_depths"] = left_left_flank_depths + [0] * (left_left_flank_size - len(left_left_flank_depths))
        depth_lists["right_right_flank_depths"] = right_right_flank_depths + [0] * (right_right_flank_size - len(right_right_flank_depths))

    return(depth_lists)

def parse_region(region): # Given a string in the form chr:start-end, return a three-element list containing chr, start, end
    chrom = region.split(":")[0].replace("chr", "").upper()
    start = int(region.split(":")[1].split("-")[0])
    end = int(region.split(":")[1].split("-")[1])

    return(chrom, start, end)

# Get the size bin name for a particular size
def get_size_bin(size):
    if size < 5000:
        return("[1000,5000)")
    elif size < 10000:
        return("[5000,10000)")
    elif size < 100000:
        return("[10000,100000)")
    elif size < 1000000:
        return("[100000,1000000)")
    else:
        return("[1000000,...)")

# Returns a filehandle either from the indicated filename, or if the indicated filename is "-", from standard input
def file_or_stdin(filename):
    if filename == "-":
        return(sys.stdin)
    else:
        return(open(filename))

# Returns ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', 'X', 'Y']
def get_chromosomes():
    return([str(c) for c in list(range(1, 23)) + ["X", "Y"]])

def read_common_format(CNV_filename):
    CNV_file = file_or_stdin(CNV_filename)
    header_line = CNV_file.readline().rstrip()
    CNVs = []

    for line in CNV_file:
        this_CNV = {}
        this_CNV["full_line"] = line.rstrip()
        this_CNV["chr"], this_CNV["start"], this_CNV["end"], this_CNV["size"], this_CNV["type"], this_CNV["quality_info"], this_CNV["caller"], this_CNV["caller_specific_info"] = line.rstrip().split("\t")[0:8]

        this_CNV["chr"] = this_CNV["chr"].replace("chr", "").upper()

        if this_CNV["chr"] == "M":
            continue

        this_CNV["start"] = int(float(this_CNV["start"]))
        this_CNV["end"] = int(float(this_CNV["end"]))
        this_CNV["size"] = this_CNV["end"] - this_CNV["start"] + 1

        this_CNV["string_rep"] = this_CNV["type"] + ":" + this_CNV["chr"] + ":" + str(this_CNV["start"]) + "-" + str(this_CNV["end"])
        this_CNV["string_rep_caller"] = this_CNV["caller"] + ":" + this_CNV["string_rep"]

        CNVs.append(this_CNV)

    return(CNVs, header_line)

def get_overlap(a, b): # a = [5,10] b = [7,12]
    return(max(0, min(a[1], b[1]) - max(a[0], b[0]) + 1))

def fifty_percent_reciprocal_overlap(CNV1, CNV2):
    if CNV1["chr"] != CNV2["chr"]:
        return(False)

    if CNV1["type"] != CNV2["type"]:
        return(False)

    overlap = get_overlap([CNV1["start"], CNV1["end"]], [CNV2["start"], CNV2["end"]])
    return(overlap >= (CNV1["size"] / 2) and overlap >= (CNV2["size"] / 2))

# read in a benchmark file, which has the format
#chromosome start_pos   end_pos length  type    technology
def read_benchmark(filename):
    file = file_or_stdin(filename)
    header_line = file.readline().rstrip() # Discard header line

    CNVs = []

    for line in file:
        line = line.rstrip()
        this_CNV = {}
        this_CNV["full_line"] = line.rstrip()
        fields = line.split("\t")

        this_CNV["chr"] = fields[0].replace("chr", "").upper()
        this_CNV["start"] = int(fields[1])
        this_CNV["end"] = int(fields[2])
        this_CNV["size"] = this_CNV["end"] - this_CNV["start"] + 1
        this_CNV["type"] = fields[4]
        this_CNV["caller"] = fields[5]

        this_CNV["string_rep"] = this_CNV["type"] + ":" + this_CNV["chr"] + ":" + str(this_CNV["start"]) + "-" + str(this_CNV["end"])
        this_CNV["string_rep_caller"] = this_CNV["caller"] + ":" + this_CNV["string_rep"]

        CNVs.append(this_CNV)

    return(CNVs, header_line)

def get_overlap_region(CNV1, CNV2):
    return get_overlap([CNV1["start"], CNV1["end"]], [CNV2["start"], CNV2["end"]])