text:
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package net.floodlightcontroller.packetstreamer.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
 * A struct that defines switch port tuple
 */
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2021-04-13")
public class SwitchPortTuple implements org.apache.thrift.TBase<SwitchPortTuple, SwitchPortTuple._Fields>, java.io.Serializable, Cloneable, Comparable<SwitchPortTuple> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SwitchPortTuple");

  private static final org.apache.thrift.protocol.TField DPID_FIELD_DESC = new org.apache.thrift.protocol.TField("dpid", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I16, (short)2);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SwitchPortTupleStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SwitchPortTupleTupleSchemeFactory();

  public long dpid; // required
  public short port; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    DPID((short)1, "dpid"),
    PORT((short)2, "port");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // DPID
          return DPID;
        case 2: // PORT
          return PORT;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __DPID_ISSET_ID = 0;
  private static final int __PORT_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.DPID, new org.apache.thrift.meta_data.FieldMetaData("dpid", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SwitchPortTuple.class, metaDataMap);
  }

  public SwitchPortTuple() {
  }

  public SwitchPortTuple(
    long dpid,
    short port)
  {
    this();
    this.dpid = dpid;
    setDpidIsSet(true);
    this.port = port;
    setPortIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public SwitchPortTuple(SwitchPortTuple other) {
    __isset_bitfield = other.__isset_bitfield;
    this.dpid = other.dpid;
    this.port = other.port;
  }

  public SwitchPortTuple deepCopy() {
    return new SwitchPortTuple(this);
  }

  @Override
  public void clear() {
    setDpidIsSet(false);
    this.dpid = 0;
    setPortIsSet(false);
    this.port = 0;
  }

  public long getDpid() {
    return this.dpid;
  }

  public SwitchPortTuple setDpid(long dpid) {
    this.dpid = dpid;
    setDpidIsSet(true);
    return this;
  }

  public void unsetDpid() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DPID_ISSET_ID);
  }

  /** Returns true if field dpid is set (has been assigned a value) and false otherwise */
  public boolean isSetDpid() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DPID_ISSET_ID);
  }

  public void setDpidIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DPID_ISSET_ID, value);
  }

  public short getPort() {
    return this.port;
  }

  public SwitchPortTuple setPort(short port) {
    this.port = port;
    setPortIsSet(true);
    return this;
  }

  public void unsetPort() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
  }

  /** Returns true if field port is set (has been assigned a value) and false otherwise */
  public boolean isSetPort() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
  }

  public void setPortIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case DPID:
      if (value == null) {
        unsetDpid();
      } else {
        setDpid((java.lang.Long)value);
      }
      break;

    case PORT:
      if (value == null) {
        unsetPort();
      } else {
        setPort((java.lang.Short)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case DPID:
      return getDpid();

    case PORT:
      return getPort();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case DPID:
      return isSetDpid();
    case PORT:
      return isSetPort();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof SwitchPortTuple)
      return this.equals((SwitchPortTuple)that);
    return false;
  }

  public boolean equals(SwitchPortTuple that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_dpid = true;
    boolean that_present_dpid = true;
    if (this_present_dpid || that_present_dpid) {
      if (!(this_present_dpid && that_present_dpid))
        return false;
      if (this.dpid != that.dpid)
        return false;
    }

    boolean this_present_port = true;
    boolean that_present_port = true;
    if (this_present_port || that_present_port) {
      if (!(this_present_port && that_present_port))
        return false;
      if (this.port != that.port)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(dpid);

    hashCode = hashCode * 8191 + port;

    return hashCode;
  }

  @Override
  public int compareTo(SwitchPortTuple other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetDpid(), other.isSetDpid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDpid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dpid, other.dpid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPort(), other.isSetPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("SwitchPortTuple(");
    boolean first = true;

    sb.append("dpid:");
    sb.append(this.dpid);
    first = false;
    if (!first) sb.append(", ");
    sb.append("port:");
    sb.append(this.port);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class SwitchPortTupleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public SwitchPortTupleStandardScheme getScheme() {
      return new SwitchPortTupleStandardScheme();
    }
  }

  private static class SwitchPortTupleStandardScheme extends org.apache.thrift.scheme.StandardScheme<SwitchPortTuple> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, SwitchPortTuple struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // DPID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.dpid = iprot.readI64();
              struct.setDpidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.port = iprot.readI16();
              struct.setPortIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, SwitchPortTuple struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DPID_FIELD_DESC);
      oprot.writeI64(struct.dpid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(PORT_FIELD_DESC);
      oprot.writeI16(struct.port);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class SwitchPortTupleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public SwitchPortTupleTupleScheme getScheme() {
      return new SwitchPortTupleTupleScheme();
    }
  }

  private static class SwitchPortTupleTupleScheme extends org.apache.thrift.scheme.TupleScheme<SwitchPortTuple> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, SwitchPortTuple struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetDpid()) {
        optionals.set(0);
      }
      if (struct.isSetPort()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetDpid()) {
        oprot.writeI64(struct.dpid);
      }
      if (struct.isSetPort()) {
        oprot.writeI16(struct.port);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, SwitchPortTuple struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        struct.dpid = iprot.readI64();
        struct.setDpidIsSet(true);
      }
      if (incoming.get(1)) {
        struct.port = iprot.readI16();
        struct.setPortIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}


text:
<?php

namespace App\Http\Controllers;

