text:
package Transformations;

import org.xml.sax.SAXException;

import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * @author xbencik1
 */
public class XmlSchemaValidatorImpl implements XmlSchemaValidator {
    private Schema schema;

    public XmlSchemaValidatorImpl(File fSchema) throws SAXException {
        SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        schema = schemaFactory.newSchema(fSchema);
    }

    @Override
    public boolean validate(File file) throws IOException {
        try {
            Validator validator = schema.newValidator();
            validator.validate(new StreamSource(new FileInputStream(file)));
            return true;
        } catch (SAXException ex) {
            //TODO logger
            return false;
        }
    }
}


text:
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf.urls.static import static

from .views import HomeView

# Uncomment the next two lines to enable the admin:
admin.autodiscover()

urlpatterns = (
    static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +
    patterns(
        '',
        url('^$', HomeView.as_view(), name='home'),
        url(r'^admin/', include(admin.site.urls)),
        url(r'^social/', include('socialregistration.urls', namespace='socialregistration')),
    )
)

redpajama_set_name: RedPajamaGithub


text:
package com.dt.cms.domain.sys;

import com.dt.cms.domain.BaseDomain;

public class Permission extends BaseDomain<Permission> {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private Integer id;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.PID
	 *
	 * @mbggenerated
	 */
	private Integer pid;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.NAME
	 *
	 * @mbggenerated
	 */
	private String name;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.TYPE
	 *
	 * @mbggenerated
	 */
	private String type;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.SORT
	 *
	 * @mbggenerated
	 */
	private Integer sort;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.URL
	 *
	 * @mbggenerated
	 */
	private String url;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.PERM_CODE
	 *
	 * @mbggenerated
	 */
	private String permCode;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.ICON
	 *
	 * @mbggenerated
	 */
	private String icon;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.STATE
	 *
	 * @mbggenerated
	 */
	private String state;

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column permission.DESCRIPTION
	 *
	 * @mbggenerated
	 */
	private String description;

	public Permission() {

	}

	public Permission(Integer pid, String name, String type, String url, String permCode) {
		this.pid = pid;
		this.name = name;
		this.type = type;
		this.url = url;
		this.permCode = permCode;
	}

