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

namespace OnePieceRenamer
{
    class Program
    {
        static void Main()
        {
            var path = @"S:\One Piece";
            if (!Directory.Exists(path))
                path = Environment.CurrentDirectory;
            var directory = new DirectoryInfo(path);

            var extensions = new HashSet<string>(Properties.Settings.Default.Extensions.Split(';'));
            var extensionsPattern = "\\.(?<ext>" + string.Join("|", extensions) + ")$";
            var patterns = Properties.Settings.Default.Patterns.Split(';').Select(p => new Regex(p + extensionsPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase)).ToArray();
            var validPattern = new Regex(Properties.Settings.Default.ValidPattern + extensionsPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);

            var allFiles = directory.GetFiles().Where(fi => extensions.Contains(fi.Extension.Substring(1))).ToArray();
            var files = allFiles.Where(fi => !validPattern.IsMatch(fi.Name)).ToArray();
            foreach (var file in files)
            {
                var pattern = patterns.Select(p => p.Match(file.Name)).FirstOrDefault(m => m.Success);
                if (pattern != null && CheckGroups(pattern, "episode", "ext"))
                {
                    var newName = "One Piece - " + pattern.Groups["episode"].Value;
                    if (CheckGroups(pattern, "group"))
                        newName += " - " + pattern.Groups["group"].Value;
                    if (CheckGroups(pattern, "hash"))
                        newName += " - " + pattern.Groups["hash"].Value;
                    newName += "." + pattern.Groups["ext"].Value;

                    Console.WriteLine("Renaming {0} to {1}", file.Name, newName);

                    var target = Path.Combine(path, newName);
                    try
                    {
                        file.MoveTo(target);
                    }
                    catch
                    {
                        File.Delete(target);

                        try
                        {
                            file.MoveTo(target);
                        }
                        catch (Exception ex)
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("ERROR: " + ex.Message);
                            Console.ResetColor();
                        }
                    }
                }
                else
                {
                    // TODO: Missing pattern!
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Missing pattern for: " + file.Name);
                    Console.ResetColor();
                }
            }
        }

        private static bool CheckGroups(Match match, params string[] groups)
        {
            return groups.All(g => match.Groups[g].Success && !string.IsNullOrEmpty(match.Groups[g].Value));
        }
    }
}


text:
namespace Littlei {
    export class NavItem {
        public name: string;
        public href: string;
        public newWindow: boolean;