use Auth;
use Config;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    /**
     * 歓迎画面.
     *
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index()
    {
        return view('welcome');
    }

    /**
     * 言語変更スイッチ
     *
     * @param Request $request
     * @param $locale
     * @return \Illuminate\Http\RedirectResponse
     */
    public function lang(Request $request, $locale)
    {
        if (Auth::guest()) {
            if (in_array($locale, config('app.available_locales'))) {
                $request->session()->put('lang_guest', $locale);
            }
        } else {
            if (in_array($locale, config('app.available_locales'))) {
                $request->session()->put('lang', $locale);
            }
        }

        return redirect()->back();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package tamaized.aov.common.core.abilities.astro;

import net.minecraft.client.resources.I18n;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import tamaized.aov.AoV;
import tamaized.aov.common.capabilities.CapabilityList;
import tamaized.aov.common.capabilities.aov.IAoVCapability;
import tamaized.aov.common.capabilities.astro.IAstroCapability;
import tamaized.aov.common.core.abilities.Abilities;
import tamaized.aov.common.core.abilities.Ability;
import tamaized.aov.common.core.abilities.AbilityBase;

public class RoyalRoad extends AbilityBase {

	private static final ResourceLocation icon = new ResourceLocation(AoV.MODID, "textures/spells/royalroad.png");

	private static final int charges = -1;

	public RoyalRoad() {
		super(

				new TranslationTextComponent(getStaticName()),

				new TranslationTextComponent(""),

				new TranslationTextComponent("aov.spells.royalroad.desc")

		);
	}

	public static String getStaticName() {
		return "aov.spells.royalroad.name";
	}

	@Override
	public ResourceLocation getIcon() {
		return icon;
	}

	@Override
	@OnlyIn(Dist.CLIENT)
	public String getName() {
		return I18n.format(getStaticName());
	}

	@Override
	public int getCoolDown() {
		return 30;
	}

	@Override
	public int getMaxCharges() {
		return charges;
	}

	@Override
	public int getChargeCost() {
		return 0;
	}

	@Override
	public double getMaxDistance() {
		return 0;
	}

	@Override
	public boolean usesInvoke() {
		return false;
	}

	@Override
	public boolean isCastOnTarget(PlayerEntity caster, IAoVCapability cap, LivingEntity target) {
		return false;
	}

	@Override
	public boolean cast(Ability ability, PlayerEntity caster, LivingEntity target) {
		IAstroCapability astro = CapabilityList.getCap(caster, CapabilityList.ASTRO);
		IAoVCapability aov = CapabilityList.getCap(caster, CapabilityList.AOV);
		if (astro == null || aov == null)
			return false;
		if (astro.getDraw() != null) {
			astro.burnCard(caster);
			for (Ability a : aov.getSlots()) {
				if (a != null && a.getAbility() == Abilities.draw)
					a.setTimer(0);
			}
			aov.addExp(caster, 15, this);
		} else
			ability.setNextCooldown(1);
		astro.sendPacketUpdates(caster);
		return true;
	}

}


text:
<?php

#apd_set_pprof_trace();
# Main wiki script; see design.doc
#
$wgRequestTime = microtime();
unset( $IP );
@ini_set( 'allow_url_fopen', 0 ); # For security...

if (!file_exists( 'LocalSettings.php' ) || filesize( 'LocalSettings.php' ) <=0) {
	header('Location: config/index.php');
	exit();
}

// Valid web server entry point, enable includes.
define('MINDTOUCH_DEKI', true);
require_once( 'includes/Defines.php' );
require_once( 'LocalSettings.php' );
require_once( 'includes/Setup.php' );

wfProfileIn('main-load-plugins');
// (guerrics) handles loading plugins and calling hooks
require_once($IP . $wgDekiPluginPath . '/deki_plugin.php');
// load plugins
DekiPlugin::loadSitePlugins();
wfProfileOut('main-load-plugins');

wfProfileIn( 'main-misc-setup' );

OutputPage::setEncodings(); # Not really used yet

// Use DekiRequest here so that we can access button values
$action = DekiRequest::getInstance()->getVal('action', 'view');

$title = $wgRequest->getVal( 'title' );
$action = strtolower( $action );
if ($wgRequest->getVal( 'printable' ) == 'yes') {
	$wgOut->setPrintable();
}

if ( wfHomePageInternalTitle() == $title && 'delete' != $action ) {
	$wgTitle = Title::newFromText( wfHomePageInternalTitle() );
}
elseif ( $curid = $wgRequest->getInt( 'curid' ) ) {
	# URLs like this are generated by RC, because rc_title isn't always accurate
	$wgTitle = Title::newFromID( $curid );
}
else {
	if ($contextID = $wgRequest->getInt( 'contextid' ))
	$wgTitle = Title::newFromURL( $title, Title::newFromID( $contextID ) );
	else
	$wgTitle = Title::newFromURL( $title );
}

// invalid title needs to fail early; see bug #6279
if (is_null($wgTitle))
{
	$wgTitle = Title::newFromText( wfMsgForContent('Article.Error.input-bad-title') );
	$wgOut->errorpage('Article.error.badtitle', 'Article.Error.page-title-is-invalid', htmlspecialchars($title));
	exit();
}

// TODO: (guerrics) remove this temporary check
if ($wgTitle->getNamespace() == NS_ADMIN)
{
	$Title = Title::makeTitle(NS_SPECIAL, 'Admin');
	$wgOut->redirect($Title->getLocalUrl());

	// redirect immediately
	$wgOut->output();
	exit();
}

// allow plugins to hook into custom titles or modify the title object
wfProfileIn('main-plugin-INDEX_PROCESS_TITLE');
DekiPlugin::executeHook(Hooks::MAIN_PROCESS_TITLE, array($wgRequest, $wgTitle));
wfProfileOut('main-plugin-INDEX_PROCESS_TITLE');

wfProfileOut( 'main-misc-setup' );
wfProfileIn( 'main-action' );

$search = $wgRequest->getText( 'search' );
if ( !is_null( $search ) && $search !== '' ) {
	$wgTitle = Title::makeTitle( NS_SPECIAL, 'Search' );
}

if ( !$wgTitle ) {
	$wgTitle = Title::newFromText( wfMsgForContent('Article.Error.input-bad-title') );
	$wgOut->errorpage('badtitle', 'Article.Error.page-title-is-invalid');
} else if ( $wgTitle->getInterwiki() != '' ) {
	$url = $wgTitle->getFullURL();
	# Check for a redirect loop
	if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) ) {
		$wgOut->redirect( $url );
	} else {
		$wgTitle = Title::newFromText( wfMsgForContent('Article.Error.input-bad-title') );
		$wgOut->errorpage('badtitle', 'Article.Error.page-title-is-invalid');
	}
} else if ( ( $action == 'view' ) &&
(!isset( $_GET['title'] ) || strcasecmp(rawurldecode($wgTitle->getPrefixedDBKey()), $_GET['title']) != 0 ) &&
!count( array_diff( array_keys( $_GET ), array( 'action', 'title' ) ) ) )
{
	$wgOut->redirect( $wgTitle->getFullURL(), '301');
}
else
{
	if (!empty($wgPreloadPages))
	{
		$articleId = $wgTitle->getArticleId();
		foreach ($wgPreloadPages as $page)
		{
			$at = new Article(Title::newFromText($page));
			$at->mTargetArticleId = $articleId;
			$at->loadContent();
		}
	}

	// variables used to avoid large conditionals
	$specialPluginResult = 0;
	$dashboardPluginResult = 0;
	if (NS_SPECIAL == $wgTitle->getNamespace())
	{
		// actions that need to be made when we have a special pages
		$bits = split("/", $wgTitle->getDBkey(), 2);
		$name = $bits[0];
		if (!isset($bits[1])) // bug 2087
		{
			$par = NULL;
		}
		else
		{
			$par = $bits[1];
		}

		// fire a special page dispatcher
		$specialPluginResult = DekiPlugin::executeHook(Hooks::SPECIAL_PAGE, array($name));
	}
	else if ($action == 'view'
			// we're on a dashboard page (/User:Admin)
			&& NS_USER == $wgTitle->getNamespace()
			&& (strlen($wgTitle->getPartialURL()) > 0)
			&& (strpos($wgTitle->getPrefixedURL(), '/') === false)
			// not a diff view
			&& is_null($wgRequest->getVal('diff'))
			// not a revision view
			&& is_null($wgRequest->getVal('revision'))
			// bug #8311 - ensure user can see the page, otherwise extra error messages
			&& $wgArticle->userCanRead())
	{
		// get user who owns dashboard
		$username = urldecode($wgTitle->getPartialUrl());
		$User = null;

		// if has underscore, try finding name with spaces first
		if (strpos($username, '_') !== false)
		{
			$usernameSpaces = str_replace('_', ' ', $username);
			$User = DekiUser::newFromText($usernameSpaces);
		}

		// load the default username
		$User = is_null($User) ? DekiUser::newFromText($username) : $User;

		// only fire dashboard for root user page
		$dashboardPluginResult = DekiPlugin::executeHook(Hooks::USER_DASHBOARD, array($User));
	}

	if ($specialPluginResult > 0)
	{
		// noop, plugin should have already rendered html
	}
	else if ($dashboardPluginResult > 0)
	{
		// dashboard renders html
	}
	else
	{
		switch( $wgTitle->getNamespace() ) {
			case NS_ATTACHMENT:
				require_once('Attach.php');
				if (AttachFile::execute( $wgTitle, $action ))
				return;
				break;
			default:
				$wgArticle = new Article( $wgTitle );
		}

		# MT ursm: edit a new article by default
		if ($action == 'view' && $wgArticle->getID() <= 0 && $wgTitle->isEditable() && $wgArticle->userCanCreate())
		{
			$action = 'edit';
		}

		// bugfix #6855: It's possible to create Talk page without parent page
		if ($action == 'edit' && $wgArticle->getID() <= 0 && $wgTitle->getNamespace() == NS_TALK)
		{
			// determine if the talk parent exists
			$Title = Title::newFromText($wgTitle->getText());
			$Article = new Article($Title);
			if ($Article->getID() <= 0)
			{
				DekiMessage::error(wfMsg('Article.Error.cannot-create-talk'));
				$wgOut->redirectHome();
			}
		}

		if ($action == 'edit' && $wgArticle->getId() > 0 && !$wgArticle->userCanEdit()) {
			$action = 'view';
		}

		switch( $action ) {
			case 'noaction':
				break;
			case 'print':
			case 'view':
			case 'diff':
				/* todo: this should split off into its own Article method when we refactor article */
				$wgArticle->view();
				break;

				// post only action for revision hiding
			case 'historysubmit':
				$Request = DekiRequest::getInstance();
				// action is for post only
				if (!$Request->isPost())
				{
					$wgOut->redirectHome();
					break;
				}

				// determine if the user is changing a revision or viewing a diff
				$revChange = $Request->getVal('revchange');
				if (empty($revChange))
				{
					// guerrics: redirect to non-posted url
					$revision = $Request->getInt('revision');
					$diff = $Request->getInt('diff');
					$query = 'action=diff&revision='.$revision.'&diff='.$diff;
					$wgOut->redirect($wgTitle->getFullURL($query));
					break;
				}

				// else, revision show/hide fall through to history
			case 'history':
				require_once( 'includes/PageHistory.php' );
				$history = new PageHistory( $wgArticle );
				$history->history();
				break;

			case 'comment':
				$Title = clone $wgArticle->getTitle(); // making copies...
				if (DekiPlugin::HANDLED_HALT != DekiPlugin::executeHook(Hooks::MAIN_ACTION_COMMENT, array($Title)))
				{
					$editor = new CommentPage($Title);
					$editor->submit();
				}
				break;

			case 'watch':
			case 'unwatch':
				//		case 'delete':
			case 'revert':
			case 'rollback':
			case 'addsubpage':
				$wgArticle->$action();
				break;
			case 'export':
				$wgOut->mExport = true;
				$wgOut->mExportType = strtolower($wgRequest->getVal('type'));
				$wgArticle->view();
				if ($wgRequest->getVal('type') == 'pdf') {
					$wgOut->mExportType == 'pdf';
				}
				break;
			case 'submit':
				if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
					DekiUser::setupSession();
				}
				# Continue...
			case 'edit':
			case 'source':
				require_once( 'includes/EditPage.php' );

				if ($action != 'submit')
				{
					$wgArticle->view();
				}

				$editor = new EditPage( $wgArticle );
				if ( $action == 'submit' )
				{
					$editor->submit();
				}
				break;

			default:
				$result = DekiPlugin::executeHook(Hooks::MAIN_ACTION, array($action, $wgTitle, $wgArticle));
				if ($result == DekiPlugin::UNHANDLED || $result == DekiPlugin::UNREGISTERED)
				{
					$wgOut->errorpage('System.error.error', 'Article.Error.unknown-action-specified');
				}
		}
	}
}

if ($action != 'export')
{
	// what's new feed
	$RecentChangesTitle = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
	$wgOut->addLink(array(
		'rel' => 'alternate',
		'type' => 'application/rss+xml',
		'title' => wfMsg('Page.ListRss.whats-new-feed'),
		'href' => $RecentChangesTitle->getLocalURL('feed=rss')
	));
}

wfProfileOut( 'main-action' );

wfProfileIn( 'main-cleanup' );
// allow plugins to add or modify content of the page
DekiPlugin::executeHook(Hooks::MAIN_PROCESS_OUTPUT, array($wgOut));
$wgOut->output();
wfProfileOut( 'main-cleanup' );

logProfilingData();
$wgDatabase->close();


text:
    <button id='play'>Play and Next</button>
    <button id='pause'>Pause</button>

    <audio autoplay preload controls></audio>


text:
PLATFORM=$1
TYPE=$2

if [ -z "$PLATFORM" ]; then
	PLATFORM="vc-win32"
	[ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux" ] && PLATFORM="linux"
fi

export vc_ver=latest

# Build <platform> <type>
function Build()
{
	local opt_platform=$1
	local opt_type=$2

	echo "---- Making $2 target for $opt_platform ----"

	# make a directory for obj files and makefiles, and generate a makefile
	[ -d "obj" ] || mkdir obj
	makefile="obj/makefile-$opt_type-$opt_platform"
	Tools/genmake Test/test.project TARGET=$opt_platform TYPE=$opt_type > $makefile

	# build
	case "$opt_platform" in
		"vc-win32")
			vc32tools --make $makefile || exit 1
			;;
		"vc-win64")
			vc32tools --64 --make $makefile || exit 1
			;;
		"mingw32"|"cygwin")
			PATH=/bin:/usr/bin:$PATH			# configure paths for Cygwin
			gccfilt make -f $makefile || exit 1
			;;
		linux*)
			make -j 4 -f $makefile || exit 1	# use 4 jobs for build
			;;
		*)
			echo "Unknown PLATFORM=\"$opt_platform\""
			exit 1
	esac
}

# BuildAll <platform>
function BuildAll()
{
	local opt_platform=$1
	if [ "$TYPE" ]; then
		Build $opt_platform $TYPE
	else
		Build $opt_platform "C"
		Build $opt_platform "Orig"
		if [ "$opt_platform" != "vc-win64" ]; then
			Build $opt_platform "Asm"			# no 64-bit assembly implementation
		fi
	fi
}