	public Permission(Integer permissionId) {
		this.id = permissionId;
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.ID
	 *
	 * @return the value of permission.ID
	 *
	 * @mbggenerated
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.ID
	 *
	 * @param id
	 *            the value for permission.ID
	 *
	 * @mbggenerated
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.PID
	 *
	 * @return the value of permission.PID
	 *
	 * @mbggenerated
	 */
	public Integer getPid() {
		return pid;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.PID
	 *
	 * @param pid
	 *            the value for permission.PID
	 *
	 * @mbggenerated
	 */
	public void setPid(Integer pid) {
		this.pid = pid;
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.NAME
	 *
	 * @return the value of permission.NAME
	 *
	 * @mbggenerated
	 */
	public String getName() {
		return name;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.NAME
	 *
	 * @param name
	 *            the value for permission.NAME
	 *
	 * @mbggenerated
	 */
	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.TYPE
	 *
	 * @return the value of permission.TYPE
	 *
	 * @mbggenerated
	 */
	public String getType() {
		return type;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.TYPE
	 *
	 * @param type
	 *            the value for permission.TYPE
	 *
	 * @mbggenerated
	 */
	public void setType(String type) {
		this.type = type == null ? null : type.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.SORT
	 *
	 * @return the value of permission.SORT
	 *
	 * @mbggenerated
	 */
	public Integer getSort() {
		return sort;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.SORT
	 *
	 * @param sort
	 *            the value for permission.SORT
	 *
	 * @mbggenerated
	 */
	public void setSort(Integer sort) {
		this.sort = sort;
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.URL
	 *
	 * @return the value of permission.URL
	 *
	 * @mbggenerated
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.URL
	 *
	 * @param url
	 *            the value for permission.URL
	 *
	 * @mbggenerated
	 */
	public void setUrl(String url) {
		this.url = url == null ? null : url.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.PERM_CODE
	 *
	 * @return the value of permission.PERM_CODE
	 *
	 * @mbggenerated
	 */
	public String getPermCode() {
		return permCode;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.PERM_CODE
	 *
	 * @param permCode
	 *            the value for permission.PERM_CODE
	 *
	 * @mbggenerated
	 */
	public void setPermCode(String permCode) {
		this.permCode = permCode == null ? null : permCode.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.ICON
	 *
	 * @return the value of permission.ICON
	 *
	 * @mbggenerated
	 */
	public String getIcon() {
		return icon;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.ICON
	 *
	 * @param icon
	 *            the value for permission.ICON
	 *
	 * @mbggenerated
	 */
	public void setIcon(String icon) {
		this.icon = icon == null ? null : icon.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.STATE
	 *
	 * @return the value of permission.STATE
	 *
	 * @mbggenerated
	 */
	public String getState() {
		return state;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.STATE
	 *
	 * @param state
	 *            the value for permission.STATE
	 *
	 * @mbggenerated
	 */
	public void setState(String state) {
		this.state = state == null ? null : state.trim();
	}

	/**
	 * This method was generated by MyBatis Generator. This method returns the
	 * value of the database column permission.DESCRIPTION
	 *
	 * @return the value of permission.DESCRIPTION
	 *
	 * @mbggenerated
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * This method was generated by MyBatis Generator. This method sets the
	 * value of the database column permission.DESCRIPTION
	 *
	 * @param description
	 *            the value for permission.DESCRIPTION
	 *
	 * @mbggenerated
	 */
	public void setDescription(String description) {
		this.description = description == null ? null : description.trim();
	}
}


text:
package org.adl.validator.contentpackage;

// native java imports
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import org.adl.parsers.dom.DOMTreeUtility;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * Filename:
ManifestHandler.java

 *
 * Description: This method tracks, stores and retrieves  the
 * Launch Data information of SCOs and the Metadata information, all of which is
 * found or referenced from within the content package test subject.
 *
 * @author ADL Technical Team
 */
public class ManifestHandler implements Serializable {
	/**
	  *
	  */
	private static final long serialVersionUID = 1L;

	/**
	    * This method returns the default organization node that is flagged
	    * by the default attribute. This method serves as a helper method.
	    *
	    * @param iRootNode root node of test subject dom.
	    *
	    * @return Node default organization
	    */
	public static Node getDefaultOrganizationNode(Node iRootNode) {
		Node result = null;

		// find the value of the "default" attribute of the <organizations> node
		Node organizationsNode = DOMTreeUtility.getNode(iRootNode, "organizations");
		if (organizationsNode != null) {
			NamedNodeMap attrList = organizationsNode.getAttributes();
			String defaultIDValue = (attrList.getNamedItem("default")).getNodeValue();

			// traverse the <organization> nodes and find the matching default ID
			NodeList children = organizationsNode.getChildNodes();

			if (children != null) {
				int numChildren = children.getLength();

				for (int i = 0; i < numChildren; i++) {
					Node currentChild = children.item(i);
					String currentChildName = currentChild.getLocalName();

					if (currentChildName.equals("organization")) {
						// find the value of the "identifier" attribute of the
						// <organization> node
						NamedNodeMap orgAttrList = currentChild.getAttributes();
						String idValue = (orgAttrList.getNamedItem("identifier")).getNodeValue();

						if (idValue.equals(defaultIDValue)) {
							result = currentChild;
							break;
						}
					}
				}
			}
		}

		return result;
	}

	/**
	 * This method retrieves all the organization nodes from the content package
	 * manifest dom.  This method serves as a helper for retrieving SCO
	 * launch data.
	 *
	 * @param iDefaultOrganizationOnly boolean describing the scope of the
	 *        organization that should be traversed for SCO launch data. Specific
	 *        to SRTE uses - will no longer be needed in future development.
	 *
	 * @param iRootNode root node of test subject dom.
	 *
	 * @return List Containing a list of organization nodes.
	 */
	public static List<Node> getOrganizationNodes(Node iRootNode, boolean iDefaultOrganizationOnly) {
		//mLogger.entering("ManifestHandler", "getOrganizationNodes()");
		List<Node> result = new ArrayList<Node>();

		if (iDefaultOrganizationOnly) {
			result.add(getDefaultOrganizationNode(iRootNode));
		} else {
			// get the list of organization nodes
			Node organizationsNode = DOMTreeUtility.getNode(iRootNode, "organizations");

			if (organizationsNode != null) {
				NodeList children = organizationsNode.getChildNodes();

				if (children != null) {
					int numChildren = children.getLength();

					for (int i = 0; i < numChildren; i++) {
						Node currentChild = children.item(i);
						String currentChildName = currentChild.getLocalName();

						if (currentChildName.equals("organization")) {
							// add the organization node to the resulting list
							result.add(currentChild);
						}
					}
				}
			}
		}
		return result;
	}

	/**
	 * This method returns the list of resources related to SSP.

	 *
	 * @param iRootNode Node object that contains SSP resources
	 * @return List of SSP resources

	 */

	public static List<Node> getSSPResourceList(Node iRootNode) {
		//take
		List<Node> result = new ArrayList<Node>();

		// get the list of resource nodes
		Node resourcesNode = DOMTreeUtility.getNode(iRootNode, "resources");
		//NodeList resources = resourcesNode.getChildNodes();
		List<Node> resource = DOMTreeUtility.getNodes(resourcesNode, "resource");

		if (resource != null) {
			//int numResources = resources.getLength();
			int numResources = resource.size();

			for (int i = 0; i < numResources; i++) {
				Node child = resource.get(i);
				NodeList children = child.getChildNodes();

				int numChildren = children.getLength();

				for (int j = 0; j < numChildren; j++) {
					Node currentChild = children.item(j);
					String currentChildName = currentChild.getLocalName();

					if (currentChildName.equals("bucket")) {
						// add the organization node to the resulting list
						result.add(child);
						break;
					}
				}
			}
		}
		return result;
	}

	/**
	 * This attribute serves as the Logger object used for debug logging.
	 */
	private transient Logger mLogger = Logger.getLogger("org.adl.util.debug.validator");

	/**
	 * This attribute describes whether or not SCO launch data has been
	 * tracked.
	 */
	private boolean mLaunchDataTracked;

	/**
	 * This attribute describes whether or not the metadata information was
	 * tracked.
	 */
	private boolean mMetadataTracked;

	/**
	 * This attribute serves as the storage list of the tracked metadata
	 * information. This list will contain the following information:  If inline
	 * metadata, than the root node will be stored here along with the
	 * metadata application profile type.  If external metadata, than the URI to
	 * the metadata will be stored along with the metadata application profile
	 * type.
	 */
	private List<MetadataData> mMetadataDataList;

	/**
	 * This attribute serves as the storage list of the tracked SCO launch data.
	 * This list uses the default organization and does not comply with given
	 * sequencing rules.  This list can be used for default behavior and
	 * testing purposes.
	 */
	private List<LaunchData> mLaunchDataList;

	/**
	 * This attribute contains the xml:base value created from the <manifest>
	 * and <resources> elements.
	 *
	 */
	private String mManifestResourcesXMLBase;

	/**
	 * This attribute contains the xml:base value created from each <resource>
	 * element.  It will complete the xml:base value after being appended to
	 * the mManifestResourceXMLBase attribute.
	 */
	private String mResourceXMLBase;

	/**
	 * This attribute contains a list of the metadata as referenced in the
	 * IMS Manifest by the adlcp:location element.
	 */
	private List<String> mLocationList;

	/**
	 * used in all areas where an empty string was checked for, or a string was set to ""
	 */
	private String mEMPTY_STRING = "";

	/**
	 * Default Constructor.  Sets the attributes to their initial values.
	 */
	public ManifestHandler() {
		mLaunchDataTracked = false;
		mMetadataTracked = false;
		mMetadataDataList = new ArrayList<MetadataData>();
		mLaunchDataList = new ArrayList<LaunchData>();
		mManifestResourcesXMLBase = "";
		mResourceXMLBase = "";
		mLocationList = new ArrayList<String>();
	}

	/**
	 * This method retrieves the information described by the <item>
	 * element and saves it for SCO launch data information.  This method
	 * traverses the <item>s of the <organization> recursively and
	 * retrieves the identifiers, referenced identifier references and
	 * corresponding parameters from the <resources> element.
	 *
	 * @param iNode The organization node.
	 *
	 * @param iOrgID The ID of the organization.
	 */
	private void addItemInfo(Node iNode, String iOrgID) {
		mLogger.entering("ManifestHandler", "addItemInfo()");
		if (iNode == null)
			return;

		int type = iNode.getNodeType();
		String orgID = iOrgID;

		switch (type) {
		// document node
		// this is a fail safe case to handle an error where a document node
		// is passed
		case Node.DOCUMENT_NODE: {
			Node rootNode = ((Document) iNode).getDocumentElement();

			addItemInfo(rootNode, orgID);

			break;
		}

		// element node
		case Node.ELEMENT_NODE: {
			String nodeName = iNode.getLocalName();

			// get the needed values of the attributes
			if (nodeName.equals("item")) {
				String orgIdentifier = mEMPTY_STRING;
				String identifier = mEMPTY_STRING;
				String identifierref = mEMPTY_STRING;
				String parameters = mEMPTY_STRING;
				String title = mEMPTY_STRING;
				String dataFromLMS = mEMPTY_STRING;
				String timeLimitAction = mEMPTY_STRING;
				String completionThreshold = mEMPTY_STRING;
				String objectiveslist = mEMPTY_STRING;
				boolean previous = false;
				boolean shouldContinue = false;
				boolean exit = false;
				boolean exitAll = false;
				boolean abandon = false;
				boolean suspendAll = false;

				//Assign orgIdentifier the value of the parameter iOrgID
				orgIdentifier = iOrgID;

				// get the value of the following attributes:
				// - identifier
				// - identifierref
				// - parameters
				//
				// leave the value at "" is the attribute does not exist
				NamedNodeMap attrList = iNode.getAttributes();
				int numAttr = attrList.getLength();
				Attr currentAttrNode;
				String currentNodeName;

				// loop through the attributes and get their values assuming that
				// the multiplicity of each attribute is 1 and only 1.
				for (int i = 0; i < numAttr; i++) {
					currentAttrNode = (Attr) attrList.item(i);
					currentNodeName = currentAttrNode.getLocalName();

					// store the value of the attribute
					if (currentNodeName.equalsIgnoreCase("identifier")) {
						identifier = currentAttrNode.getValue();
					} else if (currentNodeName.equalsIgnoreCase("identifierref")) {
						identifierref = currentAttrNode.getValue();
					} else if (currentNodeName.equalsIgnoreCase("parameters")) {
						parameters = currentAttrNode.getValue();
					}

				}

				// get the value of the title element
				// assume that there is 1 and only 1 child named title
				title = DOMTreeUtility.getNodeValue(DOMTreeUtility.getNode(iNode, "title"));

				// get the value of the datafromlms element
				dataFromLMS = DOMTreeUtility.getNodeValue(DOMTreeUtility.getNode(iNode, "dataFromLMS"));

				// get the value of the timelimitaction element
				timeLimitAction = DOMTreeUtility.getNodeValue(DOMTreeUtility.getNode(iNode, "timeLimitAction"));

				// get the value of the completionThreshold element
				completionThreshold = DOMTreeUtility.getNodeValue(DOMTreeUtility.getNode(iNode, "completionThreshold"));

				//Gets the sequencing objectives list for this item
				objectiveslist = getObjectivesList(DOMTreeUtility.getNode(iNode, "sequencing"));

				//get the hideRTSUI elements and set the previous, continue,
				//exit, exitAll, abandon and suspendAll variables accordingly.
				Node presentationNode = DOMTreeUtility.getNode(iNode, "presentation");
				if (presentationNode != null) {
					Node navInterfaceNode = DOMTreeUtility.getNode(presentationNode, "navigationInterface");
					if (navInterfaceNode != null) {
						NodeList children = navInterfaceNode.getChildNodes();
						if (children != null) {
							int numChildren = children.getLength();
							for (int i = 0; i < numChildren; i++) {
								Node currentChild = children.item(i);
								String currentChildName = currentChild.getLocalName();
								if (currentChildName.equals("hideLMSUI")) {
									String currentChildValue = DOMTreeUtility.getNodeValue(currentChild);
									if (currentChildValue.equals("previous")) {
										previous = true;
									} else if (currentChildValue.equals("continue")) {
										shouldContinue = true;
									} else if (currentChildValue.equals("exit")) {
										exit = true;
									} else if (currentChildValue.equals("exitAll")) {
										exitAll = true;
									} else if (currentChildValue.equals("abandon")) {
										abandon = true;
									} else if (currentChildValue.equals("suspendAll")) {
										suspendAll = true;
									}
								}
							}
						}
					}
				}

				// make sure this item actually points to a <resource>
				if (!identifierref.equals(mEMPTY_STRING)) {
					// create an instance of the LaunchData data structure and
					// add it to the LaunchDataList
					LaunchData launchData = new LaunchData();

					launchData.setOrganizationIdentifier(orgIdentifier);
					launchData.setItemIdentifier(identifier);
					launchData.setResourceIdentifier(identifierref);
					launchData.setParameters(parameters);
					launchData.setItemTitle(title);
					launchData.setDataFromLMS(dataFromLMS);
					launchData.setTimeLimitAction(timeLimitAction);
					launchData.setCompletionThreshold(completionThreshold);
					launchData.setPrevious(previous);
					launchData.setContinue(shouldContinue);
					launchData.setExit(exit);
					launchData.setExitAll(exitAll);
					launchData.setAbandon(abandon);
					launchData.setSuspendAll(suspendAll);
					launchData.setMinNormalizedMeasure(getMinNormalizedMeasure(iNode));
					launchData.setAttemptAbsoluteDurationLimit(getAttemptAbsoluteDurationLimit(iNode));
					launchData.setObjectivesList(objectiveslist);

					mLaunchDataList.add(launchData);
				}
			}

			// get the child nodes and add their items info
			NodeList children = iNode.getChildNodes();

			if (children != null) {
				int numChildren = children.getLength();
				Node currentChild;

				for (int z = 0; z < numChildren; z++) {
					currentChild = children.item(z);
					addItemInfo(currentChild, orgID);
				}
			}
		}
		// handle all other node types
		default: {
			break;
		}
		}
	}

	/**
	 * This method uses the information stored in the SCO Launch Data List
	 * to get the associated Resource level data.
	 *
	 * @param iRootNode root node of the DOM.
	 *
	 * @param iRemoveAssets boolean representing whether or not the assets should
	 *                      be removed.  (The Sample RTE will never want to
	 *                      remove the assets, where as the TestSuite will.)
	 */
	private void addResourceInfo(Node iRootNode, boolean iRemoveAssets) {
		// get the <resources> node
		Node resourcesNode = DOMTreeUtility.getNode(iRootNode, "resources");

		String scormType = mEMPTY_STRING;
		String location = mEMPTY_STRING;
		String xmlBase = mEMPTY_STRING;

		// launch data processing stuff
		int size = mLaunchDataList.size();
		LaunchData currentLaunchData;
		String resourceIdentifier = mEMPTY_STRING;
		String persistState = mEMPTY_STRING;
		Node matchingResourceNode = null;

		// here we are dealing with a content aggregation package
		for (int i = 0; i < size; i++) {
			currentLaunchData = mLaunchDataList.get(i);
			resourceIdentifier = currentLaunchData.getResourceIdentifier();

			matchingResourceNode = getResourceNodeWithIdentifier(resourcesNode, resourceIdentifier);

			// Ensure resource node exists
			if (matchingResourceNode != null) {
				// get the value of the following attributes:
				// - adlcp:scormtype
				// - href
				// - xml:base
				//
				// leave the value at "" is the attribute does not exist
				scormType = DOMTreeUtility.getAttributeValue(matchingResourceNode, "scormType");
				location = DOMTreeUtility.getAttributeValue(matchingResourceNode, "href");
				xmlBase = DOMTreeUtility.getAttributeValue(matchingResourceNode, "base");
				persistState = DOMTreeUtility.getAttributeValue(matchingResourceNode, "persistState");
			}

			// populate the current Launch Data with the resource level values
			currentLaunchData.setSCORMType(scormType);
			currentLaunchData.setLocation(location);
			currentLaunchData.setResourceXMLBase(xmlBase);
			currentLaunchData.setPersistState(persistState);

			try {
				mLaunchDataList.set(i, currentLaunchData);
			} catch (ArrayIndexOutOfBoundsException aioobe) {
				System.out.println("ArrayIndexOutOfBoundsException caught on " + "List currentLaunchData.  Attempted index " + "access is " + i
				        + "size of List is " + mLaunchDataList.size());
			}
		}

		if (size == 0) // then we are dealing with a resource package
		{
			// loop through resources to retieve all resource information
			// loop through the children of <resources>
			NodeList children = resourcesNode.getChildNodes();

			if (children != null) {
				int childrenSize = children.getLength();
				for (int z = 0; z < childrenSize; z++) {
					Node currentNode = children.item(z);
					String currentNodeName = currentNode.getLocalName();

					if (currentNodeName.equals("resource")) {
						// create an instance of the LaunchData data structure and
						// add it to the LaunchDataList
						LaunchData launchData = new LaunchData();

						// get the value adlcp:scormtype, href, base attribute
						// leave the value at "" is the attribute does not exist
						scormType = DOMTreeUtility.getAttributeValue(currentNode, "scormType");

						location = DOMTreeUtility.getAttributeValue(currentNode, "href");

						xmlBase = DOMTreeUtility.getAttributeValue(currentNode, "base");

						resourceIdentifier = DOMTreeUtility.getAttributeValue(currentNode, "identifier");

						// populate the  Launch Data with the resource level values
						launchData.setSCORMType(scormType);
						launchData.setLocation(location);
						launchData.setResourceXMLBase(xmlBase);
						launchData.setResourceIdentifier(resourceIdentifier);

						mLaunchDataList.add(launchData);
					} // end if current node == resource
				} // end looping over children
			} // end if there are no children
		} // end if size == 0

		if (iRemoveAssets) {
			removeAssetsFromLaunchDataList();
		}
	}

	/**
	 * This method returns a list of all the metadata that is referenced
	 * via the <adlcp:location> element in an IMS Manifest.
	 *
	 * @param iNode element nodes traversed for metadata element.
	 *
	 **/
	private void checkForAdlcpLocationMD(Node iNode) {

		if (iNode != null) {
			String nodeName = iNode.getLocalName();

			if (nodeName != null) {
				if (nodeName.equals("manifest")) {
					// set and retrieve xml:base of manifest if it exists

					// must first clear out xml:base values if dealing with a sub
					if (!mManifestResourcesXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = mEMPTY_STRING;
						mResourceXMLBase = mEMPTY_STRING;
					}

					String manifestXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					if (!manifestXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = manifestXMLBase;
					}

					getAdlcpLocationMD(iNode);
				} else if (nodeName.equals("organization")) {
					getAdlcpLocationMD(iNode);
				} else if (nodeName.equals("item")) {
					getAdlcpLocationMD(iNode);
				} else if (nodeName.equals("resources")) {
					// set and retrieve xml:base of resources if it exists
					String resourcesXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					if (!resourcesXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = mManifestResourcesXMLBase + resourcesXMLBase;
					}

				} else if (nodeName.equals("resource")) {

					// retrieve xml:base of resource if it exists
					// cannot set classattribute - applies to specified resource only

					mResourceXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					getAdlcpLocationMD(iNode);
				} else if (nodeName.equals("file")) {
					getAdlcpLocationMD(iNode);
				}

				NodeList nodeChildren = iNode.getChildNodes();
				if (nodeChildren != null) {
					int size = nodeChildren.getLength();
					for (int i = 0; i < size; i++) {
						checkForAdlcpLocationMD(nodeChildren.item(i));
					}
				}
			}
		}
	}

	/**
	 * This method retrieves only the adlcp:location value and stores it in a
	 * List
	 *
	 * @param iNode - element nodes traversed for metadata element
	 *
	 */
	private void getAdlcpLocationMD(Node iNode) {
		Node metadataNode = DOMTreeUtility.getNode(iNode, "metadata");

		if (metadataNode != null) {
			//Gets all the location metadata
			List<Node> locationNodeList = DOMTreeUtility.getNodes(metadataNode, "location");

			// iterate through the List and get the attribute names and values

			int locationNodeListSize = locationNodeList.size();
			for (int i = 0; i < locationNodeListSize; i++) {

				//Gets the location value of each node
				String locationValue = DOMTreeUtility.getNodeValue(locationNodeList.get(i));
				locationValue = mManifestResourcesXMLBase + mResourceXMLBase + locationValue;
				mLocationList.add(locationValue);

			}
		}
	}

	/**
	 * This method retrieves the attemptAbsoluteDurationLimit element from the
	 * parent sequencing element.
	 *
	 * @param iNode  node to be manipulated for attemptAbsoluteDurationLimit
	 * value.
	 *
	 * @return String containing the attemptAbsoluteDurationLimit value.
	 */
	private String getAttemptAbsoluteDurationLimit(Node iNode) {
		String attemptAbsoluteDurationLimit = mEMPTY_STRING;

		String nodeName = iNode.getLocalName();

		if (nodeName.equals("item")) {
			Node sequencingNode = DOMTreeUtility.getNode(iNode, "sequencing");
			if (sequencingNode != null) {
				Node limitConditionsNode = DOMTreeUtility.getNode(sequencingNode, "limitConditions");
				if (limitConditionsNode != null) {
					attemptAbsoluteDurationLimit = DOMTreeUtility.getAttributeValue(limitConditionsNode, "attemptAbsoluteDurationLimit");
				}
			}
		}
		return attemptAbsoluteDurationLimit;
	}

	/**
	 * This method initiates the retrieval of the SCO launch data
	 * information, if this information exists in the content package test
	 * subject.
	 *
	 * @param iRootNode root node manipulated for retrieval of launch data.
	 *
	 * @param iDefaultOrganizationOnly boolean describing the scope of the
	 *        organization that should be traversed for SCO launch data. Specific
	 *        to SRTE uses - will no longer be needed in future development.
	 *
	 * @param iRemoveAssets boolean describing whether or not to remove assets
	 *        from the LaunchData list.  The SRTE needs this to be false in
	 *        in order to import assets as well.
	 *
	 * @return List containing the launch data information for SCOs.
	 */
	public List<LaunchData> getLaunchData(Node iRootNode, boolean iDefaultOrganizationOnly, boolean iRemoveAssets) {
		mLogger.entering("ManifestHandler", "getLaunchData(iRootNode)");
		if (!mLaunchDataTracked) {
			setLaunchData(iRootNode, iDefaultOrganizationOnly, iRemoveAssets);
		}
		return mLaunchDataList;
	}

	/**
	 * This method initiates the retrieval of a list of adlcp:location element
	 * values only.
	 *
	 * @param iRootNode root node manipulated for retrieval of adlcp:location
	 * metadata info.
	 *
	 * @return List containing the adlcp:location metadata information.
	 */
	public List<String> getLocationMD(Node iRootNode) {
		checkForAdlcpLocationMD(iRootNode);
		return mLocationList;
	}

	/**
	 * This method initiates the retrieval of the metadata information,
	 * if this information exists in the content package test subject.
	 *
	 * @param iRootNode root node manipulated for retrieval of metadata info.
	 *
	 * @param iBaseDirectory base directory for location of test subject
	 *
	 * @return List containing the metadata information.
	 */
	public List<MetadataData> getMetadata(Node iRootNode, String iBaseDirectory) {
		if (!mMetadataTracked) {
			setMetadata(iRootNode, iBaseDirectory);
		}

		return mMetadataDataList;
	}

	/**
	 * This method retrieves the minNormalizedMeasure element from the parent
	 * sequencing element.
	 *
	 * @param iNode to be manipulated for minnormalizedmeasure value.
	 *
	 * @return String containing the minNormalizedMeasure value.
	 */
	private String getMinNormalizedMeasure(Node iNode) {
		String minNormalizedMeasure = mEMPTY_STRING;
		String nodeName = iNode.getLocalName();

		if (nodeName.equals("item")) {
			Node sequencingNode = DOMTreeUtility.getNode(iNode, "sequencing");
			if (sequencingNode != null) {
				Node objectivesNode = DOMTreeUtility.getNode(sequencingNode, "objectives");
				if (objectivesNode != null) {
					Node primaryObjectiveNode = DOMTreeUtility.getNode(objectivesNode, "primaryObjective");
					if (primaryObjectiveNode != null) {
						String satisfiedByMeasureValue = DOMTreeUtility.getAttributeValue(primaryObjectiveNode, "satisfiedByMeasure");
						if (satisfiedByMeasureValue.equals("true")) {
							Node minNormalizedMeasureNode = DOMTreeUtility.getNode(primaryObjectiveNode, "minNormalizedMeasure");
							if (minNormalizedMeasureNode != null) {
								minNormalizedMeasure = DOMTreeUtility.getNodeValue(minNormalizedMeasureNode);
								if (minNormalizedMeasure.trim().equals(mEMPTY_STRING)) {
									minNormalizedMeasure = "1.0";
								}
							} else {
								minNormalizedMeasure = "1.0";
							}
						}
					}
				}
			}
		}
		return minNormalizedMeasure;
	}

	/**
	 * This method gets all the sequencing objectives associated with the
	 * current item.
	 *
	 * @param iNode root item node.
	 *
	 * @return String - returns a string contaniing the objectives data
	 */
	private String getObjectivesList(Node iNode) {
		int j, k;
		NamedNodeMap attributesList = null;
		String result = mEMPTY_STRING;

		// Gets to the objectives node, if one exists
		if (iNode != null) {
			Node objNode = DOMTreeUtility.getNode(iNode, "objectives");

			if (objNode != null) {
				//Gets the primary objective id
				Node primaryObjNode = DOMTreeUtility.getNode(objNode, "primaryObjective");
				if (primaryObjNode != null) {
					attributesList = primaryObjNode.getAttributes();

					// iterate through the NamedNodeMap and get the attribute names and values
					for (j = 0; j < attributesList.getLength(); j++) {
						//Finds the schema location and parses out values
						if (attributesList.item(j).getLocalName().equalsIgnoreCase("objectiveID")) {
							result = attributesList.item(j).getNodeValue();
						}
					}
				}

				//Gets all objective ids
				List<Node> objNodes = DOMTreeUtility.getNodes(objNode, "objective");

				for (j = 0; j < objNodes.size(); j++) {
					Node currNode = objNodes.get(j);
					attributesList = currNode.getAttributes();

					// iterate through the NamedNodeMap and get the attribute names and values
					for (k = 0; k < attributesList.getLength(); k++) {
						//Finds the schema location and parses out values
						if (attributesList.item(k).getLocalName().equalsIgnoreCase("objectiveID")) {
							result = result + "," + attributesList.item(k).getNodeValue();
						}
					}
				} // end looping over nodes
			} // end if objNode != null
		} // end if iNode != null

		//returns objective list, if it was found.
		return result;
	}

	/**
	 * This method retrieves the resource node that matches the passed in
	 * identifier value.  This method serves as a helper method.
	 *
	 * @param iResourcesNode Parent resources node of the resource elements.
	 *
	 * @param iResourceIdentifier identifier value of the resource node being
	 * retrieved.
	 *
	 * @return Node resource element node that matches the identifier value.
	 */
	private Node getResourceNodeWithIdentifier(Node iResourcesNode, String iResourceIdentifier) {
		Node result = null;

		if (iResourcesNode != null) {

			// loop through the children of <resources>
			NodeList children = iResourcesNode.getChildNodes();

			if (children != null) {
				int numChildren = children.getLength();
				Node currentChild = null;
				String currentChildName = mEMPTY_STRING;
				String currentResourceIdentifier = mEMPTY_STRING;

				for (int i = 0; i < numChildren; i++) {
					currentChild = children.item(i);
					currentChildName = currentChild.getLocalName();

					// locate the <resource> Nodes
					if (currentChildName.equals("resource")) {
						// get the identifier attribute of the current <resource> Node
						currentResourceIdentifier = DOMTreeUtility.getAttributeValue(currentChild, "identifier");

						// match the identifier attributes and get the missing data
						if (currentResourceIdentifier.equals(iResourceIdentifier)) {
							result = currentChild;
							break;
						}
					} // end if currentChildName == resource
				} // end looping over children
			} // end if there are no children
		} // end of iResourcesNode != null
		return result;
	}

	/**
	 * This method removes the asset information from the launch data list.
	 * Assets are not launchable resources.
	 */
	private void removeAssetsFromLaunchDataList() {

		int size = mLaunchDataList.size();
		LaunchData currentLaunchData;

		for (int i = 0; i < size;) {
			currentLaunchData = mLaunchDataList.get(i);
			String scormType = currentLaunchData.getSCORMType();

			if (scormType.equals("asset")) {
				mLaunchDataList.remove(i);
				size = mLaunchDataList.size();
			} else {
				i++;
			}
		}
	}

	/**
	 * This method removes the duplicate LaunchData elements that are stored in
	 * the list during tracking.  This removal is based on the Resource
	 * Identifier, XML Base directories, Location and Parameters.
	 */
	private void removeDuplicateLaunchData() {
		int size = mLaunchDataList.size();
		LaunchData ldA;
		LaunchData ldB;
		String ldAid;
		String ldBid;
		String ldAll;
		String ldBll;

		for (int i = 0; i < size; i++) {
			ldA = mLaunchDataList.get(i);
			ldAid = ldA.getResourceIdentifier();

			for (int j = i + 1; j < size; j++) {
				ldB = mLaunchDataList.get(j);
				ldBid = ldB.getResourceIdentifier();

				if (ldBid.equals(ldAid)) {
					ldAll = ldA.getItemIdentifier();
					ldBll = ldB.getItemIdentifier();

					if (ldBll.equals(ldAll)) {
						mLaunchDataList.remove(j);
						j--;
						size = mLaunchDataList.size();
					}
				}
			}
		}
	}

	/**
	 * This method performs the actual retrieval of the SCO launch data
	 * information, if this information exists in the content package test
	 * subject.  This method walks through the test subject dom, storing all the
	 * SCO launch data information to the LaunchData data structure.
	 *
	 * @param iRootNode root node of test subject dom.
	 *
	 * @param iDefaultOrganizationOnly boolean describing the scope of the
	 *        organization that should be traversed for SCO launch data. Specific
	 *        to SRTE uses - will no longer be needed in future development.
	 *
	 * @param iRemoveAssets boolean describing whether or not to remove assets
	 *        from the LaunchData list.  The SRTE needs this to be false in
	 *        in order to get LaunchData for assets as well.
	 *
	 */
	private void setLaunchData(Node iRootNode, boolean iDefaultOrganizationOnly, boolean iRemoveAssets) {
		mLogger.entering("ManifestHandler", "SetLaunchData(iRootNode)");
		List<Node> organizationNodes = getOrganizationNodes(iRootNode, iDefaultOrganizationOnly);

		int size = organizationNodes.size();

		// populate the Launch Data for the Organization level
		for (int i = 0; i < size; i++) {
			Node currentOrganization = organizationNodes.get(i);

			String orgIdentifier = DOMTreeUtility.getAttributeValue(currentOrganization, "identifier");

			addItemInfo(currentOrganization, orgIdentifier);
		}

		Node xmlBaseNode = null;
		String manifestXMLBase = mEMPTY_STRING;
		String resourcesXMLBase = mEMPTY_STRING;

		// calculate the <manifest>s xml:base
		NamedNodeMap attributes = iRootNode.getAttributes();
		xmlBaseNode = attributes.getNamedItem("xml:base");

		if (xmlBaseNode != null) {
			manifestXMLBase = xmlBaseNode.getNodeValue();
		}

		// calculate the <resources> xml:base
		Node resources = DOMTreeUtility.getNode(iRootNode, "resources");
		if (resources != null) {
			attributes = resources.getAttributes();
			xmlBaseNode = attributes.getNamedItem("xml:base");

			if (xmlBaseNode != null) {
				resourcesXMLBase = xmlBaseNode.getNodeValue();
			}
		}

		// populate all Launch Data with the xml:base values
		size = mLaunchDataList.size();
		LaunchData currentLaunchData = null;

		for (int j = 0; j < size; j++) {
			currentLaunchData = mLaunchDataList.get(j);

			// update the xml:base data
			currentLaunchData.setManifestXMLBase(manifestXMLBase);
			currentLaunchData.setResourcesXMLBase(resourcesXMLBase);

			// replace the old LaunchData Object with the updated one
			mLaunchDataList.remove(j);
			mLaunchDataList.add(j, currentLaunchData);
		}
		// populate the Launch Data for the Resource level
		addResourceInfo(iRootNode, iRemoveAssets);

		removeDuplicateLaunchData();

		mLaunchDataTracked = true;
	}

	/**
	 * This method performs the actual retrieval of the metadata information,
	 * if this information exists in the content package test
	 * subject.  This method walks through the test subject dom, storing all
	 * metadata information to the MetadataData data structure.  xml:base is
	 * also being tracked for the <adlcp:location> element.
	 *
	 * @param iNode element nodes traversed for metadata element.
	 *
	 * @param iBaseDirectory base directory for location of test subject
	 *
	 **/
	private void setMetadata(Node iNode, String iBaseDirectory) {

		if (iNode != null) {
			String nodeName = iNode.getLocalName();

			if (nodeName != null) {
				if (nodeName.equals("manifest")) {
					// set and retrieve xml:base of manifest if it exists

					// must first clear out xml:base values if dealing with a sub
					if (!mManifestResourcesXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = mEMPTY_STRING;
						mResourceXMLBase = mEMPTY_STRING;
					}

					String manifestXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					if (!manifestXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = manifestXMLBase;
					}

					trackMetadata(iNode, "adlreg", iBaseDirectory);
				} else if (nodeName.equals("organization")) {
					trackMetadata(iNode, "adlreg", iBaseDirectory);
				} else if (nodeName.equals("item")) {
					trackMetadata(iNode, "adlreg", iBaseDirectory);
				} else if (nodeName.equals("resources")) {
					// set and retrieve xml:base of resources if it exists
					String resourcesXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					if (!resourcesXMLBase.equals(mEMPTY_STRING)) {
						mManifestResourcesXMLBase = mManifestResourcesXMLBase + resourcesXMLBase;
					}

				} else if (nodeName.equals("resource")) {
					// retrieve xml:base of resource if it exists
					// cannot set classattribute - applies to specified resource only

					mResourceXMLBase = DOMTreeUtility.getAttributeValue(iNode, "base");

					trackMetadata(iNode, "adlreg", iBaseDirectory);
				} else if (nodeName.equals("file")) {
					trackMetadata(iNode, "adlreg", iBaseDirectory);
				}

				NodeList nodeChildren = iNode.getChildNodes();
				if (nodeChildren != null) {
					int size = nodeChildren.getLength();
					for (int i = 0; i < size; i++) {
						// special check for SCORM 3rd Edition to eliminate
						//(sub)manifest from having metadata set

						String childNodeName = nodeChildren.item(i).getLocalName();

						if (childNodeName != null) {
							if (!childNodeName.equals("manifest")) {
								setMetadata(nodeChildren.item(i), iBaseDirectory);
							}
						} else {
							setMetadata(nodeChildren.item(i), iBaseDirectory);
						}
					}
				}
			}
			mMetadataTracked = true;

		}
	}

	/**
	 *
	 * This method tracks the metadata information contained in the
	 * metadata element and saves the information in the MetadataData object.
	 * Such information saved includes the metaddata application profile type,
	 * URI if the metadata is external stand-alone metadata, or the root node if
	 * the metadata is inline in the form of extensions to the content package
	 * manifest.
	 *
	 * @param iNode - node tracked for Metadata
	 *
	 * @param iApplicationProfileType Metadata Application Profile Typy (asset,
	 *                 sco, activity, contentaggregation).
	 *
	 * @param iBaseDirectory - base directory for location of test subject
	 *
	 */
	private void trackMetadata(Node iNode, String iApplicationProfileType, String iBaseDirectory) {
		Node metadataNode = DOMTreeUtility.getNode(iNode, "metadata");

		if (metadataNode != null) {
			String identifier = DOMTreeUtility.getAttributeValue(iNode, "identifier");

			//Gets all the location metadata
			List<Node> locationNodeList = DOMTreeUtility.getNodes(metadataNode, "location");

			// iterate through the List and get the attribute names and values

			int locationNodeListSize = locationNodeList.size();
			for (int i = 0; i < locationNodeListSize; i++) {
				MetadataData metadataData = new MetadataData();
				metadataData.setApplicationProfileType(iApplicationProfileType);

				//Gets the location value of each node
				String locationValue = DOMTreeUtility.getNodeValue(locationNodeList.get(i));
				locationValue = mManifestResourcesXMLBase + mResourceXMLBase + locationValue;

				metadataData.setIdentifier(identifier);
				metadataData.setLocation(locationValue);

				mMetadataDataList.add(metadataData);

			}

			//Gets all the inline metadata from the current node
			List<Node> lomNodelist = DOMTreeUtility.getNodes(metadataNode, "lom");

			// iterate through the List and get the attribute names and values
			int lomNodeListSize = lomNodelist.size();
			for (int j = 0; j < lomNodeListSize; j++) {
				MetadataData metadataData = new MetadataData();
				metadataData.setApplicationProfileType(iApplicationProfileType);

				//Gets the location value of each node
				metadataData.setIdentifier(identifier);

				Node lomNode = lomNodelist.get(j);
				metadataData.setRootLOMNode(lomNode);
				metadataData.setLocation("inline");

				mMetadataDataList.add(metadataData);

			}

			//metadataData.printToConsole();
		}
	}

}


text:
/****** Object:  UserDefinedFunction [dbo].[fn_CommonCharacters]    Script Date: 04/10/2016 16:34:48 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fn_CommonCharacters]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[fn_CommonCharacters]
GO

/****** Object:  UserDefinedFunction [dbo].[fn_CommonCharacters]    Script Date: 04/10/2016 16:34:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE FUNCTION [dbo].[fn_CommonCharacters]
(
    @str1 VARCHAR(100),
	@str2 VARCHAR(100)
)
RETURNS VARCHAR(MAX)

BEGIN

	DECLARE @common VARCHAR(200)
	DECLARE @counter INT

	SET @common = ''
	SET @counter = 1

	WHILE (@counter <= LEN(@str1))
	BEGIN
		IF  CHARINDEX(SUBSTRING(@str1,@counter,1), @str2) > 0
		BEGIN
			IF CHARINDEX(SUBSTRING(@str1,@counter,1), @common) = 0 AND SUBSTRING(@str1,@counter,1) <> ' '
			BEGIN
				SET @common = @common + SUBSTRING(@str1,@counter,1)
			END
		END
		SET @counter = @counter + 1
	END
	RETURN @common

END
GO


text: from utils import besselj, bessely, sbesselj, sbessely


text:
using System;
using System.Text;
using SonarScanner.MSBuild.Common.Interfaces;

namespace TestUtilities
{
    public class TestEncodingProvider : IEncodingProvider
    {
        private readonly Func<int, Encoding> _intEncodingFunc;
        private readonly Func<string, Encoding> _stringEncodingFunc;

        public TestEncodingProvider(Func<int, Encoding> intEncodingFunc, Func<string, Encoding> stringEncodingFunc)
        {
            _intEncodingFunc = intEncodingFunc;
            _stringEncodingFunc = stringEncodingFunc;
        }

        public Encoding GetEncoding(string name)
        {
            return _stringEncodingFunc(name);
        }

        public Encoding GetEncoding(int codepage)
        {
            return _intEncodingFunc(codepage);
        }
    }
}


text:
1.0.0 (2019-02-18)
------------------

* Drop Python 2.6 & 3.3 support, ensure Python 3.6+ support. Kudos to
  `jezdez <https://github.com/jezdez>`_ for pull request & implementation
* Support subclasses of the Redis client class. Again kudos to
  `jezdez  <https://github.com/jezdez>`_ for pull request & implementation
* Use `inspect.getfullargspec()` if available. Kudos to
  `vibiu <https://github.com/vibiu>`_ for pull request & implementation
* Use `redis.Redis` as default connection class, when using
  `redis-py <https://github.com/andymccurdy/redis-py>`_ >= 3

0.7 (2016-11-12)
----------------

* Improve multiple app support. Kudos to
  `timothyqiu <https://github.com/timothyqiu>`_ for pull request &
  implementation
* Simplify running tests for test application

0.6 (2015-01-08)
----------------

* Python 3 support.
* Move documentation to Read the Docs.
* Refactor example test project to Comments app which shows how to use two
  Redis databases simultaneously.

0.5 (2013-05-10)
------------------

* Use ``redis.StrictRedis`` as connection class by default.
* Understands unix socket path in ``REDIS_HOST``.
* Updates to README.

0.4 (2012-09-29)
----------------

* Big refactor for :class:`~.Redis` class. Do not inherit ``redis.Redis`` class,
  store active redis connection in ``Redis.connection`` attribute and
  ``app.extensions['redis']`` dict.
* Add support of ``config_prefix`` keyword argument for :class:`~.Redis` or
  :meth:`~.Redis.init_app` methods.
* Support multiple redis connections in test application.

0.3.3 (2012-08-29)
------------------

* Fix problem while parsing ``REDIS_URL`` value, strip unnecessary slashes from
  database path (like ``redis://localhost:6379/12/``).

0.3.2 (2012-08-15)
------------------

* Added ``redis`` as install requirement in ``setup.py``.

0.3.1 (2012-06-19)
--------------------

* Move from ``flask_redis`` package to python module.
* Little improvements for storing ``_flask_app`` attribute to :class:`~.Redis`
  instance.

0.3 (2012-05-21)
----------------

* Implement :meth:`~.Redis.init_app` method.

0.2.1 (2012-03-30)
------------------

* Convert ``REDIS_PORT`` to an ``int`` instance.

0.2 (2012-03-30)
----------------

* Added support of ``REDIS_URL`` setting. By default, :class:`~.Redis` will try
  to guess host, port, user, password and db settings from that value.

0.1 (2012-03-12)
----------------

* Initial release.


text:
package com.learning.ads.datastructure.list.problems.linkedlist;

import org.junit.Test;

import com.learning.ads.datastructure.list.problems.linkedlist.ListNode;
import com.learning.ads.datastructure.list.problems.linkedlist.MergeTwoSortedLinkedList;

import static org.junit.Assert.assertNull;

public class MergeTwoSortedLinkedListTest {

	private MergeTwoSortedLinkedList rll = new MergeTwoSortedLinkedList();

	@Test
	public void mergeWithLargeFirstList() {
		ListNode first = new ListNode(4);
		first.attach(5).attach(6).attach(8).attach(10).attach(11).attach(12);
		ListNode second = new ListNode(1);
		second.attach(2).attach(3).attach(7).attach(9);

		ListNode expected = new ListNode(1);
		expected.attach(2).attach(3).attach(4).attach(5).attach(6).attach(7).attach(8).attach(9).attach(10).attach(11)
				.attach(12);

		ListNode actual = rll.merge(first, second);

		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeWithLargeSecondList() {
		ListNode first = new ListNode(2);
		first.attach(4).attach(6).attach(8).attach(10);
		ListNode second = new ListNode(1);
		second.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode expected = new ListNode(1);
		expected.attach(2).attach(3).attach(4).attach(5).attach(6).attach(7).attach(8).attach(9).attach(10).attach(11)
				.attach(12);

		ListNode actual = rll.merge(first, second);

		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeWithFirstListNull() {
		ListNode second = new ListNode(1);
		second.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode expected = new ListNode(1);
		expected.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode actual = rll.merge(null, second);
		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeWithSecondListNull() {
		ListNode first = new ListNode(2);
		first.attach(4).attach(6).attach(8).attach(10);

		ListNode expected = new ListNode(2);
		expected.attach(4).attach(6).attach(8).attach(10);

		ListNode actual = rll.merge(first, null);
		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeWithBothListsNull() {
		assertNull(rll.merge(null, null));
	}

	@Test
	public void mergeRecWithLargeFirstList() {
		ListNode first = new ListNode(4);
		first.attach(5).attach(6).attach(8).attach(10).attach(11).attach(12);
		ListNode second = new ListNode(1);
		second.attach(2).attach(3).attach(7).attach(9);

		ListNode expected = new ListNode(1);
		expected.attach(2).attach(3).attach(4).attach(5).attach(6).attach(7).attach(8).attach(9).attach(10).attach(11)
				.attach(12);

		ListNode actual = rll.mergeRec(first, second);

		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeRecWithLargeSecondList() {
		ListNode first = new ListNode(2);
		first.attach(4).attach(6).attach(8).attach(10);
		ListNode second = new ListNode(1);
		second.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode expected = new ListNode(1);
		expected.attach(2).attach(3).attach(4).attach(5).attach(6).attach(7).attach(8).attach(9).attach(10).attach(11)
				.attach(12);

		ListNode actual = rll.mergeRec(first, second);

		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeRecWithFirstListNull() {
		ListNode second = new ListNode(1);
		second.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode expected = new ListNode(1);
		expected.attach(3).attach(5).attach(7).attach(9).attach(11).attach(12);

		ListNode actual = rll.mergeRec(null, second);
		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeRecWithSecondListNull() {
		ListNode first = new ListNode(2);
		first.attach(4).attach(6).attach(8).attach(10);

		ListNode expected = new ListNode(2);
		expected.attach(4).attach(6).attach(8).attach(10);

		ListNode actual = rll.mergeRec(first, null);
		Util.assertListEqual(expected, actual);
	}

	@Test
	public void mergeRecWithBothListsNull() {
		assertNull(rll.merge(null, null));
	}

}


text:
class Orchid::AsInstanceCreator
  def initialize(orchid, reference)
    announce "Instance Creator for orchid: #{orchid.taxon} (#{orchid.record_type})"
    @orchid = orchid
    @ref = reference
  end

  def create_instance_for_preferred_matches
    debug("Orchid::AsInstanceCreator#create_instance_for_preferred_matches")
    records = 0
    return 0 if stop_everything?
    @orchid.preferred_match.each do |preferred_match|
      debug(preferred_match.class)
      if preferred_match.standalone_instance_created
      elsif preferred_match.standalone_instance_found
      else
        records += preferred_match.create_instance(@ref)
      end
    end
    records
  end

  def stop_everything?
    if @orchid.exclude_from_further_processing?
      return true
    elsif @orchid.parent.try('exclude_from_further_processing?')
      return true
    elsif @orchid.hybrid_cross?
      debug("stop_everything?  Orchid is a hybrid cross - not ready to process these.")
      return true
    end
    false
  end

  def taxon
    @orchid.taxon
  end

  def record_failure(msg)
    msg.sub!(/uncaught throw /,'')
    msg.gsub!(/"/,'')
    msg.sub!(/^Failing/,'')
    debug "record_failure Failure: #{msg}"
  end

  def announce(msg)
    debug "="*(msg.length)
    debug msg
    debug "="*(msg.length)
  end

  def debug(msg)
    Rails.logger.debug("Orchid##{msg}")
  end
end


text:
const test = require('tape')

const { ReadFileProcessor } = require('../')

// eslint-disable-next-line no-unused-vars
function inspect(obj, depth) {
  console.error(require('util').inspect(obj, false, depth || 5, true))
}
const activities = new Map(require('./fixtures/open.stat.close-only.json'))

test('\nactivities with one file open, stat, close, but no read', function(t) {
  const includeActivities = true
  const { groups, operations } = new ReadFileProcessor({ activities, includeActivities }).process()
  t.equal(groups.size, 0, 'read file processor finds no fs.readFile group')
  t.equal(operations.size, 0, 'read file processor finds no fs.readFile operation')
  t.end()
})


text:
package com.oneops.crawler;

import com.google.gson.Gson;
import com.oneops.Deployment;
import com.oneops.Environment;
import com.oneops.Platform;
import com.oneops.notification.NotificationMessage;
import com.squareup.okhttp.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class OneOpsFacade {
    private String transistorBaseUrl ;

    private String adapterBaseUrl ;
    private String antennaBaseUrl ;
    private final Logger log = LoggerFactory.getLogger(getClass());
    private Gson gson;

    public static final MediaType JSON
            = MediaType.parse("application/json; charset=utf-8");

    public OneOpsFacade() {
        readConfig();
        gson = new Gson();
    }

    public void setTransistorBaseUrl(String transistorBaseUrl) {
        this.transistorBaseUrl = transistorBaseUrl;
    }

    public void setAdapterBaseUrl(String adapterBaseUrl) {
        this.adapterBaseUrl = adapterBaseUrl;
    }

    public void setAntennaBaseUrl(String antennaBaseUrl) {
        this.antennaBaseUrl = antennaBaseUrl;
    }

    void readConfig() {
        transistorBaseUrl = System.getProperty("transistor.base.url");
        adapterBaseUrl = System.getProperty("adapter.base.url");
        antennaBaseUrl = System.getProperty("antenna.base.url");
    }

    public int forceDeploy(Environment env, Platform platform, String userName) throws IOException, OneOpsException {
        Map<String, Platform> platformMap = env.getPlatforms();
        if (platformMap == null || platformMap.size() == 0) {
            return 400;
        }

        StringBuilder excludePlatforms = new StringBuilder();
        if (platform != null) {
            for (String platformName : platformMap.keySet()) {

                if (! platformName.equals(platform.getName())) {
                    if (excludePlatforms.length() > 0) excludePlatforms.append(",");
                    excludePlatforms.append(platformMap.get(platformName).getId());
                }
            }
        }

        HashMap<String, String> params = new HashMap<>();
        params.put("exclude", excludePlatforms.toString());

        log.info("deploying environment id: " + env.getId());
        RequestBody body = RequestBody.create(JSON, gson.toJson(params));

        String url = transistorBaseUrl + "/transistor/rest/environments/" + env.getId() + "/deployments/deploy";
        Request request = new Request.Builder()
                .url(url)
                .addHeader("X-Cms-User", userName)
                .addHeader("Content-Type", "application/json")
                .post(body)
                .build();

        OkHttpClient client = new OkHttpClient();

        Response response = client.newCall(request).execute();
        String responseBody = response.body().string();
        int responseCode = response.code();
        log.info("OO response body: " + responseBody + ", code: " + responseCode);
        if (responseCode >= 300) {
            throw new OneOpsException("Error while doing deployment. Response fron OneOps: " + responseBody
            + " ResponseCode : " + responseCode);
        }
        return responseCode;
    }

    public int disablePlatform(Platform platform, String userName) throws IOException, OneOpsException {
        log.info("disabling platform id: " + platform.getId());

        String url = transistorBaseUrl + "/transistor/rest/platforms/" + platform.getId() + "/disable";

        RequestBody body = RequestBody.create(JSON, "");

        Request request = new Request.Builder()
                .url(url)
                .header("X-Cms-User", userName)
                .addHeader("Content-Type", "application/json")
                .put(body)
                .build();

        OkHttpClient client = new OkHttpClient();

        Response response = client.newCall(request).execute();
        String responseBody = response.body().string();
        Map<String, Double> release = gson.fromJson(responseBody, Map.class);
        log.info("Response from OneOps for disable-platform api: " + release);
        int responseCode = response.code();
        if (responseCode >= 300) {
            throw new OneOpsException("Could not disable platform, response from OneOps: " + responseBody
            + ", response code: " + responseCode);
        }
        return responseCode;
    }

    public int sendNotification(NotificationMessage msg) throws IOException, OneOpsException {
        String url = antennaBaseUrl + "/antenna/rest/notify/";
        log.info(url + " sending notification: " + gson.toJson(msg));
        RequestBody body = RequestBody.create(JSON, gson.toJson(msg));

        Request request = new Request.Builder()
                .url(url)
                .addHeader("Content-Type", "application/json")
                .post(body)
                .build();

        OkHttpClient client = new OkHttpClient();
        Response response = client.newCall(request).execute();
        String responseBody = response.body().string();
        int responseCode = response.code();
        if (responseCode >= 300) {
            throw new OneOpsException("Error while sending notification. Response fron OneOps: " + responseBody
                    + " ResponseCode : " + responseCode);
        }

        log.info("OO response body from antenna notify request: " + responseBody + ", code: " + responseCode);
        return responseCode;
    }

    public int cancelDeployment(Deployment deployment, String userName) throws IOException {
        String url = adapterBaseUrl + "/adapter/rest/dj/simple/deployments/" + deployment.getDeploymentId() + "/cancel";
        log.info("calling cancel deploy api: " + url);

        Request request = new Request.Builder()
                .url(url)
                .get()
                .build();

        OkHttpClient client = new OkHttpClient();
        Response response = client.newCall(request).execute();
        String responseBody = response.body().string();
        int responseCode = response.code();
        log.info("OO response body for cance deployment: " + responseBody + ", code: " + responseCode);
        return responseCode;
    }

}


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

namespace Microsoft.AspNetCore.Testing;

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)]
public class OSSkipConditionAttribute : Attribute, ITestCondition
{
    private readonly OperatingSystems _excludedOperatingSystem;
    private readonly OperatingSystems _osPlatform;

    public OSSkipConditionAttribute(OperatingSystems operatingSystem) :
        this(operatingSystem, GetCurrentOS())
    {
    }

    [Obsolete("Use the Minimum/MaximumOSVersionAttribute for version checks.", error: true)]
    public OSSkipConditionAttribute(OperatingSystems operatingSystem, params string[] versions) :
        this(operatingSystem, GetCurrentOS())
    {
    }

    // to enable unit testing
    internal OSSkipConditionAttribute(OperatingSystems operatingSystem, OperatingSystems osPlatform)
    {
        _excludedOperatingSystem = operatingSystem;
        _osPlatform = osPlatform;
    }

    public bool IsMet
    {
        get
        {
            var skip = (_excludedOperatingSystem & _osPlatform) == _osPlatform;
            // Since a test would be excuted only if 'IsMet' is true, return false if we want to skip
            return !skip;
        }
    }

    public string SkipReason { get; set; } = "Test cannot run on this operating system.";

    private static OperatingSystems GetCurrentOS()
    {
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            return OperatingSystems.Windows;
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
        {
            return OperatingSystems.Linux;
        }
        else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
        {
            return OperatingSystems.MacOSX;
        }
        throw new PlatformNotSupportedException();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <!--<stroke android:width="1dp"-->
            <!--android:color="#61000000" />-->
    <padding android:left="5dp"
             android:top="10dp"
             android:right="5dp"
             android:bottom="10dp" />
    <corners android:radius="4dp" />
    <solid android:color="#61dadada"/>
</shape>


text:
<BroadcastMonitor>
  <updated>2015-08-05T10:55:30</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-05T10:55:30</startTime>
    <itemId>1000080535:1241309</itemId>
    <titleId>216048441</titleId>
    <itemCode>NN175</itemCode>
    <itemReference></itemReference>
    <titleName>Paris Nights-New York Mornings</titleName>
    <artistName>Corinne Bailey Rae</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>230</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-05T10:59:16</startTime>
    <itemId>1000080535:1241312</itemId>
    <titleId>216131331</titleId>
    <itemCode>R6003</itemCode>
    <itemReference></itemReference>
    <titleName>*** UURSLUITER FACEBOOK (13.8 SECONDEN)</titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode>449</CategoryCode>
    <CategoryName>JINGLES</CategoryName>
    <itemDuration>16</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
package org.apache.camel.component.event;

import org.springframework.context.ApplicationEvent;

public class DummyEvent extends ApplicationEvent {
    private static final long serialVersionUID = 1L;
    private final String text;

    public DummyEvent(Object source, String text) {
        super(source);
        this.text = text;
    }

    public String getText() {
        return text;
    }
}


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
function ContextDependencyTemplateAsId() {}
module.exports = ContextDependencyTemplateAsId;

ContextDependencyTemplateAsId.prototype.apply = function(dep, source, outputOptions, requestShortener) {
	var comment = "";
	if(outputOptions.pathinfo) comment = "/*! " + requestShortener.shorten(dep.request) + " */ ";
	if(dep.module && dep.module.dependencies && dep.module.dependencies.length > 0) {
		if(dep.valueRange) {
			source.replace(dep.valueRange[1], dep.range[1] - 1, ")");
			source.replace(dep.range[0], dep.valueRange[0] - 1, "__webpack_require__(" + comment + JSON.stringify(dep.module.id) + ").resolve(" + (typeof dep.prepend === "string" ? JSON.stringify(dep.prepend) : "") + "");
		} else {
			source.replace(dep.range[0], dep.range[1] - 1, "__webpack_require__(" + comment + JSON.stringify(dep.module.id) + ").resolve");
		}
	} else {
		var content = require("./WebpackMissingModule").module(dep.request);
		source.replace(dep.range[0], dep.range[1] - 1, content);
	}
};


text: ${nls.and}


text:
module VagrantPlugins
  module VagrantVmwareDhcp
    require_relative 'dhcp_manager/dhcp_manager.rb'
    require_relative 'dhcp_manager/dhcp_manager_darwin.rb'
    require_relative 'dhcp_manager/dhcp_manager_linux.rb'
    require_relative 'dhcp_manager/dhcp_manager_windows.rb'
  end
end


text:
namespace sf1r {
namespace QueryFiltering {

enum FilteringOperation
{
    NULL_OPERATOR = 0,
    EQUAL,
    NOT_EQUAL,
    INCLUDE,
    EXCLUDE,
    GREATER_THAN,
    GREATER_THAN_EQUAL,
    LESS_THAN,
    LESS_THAN_EQUAL,
    RANGE,
    PREFIX,
    SUFFIX,
    SUB_STRING,
    MAX_OPERATOR
}; // end - enum

enum InterFilteringLogic
{
    AND,
    OR
};

struct FilteringType
{
    FilteringOperation operation_;
    std::string property_;
    InterFilteringLogic logic_;
    std::vector<PropertyValue> values_;

    FilteringType()
        : operation_(NULL_OPERATOR)
        , logic_(AND)
    {}

    bool operator==(const FilteringType& obj) const
    {
        return operation_ == obj.operation_
                && property_ == obj.property_
                && logic_ == obj.logic_
                && values_ == obj.values_;
    }

    MSGPACK_DEFINE(operation_, property_, logic_, values_)
    DATA_IO_LOAD_SAVE(FilteringType, & operation_ & property_ & logic_ & values_);

private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive& ar, const unsigned int version)
    {
        ar & operation_;
        ar & property_;
        ar & logic_;
        ar & values_;
    }
};

struct FilteringTreeValue
{
    FilteringType fitleringType_;
    bool isRelationNode_;
    std::string relation_;
    unsigned int childNum_;

    FilteringTreeValue()
        : isRelationNode_(false)
        , childNum_(0)
    {
    }

    bool operator==(const FilteringTreeValue& obj) const
    {
        return fitleringType_ == obj.fitleringType_
                && isRelationNode_ == obj.isRelationNode_
                && relation_ == obj.relation_
                && childNum_ == obj.childNum_;
    }

    void print()
    {
        std::cout << "is RelationNode:" << isRelationNode_ << std::endl;
        if (isRelationNode_)
        {
            std::cout << "relation_" << relation_ << std::endl;
        }
        std::cout << "childNum_:" << childNum_ << std::endl << std::endl;
    }

    MSGPACK_DEFINE(fitleringType_, isRelationNode_, relation_, childNum_)
    DATA_IO_LOAD_SAVE(FilteringTreeValue, & fitleringType_ & isRelationNode_ & relation_ & childNum_);

private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive& ar, const unsigned int version)
    {
        ar & fitleringType_;
        ar & isRelationNode_;
        ar & relation_;
        ar & childNum_;
    }
};

//

} // end namespace QueryFiltering
} // end namespace sf1r

namespace msgpack
{
/// QueryFiltering::FilteringOperation
inline sf1r::QueryFiltering::FilteringOperation& operator>>(object o, sf1r::QueryFiltering::FilteringOperation& v)
{
    signed int iv = type::detail::convert_integer<signed int>(o);
    v = static_cast<sf1r::QueryFiltering::FilteringOperation>(iv);
    return v;
}

template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const sf1r::QueryFiltering::FilteringOperation& v)
    { o.pack_int(static_cast<int>(v)); return o; }

inline void operator<< (object& o, sf1r::QueryFiltering::FilteringOperation v)
    { o.type = type::POSITIVE_INTEGER, o.via.u64 = static_cast<int>(v); }

inline void operator<< (object::with_zone& o, sf1r::QueryFiltering::FilteringOperation v)
    { static_cast<object&>(o) << static_cast<int>(v); }

/// QueryFiltering::InterFilteringLogic
inline sf1r::QueryFiltering::InterFilteringLogic& operator>>(object o, sf1r::QueryFiltering::InterFilteringLogic& v)
{
    signed int iv = type::detail::convert_integer<signed int>(o);
    v = static_cast<sf1r::QueryFiltering::InterFilteringLogic>(iv);
    return v;
}

template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const sf1r::QueryFiltering::InterFilteringLogic& v)
    { o.pack_int(static_cast<int>(v)); return o; }

inline void operator<< (object& o, sf1r::QueryFiltering::InterFilteringLogic v)
    { o.type = type::POSITIVE_INTEGER, o.via.u64 = static_cast<int>(v); }

inline void operator<< (object::with_zone& o, sf1r::QueryFiltering::InterFilteringLogic v)
    { static_cast<object&>(o) << static_cast<int>(v); }
}

MAKE_FEBIRD_SERIALIZATION(sf1r::QueryFiltering::FilteringType)

#endif // _QUERYTYPEDEF_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

-->

<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <dimen name="time_text_size">153dip</dimen>
    <dimen name="ampm_text_size">32dip</dimen>
    <dimen name="date_text_size">15sp</dimen>
    <dimen name="next_alarm_text_size">15sp</dimen>
    <dimen name="time_margin_top">24dip</dimen>
    <dimen name="timer_list_padding_bottom">64dip</dimen>

    <dimen name="dialpad_font_size">24sp</dimen>
    <dimen name="dialpad_digit_padding">14dip</dimen>
    <dimen name="timer_setup_font_size">48sp</dimen>
    <dimen name="timer_setup_delete_start_margin">16sp</dimen>
    <dimen name="timer_setup_label_size">16sp</dimen>

    <dimen name="actionbar_tab_padding">32dip</dimen>

    <!-- Size of margin for circles. -->
    <dimen name="circle_margin">8dp</dimen>
    <dimen name="analog_clock_margin">70dp</dimen>
    <dimen name="timer_circle_margin">8dp</dimen>
    <dimen name="main_clock_padding">0dp</dimen>
    <dimen name="circle_margin_top">0dp</dimen>
    <dimen name="top_text_spacing_digital">-25dp</dimen>
    <dimen name="bottom_text_spacing_analog">5dp</dimen>

    <dimen name="alarm_side_padding">48dip</dimen>
    <dimen name="clock_side_padding">32dip</dimen>
    <dimen name="world_clock_end_padding">0dip</dimen>

    <dimen name="medium_font_size">48sp</dimen>

    <dimen name="circle_size">232dip</dimen>

    <dimen name="world_clock_margin">8dp</dimen>
    <dimen name="sw_padding_end">8dp</dimen>

    <dimen name="alarm_alert_clock_padding_left">32dp</dimen>

</resources>


text:
At Your Service

An Investment Promise

All of our properties come with a 90 day satisfaction guarantee.

Ready to Deliver

Reserve a parcel today, we're ready to find the most convenient arrangement.

Up to Date

We update workflow tools to make the experience as easy as possible.

Additional Services

We have a list of options and partners available that help investors obtain more value.


text:
package com.thinkaurelius.titan.hadoop.formats.script;

import com.thinkaurelius.titan.diskstorage.configuration.ConfigNamespace;
import com.thinkaurelius.titan.diskstorage.configuration.ConfigOption;

public class ScriptConfig {

    public static final ConfigNamespace ROOT_NS =
            new ConfigNamespace(null, "script", "ScriptInput/Output format options");

    public static final ConfigOption<String> SCRIPT_FILE =
            new ConfigOption<String>(ROOT_NS, "script-file",
            "Gremlin script file which defines a read and/or write method for " +
            "ScriptInputFormat and/or ScriptOutputFormat",
            ConfigOption.Type.LOCAL, String.class);
}


text:
- Reminder of the process to start the course with GIT
- FileSystem
    - Memory/CPU Battle
    - Read/write in a file
- Hashing
    - Password API
- HTTP Headers
- Status code

## Homework
- Finish in-course exerice
- Write a login/register system using the filesystem (use a users.txt file)
- Add a check for the the filesize and handle the case where the file is too big to be loaded in memory
- Read the PHP CSG Page 117 - 121
- Read the PHP CSG Page 129 - 138
- Read the PHP CSG Page 298 - 300


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.herograve.hbn.component;

/**
 *
 * @author Administrator
 */
public class Name {

    private String firstname;
    private String lastname;

    /**
     * Get the value of firstname
     *
     * @return the value of firstname
     */
    public String getFirstname() {
        return firstname;
    }

    /**
     * Set the value of firstname
     *
     * @param firstname new value of firstname
     */
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    /**
     * Get the value of lastname
     *
     * @return the value of lastname
     */
    public String getLastname() {
        return lastname;
    }

    /**
     * Set the value of lastname
     *
     * @param lastname new value of lastname
     */
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
}


text:
if $0 == __FILE__
  module OMF; module Common; end; end
end

module OMF::Common::YAML

  class YamlFileNotFound < Exception; end

  # A method to load YAML files
  #
  # file_name - Name of file to load
  # opts -
  # => :default - value to use if file can't be loaded
  # => :path - array of directories to look for file
  #
  # raise YamlFileNotFound if YAML file can't be found
  #
  def self.load(file_name, opts = {})
    if (file_name.split('.').length == 1)
      file_name = file_name + '.yaml'
    end

    path = opts[:path] || ['.', File.dirname(__FILE__)]
    begin
      path.each do |d|
        begin
          return _load_file(d + '/' + file_name)
        rescue YamlFileNotFound => ex
        end
      end
      if (default = opts[:default])
        return _symbolize(default)
      end
      raise YamlFileNotFound.new("Can't read YAML file '#{file_name}' in '#{path.join(':')}'")
    end
  end

  private

  def self._load_file(file, opts = {})
    begin
      begin
        require 'rbyaml'
        h = RbYAML::load_file(file)
      rescue LoadError => ex
        require 'yaml'
        h = YAML::load_file(file)
      end
    rescue Exception => ex
      unless (h = opts[:default])
        raise YamlFileNotFound.new("Can't read YAML file '#{file}'")
      end
    end
    _symbolize(h)
  end

  def self._symbolize(obj)
    if obj.kind_of? Hash
      res = {}
      obj.each do |k, v|
        if k.kind_of? String
          if k.start_with?(":")
            k = k[1 .. -1]
          end
          k = k.to_sym
        end
        res[k] = _symbolize(v)
      end
      return res
    elsif obj.kind_of? Array
      return obj.collect do |el|
        _symbolize(el)
      end
    else
      return obj
    end
  end
end

if $0 == __FILE__
  h = OMF::Common::YAML.load 'foo'#, :default => {':foo' => {:goo=> 3}}
  puts h.inspect
  puts h.keys[0].class
  puts h[:foo].keys[0].class

  #puts OMF::Common::YAML.load('omf-expctl', :path => ['../../../omf-expctl/etc/omf-expctl']).inspect

end


text:
module Marvin
  class Help
    include ::Marvin::Handler

    command :regex => /^help$/i, :syntax => "help", :description => "Print this help messages"

    def handle from, body, bot
      help_messages = Handler.klasses.collect(&:help)
      bot.reply(from, help_messages.join("\n"))
    end
  end
end


text:
namespace lslboost {
#ifndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
  namespace BOOST_SIGNALS_NAMESPACE {
    namespace detail {
      template<int Arity,
               typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl;

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<0, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal0<typename traits::result_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<1, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal1<typename traits::result_type,
                        typename traits::arg1_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<2, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal2<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<3, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal3<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<4, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal4<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<5, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal5<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        typename traits::arg5_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<6, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal6<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        typename traits::arg5_type,
                        typename traits::arg6_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<7, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal7<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        typename traits::arg5_type,
                        typename traits::arg6_type,
                        typename traits::arg7_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<8, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal8<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        typename traits::arg5_type,
                        typename traits::arg6_type,
                        typename traits::arg7_type,
                        typename traits::arg8_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<9, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal9<typename traits::result_type,
                        typename traits::arg1_type,
                        typename traits::arg2_type,
                        typename traits::arg3_type,
                        typename traits::arg4_type,
                        typename traits::arg5_type,
                        typename traits::arg6_type,
                        typename traits::arg7_type,
                        typename traits::arg8_type,
                        typename traits::arg9_type,
                        Combiner,
                        Group,
                        GroupCompare,
                        SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      class real_get_signal_impl<10, Signature, Combiner, Group, GroupCompare,
                                 SlotFunction>
      {
        typedef function_traits<Signature> traits;

      public:
        typedef signal10<typename traits::result_type,
                         typename traits::arg1_type,
                         typename traits::arg2_type,
                         typename traits::arg3_type,
                         typename traits::arg4_type,
                         typename traits::arg5_type,
                         typename traits::arg6_type,
                         typename traits::arg7_type,
                         typename traits::arg8_type,
                         typename traits::arg9_type,
                         typename traits::arg10_type,
                         Combiner,
                         Group,
                         GroupCompare,
                         SlotFunction> type;
      };

      template<typename Signature,
               typename Combiner,
               typename Group,
               typename GroupCompare,
               typename SlotFunction>
      struct get_signal_impl :
        public real_get_signal_impl<(function_traits<Signature>::arity),
                                    Signature,
                                    Combiner,
                                    Group,
                                    GroupCompare,
                                    SlotFunction>
      {
      };

    } // end namespace detail
  } // end namespace BOOST_SIGNALS_NAMESPACE

  // Very lightweight wrapper around the signalN classes that allows signals to
  // be created where the number of arguments does not need to be part of the
  // class name.
  template<
    typename Signature, // function type R (T1, T2, ..., TN)
    typename Combiner = last_value<typename function_traits<Signature>::result_type>,
    typename Group = int,
    typename GroupCompare = std::less<Group>,
    typename SlotFunction = function<Signature>
  >
  class signal :
    public BOOST_SIGNALS_NAMESPACE::detail::get_signal_impl<Signature,
                                                            Combiner,
                                                            Group,
                                                            GroupCompare,
                                                            SlotFunction>::type
  {
    typedef typename BOOST_SIGNALS_NAMESPACE::detail::get_signal_impl<
                       Signature,
                       Combiner,
                       Group,
                       GroupCompare,
                       SlotFunction>::type base_type;

  public:
    explicit signal(const Combiner& combiner = Combiner(),
                    const GroupCompare& group_compare = GroupCompare()) :
      base_type(combiner, group_compare)
    {
    }
  };
#endif // ndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX

} // end namespace lslboost

#ifdef BOOST_HAS_ABI_HEADERS
#  include BOOST_ABI_SUFFIX
#endif

#endif // BOOST_SIGNAL_HPP


text:
module Rhino
  module Interface
    class Base
      def initialize(*args)
        raise NotImplementedError
      end

      class RowNotFound < Exception

      end
    end
  end
end


text:
package org.optaplanner.examples.common.business;

import java.io.File;
import java.io.FileFilter;

import org.optaplanner.examples.common.persistence.SolutionDao;

public class SolutionFileFilter implements FileFilter {

    private final SolutionDao solutionDao;

    public SolutionFileFilter(SolutionDao solutionDao) {

        this.solutionDao = solutionDao;
    }

    public boolean accept(File file) {
        if (file.isDirectory() || file.isHidden()) {
            return false;
        }
        return file.getName().endsWith(solutionDao.getFileSuffix());
    }

}


text:
package cn.aezo.springboot.datasource.services.dynamic;

import cn.aezo.springboot.datasource.config.dynamic.aop.DS;
import cn.aezo.springboot.datasource.mapper.dynamic.TestDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestService {
    @Autowired
    TestDao testDao;

    @DS("mysql-one-dynamic")
    public void testMysqlOne() {
        List<Map<String, Object>> data = testDao.findTest();
        System.out.println("data = " + data); // data = [{password=123456, id=1, username=smalle}]
    }

    @DS("mysql-two-dynamic")
    public void testMysqlTwo() {
        List<Map<String, Object>> data = testDao.findTest();
        System.out.println("data = " + data); // data = [{password=ABC123, id=1, username=test_two}]
    }

    // 此数据源默认没有,需要手动添加后,才可使用。否则使用的默认数据源
    @DS("mysql-three-dynamic")
    public void testMysqlThree() {
        List<Map<String, Object>> data = testDao.findTest();
        System.out.println("data = " + data); // data = [{password=EFG456, id=1, username=test_three}]
    }

    // 在controller中通过传入参数进行数据源切换
    public List<Map<String, Object>> testMysql() {
        return testDao.findTest();
    }
}


text:
package org.apache.stratos.messaging.domain.application.signup;

import java.io.Serializable;

/**
 * Application signup.
 */
public class ApplicationSignUp implements Serializable {

    private static final long serialVersionUID = -3055522170914869018L;

    private int tenantId;
    private String applicationId;
    private ArtifactRepository[] artifactRepositories;
    private DomainMapping[] domainMappings;
    private String[] clusterIds;
    private long signupAddedTimestamp;

    public int getTenantId() {
        return tenantId;
    }

    public void setTenantId(int tenantId) {
        this.tenantId = tenantId;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public ArtifactRepository[] getArtifactRepositories() {
        return artifactRepositories;
    }

    public void setArtifactRepositories(ArtifactRepository[] artifactRepositories) {
        this.artifactRepositories = artifactRepositories;
    }

    public DomainMapping[] getDomainMappings() {
        return domainMappings;
    }

    public void setDomainMappings(DomainMapping[] domainMappings) {
        this.domainMappings = domainMappings;
    }

    public void setClusterIds(String[] clusterIds) {
        this.clusterIds = clusterIds;
    }

    public String[] getClusterIds() {
        return clusterIds;
    }

    public long getSignupAddedTimestamp() {
        return signupAddedTimestamp;
    }

    public void setSignupAddedTimestamp(long signupAddedTimestamp) {
        this.signupAddedTimestamp = signupAddedTimestamp;
    }
}


text:
var DefaultPluginTest = jstestdriver.testCaseManager.TestCase('DefaultPluginTest');

DefaultPluginTest.prototype.testCheckThatRightPluginIsCalled = function() {
  var fakeFileLoaderPlugin = new TestPlugin('defaultPlugin', true);
  var defaultPlugin = new jstestdriver.plugins.DefaultPlugin(fakeFileLoaderPlugin);
  var file = 'file.js';
  var callback = function() {};

  defaultPlugin.loadSource(file, callback);
  assertTrue(fakeFileLoaderPlugin.called);
  assertNotNull(fakeFileLoaderPlugin.file);
  assertEquals(file, fakeFileLoaderPlugin.file);
  assertNotNull(fakeFileLoaderPlugin.callback);
  assertEquals(callback, fakeFileLoaderPlugin.callback);
};


text:
[![Build Status](https://travis-ci.org/BookingSync/broccoli-i18n-lazy-lookup.svg?branch=master)](https://travis-ci.org/BookingSync/broccoli-i18n-lazy-lookup)

## Summary

Broccoli's I18n Lazy Lookup is made to add support for lazy lookup in [Ember I18n](https://github.com/jamesarosen/ember-i18n). This Broccoli filter is best used with [ember-cli-i18n-lazy-lookup](https://www.github.com/BookingSync/ember-cli-i18n-lazy-lookup).

The concept is to automatically prefix your I18n key using the current file path.
To do so, start your translation key by a `.` and it will replaced by the current file path.

## Examples

### In controllers and components

within `app/controllers/posts/edit.js`
```javascript
nameTranslation: '.name'
```

it will get converted to:
```javascript
nameTranslation: 'posts.edit.name'
```

### In templates

within `app/templates/posts/edit.hbs`
```hbs
{{t '.save'}}
```

will get converted to:
```hbs
{{t 'posts.edit.save'}}
```

but also `app/templates/posts/edit.hbs`
```hbs
{{input author as="select"
    collection="controller.authors"
    selection="controller.post.author"
    optionLabelPath="content.name"
    promptTranslation=".select_author"
  }}
```

will get converted to:
```
{{input author as="select"
    collection="controller.authors"
    selection="controller.post.author"
    optionLabelPath="content.name"
    promptTranslation="posts.edit.select_author"
  }}
```

In partial templates, the prefixing dash will be ignored when generating the translation key, so within `app/templates/post/-form.hbs`
```hbs
{{t '.submit'}}
```

will get converted to:
```hbs
{{t 'posts.form.submit'}}
```

## Installation

```shell
npm install --save-dev broccoli-i18n-lazy-lookup
```

Note: For Ember CLI installation, please check [ember-cli-i18n-lazy-lookup](https://www.github.com/BookingSync/ember-cli-i18n-lazy-lookup).

## Usage

Assuming installation via NPM, you can use broccoli-i18n-lazy-lookup in your `Brocfile.js` like this:

```javascript
var filterI18nLazyLookup = require('broccoli-i18n-lazy-lookup');
tree = filterI18nLazyLookup(tree);
```

Note: To use with Ember CLI, please check [ember-cli-i18n-lazy-lookup](https://www.github.com/BookingSync/ember-cli-i18n-lazy-lookup) instead.

## Tests

Running the tests:

```javascript
npm install
npm test
```

## License

This project is distributed under the MIT license.