        constructor(name: string = "", href: string = "", newWindow: boolean = false) {
            this.name = name;
            this.href = href;
            this.newWindow = newWindow;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>m_hControlPointEnts | demofile</title>
	<meta name="description" content="Documentation for demofile">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					demofile

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-externals" checked />
							Externals
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					"sendtabletypes"

					m_hControlPointEnts

Interface m_hControlPointEnts

Hierarchy

						m_hControlPointEnts

Index

Properties

000

001

002

003

004

005

006

007

008

009

010

011

012

013

014

015

016

017

018

019

020

021

022

023

024

025

026

027

028

029

030

031

032

033

034

035

036

037

038

039

040

041

042

043

044

045

046

047

048

049

050

051

052

053

054

055

056

057

058

059

060

061

062

Properties

000

000: EntityHandle

Defined in src/sendtabletypes.ts:11503

001

001: EntityHandle

Defined in src/sendtabletypes.ts:11504

002

002: EntityHandle

Defined in src/sendtabletypes.ts:11505

003

003: EntityHandle

Defined in src/sendtabletypes.ts:11506

004

004: EntityHandle

Defined in src/sendtabletypes.ts:11507

005

005: EntityHandle

Defined in src/sendtabletypes.ts:11508

006

006: EntityHandle

Defined in src/sendtabletypes.ts:11509

007

007: EntityHandle

Defined in src/sendtabletypes.ts:11510

008

008: EntityHandle

Defined in src/sendtabletypes.ts:11511

009

009: EntityHandle

Defined in src/sendtabletypes.ts:11512

010

010: EntityHandle

Defined in src/sendtabletypes.ts:11513

011

011: EntityHandle

Defined in src/sendtabletypes.ts:11514

012

012: EntityHandle

Defined in src/sendtabletypes.ts:11515

013

013: EntityHandle

Defined in src/sendtabletypes.ts:11516

014

014: EntityHandle

Defined in src/sendtabletypes.ts:11517

015

015: EntityHandle

Defined in src/sendtabletypes.ts:11518

016

016: EntityHandle

Defined in src/sendtabletypes.ts:11519

017

017: EntityHandle

Defined in src/sendtabletypes.ts:11520

018

018: EntityHandle

Defined in src/sendtabletypes.ts:11521

019

019: EntityHandle

Defined in src/sendtabletypes.ts:11522

020

020: EntityHandle

Defined in src/sendtabletypes.ts:11523

021

021: EntityHandle

Defined in src/sendtabletypes.ts:11524

022

022: EntityHandle

Defined in src/sendtabletypes.ts:11525

023

023: EntityHandle

Defined in src/sendtabletypes.ts:11526

024

024: EntityHandle

Defined in src/sendtabletypes.ts:11527

025

025: EntityHandle

Defined in src/sendtabletypes.ts:11528

026

026: EntityHandle

Defined in src/sendtabletypes.ts:11529

027

027: EntityHandle

Defined in src/sendtabletypes.ts:11530

028

028: EntityHandle

Defined in src/sendtabletypes.ts:11531

029

029: EntityHandle

Defined in src/sendtabletypes.ts:11532

030

030: EntityHandle

Defined in src/sendtabletypes.ts:11533

031

031: EntityHandle

Defined in src/sendtabletypes.ts:11534

032

032: EntityHandle

Defined in src/sendtabletypes.ts:11535

033

033: EntityHandle

Defined in src/sendtabletypes.ts:11536

034

034: EntityHandle

Defined in src/sendtabletypes.ts:11537

035

035: EntityHandle

Defined in src/sendtabletypes.ts:11538

036

036: EntityHandle

Defined in src/sendtabletypes.ts:11539

037

037: EntityHandle

Defined in src/sendtabletypes.ts:11540

038

038: EntityHandle

Defined in src/sendtabletypes.ts:11541

039

039: EntityHandle

Defined in src/sendtabletypes.ts:11542

040

040: EntityHandle

Defined in src/sendtabletypes.ts:11543

041

041: EntityHandle

Defined in src/sendtabletypes.ts:11544

042

042: EntityHandle

Defined in src/sendtabletypes.ts:11545

043

043: EntityHandle

Defined in src/sendtabletypes.ts:11546

044

044: EntityHandle

Defined in src/sendtabletypes.ts:11547

045

045: EntityHandle

Defined in src/sendtabletypes.ts:11548

046

046: EntityHandle

Defined in src/sendtabletypes.ts:11549

047

047: EntityHandle

Defined in src/sendtabletypes.ts:11550

048

048: EntityHandle

Defined in src/sendtabletypes.ts:11551

049

049: EntityHandle

Defined in src/sendtabletypes.ts:11552

050

050: EntityHandle

Defined in src/sendtabletypes.ts:11553

051

051: EntityHandle

Defined in src/sendtabletypes.ts:11554

052

052: EntityHandle

Defined in src/sendtabletypes.ts:11555

053

053: EntityHandle

Defined in src/sendtabletypes.ts:11556

054

054: EntityHandle

Defined in src/sendtabletypes.ts:11557

055

055: EntityHandle

Defined in src/sendtabletypes.ts:11558

056

056: EntityHandle

Defined in src/sendtabletypes.ts:11559

057

057: EntityHandle

Defined in src/sendtabletypes.ts:11560

058

058: EntityHandle

Defined in src/sendtabletypes.ts:11561

059

059: EntityHandle

Defined in src/sendtabletypes.ts:11562

060

060: EntityHandle

Defined in src/sendtabletypes.ts:11563

061

061: EntityHandle

Defined in src/sendtabletypes.ts:11564

062

062: EntityHandle

Defined in src/sendtabletypes.ts:11565

						Globals

						"sendtabletypes"

						m_<wbr>h<wbr>Control<wbr>Point<wbr>Ents

								000

								001

								002

								003

								004

								005

								006

								007

								008

								009

								010

								011

								012

								013

								014

								015

								016

								017

								018

								019

								020

								021

								022

								023

								024

								025

								026

								027

								028

								029

								030

								031

								032

								033

								034

								035

								036

								037

								038

								039

								040

								041

								042

								043

								044

								045

								046

								047

								048

								049

								050

								051

								052

								053

								054

								055

								056

								057

								058

								059

								060

								061

								062

Legend

Object literal

Variable

Function

Function with type parameter

Type alias

Type alias with type parameter

Interface

Interface with type parameter

Property

Class

Class with type parameter

Enumeration

Generated using TypeDoc


text:
class ProjectusersController < ApplicationController

  http_basic_authenticate_with name: "wangyan", password: "wangyan", only: [:destroy, :create]

  def create
    @project = Project.find(params[:project_id])
    @user = @project.projectusers.create(user_params)
    redirect_to project_path(@project)
  end

  def destroy
    @project = Project.find(params[:project_id])
    @user = @project.projectusers.find(params[:id])
    @user.destroy
    redirect_to project_path(@project)
  end

  private
  def user_params
    params.require(:projectuser).permit(:name, :password)
  end

end


text:
package org.apache.hadoop.yarn.api.records.timelineservice;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeSet;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.yarn.util.TimelineServiceHelper;

import com.fasterxml.jackson.annotation.JsonSetter;

/**
 * The basic timeline entity data structure for timeline service v2. Timeline
 * entity objects are not thread safe and should not be accessed concurrently.
 * All collection members will be initialized into empty collections. Two
 * timeline entities are equal iff. their type and id are identical.
 *
 * All non-primitive type, non-collection members will be initialized into null.
 * User should set the type and id of a timeline entity to make it valid (can be
 * checked by using the {@link #isValid()} method). Callers to the getters
 * should perform null checks for non-primitive type, non-collection members.
 *
 * Callers are recommended not to alter the returned collection objects from the
 * getters.
 */
@XmlRootElement(name = "entity")
@XmlAccessorType(XmlAccessType.NONE)
@InterfaceAudience.Public
@InterfaceStability.Unstable
public class TimelineEntity implements Comparable<TimelineEntity> {
  protected final static String SYSTEM_INFO_KEY_PREFIX = "SYSTEM_INFO_";
  public final static long DEFAULT_ENTITY_PREFIX = 0L;

  /**
   * Identifier of timeline entity(entity id + entity type).
   */
  @XmlRootElement(name = "identifier")
  @XmlAccessorType(XmlAccessType.NONE)
  public static class Identifier {
    private String type;
    private String id;

    public Identifier(String type, String id) {
      this.type = type;
      this.id = id;
    }

    public Identifier() {

    }

    @XmlElement(name = "type")
    public String getType() {
      return type;
    }

    public void setType(String entityType) {
      this.type = entityType;
    }

    @XmlElement(name = "id")
    public String getId() {
      return id;
    }

    public void setId(String entityId) {
      this.id = entityId;
    }

    @Override
    public String toString() {
      return "TimelineEntity[" +
          "type='" + type + '\'' +
          ", id='" + id + '\'' + "]";
    }

    @Override
    public int hashCode() {
      final int prime = 31;
      int result = 1;
      result = prime * result + ((id == null) ? 0 : id.hashCode());
      result =
        prime * result + ((type == null) ? 0 : type.hashCode());
      return result;
    }

    @Override
    public boolean equals(Object obj) {
      if (this == obj) {
        return true;
      }
      if (!(obj instanceof Identifier)) {
        return false;
      }
      Identifier other = (Identifier) obj;
      if (id == null) {
        if (other.getId() != null) {
          return false;
        }
      } else if (!id.equals(other.getId())) {
        return false;
      }
      if (type == null) {
        if (other.getType() != null) {
          return false;
        }
      } else if (!type.equals(other.getType())) {
        return false;
      }
      return true;
    }
  }

  private TimelineEntity real;
  private Identifier identifier;
  private HashMap<String, Object> info = new HashMap<>();
  private HashMap<String, String> configs = new HashMap<>();
  private Set<TimelineMetric> metrics = new HashSet<>();
  // events should be sorted by timestamp in descending order
  private NavigableSet<TimelineEvent> events = new TreeSet<>();
  private HashMap<String, Set<String>> isRelatedToEntities = new HashMap<>();
  private HashMap<String, Set<String>> relatesToEntities = new HashMap<>();
  private Long createdTime;
  private long idPrefix;

  public TimelineEntity() {
    identifier = new Identifier();
  }

  /**
   *

   * The constuctor is used to construct a proxy {@link TimelineEntity} or its
   * subclass object from the real entity object that carries information.
   *

   *
   *

   * It is usually used in the case where we want to recover class polymorphism
   * after deserializing the entity from its JSON form.
   *

   * @param entity the real entity that carries information
   */
  public TimelineEntity(TimelineEntity entity) {
    real = entity.getReal();
  }

  protected TimelineEntity(String type) {
    this();
    identifier.type = type;
  }

  @XmlElement(name = "type")
  public String getType() {
    if (real == null) {
      return identifier.type;
    } else {
      return real.getType();
    }
  }

  public void setType(String type) {
    if (real == null) {
      identifier.type = type;
    } else {
      real.setType(type);
    }
  }

  @XmlElement(name = "id")
  public String getId() {
    if (real == null) {
      return identifier.id;
    } else {
      return real.getId();
    }
  }

  public void setId(String id) {
    if (real == null) {
      identifier.id = id;
    } else {
      real.setId(id);
    }
  }

  public Identifier getIdentifier() {
    if (real == null) {
      return identifier;
    } else {
      return real.getIdentifier();
    }
  }

  public void setIdentifier(Identifier entityIdentifier) {
    if (real == null) {
      this.identifier = entityIdentifier;
    } else {
      real.setIdentifier(entityIdentifier);
    }
  }

  // required by JAXB
  @InterfaceAudience.Private
  @XmlElement(name = "info")
  public HashMap<String, Object> getInfoJAXB() {
    if (real == null) {
      return info;
    } else {
      return real.getInfoJAXB();
    }
  }

  public Map<String, Object> getInfo() {
    if (real == null) {
      return info;
    } else {
      return real.getInfo();
    }
  }

  public void setInfo(Map<String, Object> entityInfos) {
    if (real == null) {
      this.info = TimelineServiceHelper.mapCastToHashMap(entityInfos);
    } else {
      real.setInfo(entityInfos);
    }
  }

  public void addInfo(Map<String, Object> entityInfos) {
    if (real == null) {
      this.info.putAll(entityInfos);
    } else {
      real.addInfo(entityInfos);
    }
  }

  public void addInfo(String key, Object value) {
    if (real == null) {
      info.put(key, value);
    } else {
      real.addInfo(key, value);
    }
  }

  // required by JAXB
  @InterfaceAudience.Private
  @XmlElement(name = "configs")
  public HashMap<String, String> getConfigsJAXB() {
    if (real == null) {
      return configs;
    } else {
      return real.getConfigsJAXB();
    }
  }

  public Map<String, String> getConfigs() {
    if (real == null) {
      return configs;
    } else {
      return real.getConfigs();
    }
  }

  public void setConfigs(Map<String, String> entityConfigs) {
    if (real == null) {
      this.configs = TimelineServiceHelper.mapCastToHashMap(entityConfigs);
    } else {
      real.setConfigs(entityConfigs);
    }
  }

  public void addConfigs(Map<String, String> entityConfigs) {
    if (real == null) {
      this.configs.putAll(entityConfigs);
    } else {
      real.addConfigs(entityConfigs);
    }
  }

  public void addConfig(String key, String value) {
    if (real == null) {
      configs.put(key, value);
    } else {
      real.addConfig(key, value);
    }
  }

  @XmlElement(name = "metrics")
  public Set<TimelineMetric> getMetrics() {
    if (real == null) {
      return metrics;
    } else {
      return real.getMetrics();
    }
  }

  public void setMetrics(Set<TimelineMetric> entityMetrics) {
    if (real == null) {
      this.metrics = entityMetrics;
    } else {
      real.setMetrics(entityMetrics);
    }
  }

  public void addMetrics(Set<TimelineMetric> entityMetrics) {
    if (real == null) {
      this.metrics.addAll(entityMetrics);
    } else {
      real.addMetrics(entityMetrics);
    }
  }

  public void addMetric(TimelineMetric metric) {
    if (real == null) {
      metrics.add(metric);
    } else {
      real.addMetric(metric);
    }
  }

  @XmlElement(name = "events")
  public NavigableSet<TimelineEvent> getEvents() {
    if (real == null) {
      return events;
    } else {
      return real.getEvents();
    }
  }

  public void setEvents(NavigableSet<TimelineEvent> entityEvents) {
    if (real == null) {
      this.events = entityEvents;
    } else {
      real.setEvents(entityEvents);
    }
  }

  public void addEvents(Set<TimelineEvent> entityEvents) {
    if (real == null) {
      this.events.addAll(entityEvents);
    } else {
      real.addEvents(entityEvents);
    }
  }

  public void addEvent(TimelineEvent event) {
    if (real == null) {
      events.add(event);
    } else {
      real.addEvent(event);
    }
  }

  public Map<String, Set<String>> getIsRelatedToEntities() {
    if (real == null) {
      return isRelatedToEntities;
    } else {
      return real.getIsRelatedToEntities();
    }
  }

  // required by JAXB
  @InterfaceAudience.Private
  @XmlElement(name = "isrelatedto")
  public HashMap<String, Set<String>> getIsRelatedToEntitiesJAXB() {
    if (real == null) {
      return isRelatedToEntities;
    } else {
      return real.getIsRelatedToEntitiesJAXB();
    }
  }

  @JsonSetter("isrelatedto")
  public void setIsRelatedToEntities(
      Map<String, Set<String>> isRelatedTo) {
    if (real == null) {
      this.isRelatedToEntities =
          TimelineServiceHelper.mapCastToHashMap(isRelatedTo);
    } else {
      real.setIsRelatedToEntities(isRelatedTo);
    }
  }

  public void addIsRelatedToEntities(
      Map<String, Set<String>> isRelatedTo) {
    if (real == null) {
      for (Map.Entry<String, Set<String>> entry : isRelatedTo.entrySet()) {
        Set<String> ids = this.isRelatedToEntities.get(entry.getKey());
        if (ids == null) {
          ids = new HashSet<>();
          this.isRelatedToEntities.put(entry.getKey(), ids);
        }
        ids.addAll(entry.getValue());
      }
    } else {
      real.addIsRelatedToEntities(isRelatedTo);
    }
  }

  public void addIsRelatedToEntity(String type, String id) {
    if (real == null) {
      Set<String> ids = isRelatedToEntities.get(type);
      if (ids == null) {
        ids = new HashSet<>();
        isRelatedToEntities.put(type, ids);
      }
      ids.add(id);
    } else {
      real.addIsRelatedToEntity(type, id);
    }
  }

  // required by JAXB
  @InterfaceAudience.Private
  @XmlElement(name = "relatesto")
  public HashMap<String, Set<String>> getRelatesToEntitiesJAXB() {
    if (real == null) {
      return relatesToEntities;
    } else {
      return real.getRelatesToEntitiesJAXB();
    }
  }

  public Map<String, Set<String>> getRelatesToEntities() {
    if (real == null) {
      return relatesToEntities;
    } else {
      return real.getRelatesToEntities();
    }
  }

  public void addRelatesToEntities(Map<String, Set<String>> relatesTo) {
    if (real == null) {
      for (Map.Entry<String, Set<String>> entry : relatesTo.entrySet()) {
        Set<String> ids = this.relatesToEntities.get(entry.getKey());
        if (ids == null) {
          ids = new HashSet<>();
          this.relatesToEntities.put(entry.getKey(), ids);
        }
        ids.addAll(entry.getValue());
      }
    } else {
      real.addRelatesToEntities(relatesTo);
    }
  }

  public void addRelatesToEntity(String type, String id) {
    if (real == null) {
      Set<String> ids = relatesToEntities.get(type);
      if (ids == null) {
        ids = new HashSet<>();
        relatesToEntities.put(type, ids);
      }
      ids.add(id);
    } else {
      real.addRelatesToEntity(type, id);
    }
  }

  @JsonSetter("relatesto")
  public void setRelatesToEntities(Map<String, Set<String>> relatesTo) {
    if (real == null) {
      this.relatesToEntities =
          TimelineServiceHelper.mapCastToHashMap(relatesTo);
    } else {
      real.setRelatesToEntities(relatesTo);
    }
  }

  @XmlElement(name = "createdtime")
  public Long getCreatedTime() {
    if (real == null) {
      return createdTime;
    } else {
      return real.getCreatedTime();
    }
  }

  @JsonSetter("createdtime")
  public void setCreatedTime(Long createdTs) {
    if (real == null) {
      this.createdTime = createdTs;
    } else {
      real.setCreatedTime(createdTs);
    }
  }

  /**
   * Set UID in info which will be then used for query by UI.
   * @param uidKey key for UID in info.
   * @param uId UID to be set for the key.
   */
  public void setUID(String uidKey, String uId) {
    if (real == null) {
      info.put(uidKey, uId);
    } else {
      real.addInfo(uidKey, uId);
    }
  }

  public boolean isValid() {
    return (getId() != null && getType() != null);
  }

  // When get hashCode for a timeline entity, or check if two timeline entities
  // are equal, we only compare their identifiers (id and type)
  @Override
  public int hashCode() {
    return getIdentifier().hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof TimelineEntity)) {
      return false;
    }
    TimelineEntity other = (TimelineEntity) obj;
    return getIdentifier().equals(other.getIdentifier());
  }

  @Override
  public int compareTo(TimelineEntity other) {
    int comparison = getType().compareTo(other.getType());
    if (comparison == 0) {
      if (getIdPrefix() > other.getIdPrefix()) {
        // Descending order by entity id prefix
        return -1;
      } else if (getIdPrefix() < other.getIdPrefix()) {
        return 1;
      } else {
        return getId().compareTo(other.getId());
      }
    } else {
      return comparison;
    }
  }

  protected TimelineEntity getReal() {
    return real == null ? this : real;
  }

  public String toString() {
    if (real == null) {
      return identifier.toString();
    } else {
      return real.toString();
    }
  }