#-----------------------------------------

if [ "$PLATFORM" == "win" ]; then
	# both windows targets
	BuildAll "vc-win32"
	BuildAll "vc-win64"
else
	BuildAll $PLATFORM
fi


text:
package edu.ucsf.lava.crms.people.controller;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.validation.BindingResult;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.execution.RequestContext;

import edu.ucsf.lava.core.controller.ComponentCommand;
import edu.ucsf.lava.core.session.CoreSessionUtils;
import edu.ucsf.lava.crms.auth.CrmsAuthUtils;
import edu.ucsf.lava.crms.controller.CrmsEntityComponentHandler;
import edu.ucsf.lava.crms.people.model.ContactLog;
import edu.ucsf.lava.crms.session.CrmsSessionUtils;

public class ContactLogHandler extends CrmsEntityComponentHandler {

	public ContactLogHandler (){
		super();
		this.setHandledEntity("contactLog", ContactLog.class);
		CrmsSessionUtils.setIsPatientContext(this);
		this.setRequiredFields(new String[]{"projName","method","logDate","staffInit"});
	}

	@Override
	protected Object initializeNewCommandInstance(RequestContext context, Object command) {
		HttpServletRequest request =  ((ServletExternalContext)context.getExternalContext()).getRequest();
		((ContactLog)command).setPatient(CrmsSessionUtils.getCurrentPatient(sessionManager,request));
		return command;
	}

	protected Long getContextIdFromRequest(RequestContext context){
		HttpServletRequest request =  ((ServletExternalContext)context.getExternalContext()).getRequest();
		ContactLog c = (ContactLog) ContactLog.MANAGER.getOne(getFilterWithId(request,Long.valueOf(context.getFlowScope().getString("id"))));
		return c.getPatient().getId();
	}

	public Map addReferenceData(RequestContext context, Object command, BindingResult errors, Map model) {
		HttpServletRequest request =  ((ServletExternalContext)context.getExternalContext()).getRequest();
		//load up dynamic lists
		Map<String,Map<String,String>> dynamicLists = getDynamicLists(model);
		ContactLog cl = (ContactLog)((ComponentCommand)command).getComponents().get("contactLog");

		//get list using project name
		Map<String,String> projList = listManager.getDynamicList(getCurrentUser(request),
				"context.projectList");
		projList = CrmsAuthUtils.filterProjectListByPermission(getCurrentUser(request),
				CoreSessionUtils.getCurrentAction(sessionManager,request), projList);
		dynamicLists.put("context.projectList", projList);

		if (cl.getProjName()!= null){
			dynamicLists.put("project.staffList", listManager.getDynamicList("project.projectStaffList",
						"projectName", cl.getProjName(),String.class));
			}
			else {
				dynamicLists.put("project.staffList", listManager.getDynamicList("patient.patientStaffList",
						"patientId", cl.getPatient().getId(),Long.class));
			}

		model.put("dynamicLists", dynamicLists);
		return super.addReferenceData(context, command, errors, model);
	}

}


text:
using System.Collections.Generic;

namespace YamlDotNet.RepresentationModel
{
	/// <summary>
	/// Comparer that is based on identity comparisons.
	/// </summary>
	public sealed class YamlNodeIdentityEqualityComparer : IEqualityComparer<YamlNode>
	{
		#region IEqualityComparer<YamlNode> Members

		/// <summary />
		public bool Equals(YamlNode x, YamlNode y)
		{
			return ReferenceEquals(x, y);
		}

		/// <summary />
		public int GetHashCode(YamlNode obj)
		{
			return obj.GetHashCode();
		}

		#endregion
	}
}


text:
package org.griphyn.vdl.router;

import org.griphyn.vdl.classes.*;

/**
 * Create a fully connected fake Diamond DAG exmample structure in memory using VDL classes.
 *
 *

 *
 *

 *   C --<-- A
 *   |\     /|
 *   | \ _ / |
 *   V  | L  V
 *   |   /\  |
 *   |  /  \ |
 *   | /    \|
 *   D --<-- B
 *

 *
 * @author Jens-S. Vöckler
 * @version $Revision$
 */
public class CreateFullDiamond {

    /**
     * create a 4 node diamond DAG as in-memory data structures employing the VDL classes. This is a
     * test module for some sample concrete planning modules.
     *
     * @return a list of Transformations and Derivations, encapsulated as Definitions.
     */
    public static Definitions create() {
        // create result vector
        Definitions result = new Definitions("test", "1.0");

        try {
            // create "generate" transformation
            Transformation t1 = new Transformation("generate");
            t1.addProfile(new Profile("hints", "pfnHint", new Text("keg.exe")));
            t1.addDeclare(new Declare("a", Value.SCALAR, LFN.OUTPUT));
            t1.addArgument(new Argument(null, new Text("-a generate -o ")));
            t1.addArgument(new Argument(null, new Use("a", LFN.OUTPUT)));
            result.addDefinition(t1);

            // create "gobble" transformation
            Transformation t2 = new Transformation("take1");
            t2.addProfile(new Profile("hints", "pfnHint", new Text("keg.exe")));
            t2.addDeclare(new Declare("a", Value.SCALAR, LFN.INPUT));
            t2.addDeclare(new Declare("b", Value.SCALAR, LFN.OUTPUT));
            Argument t2a1 = new Argument();
            t2a1.addLeaf(new Text("-a "));
            t2a1.addLeaf(new Text("take1"));
            t2.addArgument(t2a1);
            Argument t2a2 = new Argument();
            t2a2.addLeaf(new Text("-i "));
            t2a2.addLeaf(new Use("a", LFN.INPUT));
            t2.addArgument(t2a2);
            t2.addArgument(new Argument(null, new Text("-o")));
            t2.addArgument(new Argument(null, new Use("b", LFN.OUTPUT)));
            result.addDefinition(t2);

            Transformation t3 = new Transformation("take2");
            t3.addProfile(new Profile("hints", "pfnHint", new Text("keg.exe")));
            t3.addDeclare(new Declare("a", Value.SCALAR, LFN.INPUT));
            t3.addDeclare(new Declare("b", Value.SCALAR, LFN.INPUT));
            t3.addDeclare(new Declare("c", Value.SCALAR, LFN.OUTPUT));
            // you can do it thus...
            Argument t3a1 = new Argument();
            t3a1.addLeaf(new Text("-a take2 -i "));
            t3a1.addLeaf(new Use("a", LFN.INPUT));
            t3.addArgument(t3a1);
            // ...or thus...
            // NOTE: the space is now unnecessary, since argumentSeparator
            // defaults to one space. The argumentSeparator will be applied
            // when constructing the commandline from two <argument> elements.
            //// t3.addArgument( new Argument( null, new Text(" ") ) );
            t3.addArgument(new Argument(null, new Use("b", LFN.INPUT)));
            // ...or thus again
            Argument t3a2 = new Argument();
            t3a2.addLeaf(new Text("-o "));
            t3a2.addLeaf(new Use("c", LFN.OUTPUT));
            t3.addArgument(t3a2);
            result.addDefinition(t3);

            Transformation t4 = new Transformation("analyze");
            t4.addProfile(new Profile("hints", "pfnHint", new Text("keg.exe")));
            t4.addDeclare(new Declare("abc", Value.LIST, LFN.INPUT));
            t4.addDeclare(new Declare("d", Value.SCALAR, LFN.OUTPUT));
            t4.addArgument(new Argument(null, new Text("-a analyze -i")));
            t4.addArgument(new Argument("files", new Use("abc", "\"", " ", "\"")));
            t4.addArgument(new Argument(null, new Text("-o")));
            t4.addArgument(new Argument(null, new Use("d", LFN.OUTPUT)));
            result.addDefinition(t4);

            // create "top" node derivation of "generate"
            Derivation d1 = new Derivation("A", "generate");
            d1.addPass(new Pass("a", new Scalar(new LFN("f.a", LFN.OUTPUT))));
            result.addDefinition(d1);

            // create "left" node derivation of "findrange"
            Derivation d2 = new Derivation("B", "take1");
            d2.addPass(new Pass("b", new Scalar(new LFN("f.b", LFN.OUTPUT))));
            d2.addPass(new Pass("a", new Scalar(new LFN("f.a", LFN.INPUT))));
            result.addDefinition(d2);

            // create "right" node derivation of "findrange"
            Derivation d3 = new Derivation("C", "take2");
            d3.addPass(new Pass("a", new Scalar(new LFN("f.a", LFN.INPUT))));
            d3.addPass(new Pass("b", new Scalar(new LFN("f.b", LFN.INPUT))));
            d3.addPass(new Pass("c", new Scalar(new LFN("f.c", LFN.OUTPUT))));
            result.addDefinition(d3);

            // create "bottom" node derivation of "analyze"
            Derivation d4 = new Derivation("D", "analyze");
            List d4_list1 = new List();
            d4_list1.addScalar(new Scalar(new LFN("f.a", LFN.INPUT)));
            d4_list1.addScalar(new Scalar(new LFN("f.b", LFN.INPUT)));
            d4_list1.addScalar(new Scalar(new LFN("f.c", LFN.INPUT)));
            d4.addPass(new Pass("abc", d4_list1));
            d4.addPass(new Pass("d", new Scalar(new LFN("f.d", LFN.OUTPUT))));
            result.addDefinition(d4);
        } catch (IllegalArgumentException iae) {
            System.err.println(iae.getMessage());
            System.exit(1);
        }

        // finally
        return result;
    }
}


text:
/*

Standard CSS file for use with Standard.html and Standard-Source.html.

*/

body
{
	font-family: Georgia, Palatino, "Times New Roman", Times, serif;
	font-size: 100%;
	-webkit-text-size-adjust: none;
}

.container
{
	margin-top: 2em;
}

/*
Paragraph features defined here apply without distinction to blurb and
source paragraphs.
*/

p
{
	font-size: 1em;
	line-height: 1.4;
}

/*
Here we get rid of underlining for links, and provide a more subdued
color scheme than the bright-blue HTML standard.

Best color schemes are likely to vary depending on cover art.
*/

