text:
package rectangle;

/**
 * This case study provide the logic to find some properties for rectangles.
 * This exercise specifically provide analysis of a common question
 * How to find out if 2 rectangles intersect?
 * This is a study using core Java, not depending on any other graphic packages.
 *
 * @author ArchiTechdemic <Techdemic.com>
 */
public class Rect {
    public int x1, y1, x2, y2;

    /*
     * A rectangle is defined by 2 points
     * x1, y1 represent the lower left corner point
     * x2, y2 represent the upper right corner point
     */
    public Rect (int x1, int y1, int x2, int y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }

    public int width() {
        return x2 - x1;
    }

    public int height() {
        return y2 - y1;
    }

    // area of a rectangle is width * height
    public int area() {
        return (this.width() * this.height());
    }

    // to move the rectangle horizontally by deltax, and vertically by deltay
    public void move(int deltax, int deltay) {
        x1 += deltax; x2 += deltax;
        y1 += deltay; y2 += deltay;
    }

    // a point is inside the rectangle if x is between x1 and x2
    // and y is between y1 and y2
    public boolean isInside(int x, int y) {
        return ( (x >= x1) && (x <= x2) && (y >= y1) && (y <= y2) );
    }

    // Return the union of this rectangle with another. The smallest
    // rectangle that includes them both.
    public Rect union (Rect r) {
        return new Rect ( (this.x1 < r.x1) ? this.x1 : r.x1,
                          (this.y1 < r.y1) ? this.y1 : r.y1,
                          (this.x2 > r.x2) ? this.x2 : r.x2,
                          (this.y2 > r.y2) ? this.y2 : r.y2 );
    }

    // Find the intersection area between 2 rectangle
    // and return the intersection rectangle
    public Rect intersection(Rect r) {
        Rect result = new Rect ( (this.x1 > r.x1) ? this.x1 : r.x1,
                                 (this.y1 > r.y1) ? this.y1 : r.y1,
                                 (this.x2 < r.x2) ? this.x2 : r.x2,
                                 (this.y2 < r.y2) ? this.y2 : r.y2 );

        // to be a valid rectangle x1 can not be greater than x2
        // and y1 can not be greater than y2.
        if (result.x1 > result.x2) { result.x1 = result.x2 = 0; }
        if (result.y1 > result.y2) { result.y1 = result.y2 = 0; }

        return result;
    }

    // case study 1: find the intersection area between the 2 rectangles
    // the 2 rectangle intersect if result is a valid rectangle,
    // meaning it's area > 0,
    public boolean intersect1(Rect r) {
        // Method1 : First find the intersection
        // if area of the intersection is greater than 0, they intersect.
        Rect i = this.intersection(r);
        return i.area() > 0;
    }

    // case study 2: we can also find out when the rectangles do NOT intersect by
    // the following logic:
    //      if the lower left point of R1 is
    //         greater than the upper right point of R2
    //             or
    //      if the lower left point of R2 is
    //         greater than the upper right point of R1
    // and just return the negative value to indicate if it intersect or vice versa.
    public boolean intersect2(Rect r) {
        return !(this.x1 > r.x2 || this.y1 > r.y2 || r.x1 > this.x2 || r.y1 > this.y2);
    }

    @Override
    public String toString() {
        return "[x1=" + x1 + ", y1=" + y1 + ", x2=" + x2 + ", y2=" + y2 +
                    ", width=" + this.width() + ", height=" + this.height() +
                    ", area=" + this.area() + "]";
    }

    public static void main(String[] args) {
        // A study to show how to determine if 2 rectangles intersect?
        // As well as to explore additional properties for rectangle.

        // Let's create a few rectangles
        Rect r1 = new Rect (2,0,9,6);
        Rect r2 = new Rect (5,3,13,7);
        Rect r3 = new Rect (-3,-3,4,1);
        Rect r4 = new Rect (6,8,10,11);
        Rect r5 = new Rect (-5,3,-1,6);
        Rect r6 = new Rect (2,-8,6,-4);

        System.out.println ("\nUse Case: Find out if two rectangles intersect each other?");

        System.out.println ("\n--- Test Case 1 ---");
        System.out.println ("r2 = " + r2);
        System.out.println ("r3 = " + r3);
        System.out.println ("r2 intersection r3 = " + r2.intersection(r3));
        System.out.println ("r2 intersect1 r3? " + r2.intersect1(r3));
        System.out.println ("r2 intersect2 r3? " + r2.intersect2(r3));

        System.out.println ("\n--- Test Case 2 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r2 = " + r2);
        System.out.println ("r1 intersection r2 = " + r1.intersection(r2));
        System.out.println ("r1 intersect1 r2? " + r1.intersect1(r2));
        System.out.println ("r1 intersect2 r2? " + r1.intersect2(r2));

        System.out.println ("\n--- Test Case 3 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r3 = " + r3);
        System.out.println ("r1 intersection r3 = " + r1.intersection(r3));
        System.out.println ("r1 intersect1 r3? " + r1.intersect1(r3));
        System.out.println ("r1 intersect2 r3? " + r1.intersect2(r3));

        System.out.println ("\n--- Test Case 4 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r4 = " + r4);
        System.out.println ("r1 intersection r4 = " + r1.intersection(r4));
        System.out.println ("r1 intersect1 r4? " + r1.intersect1(r4));
        System.out.println ("r1 intersect2 r4? " + r1.intersect2(r4));

        System.out.println ("\n--- Test Case 5 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r5 = " + r5);
        System.out.println ("r1 intersection r5 = " + r1.intersection(r5));
        System.out.println ("r1 intersect1 r5? " + r1.intersect1(r5));
        System.out.println ("r1 intersect2 r5? " + r1.intersect2(r5));

        System.out.println ("\n--- Test Case 6 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r6 = " + r6);
        System.out.println ("r1 intersection r6 = " + r1.intersection(r6));
        System.out.println ("r1 intersect1 r6? " + r1.intersect1(r6));
        System.out.println ("r1 intersect2 r6? " + r1.intersect2(r6));

        // if we move r6 up 5 space, it will intersect with r1
        System.out.println ("\n--- Test Case 7 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r6 before move = " + r6);
        r6.move(0,5);
        System.out.println ("r6 after move (0,5) = " + r6);
        System.out.println ("r1 intersection r6 = " + r1.intersection(r6));
        System.out.println ("r1 intersect1 r6? " + r1.intersect1(r6));
        System.out.println ("r1 intersect2 r6? " + r1.intersect2(r6));

        // after the move of r6, it should intersect with r3 as well
        System.out.println ("\n--- Test Case 8 ---");
        System.out.println ("r3 = " + r3);
        System.out.println ("r6 = " + r6);
        System.out.println ("r3 intersection r6 = " + r3.intersection(r6));
        System.out.println ("r3 intersect1 r6? " + r3.intersect1(r6));
        System.out.println ("r3 intersect2 r6? " + r3.intersect2(r6));

        // intersection with the union of self and another rectangle,
        // will always be self
        System.out.println ("\n--- Test Case 9 ---");
        System.out.println ("r1 = " + r1);
        System.out.println ("r2 = " + r2);
        Rect u = r1.union(r2);
        System.out.println ("u = r1 union r2 = " + u);
        System.out.println ("r1 intersection u = " + r1.intersection(u));
        System.out.println ("r1 intersect1 u? " + r1.intersect1(u));
        System.out.println ("r1 intersect2 u? " + r1.intersect2(u));

        System.out.println ("\n--- Test cases completed ---");
    }
}


text:
using System;

namespace NetSpell.SpellChecker.Dictionary.Affix
{

	/// <summary>
	///     A collection that stores 'AffixEntry' objects.
	/// </summary>
	[Serializable()]
	public class AffixEntryCollection : System.Collections.CollectionBase
	{

		/// <summary>
		///     Initializes a new instance of 'AffixEntryCollection'.
		/// </summary>
		public AffixEntryCollection()
		{
		}

		/// <summary>
		///     Initializes a new instance of 'AffixEntryCollection' based on an already existing instance.
		/// </summary>
		/// <param name='value'>
		///     A 'AffixEntryCollection' from which the contents is copied
		/// </param>
		public AffixEntryCollection(AffixEntryCollection value)
		{
			this.AddRange(value);
		}

		/// <summary>
		///     Initializes a new instance of 'AffixEntryCollection' with an array of 'AffixEntry' objects.
		/// </summary>
		/// <param name='value'>
		///     An array of 'AffixEntry' objects with which to initialize the collection
		/// </param>
		public AffixEntryCollection(AffixEntry[] value)
		{
			this.AddRange(value);
		}

		/// <summary>
		///     Represents the 'AffixEntry' item at the specified index position.
		/// </summary>
		/// <param name='index'>
		///     The zero-based index of the entry to locate in the collection.
		/// </param>
		/// <value>
		///     The entry at the specified index of the collection.
		/// </value>
		public AffixEntry this[int index]
		{
			get
			{
				return ((AffixEntry)(List[index]));
			}
			set
			{
				List[index] = value;
			}
		}

		/// <summary>
		///     Adds a 'AffixEntry' item with the specified value to the 'AffixEntryCollection'
		/// </summary>
		/// <param name='value'>
		///     The 'AffixEntry' to add.
		/// </param>
		/// <returns>
		///     The index at which the new element was inserted.
		/// </returns>
		public int Add(AffixEntry value)
		{
			return List.Add(value);
		}

		/// <summary>
		///     Copies the elements of an array at the end of this instance of 'AffixEntryCollection'.
		/// </summary>
		/// <param name='value'>
		///     An array of 'AffixEntry' objects to add to the collection.
		/// </param>
		public void AddRange(AffixEntry[] value)
		{
			for (int Counter = 0; (Counter < value.Length); Counter = (Counter + 1))
			{
				this.Add(value[Counter]);
			}
		}

		/// <summary>
		///     Adds the contents of another 'AffixEntryCollection' at the end of this instance.
		/// </summary>
		/// <param name='value'>
		///     A 'AffixEntryCollection' containing the objects to add to the collection.
		/// </param>
		public void AddRange(AffixEntryCollection value)
		{
			for (int Counter = 0; (Counter < value.Count); Counter = (Counter + 1))
			{
				this.Add(value[Counter]);
			}
		}

		/// <summary>
		///     Gets a value indicating whether the 'AffixEntryCollection' contains the specified value.
		/// </summary>
		/// <param name='value'>
		///     The item to locate.
		/// </param>
		/// <returns>
		///     True if the item exists in the collection; false otherwise.
		/// </returns>
		public bool Contains(AffixEntry value)
		{
			return List.Contains(value);
		}

		/// <summary>
		///     Copies the 'AffixEntryCollection' values to a one-dimensional System.Array
		///     instance starting at the specified array index.
		/// </summary>
		/// <param name='array'>
		///     The one-dimensional System.Array that represents the copy destination.
		/// </param>
		/// <param name='index'>
		///     The index in the array where copying begins.
		/// </param>
		public void CopyTo(AffixEntry[] array, int index)
		{
			List.CopyTo(array, index);
		}

		/// <summary>
		///     Returns the index of a 'AffixEntry' object in the collection.
		/// </summary>
		/// <param name='value'>
		///     The 'AffixEntry' object whose index will be retrieved.
		/// </param>
		/// <returns>
		///     If found, the index of the value; otherwise, -1.
		/// </returns>
		public int IndexOf(AffixEntry value)
		{
			return List.IndexOf(value);
		}

