text:
package com.github.ddth.hll.prasanthj;

import java.util.Map;

import it.unimi.dsi.fastutil.ints.Int2ByteAVLTreeMap;
import it.unimi.dsi.fastutil.ints.Int2ByteSortedMap;

public class HLLSparseRegister implements HLLRegister {

  // maintains sorted list of register indices and its corresponding values.
  // Its easier to use primitive sorted map as opposed to int[] used in this
  // paper
  // http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/40671.pdf
  private Int2ByteSortedMap sparseMap;

  // for a better insertion performance values are added to temporary unsorted
  // list which will be merged to sparse map after a threshold
  private int[] tempList;
  private int tempListIdx;

  // number of register bits
  private final int p;

  // new number of register bits for higher accuracy
  private final int pPrime;

  // number of bits to store the number of zero runs
  private final int qPrime;

  // masks for quicker extraction of p, pPrime, qPrime values
  private final int mask;
  private final int pPrimeMask;
  private final int qPrimeMask;

  public HLLSparseRegister(int p, int pp, int qp) {
    this.p = p;
    this.sparseMap = new Int2ByteAVLTreeMap();
    this.tempList = new int[HLLConstants.TEMP_LIST_DEFAULT_SIZE];
    this.tempListIdx = 0;
    this.pPrime = pp;
    this.qPrime = qp;
    this.mask = ((1 << pPrime) - 1) ^ ((1 << p) - 1);
    this.pPrimeMask = ((1 << pPrime) - 1);
    this.qPrimeMask = (1 << qPrime) - 1;
  }

  public boolean add(long hashcode) {
    boolean updated = false;

    // fill the temp list before merging to sparse map
    if (tempListIdx < tempList.length) {
      int encodedHash = encodeHash(hashcode);
      tempList[tempListIdx++] = encodedHash;
      updated = true;
    } else {
      updated = mergeTempListToSparseMap();
    }

    return updated;
  }

  /**
   * Adds temp list to sparse map. The key for sparse map entry is the register
   * index determined by pPrime and value is the number of trailing zeroes.
   * @return
   */
  private boolean mergeTempListToSparseMap() {
    boolean updated = false;
    for (int i = 0; i < tempListIdx; i++) {
      int encodedHash = tempList[i];
      int key = encodedHash & pPrimeMask;
      byte value = (byte) (encodedHash >>> pPrime);
      byte nr = 0;
      // if MSB is set to 1 then next qPrime MSB bits contains the value of
      // number of zeroes.
      // if MSB is set to 0 then number of zeroes is contained within pPrime - p
      // bits.
      if (encodedHash < 0) {
        nr = (byte) (value & qPrimeMask);
      } else {
        nr = (byte) (Integer.numberOfTrailingZeros(encodedHash >>> p) + 1);
      }
      updated = set(key, nr);
    }

    // reset temp list index
    tempListIdx = 0;
    return updated;
  }

  /**
   *

   * Input: 64 bit hashcode
   *
   * |---------w-------------| |------------p'----------|
   * 10101101.......1010101010 10101010101 01010101010101
   *                                       |------p-----|
   *
   * Output: 32 bit int
   *
   * |b| |-q'-|  |------------p'----------|
   *  1  010101  01010101010 10101010101010
   *                         |------p-----|
   *
   *
   * The default values of p', q' and b are 25, 6, 1 (total 32 bits) respectively.
   * This function will return an int encoded in the following format
   *
   * p  - LSB p bits represent the register index
   * p' - LSB p' bits are used for increased accuracy in estimation
   * q' - q' bits after p' are left as such from the hashcode if b = 0 else
   *      q' bits encodes the longest trailing zero runs from in (w-p) input bits
   * b  - 0 if longest trailing zero run is contained within (p'-p) bits
   *      1 if longest trailing zero run is computeed from (w-p) input bits and
   *      its value is stored in q' bits
   *

   * @param hashcode
   * @return
   */
  public int encodeHash(long hashcode) {
    // x = p' - p
    int x = (int) (hashcode & mask);
    if (x == 0) {
      // more bits should be considered for finding q (longest zero runs)
      // set MSB to 1
      int ntr = Long.numberOfTrailingZeros(hashcode >> p) + 1;
      long newHashCode = hashcode & pPrimeMask;
      newHashCode |= ntr << pPrime;
      newHashCode |= 0x80000000;
      return (int) newHashCode;
    } else {
      // q is contained within p' - p
      // set MSB to 0
      return (int) (hashcode & 0x7FFFFFFF);
    }
  }

  public int getSize() {

    // merge temp list before getting the size of sparse map
    if (tempListIdx != 0) {
      mergeTempListToSparseMap();
    }
    return sparseMap.size();
  }

  public void merge(HLLRegister hllRegister) {
    if (hllRegister instanceof HLLSparseRegister) {
      HLLSparseRegister hsr = (HLLSparseRegister) hllRegister;

      // retain only the largest value for a register index
      for (Map.Entry<Integer, Byte> entry : hsr.getSparseMap().entrySet()) {
        int key = entry.getKey();
        byte value = entry.getValue();
        set(key, value);
      }
    } else {
      throw new IllegalArgumentException("Specified register not instance of HLLSparseRegister");
    }
  }

  public boolean set(int key, byte value) {
    boolean updated = false;

    // retain only the largest value for a register index
    if (sparseMap.containsKey(key)) {
      byte containedVal = sparseMap.get(key);
      if (value > containedVal) {
        sparseMap.put(key, value);
        updated = true;
      }
    } else {
      sparseMap.put(key, value);
      updated = true;
    }
    return updated;
  }

  public Int2ByteSortedMap getSparseMap() {
    return sparseMap;
  }

  public Int2ByteSortedMap getMergedSparseMap() {
    if (tempListIdx != 0) {
      mergeTempListToSparseMap();
    }
    return sparseMap;
  }

  public int getP() {
    return p;
  }

  public int getPPrime() {
    return pPrime;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("HLLSparseRegister - ");
    sb.append("p: ");
    sb.append(p);
    sb.append(" pPrime: ");
    sb.append(pPrime);
    sb.append(" qPrime: ");
    sb.append(qPrime);
    return sb.toString();
  }

  public String toExtendedString() {
    return toString() + " register: " + sparseMap.toString();
  }

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof HLLSparseRegister)) {
      return false;
    }
    HLLSparseRegister other = (HLLSparseRegister) obj;
    boolean result = p == other.p && pPrime == other.pPrime && qPrime == other.qPrime
        && tempListIdx == other.tempListIdx;
    if (result) {
      for (int i = 0; i < tempListIdx; i++) {
        if (tempList[i] != other.tempList[i]) {
          return false;
        }
      }

      result = result && sparseMap.equals(other.sparseMap);
    }
    return result;
  }

  @Override
  public int hashCode() {
    int hashcode = 0;
    hashcode += 31 * p;
    hashcode += 31 * pPrime;
    hashcode += 31 * qPrime;
    for (int i = 0; i < tempListIdx; i++) {
      hashcode += 31 * tempList[tempListIdx];
    }
    hashcode += sparseMap.hashCode();
    return hashcode;
  }

}


text:
  Berthecourt est
      une commune localisée dans le département de l'Oise en Picardie. Elle comptait 1 552 habitants en 2008.

À coté de Berthecourt sont localisées les villes de
Ponchon à 2 km, 1 087 habitants,
Bailleul-sur-Thérain localisée à 3 km, 2 186 habitants,
Heilles localisée à 3 km, 587 habitants,
Mouchy-le-Châtel localisée à 3 km, 71 habitants,
Montreuil-sur-Thérain à 3 km, 220 habitants,
Saint-Félix située à 4 km, 504 habitants,
 entre autres. De plus, Berthecourt est située à seulement treize km de Beauvais.

À Berthecourt, la valeur moyenne à la vente d'un appartement se situe à zero € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 907 € du m². À la location le prix moyen se situe à 12,3 € du m² par mois.

Le nombre d'habitations, à Berthecourt, se décomposait en 2011 en 49 appartements et 573 maisons soit
 un marché relativement équilibré.

La commune propose quelques  équipements sportifs, elle dispose, entre autres, de un terrain de tennis et un terrain de sport.

redpajama_set_name: RedPajamaGithub


text:
/**
 * UserListError.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.adwords.axis.v201409.rm;

/**
 * Represents possible error codes in UserListService.
 */
public class UserListError  extends com.google.api.ads.adwords.axis.v201409.cm.ApiError  implements java.io.Serializable {
    /* The error reason represented by an enum. */
    private com.google.api.ads.adwords.axis.v201409.rm.UserListErrorReason reason;

    public UserListError() {
    }

    public UserListError(
           java.lang.String fieldPath,
           java.lang.String trigger,
           java.lang.String errorString,
           java.lang.String apiErrorType,
           com.google.api.ads.adwords.axis.v201409.rm.UserListErrorReason reason) {
        super(
            fieldPath,
            trigger,
            errorString,
            apiErrorType);
        this.reason = reason;
    }

    /**
     * Gets the reason value for this UserListError.
     *
     * @return reason   * The error reason represented by an enum.
     */
    public com.google.api.ads.adwords.axis.v201409.rm.UserListErrorReason getReason() {
        return reason;
    }