a
{
	text-decoration: none;
	color: #369;
}

a:visited
{
	text-decoration: none;
	color: #006;
}

a:hover
{
	text-decoration: none;
	color: #33C;
}

.coverimage
{
	width: 12.6em;
	margin-top: 2em;
	margin-left: 1em;
	float: left;
	clear: left;
	text-align: right;
}

/*
Here we make invisible the one-pixel border that currently goes around
the cover image.
*/

.coverimage a
{
	font-style: normal;
	font-variant: normal;
	font-weight: normal;
	color: #FFF;
}

/*
The introduction formatting applies to the title, author name, and release
number, here presented at the top of the page.

To change the appearance of specific elements, tweak

	h1 for the title
	h2 for the author name
	.bibliography for the release information

*/

.introduction
{
	padding-top: 2.4em;
	margin-left: 15.4em;
	width: 33em;
	line-height: 1;
	text-align: left;
}

/*
These set the sizes for the title (h1) and the author name (h2).

The ideal font-size for h1 may vary quite a bit depending on how long the
game's title is: larger for one-word titles, smaller for longer titles.

Should we wish to remove the title entirely and allow the cover art alone
to represent the game, we need only add the line "display: none;" to the
definition of h1.

*/
h1 { font-size: 2em;  }
h2 { font-size: 1em; line-height: .25;}

/* The about formatting applies to blurb information. */

.about
{
	margin-top: 2.8em;
	margin-left: 15.4em;
	width: 33em;
	text-align: left;
}

/*
By setting about p and about p + p, we instruct the first paragraph of the
blurb to be unindented but subsequent paragraphs to be indented a small
distance.
*/

.about p { margin-bottom: 0; }

.about p + p
{
	text-indent: 1.4em;
	margin-top: 0;
}

/*
Playinfo affects the paragraph at the bottom of the home-page that supplies
the IFID for the game and suggests interpreters for the author to use. */

.playinfo
{
	margin: 1em 0px 0px 15.4em;
	width: 33em;
}

.playinfo p {
	font-size: .75em;
}

/*
The links formatting applies to the story file and auxiliary links found
on the home page, and to the Contents, Next, and Previous links on the
source pages. Here we arrange for them to appear in a column at the left
side of the page.
*/

.links
{
	width: 13em;
	float: left;
	clear: left;
	text-align: right;
	margin-top: 2.8em;
}

.links li
{
	list-style-type: none;
	list-style-position: default;
	padding: .4 em;
}

/*
The filetype id applies only to the little (blorb), (pdf), and similar
denotations found on the links. Here we make these appear smaller than the
surrounding text. In order to get rid of them entirely, we would add
"display: none;" to our filetype definition.
*/

span.filetype { font-size: .5em; }

/*
Source formatting applies to the source text on generated pages.
*/

.source
{
	margin-top: 1.4em;
	margin-left: 15.4em;
	width: 33em;
	line-height: 1.4;
}

.sourceintroduction
{
	margin-left: 15.4em;
	width: 33em;
}

.sourceintroduction h1
{
	padding-top: 2.8em;
	font-size: 1em;
	line-height: 1;
	text-align: right;
	text-decoration: none;
	font-weight: normal;
	font-style: italic;
}

.sourceintroduction h2
{
	display: none;
}

.sourcecoverimage
{
	width: 12.6em;
	margin-top: 2em;
	margin-left: 1em;
	float: left;
	clear: left;
	text-align: right;
}

/*
Here we make invisible the one-pixel border that currently goes around
the cover image.
*/

.sourcecoverimage a
{
	font-style: normal;
	font-variant: normal;
	font-weight: normal;
	color: #FFF;
}

.sourcebibliography
{
	display: none;
}