  @XmlElement(name = "idprefix")
  public long getIdPrefix() {
    if (real == null) {
      return idPrefix;
    } else {
      return real.getIdPrefix();
    }
  }

  /**
   * Sets idPrefix for an entity.
   *

   * Note: Entities will be stored in the order of idPrefix specified.
   * If users decide to set idPrefix for an entity, they MUST provide
   * the same prefix for every update of this entity.
   *

   * Example:

   * TimelineEntity entity = new TimelineEntity();
   * entity.setIdPrefix(value);
   *

   * Users can use {@link TimelineServiceHelper#invertLong(long)} to invert
   * the prefix if necessary.
   *
   * @param entityIdPrefix prefix for an entity.
   */
  @JsonSetter("idprefix")
  public void setIdPrefix(long entityIdPrefix) {
    if (real == null) {
      this.idPrefix = entityIdPrefix;
    } else {
      real.setIdPrefix(entityIdPrefix);
    }
  }
}


text:
package org.openspaces.grid.esm;

import net.jini.id.Uuid;

/**
 * @author Niv Ingberg
 * @since 9.7.0
 */
public class SecuredESMProxy extends ESMProxy {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a ESM proxy, returning an instance that implements
     * RemoteMethodControl if the server does too.
     *
     * @param monitor The ESM server
     * @param id The Uuid of the ESM
     */
    public static SecuredESMProxy getInstance(ESM monitor, Uuid id) {
        return (new SecuredESMProxy(monitor, id));
    }

    /**
     * @param monitor The ESM server
     * @param id The Uuid of the ESM
     */
    private SecuredESMProxy(ESM monitor, Uuid id) {
        super(monitor, id);
    }

    @Override
    protected boolean isSecuredProxy() {
        return true;
    }
}


text:
#pragma once
#ifndef ZORBA_ISO_2788_H
#define ZORBA_ISO_2788_H

#include <cstdlib>                      /* for abs(3) */
#include <iostream>

#include <zorba/util/locale.h>

namespace zorba {

///////////////////////////////////////////////////////////////////////////////

/**
 * ISO 2788: Guidelines for the establishment and development of monolingual
 * thesauri.
 *
 * ANSI/NISO Z39.19-2005: Guidelines for the Construction, Format, and
 * Management of Monolingual Controlled Vocabularies.
 */
namespace iso2788 {

  /////////////////////////////////////////////////////////////////////////////

  /**
   * Relationship abbreviations from ISO 2788 section 4.1 and ANSI Z39.19-2005
   * section 4.2.  Note: we do not implement "HN" (History Note) or "X SN" (See
   * Scope Note for...).
   */
  enum rel_type {
    unknown,
    BT,   ///< Broader Term
    BTG,  ///< Broader Term (generic)
    BTI,  ///< Broader Term (instance)
    BTP,  ///< Broader Term (partitive)
    NT,   ///< Narrower Term
    NTG,  ///< Narrower Term (generic)
    NTI,  ///< Narrower Term (instance)
    NTP,  ///< Narrower Term (partitive)
    RT,   ///< Related Term
    SN,   ///< Scope Note
    TT,   ///< Top Term
    UF,   ///< Non-preferred Term
    USE,  ///< Preferred Term
  };
  extern char const *const string_of[];

  inline std::ostream& operator<<( std::ostream &o, rel_type t ) {
    return o << string_of[ t ];
  }

  /**
   * Attempts to find the ISO-2788 relationship corresponding to the given
   * string.
   *
   * @param relationship The relationship to find.  It must be lower-case.
   * @param lang The language of the relationship.
   * @return Returns the corresponding relationship or \c unknown.
   */
  rel_type find_rel( char const *relationship,
                     locale::iso639_1::type lang = locale::iso639_1::unknown );

  /**
   * Attempts to find the ISO-2788 relationship corresponding to the given
   * string.
   *
   * @tparam The string type.
   * @param relationship The relationship to find.  It must be lower-case.
   * @param lang The language of the relationship.
   * @return Returns the corresponding relationship or \c unknown.
   */
  template<class StringType> inline
  rel_type find_rel( StringType const &relationship,
                     locale::iso639_1::type lang = locale::iso639_1::unknown ) {
    return find_rel( relationship.c_str(), lang );
  }

  /////////////////////////////////////////////////////////////////////////////

  /**
   * We bestow a "direction" attribute onto every relationship, one of -1, 0,
   * or +1 for a relationship that leads to a narrower, neutral, or broader
   * term, respectively.
   */
  enum rel_dir {
    narrower = -1,
    neutral,
    broader
  };

  /**
   * Checks whether two relationship directions are "congruous", i.e., they do
   * not point in opposite directions.
   *
   * @param a The first direction.
   * @param b The second direction.
   * @return Returns \c true only if the two directions are congruous.
   */
  inline bool congruous( rel_dir a, rel_dir b ) {
    //
    // Congruity of two directions is defined by this table:
    //
    //    a  b result
    //   -- -- ------
    //    0  0  T
    //    0  1  T
    //    1  0  T
    //    1  1  T
    //    0 -1  T
    //   -1  0  T
    //   -1 -1  T
    //    1 -1  F
    //   -1  1  F
    //
    return std::abs( a - b ) <= 1;
  }

  /**
   * Gets the "direction" of a relationship, i.e., whether a relationship leads
   * to a narrower, neutral, or broader term.
   *
   * @param rel_type The relationship type to get the direction of.
   * @return Returns \c narrower, \c neutral, or \c broader, respectively.
   */
  rel_dir get_dir( rel_type t );

  /**
   * Adds two relationship "directions".
   *
   * @param a The first direction.
   * @param b The second direction.
   * @return Returns the "sum" of the two directions.
   */
  inline rel_dir operator+( rel_dir a, rel_dir b ) {
    //
    // Addition of two directions is defined by this table:
    //
    //    a  b result
    //   -- -- ------
    //    0  0  0
    //    0  1  1
    //    1  0  1
    //    1  1  1
    //    0 -1 -1
    //   -1  0 -1
    //   -1 -1 -1
    //    1 -1 ERROR
    //   -1  1 ERROR
    //
    return a ? a : b;
  }

  /////////////////////////////////////////////////////////////////////////////

} // namespace iso2788
} // namespace zorba
#endif  /* ZORBA_ISO_2788_H */
/* vim:set et sw=2 ts=2: */


text:
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;

namespace SuperfastBlur.BlurTester
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Please provide an image file name as an argument");
                return;
            }

            var fileName = args[0];
            if (!File.Exists(fileName))
            {
                Console.WriteLine($"File {fileName} does not exist");
                return;
            }

            var image = Image.FromFile(fileName);
            var blur = new GaussianBlur(image as Bitmap);

            var sw = Stopwatch.StartNew();
            var result = blur.Process(10);
            Console.WriteLine($"Finished in: {sw.ElapsedMilliseconds}ms");
            result.Save("blur.jpg", ImageFormat.Jpeg);
            result.Save("blur.png", ImageFormat.Png);
        }
    }
}


text:
package com.twu.biblioteca.options;

import com.twu.biblioteca.libstores.AllLibraryStores;
import com.twu.biblioteca.MovieNameComparator;
import com.twu.biblioteca.UserAccountManager;

/**
 * Created by aloysiusang on 16/6/15.
 */
public class ReturnMovieOption extends MainMenuOption {
    private static final String INPUT_TITLE = "Please enter the name of the movie you wish to return: ";
    private static final String MESSAGE_RETURN_SUCCESSFUL = "Thank you for returning the movie.";
    private static final String MESSAGE_RETURN_UNSUCCESSFUL = "That is not a valid movie to return.";

    public ReturnMovieOption() {
        super("Return a movie");
    }

    @Override
    public String execute(UserAccountManager userAccountManager, AllLibraryStores libraryStores) {
        System.out.println(INPUT_TITLE);
        String name = getUserInput();
        boolean success = libraryStores.getMovieStore().returnResource(userAccountManager.getCurrentUser(), name, new MovieNameComparator());
        return success ? MESSAGE_RETURN_SUCCESSFUL : MESSAGE_RETURN_UNSUCCESSFUL;
    }
}


text:
**Note:** expect periodic breaking changes since we're following the development of the material-sprint branch of wsk.

____