    /**
     * Sets the reason value for this UserListError.
     *
     * @param reason   * The error reason represented by an enum.
     */
    public void setReason(com.google.api.ads.adwords.axis.v201409.rm.UserListErrorReason reason) {
        this.reason = reason;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof UserListError)) return false;
        UserListError other = (UserListError) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) &&
            ((this.reason==null && other.getReason()==null) ||
             (this.reason!=null &&
              this.reason.equals(other.getReason())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getReason() != null) {
            _hashCode += getReason().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(UserListError.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/rm/v201409", "UserListError"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("reason");
        elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/rm/v201409", "reason"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/rm/v201409", "UserListError.Reason"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
package dynamics.container;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import dynamics.utils.InventoryUtils;

public abstract class ContainerBase<T> extends Container {

    protected final T owner;
    protected final IInventory inventory;
    protected final IInventory playerInventory;
    protected final int inventorySize;

    protected static class RestrictedSlot extends Slot {

        private final int inventoryIndex;

        public RestrictedSlot(IInventory inventory, int slot, int x, int y) {
            super (inventory, slot, x, y);
            inventoryIndex = slot;
        }

        @Override
        public boolean isItemValid(ItemStack itemstack) {
            return inventory.isItemValidForSlot(inventoryIndex, itemstack);
        }
    }

    public ContainerBase(IInventory playerInventory, IInventory ownerInventory, T owner) {
        this.owner = owner;
        this.inventory = ownerInventory;
        this.playerInventory = playerInventory;
        this.inventorySize = inventory.getSizeInventory();
    }

    protected void addInventoryGrid(int xOffset, int yOffset, int width) {
        int height = (int) Math.ceil((double) inventorySize / width);
        for (int y = 0, slotId = 0; y < height; y++) {
            for (int x = 0; x < width; x++, slotId++) {
                addSlotToContainer(new RestrictedSlot(inventory, slotId,
                        xOffset + x * 18,
                        yOffset + y * 18));
            }
        }
    }

    protected void addInventoryLine(int xOffset, int yOffset, int start, int count) {
        addInventoryLine(xOffset, yOffset, start, count, 0);
    }

    protected void addInventoryLine(int xOffset, int yOffset, int start, int count, int margin) {
        for (int x = 0, slotId = start; x < count; x++, slotId++) {
            addSlotToContainer(new RestrictedSlot(inventory, slotId,
                    xOffset + x * (18 + margin),
                    yOffset));
        }
    }

    protected void addPlayerInventorySlots(int offsetY) {
        addPlayerInventorySlots(8, offsetY);
    }

    protected void addPlayerInventorySlots(int offsetX, int offsetY) {
        for (int row = 0; row < 3; row++)
            for (int column = 0; column < 9; column++)
                addSlotToContainer(new Slot(playerInventory,
                        column + row * 9 + 9,
                        offsetX + column * 18,
                        offsetY + row * 18));

        for (int slot = 0; slot < 9; slot++)
            addSlotToContainer(new Slot(playerInventory, slot, offsetX + slot * 18, offsetY + 58));
    }

    protected boolean canTransferItemOut(Slot slot) {
        return !(slot instanceof ICustomSlot) || ((ICustomSlot) slot).canTransferItemsOut();
    }

    protected boolean canTransferItemsIn(Slot slot) {
        return !(slot instanceof ICustomSlot) || ((ICustomSlot) slot).canTransferItemsIn();
    }

    @Override
    public boolean canDragIntoSlot(Slot slot) {
        if (slot instanceof ICustomSlot) return ((ICustomSlot) slot).canDrag();

        return super.canDragIntoSlot(slot);
    }

    public T getOwner() {
        return owner;
    }

    protected boolean mergeItemStackSafe(ItemStack stackToMerge, int start, int stop, boolean reverse) {
        boolean inventoryChanged = false;

        final int delta = reverse? -1 : 1;
        List<Slot> slots = getSlots();

        if (stackToMerge.isStackable()) {
            int slotId = reverse? stop - 1 : start;
            while (stackToMerge.stackSize > 0 && ((!reverse && slotId < stop) || (reverse && slotId >= start))) {

                Slot slot = slots.get(slotId);

                if (canTransferItemsIn(slot)) {
                    ItemStack stackInSlot = slot.getStack();

                    if (InventoryUtils.tryMergeStacks(stackToMerge, stackInSlot)) {
                        slot.onSlotChanged();
                        inventoryChanged = true;
                    }
                }

                slotId += delta;
            }
        }

        if (stackToMerge.stackSize > 0) {
            int slotId = reverse? stop - 1 : start;

            while ((!reverse && slotId < stop) || (reverse && slotId >= start)) {
                Slot slot = slots.get(slotId);
                ItemStack stackInSlot = slot.getStack();

                if (stackInSlot == null && canTransferItemsIn(slot) && slot.isItemValid(stackToMerge)) {
                    slot.putStack(stackToMerge.copy());
                    slot.onSlotChanged();
                    stackToMerge.stackSize = 0;
                    return true;
                }

                slotId += delta;
            }
        }

        return inventoryChanged;
    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slotId) {
        Slot slot = (Slot)inventorySlots.get(slotId);

        if (slot != null && canTransferItemOut(slot) && slot.getHasStack()) {
            ItemStack itemToTransfer = slot.getStack();
            ItemStack copy = itemToTransfer.copy();
            if (slotId < inventorySize) {
                if (!mergeItemStackSafe(itemToTransfer, inventorySize, inventorySlots.size(), true)) return null;
            } else if (!mergeItemStackSafe(itemToTransfer, 0, inventorySize, false)) return null;

            if (itemToTransfer.stackSize == 0) slot.putStack(null);
            else slot.onSlotChanged();

            if (itemToTransfer.stackSize != copy.stackSize) return copy;
        }
        return null;
    }

    public int getInventorySize() {
        return inventorySize;
    }

    protected List<Slot> getSlots() {
        return inventorySlots;
    }
}


text:
import { Component, OnInit, AfterViewInit, EventEmitter, Output, ViewChild, ContentChild, NgZone, Input } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActionsService } from '../../services/actions.services';

import { CatalogService, IPChangeEventSorted } from '../../services/catalog.service';
import { ConfigurationService } from '../../services/configuration.service';

import { Observable ,  Observer ,  BehaviorSubject } from 'rxjs';
import { BaseComponent } from '../../catalogs/base.component';
import {  IPageChangeEvent } from '@covalent/core';
import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core/data-table';

import { TdLoadingService } from '@covalent/core/loading';
import { TdMediaService } from '@covalent/core/media';

import { MatSnackBar } from '@angular/material';
import { Router, ActivatedRoute } from '@angular/router';
import { AbstractValueAccessor } from '../../components/abstractvalueaccessor';
import { BaseCatEditorComponent } from '../../catalogs/basecateditor.component';
import { Opportunity } from '../../model/index';
import { OpportunityheaderComponent } from './+opportunityheader/opportunityheader.component';
import { Apollo } from 'apollo-angular';
import gql from 'graphql-tag';
import { EnumDocType } from '../../constants/index';

@Component({
  selector: 'crm-opportunityeditor',
  templateUrl: './opportunityeditor.component.html',
  styleUrls: ['./opportunityeditor.component.scss'],
  providers: [],
})
export class OpportunityeditorComponent extends BaseCatEditorComponent {

  opp: Opportunity;
  @ViewChild(OpportunityheaderComponent) headercomp: OpportunityheaderComponent;

  itemRoute: string = 'opportunity';
  parentRoute = 'opportunity';

  doConstruct() {
    super.doConstruct();
    this.quoteType = EnumDocType.Opportunity;
    this._route.params.subscribe((params: any) => {
      this.idOpp = params.id;
    });

  }

}


text:
import glob
import os
import sys

from setuptools import setup, Extension, find_packages

src_dir = "src"
include_dirs = glob.glob(os.path.join("src", "libqhull"))
sources = glob.glob(os.path.join("src", "libqhull", "*.c"))
if sys.platform.strip() == "darwin":
    include_dirs += glob.glob(os.path.join("src", "fmemopen"))
    sources += glob.glob(os.path.join("src", "fmemopen", "*.c"))
extension = Extension('pyhull._pyhull',
                      include_dirs=include_dirs,
                      sources=[os.path.join(src_dir, '_pyhull.c')] + sources)

long_description = """
Pyhull is a Python wrapper to Qhull (http://www.qhull.org/) for the
computation of the convex hull, Delaunay triangulation and Voronoi diagram.
It is written as a Python C extension, with both high-level and low-level
interfaces to qhull.

Pyhull has been tested to scale to 10,000 7D points for convex hull
calculations (results in ~ 10 seconds), and 10,000 6D points for Delaunay
triangulations and Voronoi tesselations (~ 100 seconds). Higher number of
points and higher dimensions should be accessible depending on your machine,
but may take a significant amount of time.

For more details or to report bugs, please visit the pyhull GitHub page at
https://github.com/materialsvirtuallab/pyhull or the documentation page at
http://packages.python.org/pyhull/.
"""

setup(name="pyhull",
      version="2015.2.1",
      author="Shyue Ping Ong, William Davidson Richards",
      author_email="shyuep@gmail.com, wrichard@mit.edu",
      maintainer="Shyue Ping Ong",
      url="https://github.com/materialsvirtuallab/pyhull",
      license="MIT",
      description="A Python wrapper to Qhull (http://www.qhull.org/) for "
                  "the computation of the convex hull, "
                  "Delaunay triangulation and Voronoi diagram",
      keywords=["qhull", "convex", "hull", "computational",
                "geometry", "delaunay", "triangulation", "voronoi",
                "diagram"],
      install_requires=["numpy"],
      classifiers=[
          "Programming Language :: Python :: 2",
          "Programming Language :: Python :: 2.7",
          "Programming Language :: Python :: 3",
          "Programming Language :: Python :: 3.2",
          "Programming Language :: Python :: 3.3",
          "Programming Language :: Python :: 3.4",
          "Programming Language :: Python :: 3.5",
          "Programming Language :: Python :: 3.6",
          "Programming Language :: Python :: 3.7",
          "Development Status :: 5 - Production/Stable",
          "Intended Audience :: Science/Research",
          "License :: OSI Approved :: MIT License",
          "Operating System :: OS Independent",
          "Topic :: Software Development :: Libraries :: Python Modules",
          "Topic :: Scientific/Engineering :: Mathematics"
      ],
      long_description=long_description,
      packages=find_packages(),
      ext_modules=[extension])


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <LinearLayout
        android:layout_width="72dip"
        android:layout_height="72dip"
        android:layout_gravity="center"
        android:paddingBottom="8dip"
        android:paddingLeft="16dip"
        android:paddingRight="16dip"
        android:paddingTop="8dip">

        <LinearLayout
            android:layout_width="40dip"
            android:layout_height="40dip"
            android:layout_gravity="center"
            android:background="@drawable/circle_stroke_apptheme">

            <ImageView
                android:id="@+id/imageView_object"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="3dip"
                android:src="@drawable/default_monster"/>

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="8dip">

        <TextView
            android:id="@+id/textview_object_name"
            style="@style/TypefaceStyle.ProximaNova.semibold"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/apptheme_color"
            android:textSize="17sp"/>

        <TextView
            android:id="@+id/textview_object_description"
            style="@style/TypefaceStyle.ProximaNova"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/apptheme_color"
            android:textSize="14sp"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="8dip">

            <TextView
                android:id="@+id/textview_object_kind"
                style="@style/TypefaceStyle.ProximaNova"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/apptheme_color"
                android:textSize="14sp"/>

            <TextView
                android:id="@+id/textview_object_power"
                style="@style/TypefaceStyle.ProximaNova"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/apptheme_color"
                android:textSize="14sp"/>

            <TextView
                android:id="@+id/textview_object_prenium"
                style="@style/TypefaceStyle.ProximaNova"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/apptheme_color"
                android:textSize="14sp"/>

            <TextView
                android:id="@+id/textview_object_price"
                style="@style/TypefaceStyle.ProximaNova"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/apptheme_color"
                android:textSize="14sp"/>

        </LinearLayout>

    </LinearLayout>

</LinearLayout>


text:
package com.intellij.debugger.memory.action;

import com.intellij.openapi.actionSystem.AnActionEvent;

abstract class ShowInstancesAction extends ClassesActionBase {
  @Override
  public void update(AnActionEvent e) {
    boolean enabled = isEnabled(e);
    if (enabled) {
      e.getPresentation().setText(String.format("%s (%d)", getLabel(), getInstancesCount(e)));
    }
  }

  protected abstract String getLabel();

  protected abstract int getInstancesCount(AnActionEvent e);
}


text:
@implementation DemoAppDelegate

@synthesize window;
@synthesize viewController;

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
	[window addSubview:viewController.view];
	[window makeKeyAndVisible];
	return YES;
}

- (void)dealloc
{
	[viewController release];
	[window release];
	[super dealloc];
}

@end


text:
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2014 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

/**
 * This file contains the CCCP (Cluster Carrier Configuration Protocol)
 * implementation of the confmon provider. It utilizes a memcached connection
 * to retrieve configuration information.
 */

#include "internal.h"
#include "clconfig.h"
#include "packetutils.h"
#include "simplestring.h"
#include <mcserver/negotiate.h>
#include <lcbio/lcbio.h>
#include <lcbio/timer-ng.h>
#include <lcbio/ssl.h>
#include "ctx-log-inl.h"
#define LOGARGS(cccp, lvl) cccp->base.parent->settings, "cccp", LCB_LOG_##lvl, __FILE__, __LINE__
#define LOGFMT "<%s:%s> "
#define LOGID(cccp) get_ctx_host(cccp->ioctx), get_ctx_port(cccp->ioctx)

struct cccp_cookie_st;

typedef struct {
    clconfig_provider base;
    hostlist_t nodes;
    clconfig_info *config;
    int server_active;
    int disabled;
    lcbio_pTIMER timer;
    lcb_t instance;
    lcbio_CONNREQ creq;
    lcbio_CTX *ioctx;
    struct cccp_cookie_st *cmdcookie;
} cccp_provider;

typedef struct cccp_cookie_st {
    /** Parent object */
    cccp_provider *parent;

    /** Whether to ignore errors on this cookie object */
    int ignore_errors;
} cccp_cookie;

static void io_error_handler(lcbio_CTX *, lcb_error_t);
static void io_read_handler(lcbio_CTX *, unsigned nr);
static void request_config(cccp_provider *);
static void on_connected(lcbio_SOCKET *, void*, lcb_error_t, lcbio_OSERR);

static void
pooled_close_cb(lcbio_SOCKET *sock, int reusable, void *arg)
{
    int *ru_ex = arg;
    lcbio_ref(sock);
    if (reusable && *ru_ex) {
        lcbio_mgr_put(sock);
    } else {
        lcbio_mgr_discard(sock);
    }
}

static void release_socket(cccp_provider *cccp, int can_reuse)
{
    if (cccp->cmdcookie) {
        cccp->cmdcookie->ignore_errors = 1;
        cccp->cmdcookie =  NULL;
        return;
    }

    lcbio_connreq_cancel(&cccp->creq);

    if (cccp->ioctx) {
        lcbio_ctx_close(cccp->ioctx, pooled_close_cb, &can_reuse);
        cccp->ioctx = NULL;
    }
}

static lcb_error_t
schedule_next_request(cccp_provider *cccp, lcb_error_t err, int can_rollover)
{
    mc_SERVER *server;
    lcb_host_t *next_host = hostlist_shift_next(cccp->nodes, can_rollover);
    if (!next_host) {
        lcbio_timer_disarm(cccp->timer);
        lcb_confmon_provider_failed(&cccp->base, err);
        cccp->server_active = 0;
        return err;
    }

    server = lcb_find_server_by_host(cccp->instance, next_host);
    if (server) {
        cccp_cookie *cookie = calloc(1, sizeof(*cookie));
        cccp->cmdcookie = cookie;
        cookie->parent = cccp;
        lcb_log(LOGARGS(cccp, INFO), "Re-Issuing CCCP Command on server struct %p (%s:%s)", (void*)server, next_host->host, next_host->port);
        lcbio_timer_rearm(
                cccp->timer, PROVIDER_SETTING(&cccp->base, config_node_timeout));
        return lcb_getconfig(cccp->instance, cookie, server);

    } else {
        lcbio_pMGRREQ preq;

        lcb_log(LOGARGS(cccp, INFO), "Requesting connection to node %s:%s for CCCP configuration", next_host->host, next_host->port);
        preq = lcbio_mgr_get(
                cccp->instance->memd_sockpool, next_host,
                PROVIDER_SETTING(&cccp->base, config_node_timeout),
                on_connected, cccp);
        LCBIO_CONNREQ_MKPOOLED(&cccp->creq, preq);
    }

    cccp->server_active = 1;
    return LCB_SUCCESS;
}

static lcb_error_t mcio_error(cccp_provider *cccp, lcb_error_t err)
{
    if (err != LCB_NOT_SUPPORTED && err != LCB_UNKNOWN_COMMAND) {
        lcb_log(LOGARGS(cccp, ERR), LOGFMT "Got I/O Error=0x%x", LOGID(cccp), err);
    }

    release_socket(cccp, err == LCB_NOT_SUPPORTED);
    return schedule_next_request(cccp, err, 0);
}

static void socket_timeout(void *arg)
{
    cccp_provider *cccp = arg;
    mcio_error(cccp, LCB_ETIMEDOUT);
}

void lcb_clconfig_cccp_enable(clconfig_provider *pb, lcb_t instance)
{
    cccp_provider *cccp = (cccp_provider *)pb;
    lcb_assert(pb->type == LCB_CLCONFIG_CCCP);
    cccp->instance = instance;
    pb->enabled = 1;
}

static hostlist_t get_nodes(const clconfig_provider *pb)
{
    return ((cccp_provider *)pb)->nodes;
}

/** Update the configuration from a server. */
lcb_error_t lcb_cccp_update(clconfig_provider *provider,
                            const char *host,
                            lcb_string *data)
{
    /** TODO: replace this with lcbvb_ names */

    lcbvb_CONFIG* vbc;
    int rv;
    clconfig_info *new_config;
    cccp_provider *cccp = (cccp_provider *)provider;
    vbc = lcbvb_create();

    if (!vbc) {
        return LCB_CLIENT_ENOMEM;
    }
    rv = lcbvb_load_json(vbc, data->base);

    if (rv) {
        lcbvb_destroy(vbc);
        return LCB_PROTOCOL_ERROR;
    }

    lcbvb_replace_host(vbc, host);
    new_config = lcb_clconfig_create(vbc, LCB_CLCONFIG_CCCP);

    if (!new_config) {
        lcbvb_destroy(vbc);
        return LCB_CLIENT_ENOMEM;
    }

    if (cccp->config) {
        lcb_clconfig_decref(cccp->config);
    }

    /** TODO: Figure out the comparison vector */
    new_config->cmpclock = gethrtime();
    cccp->config = new_config;
    lcb_confmon_provider_success(provider, new_config);
    return LCB_SUCCESS;
}

void lcb_cccp_update2(const void *cookie, lcb_error_t err,
                      const void *bytes, lcb_size_t nbytes,
                      const lcb_host_t *origin)
{
    cccp_cookie *ck = (cccp_cookie *)cookie;
    cccp_provider *cccp = ck->parent;

    if (ck == cccp->cmdcookie) {
        lcbio_timer_disarm(cccp->timer);
        cccp->cmdcookie = NULL;
    }

    if (err == LCB_SUCCESS) {
        lcb_string ss;

        lcb_string_init(&ss);
        lcb_string_append(&ss, bytes, nbytes);
        err = lcb_cccp_update(&cccp->base, origin->host, &ss);
        lcb_string_release(&ss);
    }

    if (err != LCB_SUCCESS && ck->ignore_errors == 0) {
        mcio_error(cccp, err);
    }

    free(ck);
}

static void
on_connected(lcbio_SOCKET *sock, void *data, lcb_error_t err, lcbio_OSERR syserr)
{
    lcbio_CTXPROCS ioprocs;
    cccp_provider *cccp = data;
    lcb_settings *settings = cccp->base.parent->settings;

    LCBIO_CONNREQ_CLEAR(&cccp->creq);
    if (err != LCB_SUCCESS) {
        if (sock) {
            lcbio_mgr_discard(sock);
        }
        mcio_error(cccp, err);
        return;
    }

    if (lcbio_protoctx_get(sock, LCBIO_PROTOCTX_SESSINFO) == NULL) {
        mc_pSESSREQ sreq;
        sreq = mc_sessreq_start(
                sock, settings, settings->config_node_timeout, on_connected,
                cccp);
        LCBIO_CONNREQ_MKGENERIC(&cccp->creq, sreq, mc_sessreq_cancel);
        return;
    }

    ioprocs.cb_err = io_error_handler;
    ioprocs.cb_read = io_read_handler;
    cccp->ioctx = lcbio_ctx_new(sock, data, &ioprocs);
    cccp->ioctx->subsys = "bc_cccp";
    request_config(cccp);

    (void)syserr;
}

static lcb_error_t cccp_get(clconfig_provider *pb)
{
    cccp_provider *cccp = (cccp_provider *)pb;
    if (cccp->creq.u.p_generic || cccp->server_active || cccp->cmdcookie) {
        return LCB_BUSY;
    }

    return schedule_next_request(cccp, LCB_SUCCESS, 1);
}

static clconfig_info *cccp_get_cached(clconfig_provider *pb)
{
    cccp_provider *cccp = (cccp_provider *)pb;
    return cccp->config;
}

static lcb_error_t cccp_pause(clconfig_provider *pb)
{
    cccp_provider *cccp = (cccp_provider *)pb;
    if (!cccp->server_active) {
        return LCB_SUCCESS;
    }

    cccp->server_active = 0;
    release_socket(cccp, 0);
    lcbio_timer_disarm(cccp->timer);
    return LCB_SUCCESS;
}

static void cccp_cleanup(clconfig_provider *pb)
{
    cccp_provider *cccp = (cccp_provider *)pb;

    release_socket(cccp, 0);
    if (cccp->config) {
        lcb_clconfig_decref(cccp->config);
    }
    if (cccp->nodes) {
        hostlist_destroy(cccp->nodes);
    }
    if (cccp->timer) {
        lcbio_timer_destroy(cccp->timer);
    }
    if (cccp->cmdcookie) {
        cccp->cmdcookie->ignore_errors = 1;
    }
    free(cccp);
}

static void
configure_nodes(clconfig_provider *pb, const hostlist_t nodes)
{
    unsigned ii;
    cccp_provider *cccp = (cccp_provider *)pb;
    hostlist_clear(cccp->nodes);

    for (ii = 0; ii < nodes->nentries; ii++) {
        hostlist_add_host(cccp->nodes, nodes->entries + ii);
    }
    if (PROVIDER_SETTING(pb, randomize_bootstrap_nodes)) {
        hostlist_randomize(cccp->nodes);
    }
}

static void
config_updated(clconfig_provider *provider, lcbvb_CONFIG* vbc)
{
    unsigned ii;
    lcbvb_SVCMODE mode;
    cccp_provider *cccp = (cccp_provider *)provider;
    if (LCBVB_NSERVERS(vbc) < 1) {
        return;
    }

    hostlist_clear(cccp->nodes);
    if (PROVIDER_SETTING(provider, sslopts) & LCB_SSL_ENABLED) {
        mode = LCBVB_SVCMODE_SSL;
    } else {
        mode = LCBVB_SVCMODE_PLAIN;
    }
    for (ii = 0; ii < LCBVB_NSERVERS(vbc); ii++) {
        const char *mcaddr = lcbvb_get_hostport(vbc,
            ii, LCBVB_SVCTYPE_DATA, mode);
        if (!mcaddr) {
            lcb_log(LOGARGS(cccp, DEBUG), "Node %d has no data service", ii);
            continue;
        }
        hostlist_add_stringz(cccp->nodes, mcaddr, LCB_CONFIG_MCD_PORT);
    }

    if (PROVIDER_SETTING(provider, randomize_bootstrap_nodes)) {
        hostlist_randomize(cccp->nodes);
    }
}

static void
io_error_handler(lcbio_CTX *ctx, lcb_error_t err)
{
    cccp_provider *cccp = lcbio_ctx_data(ctx);
    mcio_error(cccp, err);
}

static void
io_read_handler(lcbio_CTX *ioctx, unsigned nr)
{
    packet_info pi;
    cccp_provider *cccp = lcbio_ctx_data(ioctx);
    lcb_string jsonstr;
    lcb_error_t err;
    int rv;
    unsigned required;
    lcb_host_t curhost;

    (void)nr;

#define return_error(e) \
    lcb_pktinfo_ectx_done(&pi, ioctx); \
    mcio_error(cccp, e); \
    return

    memset(&pi, 0, sizeof(pi));
    rv = lcb_pktinfo_ectx_get(&pi, ioctx, &required);
    if (!rv) {
        lcbio_ctx_rwant(ioctx, required);
        lcbio_ctx_schedule(ioctx);
        return;
    }

    if (PACKET_STATUS(&pi) != PROTOCOL_BINARY_RESPONSE_SUCCESS) {
        lcb_log(LOGARGS(cccp, WARN), LOGFMT "CCCP Packet responded with 0x%x; nkey=%d, nbytes=%lu, cmd=0x%x, seq=0x%x", LOGID(cccp),
                PACKET_STATUS(&pi), PACKET_NKEY(&pi), (unsigned long)PACKET_NBODY(&pi),
                PACKET_OPCODE(&pi), PACKET_OPAQUE(&pi));

        switch (PACKET_STATUS(&pi)) {
        case PROTOCOL_BINARY_RESPONSE_NOT_SUPPORTED:
        case PROTOCOL_BINARY_RESPONSE_UNKNOWN_COMMAND:
            return_error(LCB_NOT_SUPPORTED);
        default:
            return_error(LCB_PROTOCOL_ERROR);
        }

        return;
    }

    if (!PACKET_NBODY(&pi)) {
        return_error(LCB_PROTOCOL_ERROR);
    }

    if (lcb_string_init(&jsonstr)) {
        return_error(LCB_CLIENT_ENOMEM);
    }

    if (lcb_string_append(&jsonstr, PACKET_BODY(&pi), PACKET_NBODY(&pi))) {
        return_error(LCB_CLIENT_ENOMEM);
    }

    curhost = *lcbio_get_host(lcbio_ctx_sock(ioctx));
    lcb_pktinfo_ectx_done(&pi, ioctx);
    release_socket(cccp, 1);

    err = lcb_cccp_update(&cccp->base, curhost.host, &jsonstr);
    lcb_string_release(&jsonstr);
    if (err == LCB_SUCCESS) {
        lcbio_timer_disarm(cccp->timer);
        cccp->server_active = 0;
    } else {
        schedule_next_request(cccp, LCB_PROTOCOL_ERROR, 0);
    }

#undef return_error
}

static void request_config(cccp_provider *cccp)
{
    protocol_binary_request_set_cluster_config req;
    memset(&req, 0, sizeof(req));
    req.message.header.request.magic = PROTOCOL_BINARY_REQ;
    req.message.header.request.opcode = PROTOCOL_BINARY_CMD_GET_CLUSTER_CONFIG;
    req.message.header.request.opaque = 0xF00D;
    lcbio_ctx_put(cccp->ioctx, req.bytes, sizeof(req.bytes));
    lcbio_ctx_rwant(cccp->ioctx, 24);
    lcbio_ctx_schedule(cccp->ioctx);
    lcbio_timer_rearm(cccp->timer, PROVIDER_SETTING(&cccp->base, config_node_timeout));
}

static void do_dump(clconfig_provider *pb, FILE *fp)
{
    cccp_provider *cccp = (cccp_provider *)pb;
    unsigned ii;

    if (!cccp->base.enabled) {
        return;
    }

    fprintf(fp, "## BEGIN CCCP PROVIDER DUMP ##\n");
    fprintf(fp, "TIMER ACTIVE: %s\n", lcbio_timer_armed(cccp->timer) ? "YES" : "NO");
    fprintf(fp, "PIPELINE RESPONSE COOKIE: %p\n", (void*)cccp->cmdcookie);
    if (cccp->ioctx) {
        fprintf(fp, "CCCP Owns connection:\n");
        lcbio_ctx_dump(cccp->ioctx, fp);
    } else if (cccp->creq.u.p_generic) {
        fprintf(fp, "CCCP Is connecting\n");
    } else {
        fprintf(fp, "CCCP does not have a dedicated connection\n");
    }

    for (ii = 0; ii < cccp->nodes->nentries; ii++) {
        const lcb_host_t *curhost = &cccp->nodes->entries[ii];
        fprintf(fp, "CCCP NODE: %s:%s\n", curhost->host, curhost->port);
    }
    fprintf(fp, "## END CCCP PROVIDER DUMP ##\n");
}

clconfig_provider * lcb_clconfig_create_cccp(lcb_confmon *mon)
{
    cccp_provider *cccp = calloc(1, sizeof(*cccp));
    cccp->nodes = hostlist_create();
    cccp->base.type = LCB_CLCONFIG_CCCP;
    cccp->base.refresh = cccp_get;
    cccp->base.get_cached = cccp_get_cached;
    cccp->base.pause = cccp_pause;
    cccp->base.shutdown = cccp_cleanup;
    cccp->base.config_updated = config_updated;
    cccp->base.configure_nodes = configure_nodes;
    cccp->base.get_nodes = get_nodes;
    cccp->base.dump = do_dump;
    cccp->base.parent = mon;
    cccp->base.enabled = 0;
    cccp->timer = lcbio_timer_new(mon->iot, cccp, socket_timeout);

    if (!cccp->nodes) {
        free(cccp);
        return NULL;
    }
    return &cccp->base;
}


text:
package caddypki

import (
	"crypto"
	"crypto/x509"
	"time"

	"github.com/smallstep/cli/crypto/x509util"
)

func generateRoot(commonName string) (rootCrt *x509.Certificate, privateKey interface{}, err error) {
	rootProfile, err := x509util.NewRootProfile(commonName)
	if err != nil {
		return
	}
	rootProfile.Subject().NotAfter = time.Now().Add(defaultRootLifetime) // TODO: make configurable
	return newCert(rootProfile)
}

func generateIntermediate(commonName string, rootCrt *x509.Certificate, rootKey crypto.PrivateKey) (cert *x509.Certificate, privateKey crypto.PrivateKey, err error) {
	interProfile, err := x509util.NewIntermediateProfile(commonName, rootCrt, rootKey)
	if err != nil {
		return
	}
	interProfile.Subject().NotAfter = time.Now().Add(defaultIntermediateLifetime) // TODO: make configurable
	return newCert(interProfile)
}

func newCert(profile x509util.Profile) (cert *x509.Certificate, privateKey crypto.PrivateKey, err error) {
	certBytes, err := profile.CreateCertificate()
	if err != nil {
		return
	}
	privateKey = profile.SubjectPrivateKey()
	cert, err = x509.ParseCertificate(certBytes)
	return
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2013 Andrew Everitt, Andrew Heckford, Daniele Masato

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>msbuild-maven-plugin-it</artifactId>
    <packaging>jar</packaging>

    <parent>
        <groupId>uk.org.raje.maven.plugins</groupId>
        <artifactId>msbuild-maven-plugin-parent</artifactId>
        <version>1.3.2-SNAPSHOT</version>
    </parent>

    <name>MSBuild Maven Plugin Integration Tests - maven-msbuild-plugin-it</name>
    <description>Integration Tests for the Maven Plugin</description>
    <url>https://github.com/andi12/maven-msbuild-plugin</url>
    <inceptionYear>2013</inceptionYear>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <!-- Dependency versions -->
        <maven-verifier.version>1.4</maven-verifier.version>
        <junit-addons.version>1.4</junit-addons.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>uk.org.raje.maven.plugins</groupId>
            <artifactId>msbuild-maven-plugin</artifactId>
            <version>1.3.2-SNAPSHOT</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-verifier</artifactId>
            <version>${maven-verifier.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit-addons</groupId>
            <artifactId>junit-addons</artifactId>
            <version>${junit-addons.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <!-- Most resources are not filtered -->
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>verifier.properties</exclude>
                </excludes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>verifier.properties</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>../msbuild-maven-plugin/style/maven_checks.xml</configLocation>
                    <headerLocation>../msbuild-maven-plugin/style/checkstyle-header.java</headerLocation>
                    <consoleOutput>true</consoleOutput>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-checkstyle-plugin</artifactId>
                                        <versionRange>[${maven-checkstyle-plugin.version},)</versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!-- This profile is added to allow the integration tests to be skipped
            if needed. For example on a machine where the required tools (msbuild, cppcheck,
            cxxtest etc) are missing -->
        <profile>
            <id>skip-integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
#include <ipxe/io.h>

#include "ath.h"

struct io_buffer *ath_rxbuf_alloc(struct ath_common *common,
				u32 len,
				u32 *iob_addr)
{
	struct io_buffer *iob;
	u32 off;

	/*
	 * Cache-line-align.  This is important (for the
	 * 5210 at least) as not doing so causes bogus data
	 * in rx'd frames.
	 */

	/* Note: the kernel can allocate a value greater than
	 * what we ask it to give us. We really only need 4 KB as that
	 * is this hardware supports and in fact we need at least 3849
	 * as that is the MAX AMSDU size this hardware supports.
	 * Unfortunately this means we may get 8 KB here from the
	 * kernel... and that is actually what is observed on some
	 * systems :( */
	iob = alloc_iob(len + common->cachelsz - 1);
	if (iob != NULL) {
		*iob_addr = virt_to_bus(iob->data);
		off = ((unsigned long) iob->data) % common->cachelsz;
		if (off != 0)
		{
			iob_reserve(iob, common->cachelsz - off);
			*iob_addr += common->cachelsz - off;
		}
	} else {
		DBG("ath: iobuffer alloc of size %d failed\n", len);
		return NULL;
	}

	return iob;
}


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.7
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.badlogic.gdx.physics.bullet.linearmath;

import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;

public class btTransform extends BulletBase {
	private long swigCPtr;

	protected btTransform(final String className, long cPtr, boolean cMemoryOwn) {
		super(className, cPtr, cMemoryOwn);
		swigCPtr = cPtr;
	}

	/** Construct a new btTransform, normally you should not need this constructor it's intended for low-level usage. */
	public btTransform(long cPtr, boolean cMemoryOwn) {
		this("btTransform", cPtr, cMemoryOwn);
		construct();
	}

	@Override
	protected void reset(long cPtr, boolean cMemoryOwn) {
		if (!destroyed)
			destroy();
		super.reset(swigCPtr = cPtr, cMemoryOwn);
	}

	public static long getCPtr(btTransform obj) {
		return (obj == null) ? 0 : obj.swigCPtr;
	}

	@Override
	protected void finalize() throws Throwable {
		if (!destroyed)
			destroy();
		super.finalize();
	}

  @Override protected synchronized void delete() {
		if (swigCPtr != 0) {
			if (swigCMemOwn) {
				swigCMemOwn = false;
				LinearMathJNI.delete_btTransform(swigCPtr);
			}
			swigCPtr = 0;
		}
		super.delete();
	}

  public btTransform() {
    this(LinearMathJNI.new_btTransform__SWIG_0(), true);
  }

  public btTransform(Quaternion q, Vector3 c) {
    this(LinearMathJNI.new_btTransform__SWIG_1(q, c), true);
  }

  public btTransform(Quaternion q) {
    this(LinearMathJNI.new_btTransform__SWIG_2(q), true);
  }

  public btTransform(Matrix3 b, Vector3 c) {
    this(LinearMathJNI.new_btTransform__SWIG_3(b, c), true);
  }

  public btTransform(Matrix3 b) {
    this(LinearMathJNI.new_btTransform__SWIG_4(b), true);
  }

  public btTransform(Matrix4 other) {
    this(LinearMathJNI.new_btTransform__SWIG_5(other), true);
  }

  public void mult(Matrix4 t1, Matrix4 t2) {
    LinearMathJNI.btTransform_mult(swigCPtr, this, t1, t2);
  }

  public Matrix3 getBasis() {
	return LinearMathJNI.btTransform_getBasis__SWIG_0(swigCPtr, this);
}

  public Vector3 getOrigin() {
	return LinearMathJNI.btTransform_getOrigin__SWIG_0(swigCPtr, this);
}

  public Quaternion getRotation() {
	return LinearMathJNI.btTransform_getRotation(swigCPtr, this);
}

  public void setFromOpenGLMatrix(float[] m) {
    LinearMathJNI.btTransform_setFromOpenGLMatrix(swigCPtr, this, m);
  }

  public void getOpenGLMatrix(float[] m) {
    LinearMathJNI.btTransform_getOpenGLMatrix(swigCPtr, this, m);
  }

  public void setOrigin(Vector3 origin) {
    LinearMathJNI.btTransform_setOrigin(swigCPtr, this, origin);
  }

  public Vector3 invXform(Vector3 inVec) {
	return LinearMathJNI.btTransform_invXform(swigCPtr, this, inVec);
}

  public void setBasis(Matrix3 basis) {
    LinearMathJNI.btTransform_setBasis(swigCPtr, this, basis);
  }

  public void setRotation(Quaternion q) {
    LinearMathJNI.btTransform_setRotation(swigCPtr, this, q);
  }

  public void setIdentity() {
    LinearMathJNI.btTransform_setIdentity(swigCPtr, this);
  }

  public Matrix4 inverse() {
	return LinearMathJNI.btTransform_inverse(swigCPtr, this);
}

  public Matrix4 inverseTimes(Matrix4 t) {
	return LinearMathJNI.btTransform_inverseTimes(swigCPtr, this, t);
}

  public static Matrix4 getIdentity() {
	return LinearMathJNI.btTransform_getIdentity();
}

  public void serialize(btTransformFloatData dataOut) {
    LinearMathJNI.btTransform_serialize(swigCPtr, this, btTransformFloatData.getCPtr(dataOut), dataOut);
  }

  public void serializeFloat(btTransformFloatData dataOut) {
    LinearMathJNI.btTransform_serializeFloat(swigCPtr, this, btTransformFloatData.getCPtr(dataOut), dataOut);
  }

  public void deSerialize(btTransformFloatData dataIn) {
    LinearMathJNI.btTransform_deSerialize(swigCPtr, this, btTransformFloatData.getCPtr(dataIn), dataIn);
  }

  public void deSerializeDouble(btTransformDoubleData dataIn) {
    LinearMathJNI.btTransform_deSerializeDouble(swigCPtr, this, btTransformDoubleData.getCPtr(dataIn), dataIn);
  }

  public void deSerializeFloat(btTransformFloatData dataIn) {
    LinearMathJNI.btTransform_deSerializeFloat(swigCPtr, this, btTransformFloatData.getCPtr(dataIn), dataIn);
  }

}


text:
module StatusPage
  class ActiveRecordStatus < Status
    def check
      super
      begin
        ActiveRecord::Base.connection.tables
      rescue => e
        @errors << "Unable to reach database."
      end
    end
  end
end


text:
/**
 * \file TskPluginModule.cpp
 * Contains the implementation for the TskPluginModule class.
 */

// Include the class definition first to ensure it does not depend on subsequent includes in this file.
#include "TskPluginModule.h"

// Framework includes
#include "tsk/framework/services/TskServices.h"
#include "tsk/framework/utilities/TskException.h"
#include "tsk/framework/file/TskFileManagerImpl.h"
#include "tsk/framework/TskVersionInfo.h"

// Poco includes
#include "Poco/String.h"
#include "Poco/Path.h"
#include "Poco/Environment.h"

// C/C++ library includes
#include <sstream>
#include <string>

const std::string TskPluginModule::GET_COMPILER_SYMBOL = "getCompiler";
const std::string TskPluginModule::GET_COMPILER_VERSION_SYMBOL = "getCompilerVersion";
const std::string TskPluginModule::GET_FRAMEWORK_VERSION_SYMBOL = "getFrameWorkVersion";
const std::string TskPluginModule::GET_BUILD_TYPE_SYMBOL = "getBuildType";
const std::string TskPluginModule::NAME_SYMBOL = "name";
const std::string TskPluginModule::DESCRIPTION_SYMBOL = "description";
const std::string TskPluginModule::VERSION_SYMBOL = "version";
const std::string TskPluginModule::RUN_SYMBOL = "run";
const std::string TskPluginModule::REPORT_SYMBOL = "report";
const std::string TskPluginModule::INITIALIZE_SYMBOL = "initialize";
const std::string TskPluginModule::FINALIZE_SYMBOL = "finalize";

TskPluginModule::~TskPluginModule()
{
    if (m_sharedLibrary.isLoaded())
    {
        // Call finalize function if defined.
        if (m_sharedLibrary.hasSymbol(TskPluginModule::FINALIZE_SYMBOL))
        {
            typedef TskModule::Status (*FinalizeFunc)();
            FinalizeFunc fin = (FinalizeFunc)m_sharedLibrary.getSymbol(TskPluginModule::FINALIZE_SYMBOL);
            fin();
        }

        m_sharedLibrary.unload();
    }
}

void TskPluginModule::setPath(const std::string& location)
{
    try
    {
        if (location.empty())
        {
            throw TskException("TskPluginModule::setPath: location is empty or missing.");
        }

        std::string os = Poco::Environment::osName();
        Poco::Path tempPath = location;

        // If on Linux or Mac, then prefix with "lib"
        if ((os.find("Linux") != std::string::npos) || (os.find("Darwin") != std::string::npos))
        {
            tempPath.setFileName("lib" + tempPath.getFileName());
        }

        // Autogenerate filename extension if needed
        if (tempPath.getExtension().empty())
        {
            if (os.find("Linux") != std::string::npos)
            {
                tempPath.setExtension("so");
            }
            else if (os.find("Darwin") != std::string::npos)
            {
                tempPath.setExtension("dylib");
            }
            else if (os.find("Windows") != std::string::npos ||
                     os.find("CYGWIN")  != std::string::npos ||
                     os.find("MINGW")   != std::string::npos )
            {
                tempPath.setExtension("dll");
            }
            else
            {
                throw TskException("TskPluginModule::setPath: OS unknown. Cannot resolve plugin extension.");
            }
        }

        // Search for location
        // Absolute (fully qualified) paths are not allowed.
        if (!tempPath.isAbsolute())
        {
            // See if we can find the executable in MODULE_DIR.
            std::string pathsToSearch = GetSystemProperty(TskSystemProperties::MODULE_DIR);

            bool found = Poco::Path::find(pathsToSearch, tempPath.toString(), tempPath);

            // Confirm existence of file at found location.
            Poco::File moduleFile(tempPath);
            if (found && moduleFile.exists())
            {
                std::wstringstream msg;
                msg << L"TskPluginModule::setPath - Module found at: "
                    << tempPath.toString().c_str();
                LOGINFO(msg.str());
            }
            else
            {
                std::stringstream msg;
                msg << "TskPluginModule::setPath - Module not found: "
                    << tempPath.toString().c_str();
                throw TskException(msg.str());
            }
        }
        else
        {
            std::stringstream msg;
            msg << "TskPluginModule::setPath: location (" << tempPath.toString() << ") is not relative to MODULE_DIR.";
            throw TskException(msg.str());
        }

        m_modulePath = tempPath.toString();

        // Load the library.
        m_sharedLibrary.load(m_modulePath);

        if (m_sharedLibrary.isLoaded())
        {
           validateLibraryVersionInfo();

           // TODO: Eliminate code duplication that follows.
           typedef const char* (*MetaDataFunc)();
           MetaDataFunc metaDataFunc = NULL;

            if (m_sharedLibrary.hasSymbol(TskPluginModule::NAME_SYMBOL))
            {
                metaDataFunc = (MetaDataFunc)m_sharedLibrary.getSymbol(TskPluginModule::NAME_SYMBOL);
                if (metaDataFunc)
                {
                    m_name = metaDataFunc();
                    metaDataFunc = NULL;
                }
            }

            if (m_sharedLibrary.hasSymbol(TskPluginModule::DESCRIPTION_SYMBOL))
            {
                metaDataFunc = (MetaDataFunc)m_sharedLibrary.getSymbol(TskPluginModule::DESCRIPTION_SYMBOL);
                if (metaDataFunc)
                {
                    m_description = metaDataFunc();
                    metaDataFunc = NULL;
                }
            }

            if (m_sharedLibrary.hasSymbol(TskPluginModule::VERSION_SYMBOL))
            {
                metaDataFunc = (MetaDataFunc)m_sharedLibrary.getSymbol(TskPluginModule::VERSION_SYMBOL);
                if (metaDataFunc)
                {
                    m_version = metaDataFunc();
                    metaDataFunc = NULL;
                }
            }
        }

        if (m_name.empty())
        {
            Poco::Path modulePath(m_modulePath);
            m_name = modulePath.getBaseName();
        }
    }
    catch (TskException& ex)
    {
        // Base class has already logged an error so we simply rethrow.
        throw ex;
    }
    catch(std::exception& ex)
    {
        // Log a message and throw a framework exception.
        std::wstringstream msg;
        msg << L"TskPluginModule::setPath - " << ex.what();
        LOGERROR(msg.str());

        throw TskException("Failed to set path: " + m_modulePath);
    }
}

TskModule::Status TskPluginModule::initialize()
{
    const std::string MSG_PREFIX = "TskPluginModule::initialize : ";
    TskModule::Status status = TskModule::FAIL;
    if (m_sharedLibrary.hasSymbol(TskPluginModule::INITIALIZE_SYMBOL))
    {
        try
        {
            std::string arguments = expandArgumentMacros(m_arguments, 0);
            typedef TskModule::Status (*InitializeFunc)(const char* args);
            InitializeFunc init = (InitializeFunc) m_sharedLibrary.getSymbol(TskPluginModule::INITIALIZE_SYMBOL);
            status = init(arguments.c_str());
        }
        catch (TskException &ex)
        {
            std::stringstream msg;
            msg << MSG_PREFIX << "TskException initializing " << getName() << ": " << ex.message();
            LOGERROR(msg.str());
            status = TskModule::FAIL;
        }
        catch (Poco::Exception &ex)
        {
            std::stringstream msg;
            msg << MSG_PREFIX <<  "Poco::Exception initializing "  << getName() << ": " << ex.displayText();
            LOGERROR(msg.str());
            status = TskModule::FAIL;
        }
        catch (std::exception &ex)
        {
            std::stringstream msg;
            msg << MSG_PREFIX <<  "std::exception initializing "  << getName() << ": " << ex.what();
            LOGERROR(msg.str());
            status = TskModule::FAIL;
        }
        catch (...)
        {
            std::stringstream msg;
            msg << MSG_PREFIX << "unrecognized exception initializing "  << getName();
            LOGERROR(msg.str());
            status = TskModule::FAIL;
        }
    }

    return status;
}

bool TskPluginModule::isLoaded() const
{
    return (m_sharedLibrary.isLoaded());
}

void *TskPluginModule::getSymbol(const std::string symbol)
{
    return (void*)m_sharedLibrary.getSymbol(symbol);
}

bool TskPluginModule::hasSymbol(const std::string symbol)
{
    return (m_sharedLibrary.hasSymbol(symbol));
}

void TskPluginModule::validateLibraryVersionInfo()
{
   if (!hasSymbol(GET_FRAMEWORK_VERSION_SYMBOL) || !hasSymbol(GET_COMPILER_SYMBOL) || !hasSymbol(GET_COMPILER_VERSION_SYMBOL) || !hasSymbol(GET_BUILD_TYPE_SYMBOL))
   {
      throw TskException("version info interface not implemented");
   }

   int frameworkVersion = TskVersionInfo::getFrameworkVersion();
   typedef int (*GetFrameworkVersion)();
   GetFrameworkVersion getFrameworkVersion = (GetFrameworkVersion) m_sharedLibrary.getSymbol(TskPluginModule::GET_FRAMEWORK_VERSION_SYMBOL);
   int moduleFrameworkVersion = getFrameworkVersion();
   if (((frameworkVersion >> 16) & 0xFFFF)  != (( moduleFrameworkVersion >> 16) & 0xFFFF))
   {
      throw TskException("TskPluginModule::validateLibraryVersionInfo : framework version mismatch");
   }

   typedef TskVersionInfo::Compiler (*GetCompiler)();
   GetCompiler getCompiler = (GetCompiler) m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_SYMBOL);
   if (TskVersionInfo::getCompiler() != getCompiler())
   {
      throw TskException("TskPluginModule::validateLibraryVersionInfo : compiler mismatch");
   }

   typedef int (*GetCompilerVersion)();
   GetCompilerVersion getCompilerVersion = (GetCompilerVersion) m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_VERSION_SYMBOL);
   if (TskVersionInfo::getCompilerVersion() != getCompilerVersion())
   {
      throw TskException("TskPluginModule::validateLibraryVersionInfo : compiler version mismatch");
   }

   typedef TskVersionInfo::BuildType (*GetBuildType)();
   GetBuildType getBuildType = (GetBuildType) m_sharedLibrary.getSymbol(TskPluginModule::GET_BUILD_TYPE_SYMBOL);
   if (TskVersionInfo::getBuildType() != getBuildType())
   {
      throw TskException("TskPluginModule::validateLibraryVersionInfo : build target mismatch");
   }
}


text:
package org.apache.camel.spring.config;

import junit.framework.Assert;
import org.apache.camel.CamelContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;

/**
 * @version
 */
@ContextConfiguration
public class CustomExecutorServiceStrategyTest extends AbstractJUnit38SpringContextTests {

    @Autowired
    protected CamelContext context;

    public void testCustomExecutorService() throws Exception {
        Assert.assertTrue(context.getExecutorServiceStrategy() instanceof CustomExecutorServiceStrategy);
    }

}


text:
#include "tools/fuzzer/gen_node.h"

#include <variant>

#include "tools/fuzzer/expr_gen.h"

namespace fuzzer {

void walk_gen_tree(std::shared_ptr<GenNode> node, GenTreeVisitor* visitor) {
  visitor->visit_node(node);
  for (auto child : node->children()) {
    auto* as_byte = std::get_if<uint8_t>(&child);
    if (as_byte) {
      visitor->visit_byte(*as_byte);
    }
    auto* as_node = std::get_if<std::shared_ptr<GenNode>>(&child);
    if (as_node) {
      walk_gen_tree(*as_node, visitor);
    }
  }
}

}  // namespace fuzzer


text:
<!DOCTYPE html>

  {% include head.html %}

        {{ content }}


text:
package edu.sdsu.watcher.quake.net;

import java.io.IOException;

/**
 * Creates the scaffolding for any future Readers.
 * @author Dennis Thompson
 */
public interface Reader {

	/**
	 * Gets a remote resource and returns a String of said resource.
	 * @param source The remote resource to pull from.
	 * @return The resource as a String.
	 * @throws IOException is there is an IO error.
	 */
	String get(String source) throws IOException;

}


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

import anotaciones.Auditable;
import java.io.Serializable;
import org.hibernate.EmptyInterceptor;
import org.hibernate.type.Type;

/**
 *
 * @author Chema
 */
public class DemoInterceptor extends EmptyInterceptor {

    @Override
    public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
        System.out.println("Se va a crear un objeto persistente instancia de " + entity.getClass().getSimpleName());
        System.out.println("Con clave " + id);
        System.out.println("Con estado ");
        for (Object obj : state) {
            System.out.println("\t" + obj);
        }
        System.out.println("Con propiedades llamadas");
        for (Object obj : propertyNames) {
            System.out.println("\t" + obj);
        }
        System.out.println("Con tipos llamados");
        for(Object obj : types){
            System.out.println("\t" + obj);
        }
        Auditable auditable = entity.getClass().getAnnotation(Auditable.class);
        if (auditable != null) {
            if (auditable.avisarAlAdministrador()) {
                System.out.println("Esta operación se le comunicará al administrador por correo electrónico");
            }
        }
        return false;
    }
}


text:
package org.compass.core;

/**
 * Holds a term within the index, its frequency and the property name
 * it is associated with.
 *
 * @author kimchy
 * @see org.compass.core.CompassSession#termFreqsBuilder(String)
 * @see org.compass.core.CompassTermFreqsBuilder
 */
public interface CompassTermFreq {

    /**
     * Returns the property name this term is associated with
     */
    String getPropertyName();

    /**
     * Returns the term value (of the property name).
     */
    String getTerm();

    /**
     * Returns the term frequency within the index.
     */
    float getFreq();
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Michelia 1(no. 2): 127 (1878)

#### Original name
Ascochyta graminicola Sacc., 1878

### Remarks
null


text:
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Security-Policy" content="img-src 'none'">
    <script src="/js-test-resources/js-test.js"></script>
    <script src="../resources/securitypolicyviolation-test.js"></script>
    <script>
        description('Check that a SecurityPolicyViolationEvent is fired upon blocking an image injected via script.');

        var expectations = {
            'documentURI': document.location.toString(),
            'referrer': document.referrer,
            'blockedURI': 'http://127.0.0.1:8000/security/resources/abe.png',
            'violatedDirective': 'img-src \'none\'',
            'effectiveDirective': 'img-src',
            'originalPolicy': 'img-src \'none\'',
            'sourceFile': 'http://127.0.0.1:8000/security/contentSecurityPolicy/resources/inject-image.js',
            'lineNumber': 3,
            'columnNumber': 7,
            'statusCode': 200,
        };

        function run() {
            var script = document.createElement('script');
            script.src = '../resources/inject-image.js';
            document.body.appendChild(script);
        }
    </script>
</head>
<body>
</body>
</html>


text:
package cmput301f17t01.bronzify.models;

import android.graphics.Bitmap;
import android.location.Location;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;

/**
 * Created by kdehaan on 19/10/17.
 */

public class User {

    private String userID;
    private Date dateCreated;
    private Date lastUpdated;
    private Date lastInfluenced;
    private Location location;

    private Double score;
    private Bitmap image;

    private ArrayList<HabitType> habitTypes = new ArrayList<HabitType>();
    //    private ArrayList<String> habitTypes = new ArrayList<String>();
    private ArrayList<String> following = new ArrayList<String>();
    private ArrayList<String> followedBy = new ArrayList<String>();
    private ArrayList<String> pendingFollowRequests = new ArrayList<String>();

    /**
     * Creation of a user
     *
     * @param userID
     */
    public User(String userID) {
        this.userID = userID;
        this.dateCreated = new Date();
        this.lastInfluenced = new Date();
        this.lastUpdated = new Date();
        this.score = 0.0;
    }

    /**
     * Convert to a string
     *
     * @return
     */
    public String toString() {
        return userID;
    }

    /**
     * Add a habit type
     *
     * @param habitType
     * @return
     */
    public void addHabitType(HabitType habitType) throws Exception {
        if (getType(habitType.getName()) == null) {
            habitTypes.add(habitType);
            this.lastUpdated = new Date();
        } else {
            throw new Exception("Habit type exists");
        }
    }

    /**
     * Method returning the last influence piece of data while you are offline. To be used
     * differently than the last updated. (OFFLINE)
     *
     * @return
     */
    public Date getLastInfluenced() {
        return lastInfluenced;
    }

    /**
     * Method setting the last influenced data
     *
     * @param lastInfluenced
     */
    public void setLastInfluenced(Date lastInfluenced) {
        this.lastInfluenced = lastInfluenced;
    }

    /**
     * Returns a list of Strings of who a user is following
     *
     * @return
     */
    public ArrayList<String> getFollowing() {
        return following;
    }

    /**
     * Method that adds a new follower to the list of followers
     *
     * @param userID
     */
    public void addFollowing(String userID) {
        following.add(userID);
        setLastInfluenced(new Date());
    } //TODO: investigate passing the user directly

    /**
     * Removes a follower
     *
     * @param userID
     */
    public void removeFollowing(String userID) {
        following.remove(userID); // might not work
    }

    /**
     * Method that sets a user following (after they have accepted the follower request)
     *
     * @param following
     */
    public void setFollowing(ArrayList<String> following) {
        this.following = following;

    }

    /**
     * Sets the pending follow requests to a list (for offline capabilities)
     *
     * @param pendingFollowRequests
     */
    public void setPendingFollowRequests(ArrayList<String> pendingFollowRequests) {
        this.pendingFollowRequests = pendingFollowRequests;
    }

    /**
     * Method that retrieves all of the pending follow requests
     *
     * @return
     */
    public ArrayList<String> getPendingFollowRequests() {
        return pendingFollowRequests;
    }

    /**
     * Method that removes pending follow requests
     *
     * @param userID
     */
    public void removePendingFollowRequest(String userID) {
        pendingFollowRequests.remove(userID);
        this.lastInfluenced = new Date();
    }

    /**
     * Method that adds to the list of pending follow requests
     *
     * @param userID
     */
    public void addPendingFollowRequest(String userID) {
        pendingFollowRequests.add(userID);
        this.lastInfluenced = new Date();
    }

    /**
     * Method that returns the userID of the logged in user
     *
     * @return
     */
    public String getUserID() {
        return userID;
    }

    /**
     * Sets the userID of the logged in user
     *
     * @param userID
     */
    public void setUserID(String userID) {
        this.userID = userID;
    }

    /**
     * Method that returns the date created (to be used with habit events or types)
     *
     * @return
     */
    public Date getDateCreated() {
        return dateCreated;
    }

    /**
     * Method that returns when the last update was
     *
     * @return
     */
    public Date getLastUpdated() {
        return lastUpdated;
    }

    /**
     * Method that sets the last update
     *
     * @param lastUpdated
     */
    public void setLastUpdated(Date lastUpdated) {
        this.lastUpdated = lastUpdated;
    }

    /**
     * Method that returns a list of HabitTypes
     *
     * @return
     */
    public ArrayList<HabitType> getHabitTypes() {
        return habitTypes;
    }

    /**
     * Method that sets a ArrayList of HabitTypes with dates
     *
     * @param habitTypes
     */
    public void setHabitTypes(ArrayList<HabitType> habitTypes) {
        this.habitTypes = habitTypes;
    }

    /**
     * Removes a habit type
     */
    public void removeHabitType(HabitType deletedHabit) {
        if (habitTypes.contains(deletedHabit)) {
            habitTypes.remove(deletedHabit);
        }
    }

    /**
     * Sets the current date as the date created
     *
     * @param dateCreated
     */
    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    /**
     * Returns the current location
     *
     * @return
     */
    public Location getLocation() {
        return location;
    }

    /**
     * Sets the current location as the location, with Google Maps
     *
     * @param location
     */
    public void setLocation(Location location) {
        this.location = location;
    }

    /**
     * Gets the Type and returns the type name
     *
     * @param typeName
     * @return
     */

    public HabitType getType(String typeName) {
        Iterator<HabitType> itr = habitTypes.iterator();
        while (itr.hasNext()) {
            HabitType next = itr.next();
            if (next.getName().equals(typeName)) {
                return next;
            }
        }
        return null;
    }

    /**
     * Checks if the habit is used or not
     *
     * @param newHabit
     * @return
     */
    public Boolean isHabitUsed(String newHabit) {
        for (HabitType habit : habitTypes) {
            if (habit.getName().equals(newHabit)) {
                return true;
            }
        }
        return false;
    }

    /**
     * Gets the score for the users, to rank them in the leader boards
     *
     * @return
     */
    public double getScore() {
        int score = 0;
        if (this.getHabitTypes().size() == 0) {
            return 0;
        } else {
            for (HabitType type : this.getHabitTypes()) {
                score = score + type.getCompletionRatio();
            }
            score = score / this.getHabitTypes().size();
        }
        return score;
    }

    /**
     * Sets a score to each user, to be used for the leader boards
     *
     * @param score
     */
    public void setScore(Double score) {
        this.score = score;
    }

    /**
     * Returns an array list of all the users who are following a user
     *
     * @return
     */
    public ArrayList<String> getFollowedBy() {
        return followedBy;
    }

    /**
     * Sets an array list to the list of all users who are following them
     *
     * @param followedBy
     */
    public void setFollowedBy(ArrayList<String> followedBy) {
        this.followedBy = followedBy;
    }

    /**
     * Adds a new user to the list of people that are following the user
     *
     * @param otherUserID
     */
    public void addFollowedBy(String otherUserID) {
        if (!followedBy.contains(otherUserID)) {
            followedBy.add(otherUserID);
        }
    }

    /**
     * Returns the bitmap of the image
     *
     * @return
     */
    public Bitmap getImage() {
        return image;
    }

    /**
     * Sets the image to a bitmap
     *
     * @param image
     */
    public void setImage(Bitmap image) {
        this.image = image;
    }
}


text:
package com.dremio.edition;

/**
 * Edition provider for providing dremio edition
 */
public interface EditionProvider {

  /**
   * Returns the dremio edition
   * @return Dremio edition
   */
  String getEdition();
}


text:
typedef struct {
	void **memory;
	bool tracked;
} DSGM_Heap;

extern DSGM_Heap DSGM_toFree[DSGM_ALLOCATION_LIMIT];
extern int DSGM_toFreeCount;

void *DSGM_TrackedAlloc(void **tracker, size_t length);
void *DSGM_Alloc(size_t length);
void DSGM_FreeAll(void);


text:
/**
 * A directive which allows elements to be manually focused / blurred.
 */
angular.module('element').directive('guacFocus', ['$parse', function guacFocus($parse) {

    return {
        restrict: 'A',

        link: function linkGuacFocus($scope, $element, $attrs) {

            /**
             * Whether the element associated with this directive should be
             * focussed.
             *
             * @type Boolean
             */
            var guacFocus = $parse($attrs.guacFocus);

            /**
             * The element which will be focused / blurred.
             *
             * @type Element
             */
            var element = $element[0];

            // Set/unset focus depending on value of guacFocus
            $scope.$watch(guacFocus, function updateFocus(value) {
                $scope.$evalAsync(function updateFocusAsync() {
                    if (value)
                        element.focus();
                    else
                        element.blur();
                });
            });

            // Set focus flag when focus is received
            element.addEventListener('focus', function focusReceived() {
                $scope.$evalAsync(function setGuacFocusAsync() {
                    guacFocus.assign($scope, true);
                });
            });

            // Unset focus flag when focus is lost
            element.addEventListener('blur', function focusLost() {
                $scope.$evalAsync(function unsetGuacFocusAsync() {
                    guacFocus.assign($scope, false);
                });
            });

        } // end guacFocus link function

    };

}]);


text:
@font-face {
  @font-face {
    font-family: "Lato Light";
    src: url("../fonts/lato/light/Lato-Light.eot");
    src: url("../fonts/lato/light/Lato-Light.eot?#iefix") format("embedded-opentype"), url("../fonts/lato/light/Lato-Light.woff") format("woff"), url("../fonts/lato/light/Lato-Light.woff2") format("woff2"), url("../fonts/lato/light/Lato-Light.ttf") format("truetype");
    font-weight: normal;
    font-style: normal; } }

@font-face {
  @font-face {
    font-family: "Lato Light";
    src: url("../fonts/lato/lightitalic/Lato-LightItalic.eot");
    src: url("../fonts/lato/lightitalic/Lato-LightItalic.eot?#iefix") format("embedded-opentype"), url("../fonts/lato/lightitalic/Lato-LightItalic.woff") format("woff"), url("../fonts/lato/lightitalic/Lato-LightItalic.woff2") format("woff2"), url("../fonts/lato/lightitalic/Lato-LightItalic.ttf") format("truetype");
    font-weight: "italic";
    font-style: normal; } }

@font-face {
  @font-face {
    font-family: "Lato Light";
    src: url("../fonts/lato/thin/Lato-Thin.eot");
    src: url("../fonts/lato/thin/Lato-Thin.eot?#iefix") format("embedded-opentype"), url("../fonts/lato/thin/Lato-Thin.woff") format("woff"), url("../fonts/lato/thin/Lato-Thin.woff2") format("woff2"), url("../fonts/lato/thin/Lato-Thin.ttf") format("truetype");
    font-weight: normal;
    font-style: normal; } }

@font-face {
  @font-face {
    font-family: "Lato Light";
    src: url("../fonts/lato/thinitalic/Lato-ThinItalic.eot");
    src: url("../fonts/lato/thinitalic/Lato-ThinItalic.eot?#iefix") format("embedded-opentype"), url("../fonts/lato/thinitalic/Lato-ThinItalic.woff") format("woff"), url("../fonts/lato/thinitalic/Lato-ThinItalic.woff2") format("woff2"), url("../fonts/lato/thinitalic/Lato-ThinItalic.ttf") format("truetype");
    font-weight: "italic";
    font-style: normal; } }

p, ul {
  font-family: Lato Light, sans-serif;
  color: #333; }

h1, h2, h3, h4, h5 {
  font-family: Lato Thin, sans-serif;
  color: #555; }

.full .height {
  height: 100%; }

.full .width {
  width: 100%; }

#view {
  display: flex; }

#menu-left {
  flex: 0 0 auto;
  background-color: #2b333d;
  width: 180px;
  height: 100%; }

#content-right {
  flex: 1 1 auto;
  background-color: red;
  position: relative; }

#header {
  position: fixed;
  top: 0;
  background-color: white;
  width: 100%;
  border-bottom: solid #999 1px; }

#header h1 {
  padding: 1em;
  font-size: 1.5em; }