span.quote { color: #369; }

span.comment {
	color: #390;}

span.substitution
{
	color: #69B;
	font-variant: small-caps;
}

span.i6code { color: #666; font-family: monospace; }

span.columnhead {
	font-style: italic;
	font-size: 1em;
}

span.heading
{
	font-weight: bold;
}

.source td
{
	padding-top: .7em;
	padding-bottom: .7em;
	padding-right: 1.4em;
	font-size: .75em;
	text-align: left;
	vertical-align: top;
}

/*
We could alter the following in order to make the footnote links in the source
text appear different from other links, but otherwise they will be the same
color as other links -- which is fine as a default.
*/

span.notecue
{
	font-size: .75em;
	vertical-align: super;
}

/*
Here we tell the elements of the table of contents not to be listed with
bullets because this tends to produce considerable visual clutter especially
with large project files.
*/

.source li
{
	list-style-type: none;
	list-style-position: default;
}

/*
Notes applies to footnotes on the source text.
*/

.notes
{
	margin-left: 16.8em;
	width: 33em;
}

.notes p
{
	text-indent: -1.4em;
	font-size: .75em;
}

.notesheading { font-style: italic; }

p.indent0
{	margin-bottom: 0;
}

p.indent1
{
	padding-left: 2.8em;
	text-indent: -.7em;
	margin-bottom: 0;
	margin-top: 0;
}

p.indent2
{	margin-bottom: 0;
	padding-left: 5.6em;
	text-indent: -.7em;
	margin-top: 0;
}

p.indent3
{
	padding-left: 8.4em;
	text-indent: -.7em;
	margin-bottom: 0;
	margin-top: 0;
}

p.indent4
{	margin-bottom: 0;
	padding-left: 11.2em;
	text-indent: -.7em;
	margin-top: 0;
}

p.indent5
{
	padding-left: 14em;
	text-indent: -.7em;
	margin-bottom: 0;
	margin-top: 0;
}

p.indent6
{	margin-bottom: 0;
	padding-left: 16.8em;
	text-indent: -.7em;
	margin-top: 0;
}

p.indent7
{
	padding-left: 19.6em;
	text-indent: -.7em;
	margin-bottom: 0;
	margin-top: 0;
}

p.indent8
{	margin-bottom: 0;
	padding-left: 22.4em;
	text-indent: -.7em;
	margin-top: 0;
}

p.indent9
{
	padding-left: 25.2em;
	text-indent: -.7em;
	margin-bottom: 0;
	margin-top: 0;
}

/*
Styles for play.html
*/
.play .coverimage
{
	position: fixed;
}
.play .links
{
	margin-top: 200px;
	position: fixed;
}

.interpretercredit
{
	bottom: 1em;
	font-size: 80%;
	position: fixed;
}

#gameport
{
	background: white;
	bottom: 0px;
	left: 15.4em;
	line-height: 1.4;
	margin: 0px;
	position: absolute;
	right: 0px;
	top: 0px;
}

/*
Styles for mobile browsers: change to a one-column layout.
*/

@media screen and (max-device-width: 480px)
{
	.coverimage, .introduction, .links, .about, .playinfo, .source, .sourceintroduction, .sourcecoverimage, .notes
	{
		float: none;
		margin-left: 1em;
		text-align: left;
	}

	.play .coverimage, .play .links, .play .interpretercredit
	{
		display: none;
	}

	#gameport
	{
		left: 0px;
		width: auto;
	}
}


text:
.. _merge:

###############
*merge*
###############

|

.. image:: ../images/tool-glyphs/merge-glyph.png
    :width: 600pt
|

``bedtools merge`` combines overlapping or "book-ended" features in an interval
file into a single feature which spans all of the combined features.

.. note::

    ``bedtools merge`` requires that you presort your data by chromosome and
    then by start position (e.g., ``sort -k1,1 -k2,2n in.bed > in.sorted.bed``
    for BED files).

.. seealso::

    :doc:`../tools/cluster`
    :doc:`../tools/complement`

==========================================================================
Usage and option summary
==========================================================================
**Usage**:
::

  bedtools merge [OPTIONS] -i <BED/GFF/VCF/BAM>

**(or)**:
::

  mergeBed [OPTIONS] -i <BED/GFF/VCF/BAM>

===========================      ===============================================================================================================================================================================================================
Option                           Description
===========================      ===============================================================================================================================================================================================================
**-s**				                   Force strandedness. That is, only merge features that are the same strand. *By default, this is disabled*.
**-S**                           Force merge for one specific strand only. Follow with + or - to force merge from only the forward or reverse strand, respectively. *By default, merging is done without respect to strand*.
**-d**                           Maximum distance between features allowed for features to be merged. *Default is 0. That is, overlapping and/or book-ended features are merged*.
**-c**                           Specify columns from the input file to operate upon (see -o option, below). Multiple columns can be specified in a comma-delimited list.
**-o**                           | Specify the operation that should be applied to ``-c``.
                                 | Valid operations:
                                 |     sum, min, max, absmin, absmax,
                                 |     mean, median,
                                 |     collapse (i.e., print a delimited list (duplicates allowed)),
                                 |     distinct (i.e., print a delimited list (NO duplicates allowed)),
                                 |     count
                                 |     count_distinct (i.e., a count of the unique values in the column),
                                 | **Default:** sum
                                 | Multiple operations can be specified in a comma-delimited list.
                                 | If there is only column, but multiple operations, all operations will be
                                 | applied on that column. Likewise, if there is only one operation, but
                                 | multiple columns, that operation will be applied to all columns.
                                 | Otherwise, the number of columns must match the the number of operations,
                                 | and will be applied in respective order.
                                 |
                                 | E.g., ``-c 5,4,6 -o sum,mean,count`` will give the sum of column 5,
                                 | the mean of column 4, and the count of column 6.
                                 | The order of output columns will match the ordering given in the command.
**-header**                      | Print the header from the A file prior to results.

**-delim**                       | Specify a custom delimiter for the -nms and -scores concat options
                                 | Example: ``-delim "|"``
                                 | ``Default: ";"``
===========================      ===============================================================================================================================================================================================================

==========================================================================
Default behavior
==========================================================================
By default, ``bedtools merge`` combines overlapping (by at least 1 bp) and/or
bookended intervals into a single, "flattened" or "merged" interval.

.. code-block:: bash

  $ cat A.bed
  chr1  100  200
  chr1  180  250
  chr1  250  500
  chr1  501  1000

  $ bedtools merge -i A.bed
  chr1  100  500
  chr1  501  1000

==========================================================================
``-s`` Enforcing "strandedness"
==========================================================================
The ``-s`` option will only merge intervals that are overlapping/bookended
*and* are on the same strand.

.. code-block:: bash

  $ cat A.bed
  chr1  100  200   a1  1 +
  chr1  180  250   a2  2 +
  chr1  250  500   a3  3 -
  chr1  501  1000  a4  4 +

  $ bedtools merge -i A.bed -s
  chr1  100  250
  chr1  501  1000
  chr1  250  500

To also report the strand, you could use the ``-c`` and ``-o`` operators (see below for more details):

.. code-block:: bash

  $ bedtools merge -i A.bed -s -c 6 -o distinct
  chr1  100 250 +
  chr1  501 1000  +

==========================================================================
``-S`` Reporting merged intervals on a specific strand.
==========================================================================
The ``-S`` option will only merge intervals for a specific strand. For example,
to only report merged intervals on the "+" strand:

.. code-block:: bash

  $ cat A.bed
  chr1  100  200   a1  1 +
  chr1  180  250   a2  2 +
  chr1  250  500   a3  3 -
  chr1  501  1000  a4  4 +

  $ bedtools merge -i A.bed -S +
  chr1  100 250
  chr1  501 1000

To also report the strand, you could use the ``-c`` and ``-o`` operators (see below for more details):

.. code-block:: bash

  $ bedtools merge -i A.bed -S + -c 6 -o distinct
  chr1  100 250 +
  chr1  501 1000  +

==========================================================================
``-d`` Controlling how close two features must be in order to merge
==========================================================================
By default, only overlapping or book-ended features are combined into a new
feature. However, one can force ``merge`` to combine more distant features
with the ``-d`` option. For example, were one to set ``-d`` to 1000, any
features that overlap or are within 1000 base pairs of one another will be
combined.

.. code-block:: bash

  $ cat A.bed
  chr1  100  200
  chr1  501  1000

  $ bedtools merge -i A.bed
  chr1  100  200
  chr1  501  1000

  $ bedtools merge -i A.bed -d 1000
  chr1  100  200  1000

==========================================================================
``-c`` and ``-o`` Applying operations to columns from merged intervals.
==========================================================================
When merging intervals, we often want to summarize or keep track of the
values observed in specific columns (e.g., the feature name or score) from
the original, unmerged intervals. When used together, the ``-c`` and ``-o``
options allow one to select specific columns (``-c``) and apply operation
(``-o``) to each column. The result will be appended to the default, merged
interval output.  For example, one could use the following to report the
count of intervals that we merged in each resulting interval (this replaces
the ``-n`` option that existed prior to version ``2.20.0``).

.. code-block:: bash

  $ cat A.bed
  chr1  100  200
  chr1  180  250
  chr1  250  500
  chr1  501  1000

  $ bedtools merge -i A.bed -c 1 -o count
  chr1  100  500  3
  chr1  501  1000 1

We could also use these options to report the mean of the score (#5) field:

.. code-block:: bash

  $ cat A.bed
  chr1  100  200   a1  1 +
  chr1  180  250   a2  2 +
  chr1  250  500   a3  3 -
  chr1  501  1000  a4  4 +

  $ bedtools merge -i A.bed -c 5 -o mean
  chr1  100 500 2
  chr1  501 1000  4

Let's get fancy and report the mean, min, and max of the score column:

.. code-block:: bash

  $ bedtools merge -i A.bed -c 5 -o mean,min,max
  chr1  100 500 2 1 3
  chr1  501 1000  4 4 4

Let's also report a comma-separated list of the strands:

.. code-block:: bash

  $ bedtools merge -i A.bed -c 5,5,5,6 -o mean,min,max,collapse
  chr1  100 500 2 1 3 +,+,-
  chr1  501 1000  4 4 4 +

Hopefully this provides a clear picture of what can be done.

==========================================================================
``-n`` Reporting the number of features that were merged
==========================================================================
.. deprecated:: 2.20.0
See the ``-c`` and ``-o`` operators.

==========================================================================
``-nms`` Reporting the names of the features that were merged
==========================================================================
.. deprecated:: 2.20.0
See the ``-c`` and ``-o`` operators.

==========================================================================
``-scores`` Reporting the scores of the features that were merged
==========================================================================
.. deprecated:: 2.20.0
See the ``-c`` and ``-o`` operators.

==========================================================================
``-delim`` Change the delimiter for ``-c`` and ``-o``
==========================================================================
One can override the use of a comma as the delimiter for the ``-c`` and
``-o collapse|distinct`` options via the use of the ``-delim`` option.

.. code-block:: bash

  $ cat A.bed
  chr1  100  200  A1
  chr1  150  300  A2
  chr1  250  500  A3

Compare:

.. code-block:: bash

  $ bedtools merge -i A.bed -c 4 -o collapse
  chr1  100  500  A1,A2,A3

to:

.. code-block:: bash

  $ bedtools merge -i A.bed -c 4 -o collapse -delim "|"
  chr1  100  500  A1|A2|A3


text:
/*
inie_torrent runs decode_bencode ant after that is creates all the files.
Returns 1 if  success.

*/
#ifndef INIT_TORRENT_H
#define INIT_TORRENT_H
#include "bencodning.h"
#include "createfile.h"
#include <unistd.h>
#include <pthread.h>

int init_torrent (char *, torrent_info *);

#endif


text:
import java.util.*;

/**
 * @author Arthur Portas
 */
public class Editor extends SkilledEmployee {

    /**
     * Default constructor
     */
    public Editor() {
    }

    /**
     *
     */
    private boolean prefersPaperEditing;

    /**
     *
     */
    public void displayInformation() {
        // TODO implement here
    }

}


text:
gisapplication
==============

gis application


text:
import logging

try:
    import docker  # NOTE(cgoes): has not been tested with Python 3.6 yet
except ImportError:
    logging.error("Could not import docker module. "
                  "Install it using 'pip install docker'")

from adles import utils
from adles.interfaces import Interface

class DockerInterface(Interface):
    """Generic interface for the Docker platform."""

    def __init__(self, infra, spec):
        """
        :param dict infra: Dict of infrastructure information
        :param dict spec: Dict of a parsed specification
        """
        super(DockerInterface, self).__init__(infra=infra, spec=spec)
        self._log = logging.getLogger(str(self.__class__))
        self._log.debug("Initializing %s", self.__class__)

        # If needed, a wrapper class that simplifies
        # the creation of containers will be made
        # Reference:
        # https://docker-py.readthedocs.io/en/stable/client.html#client-reference
        # Initialize the Docker client
        self.client = docker.DockerClient(base_url=infra.get("url",
                                                             "unix:///var/run/"
                                                             "docker.sock"),
                                          tls=bool(infra.get("tls", True)))

        # Verify the connection to the client
        self.client.ping()

        self._log.debug("System info      : %s", str(self.client.info()))
        self._log.debug("System version   : %s", str(self.client.version()))

        # Authenticate to registry, if configured
        if "registry" in self.infra:
            reg = self.infra["registry"]
            reg_logins = utils.read_json(reg["login-file"])
            self.client.login(username=reg_logins["user"],
                              password=reg_logins["pass"],
                              registry=reg["url"])

        # List images currently on the server
        self._log.debug("Images: %s", str(self.client.images.list()))

    def create_masters(self):
        pass

    def deploy_environment(self):
        pass

    def cleanup_masters(self, network_cleanup=False):
        pass

    def cleanup_environment(self, network_cleanup=False):
        pass

    def __str__(self):
        return str(self.client.info() + "\nVersion:\t" + self.client.version())

    def __eq__(self, other):
        return super(self.__class__, self).__eq__(other) \
            and self.client == other.client


text:
| Version   | Supported          |
| --------- | ------------------ |
| 3.x.x     | :white_check_mark: |
| 2.x.x     | :white_check_mark: |
| 1.0.x     | :x:                |
| 0.38.5    | :x:                |
| <= 0.38.4 | :x:                |

## Reporting Security Issues

⚠ **Please do not report security vulnerabilities through public GitHub issues.** ⚠

Instead, either encrypted through Keybase chat
  - [keybase.io/cakebuild](https://keybase.io/cakebuild)

Or report them to us using NuGet.org *Contact owners*
  - [Cake](https://www.nuget.org/packages/Cake)
  - [Cake.Tool](https://www.nuget.org/packages/Cake.Tool)
  - [Cake.Frosting](https://www.nuget.org/packages/Cake.Frosting)
  - [Cake.CoreCLR](https://www.nuget.org/packages/Cake.CoreCLR)
  - [Cake.Core](https://www.nuget.org/packages/Cake.Core)
  - [Cake.Common](https://www.nuget.org/packages/Cake.Common)
  - [Cake.Testing](https://www.nuget.org/packages/Cake.Testing)
  - [Cake.NuGet](https://www.nuget.org/packages/Cake.NuGet)
  - [Cake.Cli](https://www.nuget.org/packages/Cake.Cli)

If you prefer to submit without logging in, send an email to [security@cakebuild.net](mailto:security@cakebuild.net).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
  * Full paths of source file(s) related to the manifestation of the issue
  * The location of the affected source code (tag/branch/commit or direct URL)
  * Any special configuration required to reproduce the issue
  * Step-by-step instructions to reproduce the issue
  * Proof-of-concept or exploit code (if possible)
  * Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

## Preferred Languages

We prefer all communications to be in English.


text:
package main

import (
	"github.com/ivandejanovic/tpm/cfg"
	"github.com/ivandejanovic/tpm/compiler"
	"github.com/ivandejanovic/tpm/vm"
)

func main() {
	abort, source := cfg.HandleArgs()

	if abort {
		return
	}

	code := compiler.Compile(source)
	vm.Execute(code)
}


text:
package org.apache.cassandra.db.streaming;

import java.io.File;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;
import java.util.UUID;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.DecoratedKey;
import org.apache.cassandra.db.compaction.AbstractCompactionStrategy;
import org.apache.cassandra.db.compaction.LeveledCompactionStrategy;
import org.apache.cassandra.dht.Range;
import org.apache.cassandra.dht.Token;
import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.KeyIterator;
import org.apache.cassandra.io.sstable.format.SSTableReader;
import org.apache.cassandra.io.util.DataOutputStreamPlus;
import org.apache.cassandra.net.AsyncStreamingOutputPlus;
import org.apache.cassandra.schema.TableId;
import org.apache.cassandra.streaming.OutgoingStream;
import org.apache.cassandra.streaming.StreamOperation;
import org.apache.cassandra.streaming.StreamSession;
import org.apache.cassandra.utils.concurrent.Ref;

import static org.apache.cassandra.db.compaction.Verifier.RangeOwnHelper;

/**
 * used to transfer the part(or whole) of a SSTable data file
 */
public class CassandraOutgoingFile implements OutgoingStream
{
    public static final List<Component> STREAM_COMPONENTS = ImmutableList.of(Component.DATA, Component.PRIMARY_INDEX, Component.STATS,
                                                                             Component.COMPRESSION_INFO, Component.FILTER, Component.SUMMARY,
                                                                             Component.DIGEST, Component.CRC);

    private final Ref<SSTableReader> ref;
    private final long estimatedKeys;
    private final List<SSTableReader.PartitionPositionBounds> sections;
    private final String filename;
    private final CassandraStreamHeader header;
    private final boolean keepSSTableLevel;
    private final ComponentManifest manifest;
    private Boolean isFullyContained;

    private final List<Range<Token>> normalizedRanges;

    public CassandraOutgoingFile(StreamOperation operation, Ref<SSTableReader> ref,
                                 List<SSTableReader.PartitionPositionBounds> sections, List<Range<Token>> normalizedRanges,
                                 long estimatedKeys)
    {
        Preconditions.checkNotNull(ref.get());
        Range.assertNormalized(normalizedRanges);
        this.ref = ref;
        this.estimatedKeys = estimatedKeys;
        this.sections = sections;
        this.normalizedRanges = ImmutableList.copyOf(normalizedRanges);
        this.filename = ref.get().getFilename();
        this.manifest = getComponentManifest(ref.get());

        SSTableReader sstable = ref.get();
        keepSSTableLevel = operation == StreamOperation.BOOTSTRAP || operation == StreamOperation.REBUILD;
        this.header =
            CassandraStreamHeader.builder()
                                 .withSSTableFormat(sstable.descriptor.formatType)
                                 .withSSTableVersion(sstable.descriptor.version)
                                 .withSSTableLevel(keepSSTableLevel ? sstable.getSSTableLevel() : 0)
                                 .withEstimatedKeys(estimatedKeys)
                                 .withSections(sections)
                                 .withCompressionMetadata(sstable.compression ? sstable.getCompressionMetadata() : null)
                                 .withSerializationHeader(sstable.header.toComponent())
                                 .isEntireSSTable(shouldStreamEntireSSTable())
                                 .withComponentManifest(manifest)
                                 .withFirstKey(sstable.first)
                                 .withTableId(sstable.metadata().id)
                                 .build();
    }

    @VisibleForTesting
    public static ComponentManifest getComponentManifest(SSTableReader sstable)
    {
        LinkedHashMap<Component, Long> components = new LinkedHashMap<>(STREAM_COMPONENTS.size());
        for (Component component : STREAM_COMPONENTS)
        {
            File file = new File(sstable.descriptor.filenameFor(component));
            if (file.exists())
                components.put(component, file.length());
        }

        return new ComponentManifest(components);
    }

    public static CassandraOutgoingFile fromStream(OutgoingStream stream)
    {
        Preconditions.checkArgument(stream instanceof CassandraOutgoingFile);
        return (CassandraOutgoingFile) stream;
    }

    @VisibleForTesting
    public Ref<SSTableReader> getRef()
    {
        return ref;
    }

    @Override
    public String getName()
    {
        return filename;
    }

    @Override
    public long getSize()
    {
        return header.size();
    }

    @Override
    public TableId getTableId()
    {
        return ref.get().metadata().id;
    }

    @Override
    public long getRepairedAt()
    {
        return ref.get().getRepairedAt();
    }

    @Override
    public UUID getPendingRepair()
    {
        return ref.get().getPendingRepair();
    }

    @Override
    public void write(StreamSession session, DataOutputStreamPlus out, int version) throws IOException
    {
        SSTableReader sstable = ref.get();
        CassandraStreamHeader.serializer.serialize(header, out, version);
        out.flush();

        if (shouldStreamEntireSSTable() && out instanceof AsyncStreamingOutputPlus)
        {
            CassandraEntireSSTableStreamWriter writer = new CassandraEntireSSTableStreamWriter(sstable, session, manifest);
            writer.write((AsyncStreamingOutputPlus) out);
        }
        else
        {
            CassandraStreamWriter writer = (header.compressionInfo == null) ?
                     new CassandraStreamWriter(sstable, header.sections, session) :
                     new CassandraCompressedStreamWriter(sstable, header.sections,
                                                         header.compressionInfo, session);
            writer.write(out);
        }
    }

    @VisibleForTesting
    public boolean shouldStreamEntireSSTable()
    {
        // don't stream if full sstable transfers are disabled or legacy counter shards are present
        if (!DatabaseDescriptor.streamEntireSSTables() || ref.get().getSSTableMetadata().hasLegacyCounterShards)
            return false;

        ColumnFamilyStore cfs = ColumnFamilyStore.getIfExists(getTableId());

        if (cfs == null)
            return false;

        AbstractCompactionStrategy compactionStrategy = cfs.getCompactionStrategyManager()
                                                           .getCompactionStrategyFor(ref.get());

        if (compactionStrategy instanceof LeveledCompactionStrategy)
            return contained(normalizedRanges, ref.get());

        return false;
    }

    @VisibleForTesting
    public boolean contained(List<Range<Token>> normalizedRanges, SSTableReader sstable)
    {
        if (isFullyContained != null)
            return isFullyContained;

        isFullyContained = computeContainment(normalizedRanges, sstable);
        return isFullyContained;
    }

    private boolean computeContainment(List<Range<Token>> normalizedRanges, SSTableReader sstable)
    {
        if (normalizedRanges == null)
            return false;

        RangeOwnHelper rangeOwnHelper = new RangeOwnHelper(normalizedRanges);
        try (KeyIterator iter = new KeyIterator(sstable.descriptor, sstable.metadata()))
        {
            while (iter.hasNext())
            {
                DecoratedKey key = iter.next();
                if (!rangeOwnHelper.check(key))
                    return false;
            }
        }
        return true;
    }

    @Override
    public void finish()
    {
        ref.release();
    }

    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CassandraOutgoingFile that = (CassandraOutgoingFile) o;
        return estimatedKeys == that.estimatedKeys &&
               Objects.equals(ref, that.ref) &&
               Objects.equals(sections, that.sections);
    }

    public int hashCode()
    {
        return Objects.hash(ref, estimatedKeys, sections);
    }

    @Override
    public String toString()
    {
        return "CassandraOutgoingFile{" + filename + '}';
    }
}


text:
using System;

namespace Microsoft.Msagl.Core.Geometry.Curves {
    /// <summary>
    ///
    /// </summary>
    public class CurvatureDerivative : IFunction {
        ICurve curve;
        double start;
        double end;
        /// <summary>
        ///
        /// </summary>
        /// <param name="curve"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        public CurvatureDerivative(ICurve curve, double start, double end) {
            this.curve = curve;
            this.start = start;
            this.end = end;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public double this[double t] {
            get { return curve.CurvatureDerivative(t); }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public double Derivative(double t) {
            return curve.CurvatureSecondDerivative(t);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public double SecondDerivative(double t) {
            throw new NotImplementedException();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public double ThirdDerivative(double t) {
            throw new NotImplementedException();
        }
        /// <summary>
        ///
        /// </summary>
        public double ParStart {
            get {return start; }
        }
/// <summary>
///
/// </summary>
        public double ParEnd {
            get { return end; }
        }

    }
}


text:
using System;

namespace Azure.Search.Documents.Indexes.Models
{
    /// <summary> Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. </summary>
    public partial class NGramTokenFilterV2 : TokenFilter
    {
        /// <summary> Initializes a new instance of NGramTokenFilterV2. </summary>
        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. </param>
        public NGramTokenFilterV2(string name) : base(name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            ODataType = "#Microsoft.Azure.Search.NGramTokenFilterV2";
        }

        /// <summary> Initializes a new instance of NGramTokenFilterV2. </summary>
        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. </param>
        /// <param name="minGram"> The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. </param>
        /// <param name="maxGram"> The maximum n-gram length. Default is 2. Maximum is 300. </param>
        internal NGramTokenFilterV2(string oDataType, string name, int? minGram, int? maxGram) : base(oDataType, name)
        {
            MinGram = minGram;
            MaxGram = maxGram;
            ODataType = oDataType ?? "#Microsoft.Azure.Search.NGramTokenFilterV2";
        }

        /// <summary> The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram. </summary>
        public int? MinGram { get; set; }
        /// <summary> The maximum n-gram length. Default is 2. Maximum is 300. </summary>
        public int? MaxGram { get; set; }
    }
}


text:
class MockDownloadManager : public content::DownloadManager {
 public:
  MockDownloadManager();
  virtual ~MockDownloadManager();

  // DownloadManager:
  MOCK_METHOD0(Shutdown, void());
  MOCK_METHOD2(GetTemporaryDownloads, void(const FilePath& dir_path,
                                           DownloadVector* result));
  MOCK_METHOD2(GetAllDownloads, void(const FilePath& dir_path,
                                     DownloadVector* result));
  MOCK_METHOD2(SearchByQuery, void(const content::DownloadQuery& query,
                                   DownloadVector* results));
  MOCK_METHOD2(SearchDownloads, void(const string16& query,
                                     DownloadVector* result));
  MOCK_METHOD1(Init, bool(content::BrowserContext* browser_context));
  MOCK_METHOD1(StartDownload, void(int32 id));
  MOCK_METHOD4(UpdateDownload, void(int32 download_id,
                                    int64 bytes_so_far,
                                    int64 bytes_per_sec,
                                    const std::string& hash_state));
  MOCK_METHOD3(OnResponseCompleted, void(int32 download_id,
                                         int64 size,
                                         const std::string& hash));
  MOCK_METHOD1(CancelDownload, void(int32 download_id));
  MOCK_METHOD4(OnDownloadInterrupted, void(int32 download_id,
                                           int64 size,
                                           const std::string& hash_state,
                                           InterruptReason reason));
  MOCK_METHOD3(OnDownloadRenamedToFinalName, void(int download_id,
                                                  const FilePath& full_path,
                                                  int uniquifier));
  MOCK_METHOD2(RemoveDownloadsBetween, int(base::Time remove_begin,
                                           base::Time remove_end));
  MOCK_METHOD1(RemoveDownloads, int(base::Time remove_begin));
  MOCK_METHOD0(RemoveAllDownloads, int());
  MOCK_METHOD6(DownloadUrl, void(const GURL& url,
                                 const GURL& referrer,
                                 const std::string& referrer_encoding,
                                 bool prefer_cache,
                                 const DownloadSaveInfo& save_info,
                                 content::WebContents* web_contents));
  MOCK_METHOD1(AddObserver, void(Observer* observer));
  MOCK_METHOD1(RemoveObserver, void(Observer* observer));
  MOCK_METHOD1(OnPersistentStoreQueryComplete, void(
      std::vector<DownloadPersistentStoreInfo>* entries));
  MOCK_METHOD2(OnItemAddedToPersistentStore, void(int32 download_id,
                                                  int64 db_handle));
  MOCK_CONST_METHOD0(InProgressCount, int());
  MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*());
  MOCK_METHOD0(LastDownloadPath, FilePath());
  MOCK_METHOD2(CreateDownloadItem, void(
      DownloadCreateInfo* info,
      const DownloadRequestHandle& request_handle));
  MOCK_METHOD4(CreateSavePackageDownloadItem, content::DownloadItem*(
      const FilePath& main_file_path,
      const GURL& page_url,
      bool is_otr,
      content::DownloadItem::Observer* observer));
  MOCK_METHOD0(ClearLastDownloadPath, void());
  MOCK_METHOD2(FileSelected, void(const FilePath& path, void* params));
  MOCK_METHOD1(FileSelectionCanceled, void(void* params));
  MOCK_METHOD1(RestartDownload, void(int32 download_id));
  MOCK_METHOD0(CheckForHistoryFilesRemoval, void());
  MOCK_METHOD1(GetDownloadItem, content::DownloadItem*(int id));
  MOCK_METHOD1(SavePageDownloadFinished, void(content::DownloadItem* download));
  MOCK_METHOD1(GetActiveDownloadItem, content::DownloadItem*(int id));
  MOCK_METHOD0(GenerateFileHash, bool());
  MOCK_CONST_METHOD0(delegate, content::DownloadManagerDelegate*());
  MOCK_METHOD1(SetDownloadManagerDelegate, void(
      content::DownloadManagerDelegate* delegate));
  MOCK_METHOD2(ContinueDownloadWithPath, void(content::DownloadItem* download,
                                              const FilePath& chosen_file));
  MOCK_METHOD1(GetActiveDownload, content::DownloadItem*(int32 download_id));
  MOCK_METHOD1(SetFileManager, void(DownloadFileManager* file_manager));
};

#endif  // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_


text:
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('event', '0001_initial'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='eventprice',
            options={'get_latest_by': 'id'},
        ),
        migrations.AlterField(
            model_name='eventprice',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prices', to='event.Event'),
        ),
    ]


text:
require 'spec_helper'

require 'rbeapi/client'
require 'rbeapi/api/stp'

describe Rbeapi::Api::Stp do
  subject { described_class.new(node) }

  let(:node) do
    Rbeapi::Client.config.read(fixture_file('dut.conf'))
    Rbeapi::Client.connect_to('dut')
  end

  describe '#get' do
    let(:resource) { subject.get }

    let(:keys) do
      [:interfaces, :instances, :mode]
    end

    it 'includes all required keys' do
      keys.each do |key|
        expect(subject.get).to include(key)
      end
    end
  end

  describe '#instances' do
    it 'is a kind of StpInstances' do
      expect(subject.instances).to be_a_kind_of(Rbeapi::Api::StpInstances)
    end
  end

  describe '#interfaces' do
    it 'is a kind of StpInterfaces' do
      expect(subject.interfaces).to be_a_kind_of(Rbeapi::Api::StpInterfaces)
    end
  end

  describe '#set_mode' do
    it 'sets the stp mode to mstp' do
      node.config('spanning-tree mode none')
      expect(subject.get[:mode]).to eq('none')
      expect(subject.set_mode(value: 'mstp')).to be_truthy
      expect(subject.get[:mode]).to eq('mstp')
    end

    it 'sets the stp mode to none' do
      node.config('spanning-tree mode mstp')
      expect(subject.get[:mode]).to eq('mstp')
      expect(subject.set_mode(value: 'none')).to be_truthy
      expect(subject.get[:mode]).to eq('none')
    end

    it 'negates the stp mode' do
      node.config('spanning-tree mode none')
      expect(subject.get[:mode]).to eq('none')
      expect(subject.set_mode(enable: false)).to be_truthy
      expect(subject.get[:mode]).to eq('mstp')
    end

    it 'defaults the stp mode' do
      node.config('spanning-tree mode none')
      expect(subject.get[:mode]).to eq('none')
      expect(subject.set_mode(default: true)).to be_truthy
      expect(subject.get[:mode]).to eq('mstp')
    end
  end
end


text:
package org.metaborg.meta.core.project;

import org.apache.commons.vfs2.FileObject;
import org.metaborg.core.project.Project;
import org.metaborg.meta.core.config.ILanguageSpecConfig;

public class LanguageSpec extends Project implements ILanguageSpec {
    private final ILanguageSpecConfig config;

    public LanguageSpec(FileObject location, ILanguageSpecConfig config) {
        super(location, config);
        this.config = config;
    }

    @Override public ILanguageSpecConfig config() {
        return config;
    }
}


text:
package minion

import (
	"errors"
	"fmt"
	"net"
	"strconv"

	"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	kerrors "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)

// REST adapts minion into apiserver's RESTStorage model.
type REST struct {
	registry Registry
}

// NewREST returns a new apiserver.RESTStorage implementation for minion.
func NewREST(m Registry) *REST {
	return &REST{
		registry: m,
	}
}

var ErrDoesNotExist = errors.New("The requested resource does not exist.")
var ErrNotHealty = errors.New("The requested minion is not healthy.")

// Create satisfies the RESTStorage interface.
func (rs *REST) Create(ctx api.Context, obj runtime.Object) (runtime.Object, error) {
	minion, ok := obj.(*api.Node)
	if !ok {
		return nil, fmt.Errorf("not a minion: %#v", obj)
	}

	if err := rest.BeforeCreate(rest.Nodes, ctx, obj); err != nil {
		return nil, err
	}

	if err := rs.registry.CreateMinion(ctx, minion); err != nil {
		err = rest.CheckGeneratedNameError(rest.Nodes, err, minion)
		return nil, err
	}
	return minion, nil
}

// Delete satisfies the RESTStorage interface.
func (rs *REST) Delete(ctx api.Context, id string) (runtime.Object, error) {
	minion, err := rs.registry.GetMinion(ctx, id)
	if minion == nil {
		return nil, ErrDoesNotExist
	}
	if err != nil {
		return nil, err
	}
	return &api.Status{Status: api.StatusSuccess}, rs.registry.DeleteMinion(ctx, id)
}

// Get satisfies the RESTStorage interface.
func (rs *REST) Get(ctx api.Context, id string) (runtime.Object, error) {
	minion, err := rs.registry.GetMinion(ctx, id)
	if err != nil {
		return minion, err
	}
	if minion == nil {
		return nil, ErrDoesNotExist
	}
	return minion, err
}

// List satisfies the RESTStorage interface.
func (rs *REST) List(ctx api.Context, label, field labels.Selector) (runtime.Object, error) {
	return rs.registry.ListMinions(ctx)
}

func (rs *REST) New() runtime.Object {
	return &api.Node{}
}

func (*REST) NewList() runtime.Object {
	return &api.NodeList{}
}

// Update satisfies the RESTStorage interface.
func (rs *REST) Update(ctx api.Context, obj runtime.Object) (runtime.Object, bool, error) {
	minion, ok := obj.(*api.Node)
	if !ok {
		return nil, false, fmt.Errorf("not a minion: %#v", obj)
	}
	// This is hacky, but minions don't really have a namespace, but kubectl currently automatically
	// stuffs one in there.  Fix it here temporarily until we fix kubectl
	if minion.Namespace == api.NamespaceDefault {
		minion.Namespace = api.NamespaceNone
	}
	// Clear out the self link, if specified, since it's not in the registry either.
	minion.SelfLink = ""

	oldMinion, err := rs.registry.GetMinion(ctx, minion.Name)
	if err != nil {
		return nil, false, err
	}

	if errs := validation.ValidateMinionUpdate(oldMinion, minion); len(errs) > 0 {
		return nil, false, kerrors.NewInvalid("minion", minion.Name, errs)
	}

	if err := rs.registry.UpdateMinion(ctx, minion); err != nil {
		return nil, false, err
	}
	out, err := rs.registry.GetMinion(ctx, minion.Name)
	return out, false, err
}

// Watch returns Minions events via a watch.Interface.
// It implements apiserver.ResourceWatcher.
func (rs *REST) Watch(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
	return rs.registry.WatchMinions(ctx, label, field, resourceVersion)
}

// ResourceLocation returns a URL to which one can send traffic for the specified minion.
func (rs *REST) ResourceLocation(ctx api.Context, id string) (string, error) {
	minion, err := rs.registry.GetMinion(ctx, id)
	if err != nil {
		return "", err
	}
	host := minion.Name
	// TODO: Minion webservers should be secure!
	return "http://" + net.JoinHostPort(host, strconv.Itoa(ports.KubeletPort)), nil
}


text:
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Ambari Agent

"""

import os
from resource_management import *
from resource_management.core.resources.system import Execute, File
from resource_management.core.source import InlineTemplate, StaticFile
from resource_management.libraries.functions.format import format
from resource_management.libraries.functions.version import compare_versions
from resource_management.libraries.functions.copy_tarball import copy_to_hdfs
from resource_management.libraries.script.script import Script
from resource_management.libraries.functions.validate import call_and_match_output
from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl

class TitanServiceCheck(Script):
    pass

@OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
class TitanServiceCheckLinux(TitanServiceCheck):
    def service_check(self, env):
        import params
        env.set_params(params)

        File( format("{tmp_dir}/titanSmoke.groovy"),
              content = StaticFile("titanSmoke.groovy"),
              mode = 0755
              )

        if params.iop_stack_version != "" and compare_versions(params.iop_stack_version, '4.2') >= 0:
            if params.security_enabled:
                kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};")
                Execute(kinit_cmd,
                        user=params.smokeuser
                        )

            Execute(format("gremlin {tmp_dir}/titanSmoke.groovy"),
                    tries     = 3,
                    try_sleep = 5,
                    path      = format('{titan_bin_dir}:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'),
                    user      = params.smokeuser,
                    logoutput = True
                    )

if __name__ == "__main__":
    # print "Track service check status"
    TitanServiceCheckLinux().execute()


text:
[![Build Status](https://travis-ci.org/promptworks/logging_elf.png?branch=master)](https://travis-ci.org/promptworks/logging_elf)
[![Gem Version](https://badge.fury.io/rb/logging_elf.png)](http://badge.fury.io/rb/logging_elf)
[![Code Climate](https://codeclimate.com/github/promptworks/logging_elf/badges/gpa.svg)](https://codeclimate.com/github/promptworks/logging_elf)
[![Dependency Status](https://gemnasium.com/promptworks/logging_elf.svg)](https://gemnasium.com/promptworks/logging_elf)

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'logging_elf'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install logging_elf

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( https://github.com/[my-github-username]/logging_elf/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
        Clinical data ETL and phenotyping system

NOTE: This demonstration web site is NOT suitable for
                use with sensitive data including patient data that contains
                identifiers.

Getting Started

Learn about Eureka!

                                                About Eureka!

Get an account

                                                Register

Learn about Eureka!

                                                About Eureka!

Learn more about Eureka!

                                            About Eureka!

Want to evaluate Eureka! at your institution?

Contact us for options

                                        Contact Us

News

{{versionItem.releaseDate}}

{{versionItem.description}}

{{versionItem.releaseDate}}

{{versionItem.description}}

Funding

The software powering this site has been supported in part by


text:
package org.apereo.cas.adaptors.x509.authentication.principal;

import java.security.cert.X509Certificate;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apereo.cas.authentication.Credential;
import org.apereo.cas.authentication.principal.resolvers.PersonDirectoryPrincipalResolver;

/**
 * Abstract class in support of multiple resolvers for X509 Certificates.
 *
 * @author Scott Battaglia
 * @since 3.0.0
 */
public abstract class AbstractX509PrincipalResolver extends PersonDirectoryPrincipalResolver {

    @Override
    protected String extractPrincipalId(final Credential credential) {
        return resolvePrincipalInternal(((X509CertificateCredential) credential).getCertificate());
    }

    @Override
    public boolean supports(final Credential credential) {
        return credential instanceof X509CertificateCredential;
    }

    /**
     * Resolve principal internally, and return the id.
     *
     * @param certificate the certificate
     * @return the string
     */
    protected abstract String resolvePrincipalInternal(X509Certificate certificate);

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .appendSuper(super.toString())
                .toString();
    }
}


text:
package org.elasticsearch.index.query;

import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.support.QueryParsers;
import org.elasticsearch.index.search.MatchQuery;

import java.io.IOException;

/**
 *
 */
public class MatchQueryParser implements QueryParser {

    public static final String NAME = "match";

    @Inject
    public MatchQueryParser() {
    }

    @Override
    public String[] names() {
        return new String[]{
                NAME, "match_phrase", "matchPhrase", "match_phrase_prefix", "matchPhrasePrefix", "matchFuzzy", "match_fuzzy", "fuzzy_match",
                "text", "text_phrase", "textPhrase", "text_phrase_prefix", "textPhrasePrefix", "fuzzyText", "fuzzy_text"
        };
    }

    @Override
    public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
        XContentParser parser = parseContext.parser();

        MatchQuery.Type type = MatchQuery.Type.BOOLEAN;
        if ("match_phrase".equals(parser.currentName()) || "matchPhrase".equals(parser.currentName()) ||
                "text_phrase".equals(parser.currentName()) || "textPhrase".equals(parser.currentName())) {
            type = MatchQuery.Type.PHRASE;
        } else if ("match_phrase_prefix".equals(parser.currentName()) || "matchPhrasePrefix".equals(parser.currentName()) ||
                "text_phrase_prefix".equals(parser.currentName()) || "textPhrasePrefix".equals(parser.currentName())) {
            type = MatchQuery.Type.PHRASE_PREFIX;
        }

        XContentParser.Token token = parser.nextToken();
        if (token != XContentParser.Token.FIELD_NAME) {
            throw new QueryParsingException(parseContext.index(), "[match] query malformed, no field");
        }
        String fieldName = parser.currentName();

        String text = null;
        float boost = 1.0f;
        MatchQuery matchQuery = new MatchQuery(parseContext);
        String minimumShouldMatch = null;

        token = parser.nextToken();
        if (token == XContentParser.Token.START_OBJECT) {
            String currentFieldName = null;
            while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
                if (token == XContentParser.Token.FIELD_NAME) {
                    currentFieldName = parser.currentName();
                } else if (token.isValue()) {
                    if ("query".equals(currentFieldName)) {
                        text = parser.text();
                    } else if ("type".equals(currentFieldName)) {
                        String tStr = parser.text();
                        if ("boolean".equals(tStr)) {
                            type = MatchQuery.Type.BOOLEAN;
                        } else if ("phrase".equals(tStr)) {
                            type = MatchQuery.Type.PHRASE;
                        } else if ("phrase_prefix".equals(tStr) || "phrasePrefix".equals(currentFieldName)) {
                            type = MatchQuery.Type.PHRASE_PREFIX;
                        }
                    } else if ("analyzer".equals(currentFieldName)) {
                        String analyzer = parser.text();
                        if (parseContext.analysisService().analyzer(analyzer) == null) {
                            throw new QueryParsingException(parseContext.index(), "[match] analyzer [" + parser.text() + "] not found");
                        }
                        matchQuery.setAnalyzer(analyzer);
                    } else if ("boost".equals(currentFieldName)) {
                        boost = parser.floatValue();
                    } else if ("slop".equals(currentFieldName) || "phrase_slop".equals(currentFieldName) || "phraseSlop".equals(currentFieldName)) {
                        matchQuery.setPhraseSlop(parser.intValue());
                    } else if ("fuzziness".equals(currentFieldName)) {
                        matchQuery.setFuzziness(parser.textOrNull());
                    } else if ("prefix_length".equals(currentFieldName) || "prefixLength".equals(currentFieldName)) {
                        matchQuery.setFuzzyPrefixLength(parser.intValue());
                    } else if ("max_expansions".equals(currentFieldName) || "maxExpansions".equals(currentFieldName)) {
                        matchQuery.setMaxExpansions(parser.intValue());
                    } else if ("operator".equals(currentFieldName)) {
                        String op = parser.text();
                        if ("or".equalsIgnoreCase(op)) {
                            matchQuery.setOccur(BooleanClause.Occur.SHOULD);
                        } else if ("and".equalsIgnoreCase(op)) {
                            matchQuery.setOccur(BooleanClause.Occur.MUST);
                        } else {
                            throw new QueryParsingException(parseContext.index(), "text query requires operator to be either 'and' or 'or', not [" + op + "]");
                        }
                    } else if ("minimum_should_match".equals(currentFieldName) || "minimumShouldMatch".equals(currentFieldName)) {
                        minimumShouldMatch = parser.textOrNull();
                    } else if ("rewrite".equals(currentFieldName)) {
                        matchQuery.setRewriteMethod(QueryParsers.parseRewriteMethod(parser.textOrNull(), null));
                    } else if ("fuzzy_rewrite".equals(currentFieldName) || "fuzzyRewrite".equals(currentFieldName)) {
                        matchQuery.setFuzzyRewriteMethod(QueryParsers.parseRewriteMethod(parser.textOrNull(), null));
                    } else if ("fuzzy_transpositions".equals(fieldName)) {
                        matchQuery.setTranspositions(parser.booleanValue());
                    } else if ("lenient".equals(currentFieldName)) {
                        matchQuery.setLenient(parser.booleanValue());
                    } else {
                        throw new QueryParsingException(parseContext.index(), "[match] query does not support [" + currentFieldName + "]");
                    }
                }
            }
            parser.nextToken();
        } else {
            text = parser.text();
            // move to the next token
            parser.nextToken();
        }

        if (text == null) {
            throw new QueryParsingException(parseContext.index(), "No text specified for text query");
        }

        Query query = matchQuery.parse(type, fieldName, text);
        if (query == null) {
            return null;
        }

        if (query instanceof BooleanQuery) {
            Queries.applyMinimumShouldMatch((BooleanQuery) query, minimumShouldMatch);
        }

        query.setBoost(boost);
        return query;
    }
}


text:
require 'bacon'
require 'ruby-debug'
require 'ostruct'
require 'hipe-core'
require 'hipe-core/struct/open-struct-write-once-extension'

describe Hipe::OpenStructWriteOnceExtension do
  it "should raise appropriately when asserting write_once after the fact. (wo1)" do
    @o = OpenStruct.new(:a=>'A',:b=>'B',:c=>'C')
    Hipe::OpenStructWriteOnceExtension[@o]
    @o.write_once! 'a',:b
    @o.a.should.equal 'A'
    @o.b.should.equal 'B'
    lambda{ @o.a = 'Z' }.should.raise(TypeError)
    lambda{ @o.a = 'B' }.should.raise(TypeError)
  end

  it "should raise appropriately when asserting write once before the fact (wo2)" do
    @o = OpenStruct.new
    Hipe::OpenStructWriteOnceExtension[@o]
    @o.write_once! 'a', :b
    @o.a = 'ok'
    @o.a.should.equal 'ok'
    @o.b = 'hi'
    @o.b.should.equal 'hi'
    lambda{@o.a = 'hi'}.should.raise(TypeError)
    lambda{@o.b = 'hi'}.should.raise(TypeError)
  end
end


text:
package edu.berkeley.sparrow.examples;

import java.io.IOException;

import org.apache.log4j.Level;
import org.apache.thrift.TException;

public class test {

	public static void main(String[] args) throws IOException, TException {
		Level l = Level.toLevel("off", Level.DEBUG);
		System.out.println(l);

	}
}