This is an ember-cli addon containing a collection of [ember js](http://emberjs.com/)
components wrapping/adapting the vanilla javascript that powers the material
design elements included in the future release of Google's
[Web Starter Kit](https://github.com/google/web-starter-kit/).

The aim if this project is to keep compatibility with the default WSK,
if you need something more emberish have a look at [ember-paper](https://github.com/miguelcobain/ember-paper).

## Current version
v0.1.0 - Initial version
  * button, card, column-layout, item, shadow elements
  * ripple and shadow mixins
  * extra: animated hamburger icon.

## Installation
From the root fo your ember-cli project do:

    npm install ember-material --save-dev

## Usage

### wsk-button
- Properties (can be mixed)
  - `action`    (default: null)   : Default to trigger on button press
  - `raised`    (default: false)  : raised button, false creates a flat button
  - `colored`   (default: false)  : apply default color styles
  - `ripple`    (default: false)  : enable ripple effect
  - `fav`       (default: false)  : create a FAV button (do not mix with `icon`)
  - `icon`      (default: false)  : create icon button (do not mix with `fav`)

Example:

    {{#wsk-button action="someAction"

      ripple=true
      colored=true
      raised=true

    }} Button text {{/wsk-button}}

### wsk-column-layout

Example:

    {{#wsk-column-layout}}

        ...

        ...

        ...

    {{/wsk-column-layout}}

### wsk-card

Example:

    {{#material-card}}

      {{#material-card-image}}

      {{/material-card-image}}

      {{#material-card-heading}}
        stuff
      {{/material-card-heading}}

      {{#material-card-caption}}
        more stuff
      {{/material-card-caption}}

      {{#material-card-lower}}
        lots of stuff
      {{/material-card-lower}}

      {{#material-card-bottom}}
        some action
      {{/material-card-bottom}}

    {{/material-card}}

### wsk-item

- Properties
  - `ripple`    (default: false)  : enable ripple effect

Example:
    {{#wsk-item ripple=true}} item text {{/wsk-item}}

### wsk-shadow

- Properties
  - `zPosition`    (default: 1)   : element depth for shadowing

Example:

    {{#wsk-shadow zPosition=2}}

Some stuff

    {{/wsk-shadow}}

####More to come soon ...

----

## Contributing

If you want to contribute, well ... thank you!

Issues and PR's are welcome, the information below will be useful to you:

### Development setup

#### Requirements

*Node js
*Bower
*node-sass-cli (globally for scripting)

*NOTE: for now, you need to install node-sass-cli for the wsk styles, I hope I
find a better way to build these soon

* `git clone` this repository
* `npm install`
* `bower install`

### Refresh the stylesheets

    ./scripts/build-wsk-styles.sh

### Running Tests

* `ember test`
* `ember test --server`

### Building

* `ember build`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).


text:
package mujava.cli;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import com.sun.tools.classfile.Opcode.Set;
 /**
 * <p>
 * Description: The Class doRandomGivenPercentMutants.
 * Overview: This class is used to get random mutants, given a percentage
 * </p>
 *
 * @author Lin Deng
 * @version 1.0  $Date: 06/10/2014 $
  */

public class doRandomGivenPercentMutants {

	/**
	 * The main method.
	 *
	 * @param args
	 *            the arguments
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 */
	public static void main(String[] args) throws IOException {
		// need result file name
//		String[] argv = { "/Users/dmark/COVDLsExpCopy/Triangle/result_list_2014_7_22_11_13_35.csv", "100", "10",
//				"/Users/dmark/COVDLsExpCopy/Triangle/result/" };
		String path = args[0];
		double percent = Double.valueOf(args[1])/100.0;
		int numOfRandom = Integer.valueOf(args[2]);
		if (numOfRandom < 1) {
			System.out.println("need more random times");
			return;
		}

		String resultPath = args[3];

		ArrayList<String> targets = new ArrayList<>();
		//targets.add("VDL");

		// read in file into data structure
		HashMap<String, ArrayList<String>> result = readResultsFromFile(path);
		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// randomly get N adequate test set
		ArrayList<ArrayList<String>> randomedTestSet = new ArrayList<>();
		for(int i = 0; i < numOfRandom; i++)
		{
			// need a fltered map based on target
			HashMap<String, ArrayList<String>> filtered_data = getRandomMutants(result, percent);

			randomedTestSet.add(getAdequateTestSets4(filtered_data, testNames));
		}

		// calculate each one with mutation score
		ArrayList<Pair> mutationScores = getMutationScores(randomedTestSet, path);
		double totalMS = 0.0;
		for (Pair ms : mutationScores)
		{
			System.out.println(ms.testSet + ": " + ms.mutationScore);
			totalMS=totalMS+ms.mutationScore;
		}
		double avgMS = totalMS / mutationScores.size();
		System.out.println("avg: " + avgMS);
		// write files
		writeResultToFiles(mutationScores, resultPath, Double.toString(percent));

	}

	private static void writeResultToFiles(ArrayList<Pair> mutationScores, String resultPath, String percent)
			throws UnsupportedEncodingException, IOException {

		resultPath=resultPath+"ResultOfRandomPercent_"+percent+".txt";
		// set the output file
		File file = new File(resultPath);

		FileOutputStream fout = new FileOutputStream(file);
		StringBuffer fileContent = new StringBuffer();

		double totalMS = 0.0;
		for (Pair pair : mutationScores) {
			totalMS = totalMS + pair.mutationScore;
			fileContent.append(pair.testSet + ": " + pair.mutationScore);
			fileContent.append("\r\n");
		}
		double avgMS = totalMS / mutationScores.size();
		fileContent.append("Avg: " + avgMS);
		fout.write(fileContent.toString().getBytes("utf-8"));
		fout.close();

	}

	/**
	 * Gets the filtered data based on random percentage.
	 *
	 * @param result
	 *            the result
	 * @param percent
	 *            the random percentage
	 * @return the filtered data based on percentage
	 */
	private static HashMap<String, ArrayList<String>> getRandomMutants(
			HashMap<String, ArrayList<String>> result, double percent) {
		HashMap<String, ArrayList<String>> filtered_data = new HashMap<String, ArrayList<String>>();

		// calculate how many mutants needed
		int numOfTotalMutants = result.size() - 1;
		int numOfRandomMutants = (int) (numOfTotalMutants * percent+0.5);
		// put all keys into a list
		List<String> keysList = new ArrayList<String>(result.keySet());

		while (filtered_data.size()<numOfRandomMutants) // randomly fill in the data
		{
			SecureRandom secureRandom = new SecureRandom();
			String randomKey = keysList.get(secureRandom.nextInt(keysList.size()));
			if (!randomKey.equals("Mutant") && !filtered_data.keySet().contains(randomKey))
			{// if not the top title line, not already added into result, then add it
				filtered_data.put(randomKey, result.get(randomKey));
			}
		}

		return filtered_data;
	}

	/**
	 * Read results from file. Note: This result include the fist title line.
	 * e.g. {VDL_3=[, 1, 1, 1, 2], Mutant=[test4, test1, test2, test3, Total,
	 * Equiv?], VDL_4=[1, 1, 1, , 3, y], VDL_5=[1, , 1, , 2]}
	 *
	 * @param path
	 *            the path
	 * @return the hash map
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 */
	private static HashMap<String, ArrayList<String>> readResultsFromFile(String path) throws IOException {
		// read the file
		File f = new File(path);
		if (!f.exists()) {
			System.out.println("Can't find file at: " + path);
			return null;
		}
		// read in file into data structure
		HashMap<String, ArrayList<String>> result = new HashMap<>();

		String s = null;
		StringBuffer sb = new StringBuffer();
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
		while ((s = br.readLine()) != null) {
			// split line
			List<String> tests = Arrays.asList(s.split(",\\s*"));
			// System.out.println(tests.get(1));
			ArrayList<String> list = new ArrayList<>();
			for (int i = 1; i < tests.size(); i++) {
				list.add(tests.get(i));
			}
			result.put(tests.get(0), list);
		}

		return result;
	}

	/**
	 * Gets the mutation scores.
	 *
	 * @param randomedTestSet
	 *            the randomed test set
	 * @param path
	 * @return the mutation scores
	 * @throws IOException
	 */
	private static ArrayList<Pair> getMutationScores(ArrayList<ArrayList<String>> randomedTestSet, String path)
			throws IOException {

		// read in file into data structure, this result includes title line
		HashMap<String, ArrayList<String>> result = readResultsFromFile(path);

		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// build result with names, i.e. VDL_3=[test1, test2, test3],
		// VDL_4=[test4, test1, test2], VDL_5=[test4, test2]
		HashMap<String, ArrayList<String>> resultWithTestNames = getResultsWithNames(result);

		// calculate
		// get total number
		int totalNumOfMutants = resultWithTestNames.size();

		// get equiv number
		int numOfEq = 0;
		for (Object key : result.keySet()) {
			if (result.get(key).contains("y") || result.get(key).contains("Y")) // has
																				// an
																				// equiv
			{
				numOfEq++;
			}
		}

		ArrayList<Pair> mutationScores = new ArrayList<>();
		// get killed number
		// for each test test set, calculate how many killed mutants
		for (ArrayList<String> tests : randomedTestSet) {
			int numOfKilledMutants = 0;
			for (Object key : resultWithTestNames.keySet()) // for each mutant
			{
				for (String test : tests) // for each test in current test set
				{
					if (resultWithTestNames.get(key).contains(test)) // current
																		// test
																		// kills
																		// current
																		// mutant
					{
						numOfKilledMutants++;
						break; // directly go to the next mutant
					}
				}
			}

			// save mutation score
			double ms = (double)numOfKilledMutants / (double)(totalNumOfMutants - numOfEq);
			mutationScores.add(new Pair(tests, ms));
		}

		return mutationScores;
	}

	private static HashMap<String, ArrayList<String>> getResultsWithNames(HashMap<String, ArrayList<String>> result) {
		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// build result with names
		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		for (Object key : result.keySet()) {
			ArrayList<String> temp = result.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1") && !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));
					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			if (!key.toString().equals("Mutant"))
				resultWithTestNames.put(key.toString(), testStrings);
		}
		return resultWithTestNames;
	}

	/**
	 * Gets the randomed test set.
	 *
	 * @param adequateTestSet
	 *            the adequate test set
	 * @param numOfRandom
	 *            the num of random
	 * @return the randomed test set
	 */
	private static ArrayList<ArrayList<String>> getRandomedTestSet(CopyOnWriteArrayList<ArrayList<String>> adequateTestSet,
			int numOfRandom) {
		ArrayList<ArrayList<String>> result = new ArrayList<>();

		for (int i = 0; i < numOfRandom; i++) // random N times
		{
			SecureRandom random = new SecureRandom();
			ArrayList<String> randomTest = adequateTestSet.get(random.nextInt(adequateTestSet.size()));
			result.add(randomTest);
		}
		return result;
	}

	/**
	 * Gets the adequate test sets.
	 *
	 * @param filtered_data
	 *            the filtered_data
	 * @param testNames
	 *            the test names
	 * @return the adequate test sets
	 */

	public static CopyOnWriteArrayList<ArrayList<String>> getAdequateTestSets(HashMap<String, ArrayList<String>> filtered_data,
			ArrayList<String> testNames) {
		CopyOnWriteArrayList<ArrayList<String>> testSets = new CopyOnWriteArrayList<ArrayList<String>>();
		// ArrayList<String> tt = new ArrayList<>();
		// tt.add("a");
		// testSets.add(tt);

		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		for (Object key : filtered_data.keySet()) {
			ArrayList<String> temp = filtered_data.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1")&& !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));
					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			resultWithTestNames.put(key.toString(), testStrings);
		}

		// check if there is an equivalent
		int numOfEq = 0;
		int numOfTotalMutants = filtered_data.size();

		// filtered_data has y, need to count y for equiv
		for (Object key : filtered_data.keySet()) {
			if (filtered_data.get(key).contains("y") || filtered_data.get(key).contains("Y")) // has
																								// an
																								// equiv
			{
				numOfEq++;
			}
		}
		// for (Object key : resultWithTestNames.keySet()) {
		// if(resultWithTestNames.get(key).size()==0)
		// numOfEq ++;
		// }

		int non_equiv = numOfTotalMutants - numOfEq;
		// for (Object key : resultStat.keySet()) {
		// if (resultStat.get(key)==non_equiv) // find a single test can kill
		// all
		// {
		// ArrayList<String> t = new ArrayList<>();
		// t.add(key.toString());
		// testSets.add(t);
		// }
		// }
		// testSets= new ArrayList<ArrayList<String>>();
		for (Object key : resultWithTestNames.keySet()) {
			ArrayList<String> line = resultWithTestNames.get(key);
			if (line.size() == 0) // equiv mutant, go next one
				continue;
			if (testSets.size() == 0) { // first time, initiate new sets

				for (String str : line) {
					ArrayList<String> t = new ArrayList<>();
					t.add(str);
					testSets.add(t);
					System.out.println("add test "+t);
				}

			} else { // not the first time, need to extend everyone, and add
						// back
				// load last line's tests
				ArrayList<ArrayList<String>> temp = new ArrayList<>();
				for (ArrayList<String> tests : testSets)
					temp.add(tests);
				// empty the result set
				// ArrayList<ArrayList<String>> tempTestSets = new
				// ArrayList<>();
				testSets = new CopyOnWriteArrayList<>();
				// add and save back
				for (String str : line) {
					for (ArrayList<String> tests : temp) {
						ArrayList<String> t = new ArrayList<>();
						t.addAll(tests);
						t.add(str);
						testSets.add(t);
						System.out.println("add test "+t);
					}
				}

				// testSets = new ArrayList<>();
				// testSets.addAll(tempTestSets);
			}

		}

		testSets = removeDuplicate(testSets);
		testSets = getMinimalTests(testSets);
		// System.out.println(non_equiv);
		return testSets;
	}

	/**
	 * Gets the minimal tests.
	 *
	 * @param testSets
	 *            the test sets
	 * @return the minimal tests
	 */
	private static CopyOnWriteArrayList<ArrayList<String>> getMinimalTests(CopyOnWriteArrayList<ArrayList<String>> testSets) {
		CopyOnWriteArrayList<ArrayList<String>> result = new CopyOnWriteArrayList<>();
		List<ArrayList<String>> testSets2 = new CopyOnWriteArrayList<ArrayList<String>>();
		List<ArrayList<String>> testSets3 = new CopyOnWriteArrayList<ArrayList<String>>();
		testSets2.addAll(testSets);
		testSets3.addAll(testSets);
		for (ArrayList<String> test : testSets3) {
			for (ArrayList<String> test2 : testSets2) {
				if (test.containsAll(test2) && !test2.containsAll(test)) {
					testSets.remove(test);
					testSets2.remove(test);
					testSets3.remove(test);
					System.out.println("remove test "+test);
					break;
				}
			}
		}
		result.addAll(testSets);
		return result;
	}

	/**
	 * Removes the duplicate.
	 *
	 * @param testSets
	 *            the test sets
	 * @return the array list
	 */
	private static CopyOnWriteArrayList<ArrayList<String>> removeDuplicate(CopyOnWriteArrayList<ArrayList<String>> testSets) {
		ArrayList<ArrayList<String>> testSetNoDupInEachTest = new ArrayList<>();
		CopyOnWriteArrayList<ArrayList<String>> result = new CopyOnWriteArrayList<>();
		// remove dup in each test
		for (ArrayList<String> test : testSets) {
			HashSet<String> hs = new HashSet<>();
			hs.addAll(test);
			test.clear();
			test.addAll(hs);
			testSetNoDupInEachTest.add(test);
		}
		// remove dup tests
		for (ArrayList<String> test : testSetNoDupInEachTest)
		{
			if (!result.contains(test))
				result.add(test);
		}

		return result;
	}

	public static CopyOnWriteArrayList<ArrayList<String>> getAdequateTestSets2(HashMap<String, ArrayList<String>> filtered_data,
			ArrayList<String> testNames) {
		CopyOnWriteArrayList<ArrayList<String>> testSets = new CopyOnWriteArrayList<ArrayList<String>>();
		CopyOnWriteArrayList<String> mutantStrings = new CopyOnWriteArrayList<>();
		// ArrayList<String> tt = new ArrayList<>();
		// tt.add("a");
		// testSets.add(tt);

		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		for (Object key : filtered_data.keySet()) {
			mutantStrings.add(key.toString());
			ArrayList<String> temp = filtered_data.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1")&& !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));
					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			resultWithTestNames.put(key.toString(), testStrings);
		}

		// check if there is an equivalent
		int numOfEq = 0;
		int numOfTotalMutants = filtered_data.size();

		ArrayList<String> nonEquivNonKilled = new ArrayList<>();

		// filtered_data has y, need to count y for equiv
		for (Object key : filtered_data.keySet()) {
			if (filtered_data.get(key).contains("y") || filtered_data.get(key).contains("Y")) // has
																								// an
																								// equiv
			{
				numOfEq++;
			}
			if (filtered_data.get(key).contains("n") || filtered_data.get(key).contains("N") || filtered_data.get(key).contains("?")) // there is a mutant that can't be killed, but not equiv
			{
				nonEquivNonKilled.add(key.toString());
			}
		}
		// remove those can't be killed
		mutantStrings.removeAll(nonEquivNonKilled);

		int non_equiv = numOfTotalMutants - numOfEq;

		testNames.remove("Total");
		testNames.remove("Equiv?");

		// convert testNames into an array
		String [] stockArr = testNames.toArray(new String[testNames.size()]);

		// get all possible test combinations
        int all = stockArr.length;
        int nbit = 1 << all;
        for (int i = 0; i < nbit; i++) {
            ArrayList<String> test = new ArrayList<>();
            for (int j = 0; j < all; j++) {
                if ((i & (1 << j)) != 0) {
                    test.add(stockArr[j]);
                }
            }
            if (test.size()!=0)
            	{testSets.add(test);
            	System.out.println("add test: "+test);}
        }

        // remove non-adequate tests
        for (ArrayList<String> tests : testSets) // for each test set
        {
        	ArrayList<String> liveMutants = new ArrayList<>(mutantStrings);
        	for (String test : tests) // for each single test
        	{
        		for (String mutant : mutantStrings) // for each single mutant
            	{
            		if (resultWithTestNames.get(mutant).contains(test)) // if current test kills current mutant
            		{
            			liveMutants.remove(mutant); // the current is killed, remove from live
            		}
            	}
        	}
        	if (liveMutants.size() > numOfEq)  // have more live mutants left than equiv mutants
        	{
        		testSets.remove(tests); // not adequate tests, remove it from test Sets
        		System.out.println("remove test: "+tests);
        	}

        }

		testSets = removeDuplicate(testSets);
		testSets = getMinimalTests(testSets);
		// System.out.println(non_equiv);
		return testSets;
	}

	/**
	 * Gets the adequate test sets.
	 *
	 * @param filtered_data the filtered_data
	 * @param testNamesCopy the test names copy
	 * @return the adequate test sets4
	 */
	public static ArrayList<String> getAdequateTestSets4 (HashMap<String, ArrayList<String>> filtered_data,
			ArrayList<String> testNamesCopy) {

		CopyOnWriteArrayList<ArrayList<String>> testSets = new CopyOnWriteArrayList<ArrayList<String>>();
		CopyOnWriteArrayList<String> mutantStrings = new CopyOnWriteArrayList<>();
		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		ArrayList<String> testNames = new ArrayList<>(testNamesCopy);

		// get all mutants name in filtered data
		for (Object key : filtered_data.keySet()) {
			mutantStrings.add(key.toString());
			ArrayList<String> temp = filtered_data.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1") && !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));

					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			resultWithTestNames.put(key.toString(), testStrings);
		}

		// check if there is an equivalent
		int numOfEq = 0;
		int numOfTotalMutants = filtered_data.size();

		ArrayList<String> nonEquivNonKilled = new ArrayList<>();

		// remove those weren't be killed
		for (Object key : filtered_data.keySet()) {
			if (filtered_data.get(key).contains("y") ||
					filtered_data.get(key).contains("Y") ||
					filtered_data.get(key).contains("n") ||
					filtered_data.get(key).contains("N")||
					filtered_data.get(key).contains("?")
					)
			{
				mutantStrings.remove(key.toString());
			}
		}

		testNames.remove("Total");
		testNames.remove("Equiv?");

		ArrayList<String> result = new ArrayList<>();
		int[] mutants = new int[mutantStrings.size()];
		// for each mutant, randomly find a test that kills it
		for(int i =0; i<mutantStrings.size();i++)
		{
			if(mutants[i]==1)
				continue;
			// get all tests that kill it
			ArrayList<String> testsKillCurrentMutant = resultWithTestNames.get(mutantStrings.get(i));

			// randomly choose one
			SecureRandom random = new SecureRandom();
			String randomTest = testsKillCurrentMutant.get(random.nextInt(testsKillCurrentMutant.size()));
			result.add(randomTest);

			// remove this mutant by marking the array to 1
			mutants[i] = 1;

			// remove other mutants that killed by the same test
			for (int j =0; j<mutantStrings.size();j++)
			{
				if(mutants[j]==1)
					continue;
				if(resultWithTestNames.get(mutantStrings.get(j)).contains(randomTest))
					// the test selected killed this m
				{
					mutants[j] = 1;
				}
			}

		}
//	System.out.println(result);
	return result;
	}
}


text:
<?php
declare(strict_types = 1);

namespace DASPRiD\Formidable\Exception;

use DomainException;

final class UnboundDataException extends DomainException implements ExceptionInterface
{
    public static function fromGetValueAttempt() : self
    {
        return new self('No data have been bound to the form');
    }
}


text:
angular.module('Auth', ['ngRoute', 'ngCookies'])
    .config(['$routeProvider', function($routeProvider) {
    // route for the home page
    $routeProvider
        .when('/',  {
            templateUrl : '/views/partials/signin',
            controller  : 'AuthorizationController'
        });
}]).constant('BASE_DOMAIN', 'http://localhost:1337')
    .constant('DEFAULT_API_URL', '/api/v1');


text:
package instance;

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

import util.Util;

abstract public class CoordInstance extends Instance {

	protected Map<Integer, Coord2d> points;

	protected CoordInstance(String n, String t, String c, String e, int d, List<String> data) {
		super(n, t, c, e, d);

		points = new HashMap<Integer, Coord2d>();

		int nodeCoordSectionStartLine = -1;
		int lineNum = 0;
		for (String line : data) {
			if (line.startsWith("NODE_COORD_SECTION")) {
				nodeCoordSectionStartLine = lineNum;
				break;
			}
			lineNum += 1;
		}

		List<String> nodeCoordSection = data.subList(nodeCoordSectionStartLine + 1, nodeCoordSectionStartLine + 1 + d);

		for (String line : nodeCoordSection) {
			line = Util.removeSpaces(line);
			String[] a = line.split("\\s+");

			int index = Integer.parseInt(a[0]);
			double x = Double.parseDouble(a[1]);
			double y = Double.parseDouble(a[2]);
			Coord2d coord = new Coord2d(x, y);
			points.put(index, coord);
		}
	}
}


text:
#ifndef MAIN_WINDOW_H_
#define MAIN_WINDOW_H_

#include <QMainWindow>
#include <string>
#include "./global.h"

class QProgressBar;
class QActionGroup;

namespace soax {

class Multisnake;
class Viewer;
class ParametersDialog;
class AnalysisOptionsDialog;
class ViewOptionsDialog;

class MainWindow : public QMainWindow {
  Q_OBJECT

 public:
  MainWindow();
  ~MainWindow();

  // Disable right click on the toolbar
  virtual QMenu *createPopupMenu() {return NULL;}

 private slots:  // NOLINT(whitespace/indent)
  void OpenImage();
  void SaveAsIsotropicImage();
  void LoadParameters();
  void SaveParameters();
  void LoadSnakes();
  void SaveSnakes();
  void CompareSnakes();
  void CompareAnotherSnakes();
  void LoadJFilamentSnakes();
  void SaveJFilamentSnakes();
  void CloseSession();

  void EditSnake();

  void ShowViewOptions();

  void InitializeSnakes();
  void DeformSnakes();
  void DeformSnakesInAction();
  void DeformOneSnake();
  void CutSnakes();
  void GroupSnakes();

  void ComputeSphericalOrientation();
  void ComputeRadialOrientation();
  void ComputePointDensity();
  void ComputeCurvature();
  void ComputeSnakeLength();
  void ComputeAll();
  void ShowAnalysisOptions();

  void ShowParametersDialog();
  void LoadViewpoint();
  void SaveViewpoint();
  void SaveSnapshot();

  void AboutSOAX();

 private:
  void CreateActions();
  void CreateFileMenuActions();
  void CreateEditMenuActions();
  void CreateViewMenuActions();
  void CreateProcessMenuActions();
  void CreateAnalysisMenuActions();
  void CreateToolsMenuActions();
  void CreateHelpMenuActions();

  void CreateMenus();
  void CreateToolBar();
  void CreateStatusBar();

  void ResetActions();
  QString GetLastDirectory(const std::string &filename) const;

  bool WriteSphericalOrientation(const std::string &filename);
  bool WriteRadialOrientation(const std::string &filename);
  bool WritePointDensity(const std::string &filename);
  bool WriteCurvature(const std::string &filename);
  bool WriteSnakeLength(const std::string &filename);

  std::string GenerateAnalysisFilePath(const QString &dir,
                                       const std::string &str) const;
  void SetParameters();

  void ShowErrorDialog(const char *msg);

  QWidget *central_widget_;
  ParametersDialog *parameters_dialog_;
  ViewOptionsDialog *view_options_dialog_;
  AnalysisOptionsDialog *analysis_options_dialog_;

  // Actions in File menu
  QAction *open_image_;
  QAction *save_as_isotropic_image_;
  QAction *load_parameters_;
  QAction *save_parameters_;
  QAction *load_snakes_;
  QAction *save_snakes_;
  QAction *load_jfilament_snakes_;
  QAction *save_jfilament_snakes_;
  QAction *compare_snakes_;
  QAction *compare_another_snakes_;
  QAction *close_session_;
  QAction *exit_;

  // Actions in Edit menu
  QAction *toggle_none_;
  QAction *toggle_delete_snake_;
  QAction *toggle_trim_tip_;
  QAction *toggle_extend_tip_;
  QAction *toggle_trim_body_;
  QAction *toggle_delete_junction_;
  QAction *edit_snake_;
  QActionGroup *snake_edit_group_;

  // Actions in View menu
  QAction *toggle_planes_;
  QAction *toggle_mip_;
  QAction *toggle_orientation_marker_;
  QAction *toggle_corner_text_;
  QAction *toggle_bounding_box_;
  QAction *toggle_cube_axes_;
  QAction *toggle_snakes_;
  QAction *toggle_junctions_;
  QAction *toggle_clip_;
  QAction *toggle_color_azimuthal_;
  QAction *toggle_color_polar_;
  QAction *show_view_options_;
  QActionGroup *snake_view_group_;

  // Actions in Process menu
  QAction *initialize_snakes_;
  QAction *deform_snakes_;
  QAction *deform_snakes_in_action_;
  QAction *deform_one_snake_;
  QAction *cut_snakes_;
  QAction *group_snakes_;

  // Actions in Analysis menu
  QAction *compute_spherical_orientation_;
  QAction *compute_radial_orientation_;
  QAction *compute_point_density_;
  QAction *compute_curvature_;
  QAction *compute_snake_length_;
  QAction *compute_all_;
  QAction *show_analysis_options_;

  // Actions in Tools menu
  QAction *show_parameters_;
  QAction *load_viewpoint_;
  QAction *save_viewpoint_;
  QAction *save_snapshot_;

  // Actions in Help menu
  QAction *about_soax_;
  QAction *about_qt_;

  // Menus
  QMenu *file_;
  QMenu *edit_;
  QMenu *snake_edit_submenu_;
  QMenu *view_;
  QMenu *process_;
  QMenu *analysis_;
  QMenu *tools_;
  QMenu *help_;

  QToolBar *toolbar_;
  QProgressBar *progress_bar_;
  int message_timeout_;  // in milliseconds

  // Complete image file path and name
  std::string image_filename_;
  std::string parameter_filename_;
  std::string snake_filename_;
  std::string viewpoint_filename_;
  std::string snapshot_filename_;
  std::string analysis_filename_;

  Multisnake *multisnake_;
  Viewer *viewer_;

  DISALLOW_COPY_AND_ASSIGN(MainWindow);
};

}  // namespace soax

#endif  // MAIN_WINDOW_H_


text:
<?php

namespace Oro\Bundle\NavigationBundle\Menu\Helper;

use Doctrine\Common\Collections\Collection;
use Oro\Bundle\LocaleBundle\DependencyInjection\Configuration;
use Oro\Bundle\LocaleBundle\Entity\LocalizedFallbackValue;
use Oro\Bundle\LocaleBundle\Helper\LocalizationHelper;
use Oro\Bundle\LocaleBundle\Model\FallbackType;
use Oro\Bundle\NavigationBundle\Entity\MenuUpdateInterface;
use Oro\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
 * Translates and apply all translations for given values
 */
class MenuUpdateHelper
{
    /** @var TranslatorInterface */
    protected $translator;

    /** @var LocalizationHelper */
    protected $localizationHelper;

    /** @var PropertyAccessor */
    private $propertyAccessor;

    /**
     * @param TranslatorInterface $translator
     * @param LocalizationHelper  $localizationHelper
     */
    public function __construct(TranslatorInterface $translator, LocalizationHelper $localizationHelper)
    {
        $this->translator = $translator;
        $this->localizationHelper = $localizationHelper;
    }

    /**
     * @param MenuUpdateInterface $entity
     * @param string              $value
     * @param string              $name
     * @param string              $type
     *
     * @return MenuUpdateHelper
     */
    public function applyLocalizedFallbackValue(MenuUpdateInterface $entity, $value, $name, $type)
    {
        $values = $this->getPropertyAccessor()->getValue($entity, $name . 's');
        if ($values instanceof Collection && $values->count() <= 0) {
            // Default translation for menu must always has value for English locale, because out of the box app has
            // translations only for English language.
            $defaultValue = $this->translator->trans($value, [], null, Configuration::DEFAULT_LOCALE);
            $this->getPropertyAccessor()->setValue($entity, 'default_' . $name, $defaultValue);
            foreach ($this->localizationHelper->getLocalizations() as $localization) {
                $locale = $localization->getLanguageCode();
                $translatedValue = $this->translator->trans($value, [], null, $locale);
                $fallbackValue = new LocalizedFallbackValue();
                $fallbackValue->setLocalization($localization);

                // If value for current localization is equal to default value - fallback must be set to "default value"
                if ($translatedValue === $defaultValue) {
                    $fallbackValue->setFallback(FallbackType::SYSTEM);
                } else {
                    $this->getPropertyAccessor()->setValue($fallbackValue, $type, $translatedValue);
                }

                $this->getPropertyAccessor()->setValue($entity, $name, [$fallbackValue]);
            }
        }

        return $this;
    }

    /**
     * @return PropertyAccessor
     */
    private function getPropertyAccessor()
    {
        if (!$this->propertyAccessor) {
            $this->propertyAccessor = PropertyAccess::createPropertyAccessor();
        }

        return $this->propertyAccessor;
    }
}


text:
package org.encog.neural.networks.training.strategy;

import org.encog.ml.train.MLTrain;
import org.encog.ml.train.strategy.Strategy;
import org.encog.neural.networks.training.Momentum;
import org.encog.util.logging.EncogLogging;

/**
 * Attempt to automatically set a momentum in a training algorithm that supports
 * momentum.
 *

 * <
 * p/>
 * @author jheaton
 *

 */
public class SmartMomentum implements Strategy {

    /**
     * The minimum improvement to adjust momentum.
     */
    public static final double MIN_IMPROVEMENT = 0.0001;
    /**
     * The maximum value that momentum can go to.
     */
    public static final double MAX_MOMENTUM = 4;
    /**
     * The starting momentum.
     */
    public static final double START_MOMENTUM = 0.1;
    /**
     * How much to increase momentum by.
     */
    public static final double MOMENTUM_INCREASE = 0.01;
    /**
     * How many cycles to accept before adjusting momentum.
     */
    public static final double MOMENTUM_CYCLES = 10;
    /**
     * The training algorithm that is using this strategy.
     */
    private MLTrain train;
    /**
     * The setter used to change momentum.
     */
    private Momentum setter;
    /**
     * The last improvement in error rate.
     */
    private double lastImprovement;
    /**
     * The error rate from the previous iteration.
     */
    private double lastError;
    /**
     * Has one iteration passed, and we are now ready to start evaluation.
     */
    private boolean ready;
    /**
     * The last momentum.
     */
    private int lastMomentum;
    /**
     * The current momentum.
     */
    private double currentMomentum;

    /**
     * Initialize this strategy.
     *

     * @param train
     *              The training algorithm.
     */
    public void init(final MLTrain train) {
        this.train = train;
        this.setter = (Momentum) train;
        this.ready = false;
        this.setter.setMomentum(0.0);
        this.currentMomentum = 0;

    }

    /**
     * Called just after a training iteration.
     */
    public void postIteration() {
        if (this.ready) {
            final double currentError = this.train.getError();
            this.lastImprovement = (currentError - this.lastError) /
                    this.lastError;
            EncogLogging.log(EncogLogging.LEVEL_DEBUG, "Last improvement: " +
                    this.lastImprovement);

            if ((this.lastImprovement > 0) ||
                    (Math.abs(this.lastImprovement) <
                    SmartMomentum.MIN_IMPROVEMENT)) {
                this.lastMomentum++;

                if (this.lastMomentum > SmartMomentum.MOMENTUM_CYCLES) {
                    this.lastMomentum = 0;
                    if (((int) this.currentMomentum) == 0) {
                        this.currentMomentum = SmartMomentum.START_MOMENTUM;
                    }
                    this.currentMomentum *=
                            (1.0 + SmartMomentum.MOMENTUM_INCREASE);
                    this.setter.setMomentum(this.currentMomentum);
                    EncogLogging.log(EncogLogging.LEVEL_DEBUG,
                                     "Adjusting momentum: " +
                            this.currentMomentum);
                }
            } else {
                EncogLogging.log(EncogLogging.LEVEL_DEBUG,
                                 "Setting momentum back to zero.");

                this.currentMomentum = 0;
                this.setter.setMomentum(0);
            }
        } else {
            this.ready = true;
        }
    }

    /**
     * Called just before a training iteration.
     */
    public void preIteration() {
        this.lastError = this.train.getError();
    }
}


text:
Brand.io

Add Actor

Add Film

                    <form>

                        <input type="text" placeholder="First Name">

                        <input type="text" placeholder="Last Name">

                        <input type="text" placeholder="First Name">

                        <input type="text" placeholder="Image URL">

                    <button type="submit" class="mui-btn mui-btn--raised">Submit</button>
                </form>

                        <form>

                                <input type="text" placeholder="First Name">

                                <input type="text" placeholder="Last Name">

                                <input type="text" placeholder="First Name">

                                <input type="text" placeholder="Image URL">

                            <button type="submit" class="mui-btn mui-btn--raised">Submit</button>
                        </form>

<link href="//cdn.muicss.com/mui-latest/css/mui.min.css" rel="stylesheet" type="text/css" />
<link href="css/myStyle.css" rel="stylesheet" type="text/css" />


text:
/*
 * @file    sha224.hpp
 * @author  Fabrizio Nuccilli
 * @version 1.0
 *
 * @section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @section DESCRIPTION
 *
 * The class represents the SHA224 function
 *
 */

#ifndef SHA224_HPP_
#define SHA224_HPP_

#include "hash.hpp"
#define dgstlen224 28

namespace bm {

class SHA224 : public HASH
{

public:

    SHA224():HASH(dgstlen224){}

       /*
     * this method compute the digest of a key
     * @param key is the key that is to be hashed
     * @param len is the key length
     * @param output is the array where the message digest is stored
     */
    virtual void compute(const unsigned char key[], int len, unsigned char output[]);

    /*
     * this method hashes a file
     * @param filepath the file path
     * @param output is the array where the message digest is stored
     */
    virtual void computeFile(const char *filepath, unsigned char output[]);

    /*
     * HMAC
     * this method implements a message authentication code (MAC)
     * involving SHA224 in combination with a secret key
     * @param key is the key
     * @param keylen is the key length
     * @param input is the original message
     * @param ilen is the length of the original message
     * @param output is the array where the message digest is stored
     */
    virtual void compute(const unsigned char *key, int keylen, const unsigned char *input, int ilen,
                unsigned char output[]);

};

}

#endif


text:
// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            portions copyright @2011 Apple Inc.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*global module test htmlbody ok equals same stop start */

module("TODO: Test SC.MenuItemView Methods");


text:
<?php declare(strict_types=1);

namespace SebastianBergmann\FileIterator;

use const GLOB_ONLYDIR;
use function array_filter;
use function array_map;
use function array_merge;
use function glob;
use function is_dir;
use function is_string;
use function realpath;
use AppendIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class Factory
{
    /**
     * @param array|string $paths
     * @param array|string $suffixes
     * @param array|string $prefixes
     */
    public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = []): AppendIterator
    {
        if (is_string($paths)) {
            $paths = [$paths];
        }

        $paths   = $this->getPathsAfterResolvingWildcards($paths);
        $exclude = $this->getPathsAfterResolvingWildcards($exclude);

        if (is_string($prefixes)) {
            if ($prefixes !== '') {
                $prefixes = [$prefixes];
            } else {
                $prefixes = [];
            }
        }

        if (is_string($suffixes)) {
            if ($suffixes !== '') {
                $suffixes = [$suffixes];
            } else {
                $suffixes = [];
            }
        }

        $iterator = new AppendIterator;

        foreach ($paths as $path) {
            if (is_dir($path)) {
                $iterator->append(
                    new Iterator(
                        $path,
                        new RecursiveIteratorIterator(
                            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS | RecursiveDirectoryIterator::SKIP_DOTS)
                        ),
                        $suffixes,
                        $prefixes,
                        $exclude
                    )
                );
            }
        }

        return $iterator;
    }

    protected function getPathsAfterResolvingWildcards(array $paths): array
    {
        $_paths = [];

        foreach ($paths as $path) {
            if ($locals = glob($path, GLOB_ONLYDIR)) {
                $_paths = array_merge($_paths, array_map('\realpath', $locals));
            } else {
                $_paths[] = realpath($path);
            }
        }

        return array_filter($_paths);
    }
}


text:
package shuaicj.hobby.great.free.will.protocol.socks.message;

import static shuaicj.hobby.great.free.will.protocol.socks.SocksConst.VERSION;

import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.DecoderException;
import io.netty.handler.codec.EncoderException;
import lombok.Builder;
import lombok.Getter;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import shuaicj.hobby.great.free.will.protocol.MessageDecoder;
import shuaicj.hobby.great.free.will.protocol.Message;
import shuaicj.hobby.great.free.will.protocol.MessageEncoder;
import shuaicj.hobby.great.free.will.protocol.socks.message.part.ConnectionAddr;
import shuaicj.hobby.great.free.will.protocol.socks.type.ConnectionCmd;

/**
 * SOCKS5 connection request.
 *
 *   +----+-----+-------+------+----------+----------+
 *   |VER | CMD |  RSV  | ATYP | DST.ADDR | DST.PORT |
 *   +----+-----+-------+------+----------+----------+
 *   | 1  |  1  | X'00' |  1   | Variable |    2     |
 *   +----+-----+-------+------+----------+----------+
 *
 * @see RFC1928
 *
 * @author shuaicj 2017/09/26
 */
@Getter
@ToString
public class ConnectionRequest implements Message {

    public static final int VER_LEN = 1;
    public static final int CMD_LEN = 1;
    public static final int RSV_LEN = 1;

    private final short ver;
    private final ConnectionCmd cmd;
    private final short rsv;
    private final ConnectionAddr dst;

    @Builder
    private ConnectionRequest(short ver, ConnectionCmd cmd, short rsv, ConnectionAddr dst) {
        this.ver = ver;
        this.cmd = cmd;
        this.rsv = rsv;
        this.dst = dst;
    }

    @Override
    public int length() {
        return VER_LEN + CMD_LEN + RSV_LEN + dst.length();
    }

    /**
     * Decoder of {@link ConnectionRequest}.
     *
     * @author shuaicj 2017/09/27
     */
    @Component
    public static class Decoder implements MessageDecoder<ConnectionRequest> {

        @Autowired ConnectionAddr.Decoder addrDecoder;

        @Override
        public ConnectionRequest decode(ByteBuf in) throws DecoderException {
            if (!in.isReadable(VER_LEN + CMD_LEN + RSV_LEN)) {
                return null;
            }
            int mark = in.readerIndex();

            short ver = in.readUnsignedByte();
            if (ver != VERSION) {
                throw new DecoderException("unsupported ver: " + ver);
            }

            ConnectionCmd cmd = ConnectionCmd.valueOf(in.readUnsignedByte());
            short rsv = in.readUnsignedByte();

            ConnectionAddr dst = addrDecoder.decode(in);
            if (dst == null) {
                in.readerIndex(mark);
                return null;
            }

            return ConnectionRequest.builder()
                    .ver(ver)
                    .cmd(cmd)
                    .rsv(rsv)
                    .dst(dst)
                    .build();
        }
    }

    /**
     * Encoder of {@link ConnectionRequest}.
     *
     * @author shuaicj 2017/10/12
     */
    @Component
    public static class Encoder implements MessageEncoder<ConnectionRequest> {

        @Autowired ConnectionAddr.Encoder addrEncoder;

        @Override
        public void encode(ConnectionRequest msg, ByteBuf out) throws EncoderException {
            out.writeByte(msg.ver);
            out.writeByte(msg.cmd.value());
            out.writeByte(msg.rsv);
            addrEncoder.encode(msg.dst, out);
        }
    }
}


text:
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import uiRouter from 'angular-ui-router';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker'

import { name as Scan } from '../scan/scan';

//import html and css files of this component
import mobileTemplate from './mobile.html';

import './mobile.css';

class Mangas {
    constructor($scope, $reactive, $http) {
        'ngInject';
        $reactive(this).attach($scope);
        var vm = this;
        vm.list = [];
        vm.loadingData = true;
        $http.get("data/mangas.json")
            .then(function (response) {
                vm.loadingData = false;
                vm.list = response.data;
            });

        vm.moreContainer = {
            _show: false,
            toggle: function () {
                this._show = !this._show;
            }
        }

        vm.moreButton = {
            click: function ($event) {
                vm.moreContainer.toggle();
                $event.stopPropagation();
            }
        }

        $('body').bind('click', () => {
            $scope.$apply(() => {
                vm.moreContainer._show = false;
            })
        })

    }
}

const name = 'mangas';
const template = mobileTemplate;
export default angular.module(name, [
    angularMeteor,
    uiRouter,
    Scan
]).component(name, {
    template,
    controllerAs: name,
    controller: Mangas
}).config(config); //to set the route config of this Component
function config($locationProvider, $stateProvider, $urlRouterProvider) {
    'ngInject';
    $stateProvider
        .state('mangas', {
            url: '/mangas',
            template: '<mangas></mangas>',
        })
}


text:
package com.opengamma.analytics.math.cube;

import static org.testng.AssertJUnit.assertTrue;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.testng.annotations.Test;

import com.opengamma.util.test.TestGroup;
import com.opengamma.util.tuple.Triple;

/**
 * Test.
 */
@Test(groups = TestGroup.UNIT)
public class DoublesCubeTest {
  static final String NAME = "a";
  static final double[] X_PRIMITIVE;
  static final double[] Y_PRIMITIVE;
  static final double[] Z_PRIMITIVE;
  static final double[] DATA_PRIMITIVE;
  static final Double[] X_OBJECT;
  static final Double[] Y_OBJECT;
  static final Double[] Z_OBJECT;
  static final Double[] DATA_OBJECT;
  static final List<Double> X_LIST;
  static final List<Double> Y_LIST;
  static final List<Double> Z_LIST;
  static final List<Double> DATA_LIST;

  static {
    final int n = 125;
    X_PRIMITIVE = new double[n];
    Y_PRIMITIVE = new double[n];
    Z_PRIMITIVE = new double[n];
    DATA_PRIMITIVE = new double[n];
    X_OBJECT = new Double[n];
    Y_OBJECT = new Double[n];
    Z_OBJECT = new Double[n];
    DATA_OBJECT = new Double[n];
    X_LIST = new ArrayList<>();
    Y_LIST = new ArrayList<>();
    Z_LIST = new ArrayList<>();
    DATA_LIST = new ArrayList<>();
    int count = 0;
    for (int i = 0; i < 5; i++) {
      final double x = i;
      for (int j = 0; j < 5; j++) {
        final double y = j;
        for (int k = 0; k < 5; k++) {
          final double z = k;
          final double data = k;
          X_PRIMITIVE[count] = x;
          Y_PRIMITIVE[count] = y;
          Z_PRIMITIVE[count] = z;
          DATA_PRIMITIVE[count] = data;
          X_OBJECT[count] = x;
          Y_OBJECT[count] = y;
          Z_OBJECT[count] = z;
          DATA_OBJECT[count] = data;
          X_LIST.add(x);
          Y_LIST.add(y);
          Z_LIST.add(z);
          DATA_LIST.add(data);
          count++;
        }
      }
    }
  }

  @Test
  public void testObjectArrays() {
    final DoublesCube cube = new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, DATA_PRIMITIVE);
    final Double[] x = cube.getXData();
    assertTrue(x == cube.getXData());
    final Double[] y = cube.getYData();
    assertTrue(y == cube.getYData());
    final Double[] z = cube.getZData();
    assertTrue(z == cube.getZData());
    final Double[] data = cube.getValues();
    assertTrue(data == cube.getValues());
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull1() {
    new DummyCube(null, Y_PRIMITIVE, Z_PRIMITIVE, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull2() {
    new DummyCube(X_PRIMITIVE, null, Z_PRIMITIVE, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull3() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, null, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull4() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, null);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength1() {
    new DummyCube(new double[] {2}, Y_PRIMITIVE, Z_PRIMITIVE, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength2() {
    new DummyCube(X_PRIMITIVE, new double[] {2}, Z_PRIMITIVE, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength3() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, new double[] {2}, DATA_PRIMITIVE);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength4() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, new double[] {2});
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull5() {
    new DummyCube(null, Y_PRIMITIVE, Z_PRIMITIVE, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull6() {
    new DummyCube(X_PRIMITIVE, null, Z_PRIMITIVE, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull7() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, null, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull8() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, null, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength5() {
    new DummyCube(new double[] {2}, Y_PRIMITIVE, Z_PRIMITIVE, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength6() {
    new DummyCube(X_PRIMITIVE, new double[] {2}, Z_PRIMITIVE, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength7() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, new double[] {2}, DATA_PRIMITIVE, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength8() {
    new DummyCube(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, new double[] {2}, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull9() {
    new DummyCube(null, Y_OBJECT, Z_OBJECT, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull10() {
    new DummyCube(X_OBJECT, null, Z_OBJECT, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull11() {
    new DummyCube(X_OBJECT, Y_OBJECT, null, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull12() {
    new DummyCube(X_OBJECT, Y_OBJECT, Z_OBJECT, null);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength9() {
    new DummyCube(new Double[] {2.}, Y_OBJECT, Z_OBJECT, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength10() {
    new DummyCube(X_OBJECT, new Double[] {2.}, Z_OBJECT, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength11() {
    new DummyCube(X_OBJECT, Y_OBJECT, new Double[] {2.}, DATA_OBJECT);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength12() {
    new DummyCube(X_OBJECT, Y_OBJECT, Z_OBJECT, new Double[] {2.});
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull13() {
    new DummyCube(null, Y_OBJECT, Z_OBJECT, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull14() {
    new DummyCube(X_OBJECT, null, Z_OBJECT, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull15() {
    new DummyCube(X_OBJECT, Y_OBJECT, null, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull16() {
    new DummyCube(X_OBJECT, Y_OBJECT, Z_OBJECT, null, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength13() {
    new DummyCube(new Double[] {2.}, Y_OBJECT, Z_OBJECT, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength14() {
    new DummyCube(X_OBJECT, new Double[] {2.}, Z_OBJECT, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength15() {
    new DummyCube(X_OBJECT, Y_OBJECT, new Double[] {2.}, DATA_OBJECT, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength16() {
    new DummyCube(X_OBJECT, Y_OBJECT, Z_OBJECT, new Double[] {2.}, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull17() {
    new DummyCube(null, Y_LIST, Z_LIST, DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull18() {
    new DummyCube(X_LIST, null, Z_LIST, DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull19() {
    new DummyCube(X_LIST, Y_LIST, null, DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull20() {
    new DummyCube(X_LIST, Y_LIST, Z_LIST, null);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength17() {
    new DummyCube(Arrays.asList(2.), Y_LIST, Z_LIST, DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength18() {
    new DummyCube(X_LIST, Arrays.asList(2.), Z_LIST, DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength19() {
    new DummyCube(X_LIST, Y_LIST, Arrays.asList(2.), DATA_LIST);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength20() {
    new DummyCube(X_LIST, Y_LIST, Z_LIST, Arrays.asList(2.));
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull21() {
    new DummyCube(null, Y_LIST, Z_LIST, DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull22() {
    new DummyCube(X_LIST, null, Z_LIST, DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull23() {
    new DummyCube(X_LIST, Y_LIST, null, DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull24() {
    new DummyCube(X_LIST, Y_LIST, Z_LIST, null, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength21() {
    new DummyCube(Arrays.asList(2.), Y_LIST, Z_LIST, DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength22() {
    new DummyCube(X_LIST, Arrays.asList(2.), Z_LIST, DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength23() {
    new DummyCube(X_LIST, Y_LIST, Arrays.asList(2.), DATA_LIST, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLength24() {
    new DummyCube(X_LIST, Y_LIST, Z_LIST, Arrays.asList(2.), NAME);
  }

  private static class DummyCube extends DoublesCube {
    public DummyCube(final double[] xData, final double[] yData, final double[] zData, final double[] data) {
      super(xData, yData, zData, data);
    }

    public DummyCube(final Double[] xData, final Double[] yData, final Double[] zData, final Double[] data) {
      super(xData, yData, zData, data);
    }

    public DummyCube(final List<Double> xData, final List<Double> yData, final List<Double> zData, final List<Double> data) {
      super(xData, yData, zData, data);
    }

    public DummyCube(final double[] xData, final double[] yData, final double[] zData, final double[] data, final String name) {
      super(xData, yData, zData, data, name);
    }

    public DummyCube(final Double[] xData, final Double[] yData, final Double[] zData, final Double[] data, final String name) {
      super(xData, yData, zData, data, name);
    }

    public DummyCube(final List<Double> xData, final List<Double> yData, final List<Double> zData, final List<Double> data, final String name) {
      super(xData, yData, zData, data, name);
    }

    @Override
    public Double getValue(final Double x, final Double y, final Double z) {
      return null;
    }

    @Override
    public Double getValue(final Triple<Double, Double, Double> xyz) {
      return null;
    }
  }

}


text:
package org.csanchez.jenkins.plugins.kubernetes;

import static java.util.stream.Collectors.toSet;

import java.util.Set;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Label;

/**
 * Collects the Kubernetes agents currently in provisioning.
 */
public abstract class InProvisioning implements ExtensionPoint {
    /**
     * Returns the agents names in provisioning according to all implementations of this extension point for the given label.
     *
     * @param label the {@link Label} being checked.
     * @return the agents names in provisioning according to all implementations of this extension point for the given label.
     */
    @NonNull
    public static Set<String> getAllInProvisioning(@CheckForNull Label label) {
        return all().stream()
                .flatMap(c -> c.getInProvisioning(label).stream())
                .collect(toSet());
    }

    public static ExtensionList<InProvisioning> all() {
        return ExtensionList.lookup(InProvisioning.class);
    }

    /**
     * Returns the agents in provisioning for the current label.
     *
     * @param label The label being checked
     * @return The agents names in provisioning for the current label.
     */
    @NonNull
    public abstract Set<String> getInProvisioning(Label label);
}


text:
package org.apache.carbondata.index.bloom;

import java.io.IOException;
import java.util.List;

import org.apache.carbondata.common.annotations.InterfaceAudience;
import org.apache.carbondata.core.index.Segment;
import org.apache.carbondata.core.index.dev.IndexBuilder;
import org.apache.carbondata.core.metadata.datatype.DataTypes;
import org.apache.carbondata.core.metadata.schema.table.column.CarbonColumn;
import org.apache.carbondata.core.util.CarbonUtil;
import org.apache.carbondata.core.util.DataTypeUtil;

/**
 * Implementation for BloomFilter Index to rebuild the indes for main table with existing data
 */
@InterfaceAudience.Internal
public class BloomIndexBuilder extends AbstractBloomIndexWriter implements IndexBuilder {

  BloomIndexBuilder(String tablePath, String indexName, List<CarbonColumn> indexColumns,
      Segment segment, String shardName, int bloomFilterSize, double bloomFilterFpp,
      boolean bloomCompress) throws IOException {
    super(tablePath, indexName, indexColumns, segment, shardName, bloomFilterSize,
        bloomFilterFpp, bloomCompress);
  }

  @Override
  public void initialize() {
    super.resetBloomFilters();
  }

  @Override
  public void addRow(int blockletId, int pageId, int rowId, Object[] values) {
    if (currentBlockletId != blockletId) {
      // new blocklet started, flush bloom filter to index fileh
      super.writeBloomIndexFile();
      currentBlockletId = blockletId;
    }
    // for each indexed column, add the data to bloom filter
    for (int i = 0; i < indexColumns.size(); i++) {
      Object data = values[i];
      addValue2BloomIndex(i, data);
    }
  }

  @Override
  protected byte[] convertNonDictionaryValue(int indexColIdx, Object value) {
    // no dictionary measure columns will be of original data, so convert it to bytes
    if (DataTypeUtil.isPrimitiveColumn(indexColumns.get(indexColIdx).getDataType())) {
      return CarbonUtil.getValueAsBytes(indexColumns.get(indexColIdx).getDataType(), value);
    }
    return (byte[]) value;
  }

  @Override
  public void finish() {
    if (!isWritingFinished()) {
      if (indexBloomFilters.size() > 0) {
        writeBloomIndexFile();
      }
      releaseResouce();
      setWritingFinished(true);
    }
  }

  @Override
  protected byte[] convertDictionaryValue(int indexColIdx, Object value) {
    // input value from IndexIndexRebuildRDD is already decoded as surrogate key
    return CarbonUtil.getValueAsBytes(DataTypes.INT, value);
  }

  @Override
  public void close() {
    releaseResouce();
  }

  @Override
  public boolean isIndexForCarbonRawBytes() {
    return true;
  }
}


text:
delete from MFR_TOPIC_T where PF_SURROGATEKEY in (select f11.ID from MFR_PRIVATE_FORUM_T f11, MFR_PRIVATE_FORUM_T f22
    where f11.ID != f22.ID
    and f11.OWNER = f22.OWNER and f11.SURROGATEKEY = f22.SURROGATEKEY
    and f11.SURROGATEKEY is not null and f22.SURROGATEKEY is not null
    and f11.id not in (
        select min(id) from MFR_PRIVATE_FORUM_T where ID in (select f1.ID from MFR_PRIVATE_FORUM_T f1, MFR_PRIVATE_FORUM_T f2
        where f1.ID != f2.ID
        and f1.OWNER = f2.OWNER and f1.SURROGATEKEY = f2.SURROGATEKEY
        and f1.SURROGATEKEY is not null and f2.SURROGATEKEY is not null
    )
    group by OWNER, SURROGATEKEY
));

delete from MFR_PRIVATE_FORUM_T where ID in
(select f11.ID from MFR_PRIVATE_FORUM_T f11, MFR_PRIVATE_FORUM_T f22
    where f11.ID != f22.ID
    and f11.OWNER = f22.OWNER and f11.SURROGATEKEY = f22.SURROGATEKEY
    and f11.SURROGATEKEY is not null and f22.SURROGATEKEY is not null
    and f11.id not in (
        select min(id) from MFR_PRIVATE_FORUM_T where ID in (select f1.ID from MFR_PRIVATE_FORUM_T f1, MFR_PRIVATE_FORUM_T f2
        where f1.ID != f2.ID
        and f1.OWNER = f2.OWNER and f1.SURROGATEKEY = f2.SURROGATEKEY
        and f1.SURROGATEKEY is not null and f2.SURROGATEKEY is not null
    )
    group by OWNER, SURROGATEKEY
));

delete from MFR_TOPIC_T where PF_SURROGATEKEY in (
select f11.ID from MFR_PRIVATE_FORUM_T f11, MFR_PRIVATE_FORUM_T f22
    where f11.ID != f22.ID
    and f11.OWNER = f22.OWNER
    and f11.SURROGATEKEY is null and f22.SURROGATEKEY is null
    and f11.id not in (select min(id) from MFR_PRIVATE_FORUM_T where ID in (select f1.ID from MFR_PRIVATE_FORUM_T f1, MFR_PRIVATE_FORUM_T f2
        where f1.ID != f2.ID
        and f1.OWNER = f2.OWNER
        and f1.SURROGATEKEY is null and f2.SURROGATEKEY is null
    )
    group by OWNER, SURROGATEKEY
));

delete from MFR_PRIVATE_FORUM_T where ID in
(select f11.ID from MFR_PRIVATE_FORUM_T f11, MFR_PRIVATE_FORUM_T f22
    where f11.ID != f22.ID
    and f11.OWNER = f22.OWNER
    and f11.SURROGATEKEY is null and f22.SURROGATEKEY is null
    and f11.id not in (select min(id) from MFR_PRIVATE_FORUM_T where ID in (select f1.ID from MFR_PRIVATE_FORUM_T f1, MFR_PRIVATE_FORUM_T f2
        where f1.ID != f2.ID
        and f1.OWNER = f2.OWNER
        and f1.SURROGATEKEY is null and f2.SURROGATEKEY is null
    )
    group by OWNER, SURROGATEKEY
));

alter table MFR_PRIVATE_FORUM_T add constraint unique_mfr_pf_user_site unique (OWNER, SURROGATEKEY);