#center-content {
  margin-top: 3em; }


text:
"""This example gets all product packages.
"""

# Import appropriate modules from the client library.
from googleads import ad_manager

def main(client):
  # Initialize appropriate service.
  product_package_service = client.GetService(
      'ProductPackageService', version='v201805')

  # Create a statement to select product packages.
  statement = ad_manager.StatementBuilder(version='v201805')

  # Retrieve a small amount of product packages at a time, paging
  # through until all product packages have been retrieved.
  while True:
    response = product_package_service.getProductPackagesByStatement(
        statement.ToStatement())
    if 'results' in response and len(response['results']):
      for product_package in response['results']:
        # Print out some information for each product package.
        print('Product package with ID "%d" and name "%s" was found.\n' %
              (product_package['id'], product_package['name']))
      statement.offset += statement.limit
    else:
      break

  print '\nNumber of results found: %s' % response['totalResultSetSize']

if __name__ == '__main__':
  # Initialize client object.
  ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
  main(ad_manager_client)


text:
package org.keycloak.testsuite.ui.account2.page;

/**
 * @author Vaclav Muzikar <vmuzikar@redhat.com>
 */
public class PageNotFound extends AbstractLoggedInPage {
    @Override
    public String getPageId() {
        return "some-nonexisting-id";
    }