		/// <summary>
		///     Inserts an existing 'AffixEntry' into the collection at the specified index.
		/// </summary>
		/// <param name='index'>
		///     The zero-based index where the new item should be inserted.
		/// </param>
		/// <param name='value'>
		///     The item to insert.
		/// </param>
		public void Insert(int index, AffixEntry value)
		{
			List.Insert(index, value);
		}

		/// <summary>
		///     Returns an enumerator that can be used to iterate through
		///     the 'AffixEntryCollection'.
		/// </summary>
		public new AffixEntryEnumerator GetEnumerator()
		{
			return new AffixEntryEnumerator(this);
		}

		/// <summary>
		///     Removes a specific item from the 'AffixEntryCollection'.
		/// </summary>
		/// <param name='value'>
		///     The item to remove from the 'AffixEntryCollection'.
		/// </param>
		public void Remove(AffixEntry value)
		{
			List.Remove(value);
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
import React, {Component} from 'react';

class LeftPanel extends Component {

    componentDidMount() {
        console.log(this.props);
    }

    render() {
        return (
            <div>
                LEFT
            </div>
        );
    }
}

export default LeftPanel;


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

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Uses of Class org.apache.solr.common.SolrInputField (Solr 4.0.0 API)
</TITLE>

<META NAME="date" CONTENT="2012-10-06">

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.solr.common.SolrInputField

Packages that use SolrInputField

org.apache.solr.common

Uses of SolrInputField in org.apache.solr.common

Methods in org.apache.solr.common that return SolrInputField

 SolrInputField
SolrInputField.deepCopy()

 SolrInputField
SolrInputDocument.get(Object key)

 SolrInputField
SolrInputDocument.getField(String field)

 SolrInputField
SolrInputDocument.put(String key,
    SolrInputField value)

 SolrInputField
SolrInputDocument.remove(Object key)

 SolrInputField
SolrInputDocument.removeField(String name)

          Remove a field from the document

Methods in org.apache.solr.common that return types with arguments of type SolrInputField

 Set<Map.Entry<String,SolrInputField>>
SolrInputDocument.entrySet()

 Iterator<SolrInputField>
SolrInputDocument.iterator()

 Collection<SolrInputField>
SolrInputDocument.values()

Methods in org.apache.solr.common with parameters of type SolrInputField

 SolrInputField
SolrInputDocument.put(String key,
    SolrInputField value)

Method parameters in org.apache.solr.common with type arguments of type SolrInputField

 void
SolrInputDocument.putAll(Map<? extends String,? extends SolrInputField> t)

Constructor parameters in org.apache.solr.common with type arguments of type SolrInputField

SolrInputDocument(Map<String,SolrInputField> fields)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

          <address>Copyright © 2000-2012 Apache Software Foundation.  All Rights Reserved.</address>


text:
package com.sinotrans.transport.dto;

import com.sinotrans.transport.common.enums.CompanyType;
import com.sinotrans.transport.dto.common.CommonListRequest;
import org.springframework.util.StringUtils;

import javax.validation.constraints.Pattern;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by emi on 2016/6/15.
 */
public class PositionListRequest extends CommonListRequest {

    private String orderBillNo;//提单号

    private String containerCaseNo;//箱号,柜号

    @Pattern(regexp = "^[1|2]$", message = "进口出口类型格式错误")
    private String orderType;//1: 进口  2:出口

    public String getOrderBillNo() {
        return orderBillNo;
    }

    public void setOrderBillNo(String orderBillNo) {
        this.orderBillNo = orderBillNo;
    }

    public String getContainerCaseNo() {
        return containerCaseNo;
    }

    public void setContainerCaseNo(String containerCaseNo) {
        this.containerCaseNo = containerCaseNo;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    @Override
    public List fetchFilter(Long userId, CompanyType companyType) {
        return null;
    }

    public Map<String, Object> fetchCondition() {
        Map<String, Object> condition = new HashMap<String,Object>();
        condition.put("orderBillNo", this.orderBillNo);
        condition.put("containerCaseNo", this.containerCaseNo);
        condition.put("orderType", this.orderType);
        return condition;
    }

    @Override
    public Map<String, Object> fetchCondition(Long userId, CompanyType companyType) {
        return null;
    }

    public Map<String, Object> fetchMapCondition() {
        Map<String, Object> condition = new HashMap<String,Object>();
        condition.put("orderBillNo", StringUtils.isEmpty(this.orderBillNo) ? "" : this.orderBillNo);
        condition.put("containerCaseNo", StringUtils.isEmpty(this.containerCaseNo) ? "" : this.containerCaseNo);
        condition.put("orderType", StringUtils.isEmpty(this.orderType) ? "" : this.orderType);
        return condition;
    }

}


text:
package com.zimbra.cs.account.soap;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.common.collect.Sets;
import com.zimbra.common.account.Key;
import com.zimbra.common.service.ServiceException;
import com.zimbra.common.soap.AdminConstants;
import com.zimbra.common.soap.Element;
import com.zimbra.common.soap.Element.XMLElement;
import com.zimbra.cs.account.DynamicGroup;
import com.zimbra.cs.account.Provisioning;
import com.zimbra.soap.admin.type.Attr;
import com.zimbra.soap.admin.type.DLInfo;
import com.zimbra.soap.admin.type.DistributionListInfo;
import com.zimbra.soap.admin.type.DistributionListMembershipInfo;

public class SoapDynamicGroup extends DynamicGroup implements SoapEntry {

    List<String> membersList;

    SoapDynamicGroup(String name, String id, Map<String, Object> attrs, Provisioning prov) {
        super(name, id, attrs, prov);
    }

    /**
     * @param dlInfo contains information about a DL that another DL is
     *        a member of.
     * @throws ServiceException
     */
    SoapDynamicGroup(DistributionListMembershipInfo dlInfo,
            Provisioning prov)
    throws ServiceException {
        // DistributionListMembershipInfo does not supply attributes
        super(dlInfo.getName(), dlInfo.getId(),
                new HashMap<String,Object>(), prov);
        // DistributionListMembershipInfo does not supply membership info
        addDlm(new ArrayList<String>(), getRawAttrs());
    }

    SoapDynamicGroup(DistributionListInfo dlInfo, Provisioning prov)
    throws ServiceException {
        super(dlInfo.getName(), dlInfo.getId(),
                Attr.collectionToMap(dlInfo.getAttrList()), prov);
        addDlm(dlInfo.getMembers(), getRawAttrs());
    }

    SoapDynamicGroup(DLInfo dlInfo, Provisioning prov)
    throws ServiceException {
        super(dlInfo.getName(), dlInfo.getId(),
                Attr.collectionToMap(dlInfo.getAttrList()), prov);
        // DLInfo does not supply membership info
        addDlm(new ArrayList<String>(), getRawAttrs());
    }

    SoapDynamicGroup(Element e, Provisioning prov) throws ServiceException {
        super(e.getAttribute(AdminConstants.A_NAME), e.getAttribute(AdminConstants.A_ID), SoapProvisioning.getAttrs(e), prov);
        addDlm(e, getRawAttrs());
    }

    @Override
    public String[] getAllMembers() throws ServiceException {
        if (membersList == null) {
            return new String[0];
        } else {
            return membersList.toArray(new String[membersList.size()]);
        }
    }

    @Override
    public Set<String> getAllMembersSet() throws ServiceException {
        if (membersList == null) {
            return Sets.newHashSet();
        } else {
            return Sets.newHashSet(membersList);
        }
    }

    private void addDlm(List <String> members, Map<String, Object> attrs) {
        /*
        attrs.put(Provisioning.A_member,
                members.toArray(new String[members.size()]));
        */
        setMembers(members);
    }

    private void setMembers(List <String> members) {
        membersList = members;
    }

    private void addDlm(Element e, Map<String, Object> attrs) {
        ArrayList<String> list = new ArrayList<String>();
        for (Element dlm : e.listElements(AdminConstants.E_DLM)) {
            list.add(dlm.getText());
        }
        addDlm(list, attrs);
    }

    public void modifyAttrs(SoapProvisioning prov, Map<String, ? extends Object> attrs, boolean checkImmutable) throws ServiceException {
        XMLElement req = new XMLElement(AdminConstants.MODIFY_DISTRIBUTION_LIST_REQUEST);
        req.addElement(AdminConstants.E_ID).setText(getId());
        SoapProvisioning.addAttrElements(req, attrs);
        Element dl = prov.invoke(req).getElement(AdminConstants.E_DL);
        Map<String, Object> newAttrs = SoapProvisioning.getAttrs(dl);
        addDlm(dl, newAttrs);
        setAttrs(newAttrs);
    }

    public void reload(SoapProvisioning prov) throws ServiceException {
        XMLElement req = new XMLElement(AdminConstants.GET_DISTRIBUTION_LIST_REQUEST);
        Element a = req.addElement(AdminConstants.E_DL);
        a.setText(getId());
        a.addAttribute(AdminConstants.A_BY, Key.DistributionListBy.id.name());
        Element dl = prov.invoke(req).getElement(AdminConstants.E_DL);
        Map<String, Object> attrs = SoapProvisioning.getAttrs(dl);
        addDlm(dl, attrs);
        setAttrs(attrs);
    }
}


text:
set(MITK_DEPENDS)
set(proj_DEPENDENCIES)
set(proj MITK)

if(NOT MITK_DIR)

  #-----------------------------------------------------------------------------
  # Create CMake options to customize the MITK build
  #-----------------------------------------------------------------------------

  option(MITK_USE_SUPERBUILD "Use superbuild for MITK" ON)
  option(MITK_USE_BLUEBERRY "Build the BlueBerry platform in MITK" ON)
  option(MITK_BUILD_EXAMPLES "Build the MITK examples" OFF)
  option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF)
  option(MITK_BUILD_TESTING "Build the MITK unit tests" OFF)
  option(MITK_USE_ACVD "Use Approximated Centroidal Voronoi Diagrams" OFF)
  option(MITK_USE_CTK "Use CTK in MITK" ${MITK_USE_BLUEBERRY})
  option(MITK_USE_DCMTK "Use DCMTK in MITK" ON)
  option(MITK_USE_Qt5 "Use Qt 5 library in MITK" ON)
  option(MITK_USE_OpenCV "Use Intel's OpenCV library" OFF)
  option(MITK_USE_SOFA "Use Simulation Open Framework Architecture" OFF)
  option(MITK_USE_VMTK "Use the Vascular Modeling Toolkit in MITK" OFF)
  option(MITK_USE_Python "Enable Python wrapping in MITK" OFF)

  if(MITK_USE_BLUEBERRY AND NOT MITK_USE_CTK)
    message("Forcing MITK_USE_CTK to ON because of MITK_USE_BLUEBERRY")
    set(MITK_USE_CTK ON CACHE BOOL "Use CTK in MITK" FORCE)
  endif()

  if(MITK_USE_CTK AND NOT MITK_USE_Qt5)
    message("Forcing MITK_USE_Qt5 to ON because of MITK_USE_CTK")
    set(MITK_USE_Qt5 ON CACHE BOOL "Use Qt 5 library in MITK" FORCE)
  endif()

  set(MITK_USE_CableSwig ${MITK_USE_Python})
  set(MITK_USE_GDCM 1)
  set(MITK_USE_ITK 1)
  set(MITK_USE_VTK 1)

  mark_as_advanced(MITK_USE_SUPERBUILD
                   MITK_BUILD_ALL_PLUGINS
                   MITK_BUILD_TESTING
                   )

  set(mitk_cmake_boolean_args
    MITK_USE_SUPERBUILD
    MITK_USE_BLUEBERRY
    MITK_BUILD_EXAMPLES
    MITK_BUILD_ALL_PLUGINS
    MITK_USE_ACVD
    MITK_USE_CTK
    MITK_USE_DCMTK
    MITK_USE_Qt5
    MITK_USE_OpenCV
    MITK_USE_SOFA
    MITK_USE_VMTK
    MITK_USE_Python
   )

  if(MITK_USE_Qt5)
    # Look for Qt at the superbuild level, to catch missing Qt libs early
    find_package(Qt5Widgets REQUIRED)
  endif()

  set(additional_mitk_cmakevars )

  # Configure the set of default pixel types
  set(MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES
      "int, unsigned int, short, unsigned short, char, unsigned char"
      CACHE STRING "List of integral pixel types used in AccessByItk and InstantiateAccessFunction macros")

  set(MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
      "double, float"
      CACHE STRING "List of floating pixel types used in AccessByItk and InstantiateAccessFunction macros")

  set(MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES
      ""
      CACHE STRING "List of composite pixel types used in AccessByItk and InstantiateAccessFunction macros")

  set(MITK_ACCESSBYITK_DIMENSIONS
      "2,3"
      CACHE STRING "List of dimensions used in AccessByItk and InstantiateAccessFunction macros")

  foreach(_arg MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES
               MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES MITK_ACCESSBYITK_DIMENSIONS)
    mark_as_advanced(${_arg})
    list(APPEND additional_mitk_cmakevars "-D${_arg}:STRING=${${_arg}}")
  endforeach()

  #-----------------------------------------------------------------------------
  # Create options to inject pre-build dependencies
  #-----------------------------------------------------------------------------

  foreach(proj CTK DCMTK GDCM VTK ACVD ITK OpenCV SOFA VMTK CableSwig)
    if(MITK_USE_${proj})
      set(MITK_${proj}_DIR "${${proj}_DIR}" CACHE PATH "Path to ${proj} build directory")
      mark_as_advanced(MITK_${proj}_DIR)
      if(MITK_${proj}_DIR)
        list(APPEND additional_mitk_cmakevars "-D${proj}_DIR:PATH=${MITK_${proj}_DIR}")
      endif()
    endif()
  endforeach()

  set(MITK_BOOST_ROOT "${BOOST_ROOT}" CACHE PATH "Path to Boost directory")
  mark_as_advanced(MITK_BOOST_ROOT)
  if(MITK_BOOST_ROOT)
    list(APPEND additional_mitk_cmakevars "-DBOOST_ROOT:PATH=${MITK_BOOST_ROOT}")
  endif()

  set(MITK_SOURCE_DIR "" CACHE PATH "MITK source code location. If empty, MITK will be cloned from MITK_GIT_REPOSITORY")
  set(MITK_GIT_REPOSITORY "https://phabricator.mitk.org/diffusion/MITK/mitk.git" CACHE STRING "The git repository for cloning MITK")
  set(MITK_GIT_TAG "origin/release/2016-11" CACHE STRING "The git tag/hash to be used when cloning from MITK_GIT_REPOSITORY")
  mark_as_advanced(MITK_SOURCE_DIR MITK_GIT_REPOSITORY MITK_GIT_TAG)

  #-----------------------------------------------------------------------------
  # Create the final variable containing superbuild boolean args
  #-----------------------------------------------------------------------------

  set(mitk_boolean_args)
  foreach(mitk_cmake_arg ${mitk_cmake_boolean_args})
    list(APPEND mitk_boolean_args -D${mitk_cmake_arg}:BOOL=${${mitk_cmake_arg}})
  endforeach()

  #-----------------------------------------------------------------------------
  # Additional MITK CMake variables
  #-----------------------------------------------------------------------------

  if(MITK_USE_Qt5)
    list(APPEND additional_mitk_cmakevars "-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}")
  endif()

  if(MITK_USE_CTK)
    list(APPEND additional_mitk_cmakevars "-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}")
  endif()

  if(MITK_INITIAL_CACHE_FILE)
    list(APPEND additional_mitk_cmakevars "-DMITK_INITIAL_CACHE_FILE:INTERNAL=${MITK_INITIAL_CACHE_FILE}")
  endif()

  if(MITK_USE_SUPERBUILD)
    set(MITK_BINARY_DIR ${proj}-superbuild)
  else()
    set(MITK_BINARY_DIR ${proj}-build)
  endif()

  set(proj_DEPENDENCIES)
  set(MITK_DEPENDS ${proj})

  # Configure the MITK souce code location

  if(NOT MITK_SOURCE_DIR)
    set(mitk_source_location
        SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
        GIT_REPOSITORY ${MITK_GIT_REPOSITORY}
        GIT_TAG ${MITK_GIT_TAG}
        )
  else()
    set(mitk_source_location
        SOURCE_DIR ${MITK_SOURCE_DIR}
       )
  endif()

  ExternalProject_Add(${proj}
    ${mitk_source_location}
    BINARY_DIR ${MITK_BINARY_DIR}
    PREFIX ${proj}${ep_suffix}
    INSTALL_COMMAND ""
    CMAKE_GENERATOR ${gen}
    CMAKE_ARGS
      ${ep_common_args}
      ${mitk_boolean_args}
      ${additional_mitk_cmakevars}
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_TESTING:BOOL=${MITK_BUILD_TESTING}
    CMAKE_CACHE_ARGS
      ${ep_common_cache_args}
    CMAKE_CACHE_DEFAULT_ARGS
      ${ep_common_cache_default_args}
    DEPENDS
      ${proj_DEPENDENCIES}
    )

  if(MITK_USE_SUPERBUILD)
    set(MITK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${MITK_BINARY_DIR}/MITK-build")
  else()
    set(MITK_DIR "${CMAKE_CURRENT_BINARY_DIR}/${MITK_BINARY_DIR}")
  endif()

else()

  # The project is provided using MITK_DIR, nevertheless since other
  # projects may depend on MITK, let's add an 'empty' one
  MacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")

  # Further, do some sanity checks in the case of a pre-built MITK
  set(my_itk_dir ${ITK_DIR})
  set(my_vtk_dir ${VTK_DIR})

  find_package(MITK REQUIRED)

  if(my_itk_dir AND NOT my_itk_dir STREQUAL ${ITK_DIR})
    message(FATAL_ERROR "ITK packages do not match:\n   ${MY_PROJECT_NAME}: ${my_itk_dir}\n  MITK: ${ITK_DIR}")
  endif()

  if(my_vtk_dir AND NOT my_vtk_dir STREQUAL ${VTK_DIR})
    message(FATAL_ERROR "VTK packages do not match:\n   ${MY_PROJECT_NAME}: ${my_vtk_dir}\n  MITK: ${VTK_DIR}")
  endif()

endif()


text:
package com.azure.spring.data.cosmos.repository.integration;

import com.azure.spring.data.cosmos.IntegrationTestCollectionManager;
import com.azure.spring.data.cosmos.core.CosmosTemplate;
import com.azure.spring.data.cosmos.domain.Question;
import com.azure.spring.data.cosmos.repository.TestRepositoryConfig;
import com.azure.spring.data.cosmos.repository.repository.QuestionRepository;
import org.assertj.core.util.Lists;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = TestRepositoryConfig.class)
public class QuestionRepositoryIT {

    private static final String QUESTION_ID = "question-id";

    private static final String QUESTION_URL = "http://xxx.html";

    private static final Question QUESTION = new Question(QUESTION_ID, QUESTION_URL);

    @ClassRule
    public static final IntegrationTestCollectionManager collectionManager = new IntegrationTestCollectionManager();

    @Autowired
    private CosmosTemplate template;

    @Autowired
    private QuestionRepository repository;

    @Before
    public void setUp() {
        collectionManager.ensureContainersCreatedAndEmpty(template, Question.class);
        this.repository.save(QUESTION);
    }

    @Test
    public void testFindById() {
        final Optional<Question> optional = this.repository.findById(QUESTION_ID);

        Assert.assertTrue(optional.isPresent());
        Assert.assertEquals(QUESTION, optional.get());
    }

    @Test
    public void testFindByIdNull() {
        final Optional<Question> byId = this.repository.findById(QUESTION_URL);
        Assert.assertFalse(byId.isPresent());
    }

    @Test
    public void testFindAll() {
        final List<Question> questions = Lists.newArrayList(this.repository.findAll());

        Assert.assertEquals(Collections.singletonList(QUESTION), questions);
    }

    @Test
    public void testDelete() {
        Optional<Question> optional = this.repository.findById(QUESTION_ID);

        Assert.assertTrue(optional.isPresent());
        Assert.assertEquals(QUESTION, optional.get());

        this.repository.delete(QUESTION);
        optional = this.repository.findById(QUESTION_ID);

        Assert.assertFalse(optional.isPresent());
    }
}


text:
1.1.RELEASE

### Note (for Gmail)
You must allow your Gmail account to access less secure apps.

Login to Gmail and visit [Here](https://www.google.com/settings/security/lesssecureapps) to Turn On Access for less secure apps.

[More Info here](https://support.google.com/accounts/answer/6010255)

### Installation

```sh
$ git clone https://github.com/RawSanj/java-mail-clients.git
```

#### Updated Version (added support for Attachments):

1. Update `ConfigConsts.java` file with *to* and *from* Email address and password.
2. Select the SMTP Server (GMAIL, YAHOO, OUTLOOK or ZOHO) and update the File path where the attachments are located.
3. Run the `SendEmailWithAttachments` class as Java Application.

#### Older Version:
1. Change the `sendToAddress`, `sendFromAddress` and `password` in the respective E-Mail client app and run as Java Application.

### Reference

Refer below links for API and SMTP settings:

* [JavaMail API] - JavaMail : version-1.5.4
* [GMail SMTP] - Gmail SMTP Settings.
* [Outlook SMTP] - Outlook SMTP Settings.
* [Yahoo SMTP] - Yahoo SMTP Settings.
* [Zoho SMTP] - Zoho SMTP Settings.

### Tools

The following tools are used to create this project :

* Eclipse
* Google Chrome
* Git

### License
----

The MIT License (MIT)

Copyright (c) 2017. Sanjay Rawat

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)

   [JavaMail API]: <http://www.oracle.com/technetwork/java/javamail/index.html>
   [GMail SMTP]: <https://support.google.com/a/answer/176600?hl=en>
   [Outlook SMTP]: <https://www.outlook-apps.com/outlook-com-pop-settings/>
   [Yahoo SMTP]: <http://www.serversmtp.com/en/smtp-yahoo>
   [Zoho SMTP]: <https://www.zoho.com/mail/help/zoho-smtp.html>
   [jHipster]: <http://www.jhipster.tech>
   [Configuring Email with - Gmail]: <http://www.jhipster.tech/tips/011_tip_configuring_email_in_jhipster.html>


text:
package com.mossle.asset.data;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.util.Date;
import java.util.UUID;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import com.mossle.asset.persistence.domain.AssetCategory;
import com.mossle.asset.persistence.domain.AssetInfo;
import com.mossle.asset.persistence.manager.AssetCategoryManager;
import com.mossle.asset.persistence.manager.AssetInfoManager;
import com.mossle.asset.persistence.manager.SkuCategoryManager;
import com.mossle.asset.persistence.manager.SkuInfoManager;
import com.mossle.asset.persistence.manager.StockInfoManager;
import com.mossle.asset.persistence.manager.StockItemManager;

import com.mossle.core.csv.CsvProcessor;

import org.apache.commons.lang3.StringUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AssetDeployer {
    private static Logger logger = LoggerFactory.getLogger(AssetDeployer.class);
    private AssetInfoManager assetInfoManager;
    private AssetCategoryManager assetCategoryManager;
    private SkuInfoManager skuInfoManager;
    private SkuCategoryManager skuCategoryManager;
    private StockInfoManager stockInfoManager;
    private StockItemManager stockItemManager;
    private String dataFilePath = "data/asset.csv";
    private String dataFileEncoding = "GB2312";
    private String skuDataFilePath = "data/sku.csv";
    private String skuDataFileEncoding = "GB2312";
    private String stockDataFilePath = "data/stock.csv";
    private String stockDataFileEncoding = "GB2312";
    private String defaultTenantId = "1";
    private boolean enable = true;

    @PostConstruct
    public void process() throws Exception {
        if (!enable) {
            logger.info("skip init asset data");

            return;
        }

        AssetInfoCallback assetInfoCallback = new AssetInfoCallback();
        assetInfoCallback.setAssetInfoManager(assetInfoManager);
        assetInfoCallback.setAssetCategoryManager(assetCategoryManager);
        new CsvProcessor().process(dataFilePath, dataFileEncoding,
                assetInfoCallback);

        SkuCallback skuCallback = new SkuCallback();
        skuCallback.setSkuInfoManager(skuInfoManager);
        skuCallback.setSkuCategoryManager(skuCategoryManager);
        new CsvProcessor().process(skuDataFilePath, skuDataFileEncoding,
                skuCallback);

        StockCallback stockCallback = new StockCallback();
        stockCallback.setStockInfoManager(stockInfoManager);
        stockCallback.setStockItemManager(stockItemManager);
        stockCallback.setSkuInfoManager(skuInfoManager);
        new CsvProcessor().process(stockDataFilePath, stockDataFileEncoding,
                stockCallback);
    }

    @Resource
    public void setAssetInfoManager(AssetInfoManager assetInfoManager) {
        this.assetInfoManager = assetInfoManager;
    }

    @Resource
    public void setAssetCategoryManager(
            AssetCategoryManager assetCategoryManager) {
        this.assetCategoryManager = assetCategoryManager;
    }

    @Resource
    public void setSkuInfoManager(SkuInfoManager skuInfoManager) {
        this.skuInfoManager = skuInfoManager;
    }

    @Resource
    public void setSkuCategoryManager(SkuCategoryManager skuCategoryManager) {
        this.skuCategoryManager = skuCategoryManager;
    }

    @Resource
    public void setStockInfoManager(StockInfoManager stockInfoManager) {
        this.stockInfoManager = stockInfoManager;
    }

    @Resource
    public void setStockItemManager(StockItemManager stockItemManager) {
        this.stockItemManager = stockItemManager;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">

    <title>Fireball | <%=project%></title>

    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="full-screen" content="yes"/>
    <meta name="screen-orientation" content="portrait"/>
    <meta name="x5-fullscreen" content="true"/>
    <meta name="360-fullscreen" content="true"/>

<%=project%>

            <canvas id="GameCanvas" width="32" height="32" oncontextmenu="event.preventDefault()" style="visibility: hidden"></canvas>

Created with Fireball-x


text:
from typing import Any

from pyflink.common import Duration
from pyflink.common.serialization import SimpleStringSchema, JsonRowDeserializationSchema
from pyflink.common.typeinfo import Types
from pyflink.common.watermark_strategy import TimestampAssigner, WatermarkStrategy
from pyflink.datastream import StreamExecutionEnvironment, TimeCharacteristic
from pyflink.datastream.connectors import FlinkKafkaProducer, FlinkKafkaConsumer
from pyflink.datastream.functions import KeyedProcessFunction

from functions import MyKeySelector

def python_data_stream_example():
    env = StreamExecutionEnvironment.get_execution_environment()
    # Set the parallelism to be one to make sure that all data including fired timer and normal data
    # are processed by the same worker and the collected result would be in order which is good for
    # assertion.
    env.set_parallelism(1)
    env.set_stream_time_characteristic(TimeCharacteristic.EventTime)

    type_info = Types.ROW_NAMED(['createTime', 'orderId', 'payAmount', 'payPlatform', 'provinceId'],
                                [Types.LONG(), Types.LONG(), Types.DOUBLE(), Types.INT(),
                                 Types.INT()])
    json_row_schema = JsonRowDeserializationSchema.builder().type_info(type_info).build()
    kafka_props = {'bootstrap.servers': 'localhost:9092', 'group.id': 'pyflink-e2e-source'}

    kafka_consumer = FlinkKafkaConsumer("timer-stream-source", json_row_schema, kafka_props)
    kafka_producer = FlinkKafkaProducer("timer-stream-sink", SimpleStringSchema(), kafka_props)

    watermark_strategy = WatermarkStrategy.for_bounded_out_of_orderness(Duration.of_seconds(5))\
        .with_timestamp_assigner(KafkaRowTimestampAssigner())

    kafka_consumer.set_start_from_earliest()
    ds = env.add_source(kafka_consumer).assign_timestamps_and_watermarks(watermark_strategy)
    ds.key_by(MyKeySelector(), key_type=Types.LONG()) \
        .process(MyProcessFunction(), output_type=Types.STRING()) \
        .add_sink(kafka_producer)
    env.execute_async("test data stream timer")

class MyProcessFunction(KeyedProcessFunction):

    def process_element(self, value, ctx: 'KeyedProcessFunction.Context'):
        result = "Current key: {}, orderId: {}, payAmount: {}, timestamp: {}".format(
            str(ctx.get_current_key()), str(value[1]), str(value[2]), str(ctx.timestamp()))
        yield result
        current_watermark = ctx.timer_service().current_watermark()
        ctx.timer_service().register_event_time_timer(current_watermark + 1500)

    def on_timer(self, timestamp, ctx: 'KeyedProcessFunction.OnTimerContext'):
        yield "On timer timestamp: " + str(timestamp)

class KafkaRowTimestampAssigner(TimestampAssigner):

    def extract_timestamp(self, value: Any, record_timestamp: int) -> int:
        return int(value[0])

if __name__ == '__main__':
    python_data_stream_example()


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class OnHold extends Model
{
    protected $table = 'on_hold';

    protected $guarded = ['id', 'created_at', 'updated_at'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function manga()
    {
        return $this->belongsTo(Manga::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}


text:
<?php

namespace Norm\riak;

use Norm\riak\base\AdBase;

class Ad extends AdBase {

}


text:
#region License Header

#endregion License Header

using FluentAssertions;
using Quantler.Indicators;
using Xunit;

namespace Quantler.Tests.Indicators
{
    public class KeltnerChannelsTests
    {
        #region Public Methods

        [Fact]
        [Trait("Quantler.Indicators", "KeltnerChannels")]
        public void ComparesWithExtenralDataMiddleBand()
        {
            var kch = new KeltnerChannels(20, 1.5m, MovingAverageType.Simple);
            TestHelper.TestIndicator(kch, "spy_with_keltner.csv", "Middle Band",
                (ind, expected) => ((double) ((KeltnerChannels) ind).MiddleBand.Current.Price).Should()
                    .BeApproximately(expected, 1e-3));
        }

        [Fact]
        [Trait("Quantler.Indicators", "KeltnerChannels")]
        public void ComparesWithExternalDataLowerBand()
        {
            var kch = new KeltnerChannels(20, 1.5m, MovingAverageType.Simple);
            TestHelper.TestIndicator(kch, "spy_with_keltner.csv", "Keltner Channels 20 Bottom",
                (ind, expected) => ((double) ((KeltnerChannels) ind).LowerBand.Current.Price).Should()
                    .BeApproximately(expected, 1e-3));
        }

        [Fact]
        [Trait("Quantler.Indicators", "KeltnerChannels")]
        public void ComparesWithExternalDataUpperBand()
        {
            var kch = new KeltnerChannels(20, 1.5m, MovingAverageType.Simple);
            TestHelper.TestIndicator(kch, "spy_with_keltner.csv", "Keltner Channels 20 Top",
                (ind, expected) => ((double) ((KeltnerChannels) ind).UpperBand.Current.Price).Should()
                    .BeApproximately(expected, 1e-3));
        }

        [Fact]
        [Trait("Quantler.Indicators", "KeltnerChannels")]
        public void ResetsProperly()
        {
            var kch = new KeltnerChannels(20, 1.5m, MovingAverageType.Simple);
            foreach (var data in TestHelper.GetTradeBarStream("spy_with_keltner.csv", false))
            {
                kch.Update(data);
            }

            Assert.True(kch.IsReady);
            Assert.True(kch.UpperBand.IsReady);
            Assert.True(kch.LowerBand.IsReady);
            Assert.True(kch.MiddleBand.IsReady);
            Assert.True(kch.AverageTrueRange.IsReady);

            kch.Reset();

            TestHelper.AssertIndicatorIsInDefaultState(kch);
            TestHelper.AssertIndicatorIsInDefaultState(kch.UpperBand);
            TestHelper.AssertIndicatorIsInDefaultState(kch.LowerBand);
            TestHelper.AssertIndicatorIsInDefaultState(kch.AverageTrueRange);
        }

        #endregion Public Methods
    }
}


text:
<!DOCTYPE html>

<title>GROSS!</title>

	<link rel="stylesheet" type="text/css" href="styles/main.css">

	<title>Github Tutorial</title>

	    * html body { background: {color:Background}; }

Hello CS Students!

This is a list of classes for the CS major at Wellesley College

CS111

CS230

CS240

MATH225

2 300 Level Courses

1 additional 200 Level Math

An eccentric tea collection

These are professors in the CS Department

Brian Tjaden

Scott Anderson

Orit Shaer

Stella Kakavouli

Ben Wood

Jean Herbst

An Entire Flock of Red Herrings


text:
<!DOCTYPE html>

Goblins estão fazendo essa página


text:
id: 5900f36e1000cf542c50fe80
challengeType: 5
title: 'Problem 1: Multiples of 3 and 5'
videoUrl: ''
localeTitle: ''
---

## Description
undefined

## Instructions
undefined

## Tests

```yml
tests:
  - text: ''
    testString: 'assert.strictEqual(multiplesOf3and5(1000), 233168, "<code>multiplesOf3and5(1000)</code> should return 233168.");'
  - text: ''
    testString: 'assert.strictEqual(multiplesOf3and5(49), 543, "<code>multiplesOf3and5(49)</code> should return 543.");'
  - text: ''
    testString: 'assert.strictEqual(multiplesOf3and5(19564), 89301183, "<code>multiplesOf3and5(19564)</code> should return 89301183.");'
  - text: ''
    testString: 'assert.strictEqual(multiplesOf3and5(8456), 16687353, "Your function is not returning the correct result using our tests values.");'

```

## Challenge Seed

```js
function multiplesOf3and5(number) {
  // Good luck!
  return true;
}

multiplesOf3and5(1000);

```

## Solution

```js
// solution required
```


text:
#ifndef BOARD_H_   /* Include guard */
#define BOARD_H_

//game board struct
struct game {
    //pointer to the array that is size*size long
    int * board;
    //the size of the grid
    int size;
};

//exported functions

/*
 * Creates a new board in memory
 * Returns a pointer to the new struct
 */
struct game * board_create(int size);

/*
 * Cleans up a board given from board_create
 * Returns 0 on sucess
 */
int board_free(struct game * input);

int board_copy(struct game * board_input,struct game * board_output);

/*
 * Returns the value at the given position on the given board
 * Returns 0 if outside the grid
 * (used for shifting on new cells)
 */
int board_get(struct game * input ,int x , int y);

/*
 * Sets the value at the given postion on the given table
 * Returns 0 on sucess
 */
int board_set(struct game * input ,int x , int y,int value);

/*
 * Performs a left,right,up,down move actions on the given board
 * Returns:
 * -1 if the move fails
 * 0 if there was a move but no merges
 * >0 the value of the merges
 */
int moveLeft(struct game * input );
int moveRight(struct game * input );
int moveDown(struct game * input );
int moveUp(struct game * input );

/*
 *inserts new numbers into the given grid over blank(0) spaces
 */
void insertNewNumber(struct game * input );

#endif


text:
package com.azure.identity.implementation;

import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpResponse;
import com.microsoft.aad.msal4j.HttpMethod;
import com.microsoft.aad.msal4j.HttpRequest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import reactor.core.publisher.Mono;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;

@RunWith(PowerMockRunner.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
@PrepareForTest({HttpPipeline.class, HttpRequest.class, HttpResponse.class, URL.class})
public class HttpPipelineAdapterTests {

    @Test
    public void testSendRequest() throws Exception {
        Mono<String> bodyResponse = Mono.just("dummy-body");
        HttpPipeline pipeline = PowerMockito.mock(HttpPipeline.class);
        HttpPipelineAdapter pipelineAdapter = new HttpPipelineAdapter(pipeline);
        HttpRequest req = mockForSendRequest(bodyResponse, pipeline);
        pipelineAdapter.send(req);
    }

    @Test
    public void testSendRequestEmptyBody() throws Exception {
        HttpPipeline pipeline = PowerMockito.mock(HttpPipeline.class);
        HttpPipelineAdapter pipelineAdapter = new HttpPipelineAdapter(pipeline);
        HttpRequest req = mockForSendRequest(Mono.empty(), pipeline);
        pipelineAdapter.send(req);
    }

    private HttpRequest mockForSendRequest(Mono<String> bodyResponse, HttpPipeline pipeline) throws MalformedURLException {
        HttpRequest req = PowerMockito.mock(HttpRequest.class);
        HttpMethod method = HttpMethod.GET;
        when(req.httpMethod()).thenReturn(method);
        URL url = new URL("https://localhost.com/");
        when(req.url()).thenReturn(url);
        when(req.body()).thenReturn("");
        Map<String, String> a = new HashMap<>();
        when(req.headers()).thenReturn(a);
        HttpResponse coreResponse = PowerMockito.mock(HttpResponse.class);
        when(coreResponse.getBodyAsString()).thenReturn(bodyResponse);
        when(coreResponse.getHeaders()).thenReturn(new HttpHeaders(a));
        when(coreResponse.getStatusCode()).thenReturn(200);
        when(pipeline.send(any(com.azure.core.http.HttpRequest.class))).thenReturn(Mono.just(coreResponse));
        return req;
    }
}


text:
/* Node Modules */
import React from 'react';
import { Route, IndexRoute } from 'react-router';

/* Components */
import App from 'App';
import Home from 'Home';

export default (
  <Route path="/" component={App}>
  </Route>
);


text:
from pythonforandroid.toolchain import Recipe, shprint, current_directory, ArchARM
from os.path import exists, join, realpath
from os import uname
import glob
import sh

class LibShineRecipe(Recipe):
    version = 'c72aba9031bde18a0995e7c01c9b53f2e08a0e46'
    url = 'https://github.com/toots/shine/archive/{version}.zip'

    def should_build(self, arch):
        build_dir = self.get_build_dir(arch.arch)
        return not exists(join(build_dir, 'lib', 'libshine.a'))

    def build_arch(self, arch):
        with current_directory(self.get_build_dir(arch.arch)):
            env = self.get_recipe_env(arch)
            shprint(sh.Command('./bootstrap'))
            configure = sh.Command('./configure')
            shprint(configure,
                    '--host=arm-linux',
                    '--enable-pic',
                    '--disable-shared',
                    '--enable-static',
                    '--prefix={}'.format(realpath('.')),
                    _env=env)
            shprint(sh.make, '-j4', _env=env)
            shprint(sh.make, 'install', _env=env)

recipe = LibShineRecipe()


text:
Selenium GenericObjectFunctions::<BIG>Click</BIG>

TID
SE
SE2

<short_desc xmlns="">
                A single click on an object.
              </short_desc>

<detailed_desc xmlns="">

                By default, clicks on the center of the component.
                We can also click on any part of an object, or any point relative to an object
                based on a provided x,y coordinate or other component-specific parameters.

                For SE+, the coordinate can be percentage format, like "20%,30%". This percentage format
                indicates the point (20% width of component, 30% height of component) relative to the object.

                The object to be clicked is first given context and then a click is
                generated at the coordinates.  Thus, a subitem or object can be
                referenced by name even though it is only recognized via coordinates.

                The coordinate lookup is done with the component name of the record AND
                Field #5 or by providing the literal text of the coordinates, where supported.

                Typical Data Table records:

                (1) t MainWindow MainWindow  Click

                (2) t MainWindow MainWindow  Click AnObject

                (3) t MainWindow FolderTree  Click Node1

                (4) t MainWindow MainWindow  Click "50,200"

                (5) t MainWindow MainWindow  Click "Coords=50,200"

                For SE+, the Data Table records can be:

                (6) t MainWindow MainWindow  Click "50%,20%"

                (7) t MainWindow MainWindow  Click "50,20%"

                #2 above will contain an AnObject="3,10" entry in the MainWindow section
                of the Application Map to click at x=3, y=10 in the MainWindow.

                #3 above will contain a FolderTree entry in the MainWindow section with
                normal recognition information for it.  FolderTree will also have it's
                own section in the Application Map in which there will be an entry like
                Node1="15,30".  This will tell Robot to locate the FolderTree Generic
                object and click at the coordinates specified by the reference.

                #4 and #5 above show using literal text instead of an App Map entry to specify
                where to click relative to the item.

                #6 and #7 above show using percentage format in SE+. #6 will click at position,
                where the X value equals 50% width of component, its Y value equals 20% height of component,
                relative to the object. #7 will click at position, where the X value equals 50,
                its Y value equals 20% height of component, relative to the object.

                Rational Robot no longer requires the AppMapSubKey be provided and will
                attempt to use the string as literal text if no AppMapSubKey is found in
                the current App Map.  Robot also no longer assumes the AppMapSubKey value
                or the literal value is presenting coordinate information.  This allows
                components that can accept parameters other than coordinates, like table
                row/col values or ImageMap areas to be specified.

                If the value is deduced to contain coordinates, but is not prefixed with
                "Coords=" text, then Robot will add the prefix.  Otherwise, the text value
                will remain unmodified.

		        This is the direction we expect all tools to follow going forward.

		        Engines should also attempt to support coordinates separated by alternate separators.
		        The most common separators that should be supported would be:

"," (comma) Example: "50,200"

";" (semi-colon) Example: "50;200"

" " (space) Example: "50 200"

		        Note: the TID supports this command using
		        Image-Based Testing
		        techniques and App Map entries as well as literal text coordinates.

For IOS: Any optional coordinates MUST be specified as an integer number between
		        0-100.  0 represents the extreme left (or top), while 100 represents the extreme
		        right (or bottom). IOS does not use absolute coordinates, but relative coordinates
		        representing a percentage of the element width or height.

</detailed_desc>

Fields: [ ]=Optional with Default Value

[ AppMapSubkey =  ]

<short_desc xmlns="">
                (Optional)Name of the AppMap subkey to lookup or the literal text to use for the click.
              </short_desc>

<detailed_desc xmlns="">
                Without this we should click on the center of the object.

Name of the AppMap subkey to lookup and use for the click.
                We expect the AppMap or literal text to contain the item in the format "x,y":

                [FolderTree]
                Node1="33,120"      OR
                Node1="Coords=33,120"
                ...
                [AnHTMLImage]
                AMappdedRegion=Coords=10,10
                ANamedRegion=AreaName=TechSupport
                AnIndexedRegion=AreaIndex=2
                AnotherRegion=AreaID=Contact

                The results from the lookup are appended to the "Coords=" string
                used by the Click command in Robot (only if necessary).  So any
                valid content used with the Click command can be part of
                this AppMap entry.

                Both Fields #3 and #5 are used to locate the item in the App Map.
                This routine does not specify an App Map so only the current Map
                is used and it is expected to be valid.

                The Rational Robot implementation also supports using literal text in
                this parameter instead of an AppMapSubKey.  If the value retrieved from
                this field is NOT found to exist in the App Map as a Sub Key then it
                will be used as literal text as if it HAD been retrieved from the App Map.

				Engines should also attempt to support coordinates separated by alternate separators.
				The most common separators that should be supported would be:

"," (comma) Example: "50,200"

";" (semi-colon) Example: "50;200"

" " (space) Example: "50 200"

Important TID note. The TID IBT implementation supports using literal text in
                this parameter instead of an AppMapSubKey.  If the value retrieved from
                this field is NOT found to exist in the App Map as a Sub Key then it
                will be used as literal text as if it HAD been retrieved from the App Map.

                Any coordinates provided for TID IBT are considered relative to the top-left (0,0) of the
                image or item found unless PointRelative and\or Hotspot information in the IBT recognition
                string change this initial relative point to be somewhere else.

Important Abbot note. Presently, there is no support for AppMapSubkey
                specification (5th field).

For IOS: Any optional coordinates MUST be specified as an integer number between
		        0-100.  0 represents the extreme left (or top), while 100 represents the extreme
		        right (or bottom). IOS does not use absolute coordinates, but relative coordinates
		        representing a percentage of the element width or height.

</detailed_desc>

[ AutoScroll =  ]

<short_desc xmlns="">
                (Optional) True|False. If the component will be scrolled into view automatically before clicking. The default value is true.
              </short_desc>

<detailed_desc xmlns="">
                If the component is out of view, the click action will not succeed. Normally we will scroll the component into view,
                and then perform the click action. But sometimes, the component is partially shown and click could work and user does not
                want the component shift, then we could turn off the auto-scroll ability by setting this parameter to false.

                If this auto-scroll is turned off, user needs to make sure that component is shown by himself.
              </detailed_desc>

NOTE:
SE2 : <value xmlns="">For now, this optional parameter is only supported in Selenium2.0 Engine. </value>

Examples:

<usage xmlns="">T, WINDOW, COMPONENT, CLICK</usage>

<short_desc xmlns="">
               A single click on the center of the object.
              </short_desc>

<detailed_desc xmlns="">
               A single click on the center of the object.
              </detailed_desc>

<usage xmlns="">T, WINDOW, WINDOW, CLICK, AnObject</usage>

<short_desc xmlns="">
               A single click will be performed at a x,y coordinate indicated by the AnObject reference in
               the Application Map.
              </short_desc>

<detailed_desc xmlns="">
               Field  5 : TQ String. A reference identified in the Application Map identifying coordinates
               on which to click
               This example shows AnObject which will be found in the Application Map as a referenced item
               in the WINDOW section.
              </detailed_desc>

<usage xmlns="">T, WINDOW, AnObject, CLICK, ASubObject</usage>

<short_desc xmlns="">
               A single click will be performed at a x,y coordinate indicated by the ASubObject reference in
               the Application Map.
              </short_desc>

<detailed_desc xmlns="">
               Field  5 : TQ String. A reference identified in the Application Map identifying coordinates
               on which to click
               This example shows AnObject as a viable object in the WINDOW but that it also has its own
               section in the Application Map which contains one or more named references like
               ASubObject which are used for test.
              </detailed_desc>

<usage xmlns="">T, WINDOW, AnObject, CLICK, 10;20</usage>

<short_desc xmlns="">
               A single click will be performed at coordinate 10,20 in the object.
              </short_desc>

<detailed_desc xmlns="">
               Field  5 : TQ String. The item does not exist in the app map so will be
               treated as literal text.  Note we allow semi-colon delimited coordinates
               to support the case when commas are used as field delimiters and cannot be
               used to delimit the X and Y coordinates.
              </detailed_desc>

<usage xmlns="">T, WINDOW, AnObject, CLICK, "Coords=10;20"</usage>

<short_desc xmlns="">
               A single click will be performed at coordinate 10,20 in the object.
              </short_desc>

<detailed_desc xmlns="">
               Field  5 : TQ String. The item does not exist in the app map so will be
               treated as literal text.  Note we allow semi-colon delimited coordinates
               to support the case when commas are used as field delimiters and cannot be
               used to delimit the X and Y coordinates.
              </detailed_desc>

<usage xmlns="">T, WINDOW, AnObject, CLICK, 10;20, False</usage>

<short_desc xmlns="">
               A single click will be performed at coordinate 10,20 in the object. And the object
               will not be scrolled into view automatically before clicking.</short_desc>

<detailed_desc xmlns="">
               Field  5 : TQ String. The item does not exist in the app map so will be
               treated as literal text.  Note we allow semi-colon delimited coordinates
               to support the case when commas are used as field delimiters and cannot be
               used to delimit the X and Y coordinates.
              </detailed_desc>

NOTE:
SE2 : <value xmlns="">Auto-scroll will be turned off.</value>

[How To Read This Reference]


text:
#ifndef __EFFEKSEERRENDERER_DX11_MATERIALLOADER_H__
#define __EFFEKSEERRENDERER_DX11_MATERIALLOADER_H__

#include "EffekseerRendererDX11.DeviceObject.h"
#include "EffekseerRendererDX11.RendererImplemented.h"
#include <memory>

namespace Effekseer
{
class Material;
class CompiledMaterialBinary;
} // namespace Effekseer

namespace EffekseerRendererDX11
{

class MaterialLoader : public ::Effekseer::MaterialLoader
{
private:
	Effekseer::Backend::GraphicsDeviceRef graphicsDevice_;
	::Effekseer::FileInterfaceRef fileInterface_ = nullptr;

	::Effekseer::MaterialRef LoadAcutually(::Effekseer::MaterialFile& materialFile, ::Effekseer::CompiledMaterialBinary* binary);

public:
	MaterialLoader(Effekseer::Backend::GraphicsDeviceRef graphicsDevice, ::Effekseer::FileInterfaceRef fileInterface);
	virtual ~MaterialLoader();

	::Effekseer::MaterialRef Load(const char16_t* path) override;

	::Effekseer::MaterialRef Load(const void* data, int32_t size, Effekseer::MaterialFileType fileType) override;

	void Unload(::Effekseer::MaterialRef data) override;
};

} // namespace EffekseerRendererDX11

#endif // __EFFEKSEERRENDERER_GL_MODELLOADER_H__


text:
#include <rtti/metadefine.h>

template<typename T>
void define_std_unique_ptr(rtti::meta_define<std::unique_ptr<T>> define)
{
    using U = std::unique_ptr<T>;
    define
        .template _constructor<typename U::pointer>()
        .template _method("get", &U::get)
        .template _method("release", &U::release)
        .template _method("reset", &U::reset)
    ;
}

template<typename T>
void register_std_unique_ptr()
{
    using namespace std::literals;

    auto name = "unique_ptr<"s.append(rtti::type_name<T>()) + '>';
    rtti::global_define()
        ._namespace("std")
            ._class<std::unique_ptr<T>>(name)
                ._lazy(define_std_unique_ptr<T>)
            ._end()
        ._end()
    ;
}

template<typename Char>
void define_std_string(rtti::meta_define<std::basic_string<Char>> define)
{
    using T = std::basic_string<Char>;
    using size_type = typename T::size_type;
    using value_type = typename T::value_type;
    using reference = typename T::reference;
    using const_reference = typename T::const_reference;
    using iterator = typename T::iterator;

    define
        .template _constructor<value_type const*>()
        .template _constructor<value_type const*, size_type>()

        .template _method("size", &T::size)
        .template _method<void (T::*)(size_type)>("resize", &T::resize)
        .template _method<void (T::*)(size_type, value_type)>("resize_init_char", &T::resize)
        .template _method("capacity", &T::capacity)
        .template _method("empty", &T::empty)
        .template _method("clear", &T::clear)
        .template _method("reserve", &T::reserve)

        .template _method("c_str", &T::c_str)

        .template _method<iterator (T::*)()>("begin", &T::begin)
        .template _method("cbegin", &T::cbegin)

        .template _method<iterator (T::*)()>("end", &T::end)
        .template _method("cend", &T::cend)

        .template _method<reference (T::*)(size_type)>("[]", &T::operator[])
        .template _method<const_reference (T::*)(size_type) const>("const []", &T::operator[])
        .template _method<reference (T::*)(size_type)>("at", &T::at)
        .template _method<const_reference (T::*)(size_type) const>("const at", &T::at)

        .template _method<T& (T::*)(T const&)>("append str", &T::operator+=)
        .template _method<T& (T::*)(value_type const*)>("append pchar", &T::operator+=)
        .template _method<T& (T::*)(value_type)>("append char", &T::operator+=)

        .template _method<size_type (T::*)(value_type const*, size_type) const>("find pchar", &T::find)
        .template _method<size_type (T::*)(T const&, size_type) const>("find str", &T::find)
        .template _method<size_type (T::*)(value_type, size_type) const>("find char", &T::find)

        .template _method<size_type (T::*)(value_type const*, size_type) const>("rfind pchar", &T::rfind)
        .template _method<size_type (T::*)(T const&, size_type) const>("rfind str", &T::rfind)
        .template _method<size_type (T::*)(value_type, size_type) const>("rfind char", &T::rfind)
    ;
}

template<typename Char>
void register_std_string(std::string_view name)
{
    rtti::global_define()
        ._namespace("std")
            ._class<std::basic_string<Char>>(name)
                ._lazy(define_std_string<Char>)
            ._end()
        ._end()
    ;
}

template<typename T>
void define_std_vector(rtti::meta_define<std::vector<T>> define)
{
    using V = std::vector<T>;
    using size_type = typename V::size_type;
    using value_type = typename V::value_type;
    using pointer = typename V::pointer;
    using reference = typename V::reference;
    using const_reference = typename V::const_reference;
    using iterator = typename V::iterator;
    using initializer_list = std::initializer_list<value_type>;

    define
        .template _constructor<size_type>("size")
        .template _constructor<size_type, const_reference>("size_init_val")
        .template _constructor<initializer_list>("init_list")
        .template _constructor<pointer, pointer>("range1")
        .template _constructor<iterator, iterator>("range2")

        .template _method("size", &V::size)
        .template _method<void (V::*)(size_type)>("resize", &V::resize)
        .template _method<void (V::*)(size_type, const_reference)>("resize_init_val", &V::resize)
        .template _method("capacity", &V::capacity)
        .template _method("empty", &V::empty)
        .template _method("clear", &V::clear)
        .template _method("reserve", &V::reserve)

        .template _method<iterator (V::*)()>("begin", &V::begin)
        .template _method("cbegin", &V::cbegin)

        .template _method<reference (V::*)()>("front", &V::front)
        .template _method<const_reference(V::*)() const>("cfront", &V::front)

        .template _method<iterator (V::*)()>("end", &V::end)
        .template _method("cend", &V::cend)

        .template _method<reference (V::*)()>("back", &V::back)
        .template _method<const_reference(V::*)() const>("cback", &V::back)

        .template _method<reference (V::*)(size_type)>("[]", &V::operator[])
        .template _method<const_reference (V::*)(size_type) const>("const []", &V::operator[])
        .template _method<reference (V::*)(size_type)>("at", &V::at)
        .template _method<const_reference (V::*)(size_type) const>("const at", &V::at)

        .template _method<void (V::*)(value_type const&)>("push_back", &V::push_back)
        .template _method<void (V::*)(value_type &&)>("push_back_rv", &V::push_back)
        .template _method("pop_back", &V::pop_back)
    ;
}

template<typename T>
void register_std_vector()
{
    using namespace std::literals;

    auto name = "vector<"s.append(rtti::type_name<T>()) + '>';
    rtti::global_define()
        ._namespace("std")
            ._class<std::vector<T>>(name)
                ._lazy(define_std_vector<T>)
            ._end()
        ._end()
    ;
}

void register_std_ns()
{
    register_std_unique_ptr<std::string>();
    register_std_string<char>("string");
    register_std_vector<std::string>();
    register_std_vector<int>();
}


text:
<?php require 'templates/header.php' ;?>

            Nice Admin

                        <form class="navbar-form">
                            <input class="form-control" placeholder="Search" type="text">
                        </form>

                            7

You have 4 new notifications

                                    Friend Request
                                    5 mins

                                    John location.
                                    50 mins

                                    Project 3 Completed.
                                    1 hr

                                    Mick appreciated your work.
                                     Today

                                See all notifications

                            Jenifer Smith

                                 My Profile

                                 My Inbox

                                 Timeline

                                 Chats

                                 Log Out

                                 Documentation

                                 Documentation

      <?php require '/templates/member_sidebar.php';?>

 My Calendar

                <?php require 'calendar/mycalendar.php'; ?>

   <?php require 'templates/footer.php'; ?>


text:
//Used to invoke function in BNArticleView UIWebView to indicate that the document (including images)
//has completely loaded to allow height to be correctly determined.
window.addEventListener("load", function () {
    location.href = "internal://iosapp";
});

(function () {
    var BASE_64_1x1_WHITE_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";

    var PLAY_ICON_NORMAL;
    var PLAY_ICON_OVER;

     var touchMoving = false; //Prevent accidentally playing video whilst scrolling article.

    /*
     * Adds an Play icon to the argument (anchor) element that when
     * tapped, invokes the video player (based on the href attribute value).
     */
    function addPlayOverlay(element, mediaType) {
        var uri = element.getAttribute('href');
        makePlayButton(element.parentNode, uri, mediaType);
    }

    /*
     * appends a play graphic to a new anchor element
     * in the DOM and sets its URI to the specified uri arg value.
     */
    function makePlayButton(elementToAppend, uri, mediaType) {
        var imgPlay = document.createElement('div');
        imgPlay.className = mediaType === 'video' ? 'playVideoIcon' : 'playAudioIcon';
        elementToAppend.appendChild(imgPlay);
        addTouchEvents(imgPlay, uri);

    }

    function addTouchEvents(element, uri) {

        var touchEndHandler = function (e) {
            e.target.className = PLAY_ICON_NORMAL;

            if(touchMoving == false) {
                location.assign(uri); //Invoke handler (in Objective-C) to play video.
                return false;
            } else {
                touchMoving = false;
            }
        };

        var touchStartHandler = function (e) {
            if(touchMoving == false) {
                e.target.className = PLAY_ICON_NORMAL + " " + PLAY_ICON_OVER;
                return false;
            }
        };

        var touchMoveHandler = function (e) {
            touchMoving = true;
        };

        //Video played on touchend.
        element.addEventListener("touchend",touchEndHandler,true);

        element.addEventListener("touchstart",touchStartHandler,true);

        element.addEventListener("touchmove", touchMoveHandler, true);

    }

    function isVideo(element) {
        var urlref = element.getAttribute('href');
        if (urlref != null) {
            return (urlref.substring(0, 8) == 'bbcvideo');
        }
        return false;
    }

    function isAudio(element) {
        var urlref = element.getAttribute('href');
        if (urlref != null) {
            return (urlref.substring(0, 8) == 'bbcaudio');
        }
        return false;
    }

    //Displays block element if hidden (used to display hidden (non-video) images and related captions.
    function displayElement(element) {
        var displayStyle = window.getComputedStyle(element, null).getPropertyValue('display');

        if (displayStyle == 'none') {
            element.style.display = 'block'; //assumption.
        }
    }

    function checkImageLoaded(img) {
        if (!img.complete) {
            return false;
        }

        //This should also determine if the image is actually loaded.
        if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
            return false;
        }

        return true;
    }

    /* Topcat (which powers the foreign language feeds (for now) introduces
    * different CSS which makes image re-display checks fail between feed types
    */
    function isWorldServiceArticle(parentNode) {
        var parentClass = parentNode.getAttribute("class");
        if (parentClass === "bbc-image") {
            return true;
        } else {
            return false;
        }
    }

    var newsArticle = {
        init: function () {
            var images = document.getElementsByTagName('img');

            for (var i = 0; i < images.length; i++) {
                var mediaType;
                var image = images[i];

                var elementIsVideo = isVideo(image.parentNode);
                var elementIsAudio = isAudio(image.parentNode);

                if (elementIsVideo || elementIsAudio) {
                    //In the case of a video, it's the grand parent that's not displayed.
                    if (image.parentNode && image.parentNode.parentNode) {
                        displayElement(image.parentNode.parentNode);
                        image.parentNode.className = "has-avcontent";//Used for ting height (in css).
                    }

                    mediaType = elementIsVideo ? "video" : "audio";
                    PLAY_ICON_NORMAL = elementIsVideo ? "playVideoIcon" : "playAudioIcon";
                    PLAY_ICON_OVER = elementIsVideo ? "playVideoOverIcon" : "playAudioOverIcon";

                    addPlayOverlay(image.parentNode, mediaType);
                }

                if (checkImageLoaded(image) == false) {
                    image.addEventListener('load', function (e) {
                        var element = e.target;
                        if (isWorldServiceArticle(image.parentNode.parentNode.parentNode)) {
                            displayElement(image.parentNode.parentNode);
                        } else {
                            displayElement(element.parentNode);
                        }
                    });

                    image.addEventListener("error", function (e) {
                        e.target.src = BASE_64_1x1_WHITE_IMAGE;
                        e.target.className += ' blank-img';
                    });
                } else {
                    displayElement(image.parentNode);
                }
            }
        },

        /*
         * Util function used by the app to change width based on orientation.
         */
        adjustContentWidth: function (width) {
            document.getElementById("view").setAttribute('content', 'width=' + width);
        },

        /*
         * Change font-size by adding a class to the HTML element.
         * Keys are xs, s, m (default), l, xl, xxl
         */
        adjustTextSize: function (key) {
            var element = document.getElementsByTagName("html")[0];
            element.className = key;
        },

        /*
         * Util function used by app to determine where to position the section title based
         * on the left padding of the H1 element in the Web View.
         */
        getXPosForCategoryHeaderTitle: function () {
            var articlePadding = this.computeStyleProperty(document.getElementById("content")[0], "margin-left");
            return parseFloat(articlePadding);
        },

        computeStyleProperty: function (elementName, propertyValue) {
            return window.getComputedStyle(elementName, null).getPropertyValue(propertyValue);
        }
    };

    if (!window.newsArticle) {
        window.newsArticle = newsArticle;
    }

})();


text:
<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use app\forms\CategoryForm;

class CategoryController extends Controller
{
	public function actionIndex($id = null)
	{
		$model = new CategoryForm();
		if (!isset($id)){
			return $this->render('index', [
					'model' => $model,
			]);
		} else {
			$model->setCurrentCategoryById($id);
			return $this->render('index', [
					'model' => $model,
			]);
		}
	}

	public function actionSubcategory($id)
	{
		$result = new \stdClass();
		$model = new CategoryForm();
		$model->setCurrentCategoryById($id);
		$result->genitive = $model->currentCategory->genitive;
		$result->data = CategoryForm::getArrayMap($model->getSubcategories());
		return json_encode($result);
	}
}


text:
import datetime, calendar

def setup(bot):
	# This module isn't actually a cog
    return

def get_years(timeBetween, year, reverse):
    years = 0

    while True:
        if reverse:
            year -= 1
        else:
            year += 1

        year_days = 366 if calendar.isleap(year) else 365
        year_seconds = year_days * 86400

        if timeBetween < year_seconds:
            break

        years += 1
        timeBetween -= year_seconds

    return timeBetween, years, year

def get_months(timeBetween, year, month, reverse):
    months = 0

    while True:
        month_days = calendar.monthrange(year, month)[1]
        month_seconds = month_days * 86400

        if timeBetween < month_seconds:
            break

        months += 1
        timeBetween -= month_seconds

        if reverse:
            if month > 1:
                month -= 1
            else:
                month = 12
                year -= 1
        else:
            if month < 12:
                month += 1
            else:
                month = 1
                year += 1

    return timeBetween, months

def getReadableTimeBetween(first, last, reverse=False):
    # A helper function to make a readable string between two times
    timeBetween = int(last-first)
    now = datetime.datetime.now()
    year = now.year
    month = now.month

    timeBetween, years, year = get_years(timeBetween, year, reverse)
    timeBetween, months = get_months(timeBetween, year, month, reverse)

    weeks   = int(timeBetween/604800)
    days    = int((timeBetween-(weeks*604800))/86400)
    hours   = int((timeBetween-(days*86400 + weeks*604800))/3600)
    minutes = int((timeBetween-(hours*3600 + days*86400 + weeks*604800))/60)
    seconds = int(timeBetween-(minutes*60 + hours*3600 + days*86400 + weeks*604800))
    msg = ""

    if years > 0:
        msg += "1 year, " if years == 1 else "{:,} years, ".format(years)
    if months > 0:
        msg += "1 month, " if months == 1 else "{:,} months, ".format(months)
    if weeks > 0:
        msg += "1 week, " if weeks == 1 else "{:,} weeks, ".format(weeks)
    if days > 0:
        msg += "1 day, " if days == 1 else "{:,} days, ".format(days)
    if hours > 0:
        msg += "1 hour, " if hours == 1 else "{:,} hours, ".format(hours)
    if minutes > 0:
        msg += "1 minute, " if minutes == 1 else "{:,} minutes, ".format(minutes)
    if seconds > 0:
        msg += "1 second, " if seconds == 1 else "{:,} seconds, ".format(seconds)

    if msg == "":
        return "0 seconds"
    else:
        return msg[:-2]


text:
require 'test_helper'

class SubscriptionBillingTest < ActiveSupport::TestCase

  test "Execute subscription billing job" do
    Jobs::SubscriptionBilling.perform("hour" => Time.now.hour)
  end
end


text:
require 'ancestry'

module Geotree
  class Location < ActiveRecord::Base
    has_ancestry
    has_many :placements
    attr_accessible :geometry, :lat, :lng, :long_name, :short_name, :type if defined?(ActiveModel::MassAssignmentSecurity)
    serialize :geometry, Hash

    validates_uniqueness_of :long_name, scope: [:type, :ancestry]

    ADDRESS_COMPONENTS_TO_TYPES = {
      'country' => 'Country',
      'administrative_area_level_1' => 'State',
      'administrative_area_level_2' => 'County',
      'locality' => 'Locality',
      'sublocality' => 'SubLocality',
      'neighborhood' => 'Neighborhood'
    }

    # returns comma-delimited parts: e.g. city, county, state, country
    def full_name
      (self.ancestors.to_a << self).reverse.map{|a| a.long_name}.join(', ')

    end

    # results is an Array of Google-like geocoder response results

    # returns an Array of built Locations
    def self.responses_to_locations(responses)
      responses = Array(responses)

      responses.inject([]) do |arr, resp|
        types_and_components = ordered_components_by_type resp.data['address_components']
        prev_loc = nil
        types_and_components.each do |(_type, c)|
          loc = Location.where( short_name: c['short_name'], long_name: c['long_name'], type: _type).first_or_initialize
          loc.parent = prev_loc

          if loc.valid?
            loc.save
            prev_loc = loc
          end
        end
      end
    end

    def self.component_type_lookup(str)
      ADDRESS_COMPONENTS_TO_TYPES[str]
    end

    def self.ordered_components_by_type(a)
      types = ADDRESS_COMPONENTS_TO_TYPES.values
      arr = a.map{|c|  _type = component_type_lookup(c['types'].find{|t| t != 'political' }); _type.present? ? [_type, c] : nil }

      return arr.compact.sort_by{|(t,v)| types.index(t) }
    end
  end

  class Country < Location; end
  class State < Location; end
  class County < Location; end
  class Locality < Location; end
  class SubLocality < Location; end
  class Neighborhood < Location; end
end


text:
This pack integrates **StackStorm** with [**Chef**](https://www.chef.io/) and provides various actions performing remote operations with chef nodes.

## Remote actions

Provide operations such as an installation of chef, invocation of *chef-solo/chef-client* etc. Remote actions require **hosts** parameter to be explicitly set.

### chef.install action

Performs an installation of chef on a remote node.

#### parameters:

`method` - Specify the method to install chef. (Omnibus is enabled by default, since it's the only supported way). *Default*: `'omnibus'`.

**Omnibus parameters:**

* `pre_release` - Set to `true` to install a pre-release version. Requires that version is also specified. *Default*: `false`.
* `version` - Specify a version of the chef-client to be installed. If no version is specified the latest version will be installed. *Default*: `none`.
* `download_path` - Use to specify the directory into which a omnibus package is downloaded. *Default*: `/tmp`.

### chef.apply action

Performs remote invocation of *chef-apply*.

#### parameters:

* `attributes` - Specify a path on remote a node or URL to load json attributes from. *Default*: `none`.
* `log_level` - Set the log level (debug, info, warn, error, fatal). *Default*: `none`.
* `why_run` - Set to `true` to enable whyrun mode. *Default*: `false`.
* `recipe_file` - Specifies the path to a recipe file to be executed (relative to the remote host). *Default*: `none`.
* `execute` - Execute resources supplied in a string. *Default*: `none`.
* `minimal_ohai` - Set to `true` to run with the bare minimum of ohai plugins chef needs to function". *Default*: `none`.
  Note: This option is only available in chef >= 12.3.

### chef.solo action

Performs remote invocation of *chef-solo*.

#### parameters:

* `environment` - Specify a **string** to set the chef environment. *Default*: `none`.
* `attributes` - Specify a path on remote a node or URL to load json attributes from. *Default*: `none`. **Required**.
* `log_level` - Set the log level (debug, info, warn, error, fatal). *Default*: `none`.
* `why_run` - Set to `true` to enable whyrun mode. *Default*: `false`.
* `override_runlist` - Specify a **string** providing override run list. Replaces the current run list with specified items.
* `recipe_url` - Specify URL to pull down a remote gzipped tarball of recipes and untar it to the cookbook cache. *Default*: `none`.

### chef.client action

Performs remote invocation of *chef-client*.

#### parameters:

Parameters *environment, attributes, log_level, why_run, override_runlist* are the same as for **chef.solo** action.

* `rewrite_runlist` - Specify a **string** providing rewrite run list. Permanently replaces the current run list with specified items. *Default*: `none`.

### chef.ohai action

Invokes ohai on remote nodes. The action accepts one single optional parameter **path** representing an ohai attribute.

### Examples
```shell
# Installing chef via omnibus
st2 run chef.install hosts=st2_agent_1 version=11.18.0 # to install the specified option
st2 run chef.install hosts=st2_agent_1 # to install latest version

# Invocation of chef-solo. /tmp/dna.json must present on remote nodes.
st2 run chef.solo hosts=st2_agent_1 recipe_url="https://github.com/dennybaa/st2-chef-test/raw/master/cookbooks.tgz" attributes=/tmp/dna.json

# Querying ohai
st2 run chef.ohai hosts=st2_agent_1 path=network/interfaces/eth0/addresses
st2 run chef.ohai hosts=st2_agent_1

# Using apply
# Apply a chef recipe, mind that recipe's file path is relative to the remote node
# and the file must exist there.
st2 run chef.apply hosts=chef_node minimal_ohai=true sudo=true recipe_file=/tmp/a.rb

# Running one-off apply command, execute accepts ruby code as a string.
st2 run chef.apply hosts=chef_node minimal_ohai=true sudo=true execute="package('unrar') { action :install }"
```

## License and Authors

* Author:: StackStorm (st2-dev) (<info@stackstorm.com>)
* Author:: Denis Baryshev (<dennybaa@gmail.com>)


text:
package org.apache.airavata.registry.core.experiment.catalog.model;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

public class ExperimentErrorPK implements Serializable {
    private final static Logger logger = LoggerFactory.getLogger(ExperimentErrorPK.class);
    private String errorId;
    private String experimentId;

    @Column(name = "ERROR_ID")
    @Id
    public String getErrorId() {
        return errorId;
    }

    public void setErrorId(String errorId) {
        this.errorId = errorId;
    }

    @Column(name = "EXPERIMENT_ID")
    @Id
    public String getExperimentId() {
        return experimentId;
    }

    public void setExperimentId(String experimentId) {
        this.experimentId = experimentId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ExperimentErrorPK that = (ExperimentErrorPK) o;

        if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false;
        if (getExperimentId() != null ? !getExperimentId().equals(that.getExperimentId()) : that.getExperimentId() != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = getErrorId() != null ? getErrorId().hashCode() : 0;
        result = 31 * result + (getExperimentId() != null ? getExperimentId().hashCode() : 0);
        return result;
    }
}


text:
package gcetasks

import (
	"fmt"
	"github.com/golang/glog"
	compute "google.golang.org/api/compute/v0.beta"
	"k8s.io/kops/upup/pkg/fi"
	"k8s.io/kops/upup/pkg/fi/cloudup/gce"
	"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)

// TargetPool represents a GCE TargetPool
//go:generate fitask -type=TargetPool
type TargetPool struct {
	Name      *string
	Lifecycle *fi.Lifecycle
}

var _ fi.CompareWithID = &TargetPool{}

func (e *TargetPool) CompareWithID() *string {
	return e.Name
}

func (e *TargetPool) Find(c *fi.Context) (*TargetPool, error) {
	cloud := c.Cloud.(gce.GCECloud)
	name := fi.StringValue(e.Name)

	r, err := cloud.Compute().TargetPools.Get(cloud.Project(), cloud.Region(), name).Do()
	if err != nil {
		if gce.IsNotFound(err) {
			return nil, nil
		}
		return nil, fmt.Errorf("error getting TargetPool %q: %v", name, err)
	}

	actual := &TargetPool{}
	actual.Name = fi.String(r.Name)

	return actual, nil
}

func (e *TargetPool) Run(c *fi.Context) error {
	return fi.DefaultDeltaRunMethod(e, c)
}

func (_ *TargetPool) CheckChanges(a, e, changes *TargetPool) error {
	if fi.StringValue(e.Name) == "" {
		return fi.RequiredField("Name")
	}
	return nil
}

func (e *TargetPool) URL(cloud gce.GCECloud) string {
	name := fi.StringValue(e.Name)

	return fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%s/regions/%s/targetPools/%s", cloud.Project(), cloud.Region(), name)
}

func (_ *TargetPool) RenderGCE(t *gce.GCEAPITarget, a, e, changes *TargetPool) error {
	name := fi.StringValue(e.Name)

	o := &compute.TargetPool{
		Name: name,
	}

	if a == nil {
		glog.V(4).Infof("Creating TargetPool %q", o.Name)

		op, err := t.Cloud.Compute().TargetPools.Insert(t.Cloud.Project(), t.Cloud.Region(), o).Do()
		if err != nil {
			return fmt.Errorf("error creating TargetPool %q: %v", name, err)
		}

		if err := t.Cloud.WaitForOp(op); err != nil {
			return fmt.Errorf("error creating TargetPool: %v", err)
		}
	} else {
		return fmt.Errorf("cannot apply changes to TargetPool: %v", changes)
	}

	return nil
}

type terraformTargetPool struct {
	Name           string   `json:"name"`
	Description    string   `json:"description,omitempty"`
	HealthChecks   []string `json:"health_checks,omitempty"`
	Instances      []string `json:"instances,omitempty"`
	SessionAfinity string   `json:"session_affnity,omitempty"`
}

func (_ *TargetPool) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *TargetPool) error {
	name := fi.StringValue(e.Name)

	tf := &terraformTargetPool{
		Name: name,
	}

	return t.RenderResource("google_compute_target_pool", name, tf)
}

func (e *TargetPool) TerraformLink() *terraform.Literal {
	name := fi.StringValue(e.Name)

	return terraform.LiteralSelfLink("google_compute_target_pool", name)
}


text:
package utils;

import actors.ActorRegistry;
import akka.actor.Cancellable;
import java.util.concurrent.TimeUnit;
import play.Play;
import scala.concurrent.duration.Duration;

/**
 * Created by zechen on 9/3/15.
 */
public class SchedulerUtil {

  public static Cancellable schedulerRef;

  public static synchronized void start() {
    start(Play.application().configuration().getLong("scheduler.check.interval", 10L));
  }

  /**
   * Start system's scheduler
   * @param mins
   */
  public static synchronized void start(Long mins) {
    if (schedulerRef != null) {
      schedulerRef.cancel();
    }

    schedulerRef = ActorRegistry.scheduler
      .schedule(Duration.create(0, TimeUnit.MILLISECONDS), Duration.create(mins, TimeUnit.MINUTES),
        ActorRegistry.schedulerActor, "checking", ActorRegistry.dispatcher, null);
  }

  /**
   * Cancel system's scheduler
   */
  public static synchronized void cancel() {
    schedulerRef.cancel();
  }
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="connect_holland_ldap.object_factory.class">ConnectHolland\LdapBundle\DependencyInjection\ObjectFactory</parameter>
        <parameter key="connect_holland_ldap.security.user.provider.ldap.class">ConnectHolland\LdapBundle\Security\User\LdapEntryUserProvider</parameter>
        <parameter key="connect_holland_ldap.ldap.class">Symfony\Component\Ldap\Ldap</parameter>
    </parameters>

    <services>
        <service id="connect_holland_ldap.security.user.provider.ldap" class="%connect_holland_ldap.security.user.provider.ldap.class%" abstract="true" public="false">
            <argument/> <!-- connect_holland_ldap.security.user.factory -->
            <argument/> <!-- connect_holland_ldap.ldap.client -->
            <argument/> <!-- base_dn -->
            <argument/> <!-- search_dn -->
            <argument/> <!-- search_password -->
            <argument/> <!-- default_roles -->
            <argument/> <!-- uid_key -->
            <argument/> <!-- filter -->
        </service>

        <service id="connect_holland_ldap.ldap" class="%connect_holland_ldap.ldap.class%" abstract="true" public="false">
            <factory class="%connect_holland_ldap.object_factory.class%" method="createLdap"/>

            <argument/> <!-- configuration -->
        </service>
    </services>
</container>


text:
import merge from 'lodash/merge';

const DEFAULT_CONFIG = {
  uiSettings: {
    brand: 'Spring Boot Admin',
    rememberMeEnabled: true,
    externalViews: [],
    favicon: 'assets/img/favicon.png',
    faviconDanger: 'assets/img/favicon-danger.png',
    notificationFilterEnabled: false,
    routes: [],
    availableLanguages: []
  },
  user: null,
  extensions: [],
  externalViews: [],
  csrf: {
    parameterName: '_csrf',
    headerName: 'X-XSRF-TOKEN'
  },
  use: function (ext) {
    this.extensions.push(ext);
  }
};

export default merge(DEFAULT_CONFIG, global.SBA)


text:
//////////////////////////////////////////////////////////////////////////////
//
//                    Copyright 2019, Cornutum Project
//                             www.cornutum.org
//
//////////////////////////////////////////////////////////////////////////////

package org.cornutum.tcases.io;

import org.cornutum.tcases.SystemTestDef;

import org.apache.commons.io.IOUtils;
import org.leadpony.justify.api.JsonSchema;
import org.leadpony.justify.api.JsonValidationService;
import org.leadpony.justify.api.ProblemHandler;

import java.io.Closeable;
import java.io.InputStream;
import javax.json.JsonObject;
import javax.json.JsonReader;

/**
 * An {@link ISystemTestSource} that reads from an JSON document.
 *
 */
public class SystemTestJsonReader implements ISystemTestSource, Closeable
  {
  /**
   * Creates a new SystemTestJsonReader object.
   */
  public SystemTestJsonReader()
    {
    this( null);
    }

  /**
   * Creates a new SystemTestJsonReader object.
   */
  public SystemTestJsonReader( InputStream stream)
    {
    setInputStream( stream);
    }

  /**
   * Returns a {@link SystemTestDef} instance.
   */
  @Override
  public SystemTestDef getSystemTestDef()
    {
    JsonValidationService service = JsonValidationService.newInstance();
    JsonSchema schema = service.readSchema( getClass().getResourceAsStream( "/schema/system-test-schema.json"));
    ProblemHandler handler = ProblemHandler.throwing();
    try( JsonReader reader = service.createReader( stream_, schema, handler))
      {
      JsonObject json;
      try
        {
        json = reader.readObject();
        }
      catch( Exception e)
        {
        throw new SystemTestException( "Invalid system test definition", e);
        }

      return SystemTestJson.asSystemTestDef( json);
      }
    }

  /**
   * Changes the input stream for this reader.
   */
  public void setInputStream( InputStream stream)
    {
    stream_ =
      stream==null
      ? System.in
      : stream;
    }

  /**
   * Returns the input stream for this reader.
   */
  protected InputStream getInputStream()
    {
    return stream_;
    }

  @Override
  public void close()
    {
    IOUtils.closeQuietly( getInputStream(), null);
    }

  private InputStream stream_;
  }