    @Override
    public boolean isCurrent() {
        return driver.getPageSource().contains("Page Not Found");
    }
}


text:
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var monthArr = ['Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
	var dayInMonthArray = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	var weekArr = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
	var weekArrSrt = ['L', 'M', 'M', 'J', 'V', 'S', 'D'];
	var hoursArr = [];
	var mode = 0;

	// iteration variables;
	var i = 0;
	var j = 0;
	// let k = 0;
	var l = 0;

	// year counter
	var count = 0;

	// initiating the hours array
	for (i = 0; i < 24; i += 1) {
	  hoursArr.push(i + 'h');
	}

	// clearing the dom element
	var clear = function clearTheDom(elemToClear) {
	  var elMac = elemToClear;
	  var newBoxMac = elMac.cloneNode(false);
	  elMac.parentNode.replaceChild(newBoxMac, elMac);
	  elMac = newBoxMac;
	};

	var calLib = [];

	var ref = new Date();
	// month counter
	var mCount = ref.getMonth();

	var CalYear = function () {
	  function CalYear(dateSet) {
	    _classCallCheck(this, CalYear);

	    this.date = dateSet;
	    this.year = ref.getFullYear();
	    this.days = [];
	    this.day = [];
	    this.dayName = [];
	    this.dateFull = [];
	  }

	  _createClass(CalYear, [{
	    key: 'init',
	    value: function init() {
	      this.year = this.date.getFullYear();
	    }
	  }, {
	    key: 'setArrays',
	    value: function setArrays() {
	      for (var m = 0; m < 12; m += 1) {
	        this.days.push([]);
	        this.day.push([]);
	        this.dayName.push([]);
	        this.dateFull.push([]);
	      }
	    }
	  }]);

	  return CalYear;
	}();

	function calInit(span) {
	  count = span / 2;
	  for (i = 0; i < span; i += 1) {
	    // populate the array with objects at date -/+ (span / 2)
	    calLib.push(new CalYear(new Date(ref.getFullYear() - span / 2 + i, 0, 1)));
	  }
	  l = 0;
	  calLib.map(function (x) {
	    x.init();
	    x.setArrays();

	    x.date = new Date(ref.getFullYear() - span / 2 + l, 0, 1);

	    // check for leap year
	    if (x.year % 4 === 0 && x.year % 100 !== 0 || x.year % 400 === 0) {
	      dayInMonthArray[1] = 29;
	    } else {
	      dayInMonthArray[1] = 28;
	    }

	    for (j = 0; j < 12; j += 1) {
	      x.date = new Date(ref.getFullYear() - span / 2 + l, j, 1);
	      for (i = 0; i < dayInMonthArray[j]; i += 1) {
	        // increment the reference day
	        x.date = new Date(ref.getFullYear() - span / 2 + l, j, i + 1);
	        // set the date's digit of the current day
	        x.days[j].push(i + 1);
	        // set the day of the week of the current day
	        x.day[j].push((x.date.getDay() + 6) % 7);
	        // set the label of the current day
	        x.dayName[j].push(weekArr[(x.date.getDay() + 6) % 7]);
	      }
	    }
	    l += 1;
	    return calLib;
	  });
	}

	var renderYear = function renderTheFullYear(_ref) {
	  var titleElemSup = _ref.titleElemSup;
	  var contentElemSup = _ref.contentElemSup;

	  // shorthands
	  var prevYear = calLib[count - 1];
	  var curYear = calLib[count];
	  var nextYear = calLib[count + 1];

	  // check for leap year
	  if (curYear.year % 4 === 0 && curYear.year % 100 !== 0 || curYear.year % 400 === 0) {
	    dayInMonthArray[1] = 29;
	  } else {
	    dayInMonthArray[1] = 28;
	  }

	  // reset iterators
	  j = 0;

	  // append the year to the title bar
	  $(titleElemSup).append(curYear.year);

	  // append the months
	  monthArr.map(function (x) {
	    // append the months name and prepare the dom for the rest
	    $(contentElemSup).append('

' + x + '

');

	    // append the day shorthand to the calendar
	    weekArrSrt.map(function (y) {
	      $('.dayLabels').eq(j + 1).append('
' + y + '
');
	      return weekArrSrt;
	    });

	    // append the date to the calendar
	    for (i = 0; i < 42; i += 1) {
	      var digit = 0;
	      switch (true) {
	        // day overflow
	        case i > dayInMonthArray[j] - 1 + curYear.day[j][0]:
	          if (j === 11) {
	            digit = nextYear.days[0][i - dayInMonthArray[0]] - curYear.day[j][0];
	          } else {
	            digit = curYear.days[j][i - dayInMonthArray[j]] - curYear.day[j][0];
	          }
	          break;
	        // not on monday
	        case curYear.day[j][0] > i:
	          if (j === 0) {
	            digit = prevYear.days[11][dayInMonthArray[11] - (curYear.day[j][0] - i)];
	          } else {
	            digit = curYear.days[j - 1][dayInMonthArray[j - 1] - (curYear.day[j][0] - i)];
	          }
	          break;
	        default:
	          digit = i - curYear.day[j][0] + 1;
	      }
	      $('.dayDigits').eq(j + 1).append('
' + digit + '
');
	    }

	    j += 1;
	    return monthArr;
	  });
	};

	var renderFancy = function renderCalAndDetails() {};
	var renderMonth = function renderMonthDetailedView(_ref2) {
	  var first = _ref2.titleElemSup;
	  var second = _ref2.contentElemSup;

	  var curYear = calLib[count];

	  // render month title
	  $(first).append(monthArr[mCount]);

	  i = 1;
	  // append global blueprint
	  curYear.dayName[mCount].map(function (x) {
	    $(second).append('

' + x + '

' + i + '

');
	    i += 1;
	    return curYear.dayName[mCount];
	  });
	  console.log(curYear);
	};
	var renderWeek = function renderWeekDetailedView() {};
	var renderDay = function renderDayDetailedView() {};

	// counter management
	var countUp = function setYearCounterUp() {
	  // check view mode selected
	  switch (mode) {
	    case 0:
	      count += 1;
	      break;
	    case 1:
	      fCount += 1;
	      break;
	    case 2:
	      if (mCount === 11) {
	        count += 1;
	        mCount = 0;
	      } else {
	        mCount += 1;
	      }
	      break;
	    case 3:
	      wCount += 1;
	      break;
	    default:
	      dCount += 1;
	  }
	};
	var countDown = function setYearCounterDown() {
	  // check view mode selected
	  switch (mode) {
	    case 0:
	      count -= 1;
	      break;
	    case 1:
	      fCount -= 1;
	      break;
	    case 2:
	      if (mCount === 0) {
	        count -= 1;
	        mCount = 11;
	      } else {
	        mCount -= 1;
	      }
	      break;
	    case 3:
	      wCount -= 1;
	      break;
	    default:
	      dCount -= 1;
	  }
	};

	var build = function initTheCalAndRender(first, second) {
	  clear($(first).dom());
	  clear($(second).dom());

	  // check view mode selected
	  switch (mode) {
	    case 0:
	      renderYear({ titleElemSup: first, contentElemSup: second });
	      break;
	    case 1:
	      renderFancy({ titleElemSup: first, contentElemSup: second });
	      break;
	    case 2:
	      renderMonth({ titleElemSup: first, contentElemSup: second });
	      break;
	    case 3:
	      renderWeek({ titleElemSup: first, contentElemSup: second });
	      break;
	    default:
	      renderDay({ titleElemSup: first, contentElemSup: second });
	  }
	};

	var initBase = function setUpBaseView() {
	  calInit(80);
	  build('#macroContent', '#microContent');
	};

	$('#fancyButton').listen('click', function () {
	  mode = 1;build('#macroContent', '#microContent');
	});
	$('#yearButton').listen('click', function () {
	  mode = 0;build('#macroContent', '#microContent');
	});
	$('#monthButton').listen('click', function () {
	  mode = 2;build('#macroContent', '#microContent');
	});
	$('#weekButton').listen('click', function () {
	  mode = 3;build('#macroContent', '#microContent');
	});
	$('#dayButton').listen('click', function () {
	  mode = 4;build('#macroContent', '#microContent');
	});

	$('#next').listen('click', function () {
	  countUp();
	  build('#macroContent', '#microContent');
	});
	$('#prev').listen('click', function () {
	  countDown();
	  build('#macroContent', '#microContent');
	});

	initBase();

	// const test = new Date(2016, 1, 1);
	// console.log(test);

/***/ }
/******/ ]);


text:
function extract_cnn_features(video_names,param)

% create cache folders
cdirs={'cnn_features_app','cnn_features_app/frame_features','cnn_features_app/video_features' ...
    'cnn_features_flow','cnn_features_flow/frame_features','cnn_features_flow/video_features'};
for d=1:length(cdirs)
    dname=sprintf('%s/%s',param.cachepath,cdirs{d});
    if ~exist(dname,'dir'); mkdir(dname) ; end
end

fprintf('\n------ Extract CNN features ------\n')

suf={'app','flow'} ;

for i=1:2 % appearance and flow

    % get folders
    patchesdir = sprintf('%s/patches_%s',param.cachepath,suf{i}) ;
    framefeaturesdir = sprintf('%s/cnn_features_%s/frame_features',param.cachepath,suf{i});
    videofeaturesdir = sprintf('%s/cnn_features_%s/video_features',param.cachepath,suf{i});

    % get list of part patches
    [filelist,outlist]=get_patches_list(patchesdir,framefeaturesdir);

    % get net
    net=param.(sprintf('net_%s',suf{i}));
    if param.use_gpu ; net = vl_simplenn_move(net, 'gpu') ; end % move net on GPU if needed
    bsize=param.batchsize;
    nim=length(filelist);

    % extract CNN features per frame
    for b=1:bsize:nim

        fprintf('%s -- feature extraction: %d\tover %d:\t',suf{i},b,nim);tic;
        im = vl_imreadjpeg(filelist(b:min(b+bsize-1,nim)),'numThreads', param.nbthreads_netinput_loading) ;
        im = cat(4,im{:}) ;
        im = bsxfun(@minus, im, net.normalization.averageImage) ;
        if param.use_gpu ; im = gpuArray(im) ; end
        res=vl_simplenn(net,im);
        fprintf('extract %.2f s\t',toc);tic;
        save_feats(squeeze(res(end-2).x),outlist(b:min(b+bsize-1,nim)),param); % take features after last ReLU
        fprintf('save %.2f s\n',toc)
    end

    % group frame features in their corresponding video
    % features(1).x <--- left hand
    % features(2).x <--- rigth hand
    % features(3).x <--- upper body
    % features(4).x <--- full body
    % features(5).x <--- full image

    parfor vi=1:length(video_names)
        group_cnn_features(framefeaturesdir,videofeaturesdir,video_names{vi});
    end
end

function [filelist,outlist]=get_patches_list(indirname,outdirname)

bodyparts={'left_hand'  'right_hand' 'upper_body' 'full_body' 'full_image'};

images=dir(sprintf('%s/%s/*jpg',indirname,bodyparts{1}));
images = {images.name};
[~,resnames,~]=cellfun(@(x) fileparts(x),images,'UniformOutput',false);
resnames=strcat(resnames,repmat({'.mat'},1,length(images)));

filelist=cell(1,length(bodyparts)*length(images));
outlist=cell(1,length(bodyparts)*length(images));
for i=1:length(bodyparts)
    indirpath=sprintf('%s/%s/',indirname,bodyparts{i});
    destdirpath=sprintf('%s/%s/',outdirname,bodyparts{i});
    if ~exist(destdirpath,'dir'); mkdir(destdirpath) ; end

    pimages=repmat({indirpath},1,length(images));
    qimages=repmat({destdirpath},1,length(images));

    filelist(1,1+(i-1)*length(images):i*length(images)) = strcat(pimages,images);
    outlist(1,1+(i-1)*length(images):i*length(images)) = strcat(qimages,resnames);
end

function save_feats(feats,outlist,param)
assert(length(outlist)==size(feats,2));
if param.use_gpu; feats=gather(feats); end

parfor i=1:length(outlist)
    out=outlist{i};
    features=feats(:,i)';
    parsave(out,features);
end

function parsave(out,features)
save(out,'features');

function group_cnn_features(framefeaturesdir,videofeaturesdir,video_name)
% features(1).x <--- left hand
% features(2).x <--- rigth hand
% features(3).x <--- upper body
% features(4).x <--- full body
% features(5).x <--- full image

% part sub-directories to check
subD={'left_hand'  'right_hand' 'upper_body' 'full_body' 'full_image'};

features = [] ;
for i=1:length(subD)
    dirpath=sprintf('%s/%s',framefeaturesdir,subD{i});
    pathname=sprintf('%s/%s_im*',dirpath,video_name);
    td=dir(pathname) ;
    assert(~isempty(td));
    x=zeros(length(td),4096) ;
    features(i).name=sprintf('CNNf_%s',subD{i}) ;
    for j=1:length(td)
        samplepath=sprintf('%s/%s',dirpath,td(j).name);
        tmp=load(samplepath) ;
        x(j,:)=tmp.features ;
    end
    features(i).x=x;
end
save(sprintf('%s/%s.mat',videofeaturesdir,video_name),'features');